noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 09/29: Fix Bug Balance Accountancy


From: dwm
Subject: [Noalyss-commit] [noalyss] 09/29: Fix Bug Balance Accountancy
Date: Sat, 6 Jan 2024 05:59:14 -0500 (EST)

sparkyx pushed a commit to branch devel
in repository noalyss.

commit e23270877924dd0ecf46744b6d0cd3475584bfb5
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Fri Dec 15 19:04:24 2023 +0100

    Fix Bug Balance Accountancy
---
 include/class/acc_balance.class.php              |  2 +-
 include/class/print_ledger_detail_item.class.php | 20 ++++++++++----------
 include/export/export_balance_csv.php            | 17 +++++++++++++----
 3 files changed, 24 insertions(+), 15 deletions(-)

diff --git a/include/class/acc_balance.class.php 
b/include/class/acc_balance.class.php
index 074710ba9..f079bcf7d 100644
--- a/include/class/acc_balance.class.php
+++ b/include/class/acc_balance.class.php
@@ -275,7 +275,7 @@ class Acc_Balance
         $side_delta=findSide($delta);
 
         $a['poste']="";
-        $a['label']=sprintf(_("Totaux %s %s"),nbm(abs($delta)),$side_delta);
+        $a['label']=sprintf(_("Totaux delta  %s 
%s"),nbm(abs($delta)),$side_delta);
         $a['sum_deb']=$tot_deb;
         $a['sum_cred']=$tot_cred;
         $a['solde_deb']=$tot_deb_saldo;
diff --git a/include/class/print_ledger_detail_item.class.php 
b/include/class/print_ledger_detail_item.class.php
index 84399c08c..243ef9217 100644
--- a/include/class/print_ledger_detail_item.class.php
+++ b/include/class/print_ledger_detail_item.class.php
@@ -50,16 +50,16 @@ class Print_Ledger_Detail_Item extends Print_Ledger
         $this->Ln(20);
         $high=6;
         $this->SetFont('DejaVu', '', 6);
-        $this->Cell(20, $high, _('Date'),0,  'L', false);
-        $this->Cell(20, $high, _('Numéro interne'), 0, 0, 'L', false);
-        $this->Cell(50, $high, _('Code'),0,'L',false);
-        $this->Cell(80, $high, _('Libellé'),0,'L',false);
-        $this->Cell(20, $high, _('Tot HTVA'), 0, 0, 'R', false);
-        $this->Cell(20, $high, _('Tot TVA NP'), 0, 0, 'R', false);
-        $this->Cell(20, $high, _("Autre Tx"), 0, 0, 'R', false);
-        $this->Cell(20, $high, _('Tot TVA'), 0, 0, 'R', false);
-        $this->Cell(20, $high, _('TVAC'), 0, 0, 'R', false);
-        $this->Ln(6);
+        $this->write_cell(20, $high, _('Date'),0,0,  'L', false);
+        $this->write_cell(20, $high, _('Numéro interne'), 0,0,  'L', false);
+        $this->write_cell(50, $high, _('Code'),0,0,'L',false);
+        $this->write_cell(80, $high, _('Libellé'),0,0,'L',false);
+        $this->write_cell(20, $high, _('Tot HTVA'), 0, 0,'R', false,'R', 
false);
+        $this->write_cell(20, $high, _('Tot TVA NP'), 0, 0,'R', false, false);
+        $this->write_cell(20, $high, _("Autre Tx"), 0, 0, 'R', false);
+        $this->write_cell(20, $high, _('Tot TVA'), 0, 0, 'R', false);
+        $this->write_cell(20, $high, _('TVAC'), 0, 0, 'R', false);
+        $this->line_new(6);
         $this->show_col=true;
         
     }
diff --git a/include/export/export_balance_csv.php 
b/include/export/export_balance_csv.php
index 9278b852c..359ed1bad 100644
--- a/include/export/export_balance_csv.php
+++ b/include/export/export_balance_csv.php
@@ -101,12 +101,21 @@ foreach ($row as $r)
     $export->add($r['sum_deb'],"number");
     $export->add($r['sum_cred'],"number");
 
-    if ( $delta < 0 ){
+    if ( $delta < 0){
+        $export->add("0","number");
+        $export->add($r['solde_cred'],"number");
+    }elseif ( $delta > 0 ) {
+        $export->add($r['solde_deb'],"number");
+        $export->add("0","number");
+    }elseif ($delta==0 && $r['poste']!="")
+    {
         $export->add("0","number");
-        $export->add(abs($delta),"number");
-    }else {
-        $export->add(abs($delta),"number");
         $export->add("0","number");
+    }elseif ( $delta == 0 && $r['poste'] =="" ) {
+        $export->add($r['solde_deb'],"number");
+        $export->add($r['solde_cred'],"number");
+    } else {
+        throw new \Exception(__FILE__.":".__LINE__);
     }
     $export->write();
 }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]