noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 14/46: Task #0001699: Affichage PDF balance -


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 14/46: Task #0001699: Affichage PDF balance - totaux niveaux, etc'.
Date: Mon, 4 May 2020 13:38:45 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 68e1d75a608ce6b772d564cd814bd931ffd35296
Author: Dany De Bontridder <address@hidden>
AuthorDate: Wed Feb 26 21:02:03 2020 +0100

    Task #0001699: Affichage PDF balance - totaux niveaux, etc'.
---
 include/class/acc_balance.class.php   |  7 +++----
 include/export/export_balance_pdf.php | 21 +++++++++++----------
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/include/class/acc_balance.class.php 
b/include/class/acc_balance.class.php
index 6fbf2fc..71469ab 100644
--- a/include/class/acc_balance.class.php
+++ b/include/class/acc_balance.class.php
@@ -273,11 +273,10 @@ class Acc_Balance
         // Add the saldo
         $i+=1;
         $delta=bcsub($tot_deb,$tot_cred);
-        $side_delta=($delta<0)?"C":"D";
-        $side_delta=($delta==0)?"=":$side_delta;
-        
+        $side_delta=findSide($delta);
+
         $a['poste']="";
-        $a['label']="Totaux ".nbm(abs($delta)).$side_delta;
+        $a['label']=sprintf(_("Totaux %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/export/export_balance_pdf.php 
b/include/export/export_balance_pdf.php
index 2490bb1..03bc3ee 100644
--- a/include/export/export_balance_pdf.php
+++ b/include/export/export_balance_pdf.php
@@ -176,31 +176,32 @@ if (!empty($array)) {
             if (${'lvl' . $ind . '_old'} == '') ${'lvl' . $ind . '_old'} = 
substr($r['poste'], 0, $ind);
             if (${'lvl' . $ind . '_old'} != substr($r['poste'], 0, $ind)) {
                 $pdf->SetFont('DejaVu', 'B', 7);
-                $pdf->LongLine(30, 6, ${'lvl' . $ind . '_old'});
+                $strTotal=sprintf(_("Totaux %s "),${'lvl' . $ind . '_old'});
+                $pdf->LongLine(30, 6, $strTotal,"TB");
                 $delta = bcsub(${'nlvl' . $ind}['solde_cred'], ${'nlvl' . 
$ind}['solde_deb']);
                 $side = ($delta < 0) ? "D" : "C";
                 if ($previous == 1) {
                     $delta_previous = bcsub(${'nlvl' . 
$ind}['solde_cred_previous'], ${'nlvl' . $ind}['solde_deb_previous']);
                     $side_previous = ($delta_previous < 0) ? "D" : "C";
-                    $pdf->write_cell(60, 6, " ", 0, 0, 'R');
-                    $pdf->write_cell(22, 6, nbm(${'nlvl' . 
$ind}['sum_deb_previous']), 0, 0, 'R');
-                    $pdf->write_cell(22, 6, nbm(${'nlvl' . 
$ind}['sum_cred_previous']), 0, 0, 'R');
-                    $pdf->write_cell(22, 6, nbm(abs($delta_previous)) . " 
$side_previous", 0, 0, 'R');
+                    $pdf->write_cell(60, 6, sprintf(_("niveau %s"),$ind), 
"TB", 0, 'R');
+                    $pdf->write_cell(22, 6, nbm(${'nlvl' . 
$ind}['sum_deb_previous']), "TB", 0, 'R');
+                    $pdf->write_cell(22, 6, nbm(${'nlvl' . 
$ind}['sum_cred_previous']), "TB", 0, 'R');
+                    $pdf->write_cell(22, 6, nbm(abs($delta_previous)) . " 
$side_previous", "TB", 0, 'R');
 
                 } else {
-                    $pdf->write_cell(60, 6, " ", 0, 0, 'R');
+                    $pdf->write_cell(60, 6, sprintf(_("niveau %s"),$ind), 
"TB", 0, 'R');
 
                 }
                 $solde_lv = bcsub(${'nlvl' . $ind}['sum_deb_ope'], ${'nlvl' . 
$ind}['sum_cred_ope']);
                 $side_lv = ($solde_lv < 0) ? " C" : " D";
                 $side_lv = ($solde_lv == 0) ? " " : $side_lv;
-                $pdf->write_cell(25, 6, nbm(abs($solde_lv)) . $side_lv, 0, 0, 
'R');
-                $pdf->write_cell(25, 6, nbm(bcsub(${'nlvl' . $ind}['sum_deb'], 
${'nlvl' . $ind}['sum_deb_ope'])), 0, 0, 'R');
-                $pdf->write_cell(25, 6, nbm(bcsub(${'nlvl' . 
$ind}['sum_cred'], ${'nlvl' . $ind}['sum_cred_ope'])), 0, 0, 'R');
+                $pdf->write_cell(25, 6, nbm(abs($solde_lv)) . $side_lv, "TB", 
0, 'R');
+                $pdf->write_cell(25, 6, nbm(bcsub(${'nlvl' . $ind}['sum_deb'], 
${'nlvl' . $ind}['sum_deb_ope'])), "TB", 0, 'R');
+                $pdf->write_cell(25, 6, nbm(bcsub(${'nlvl' . 
$ind}['sum_cred'], ${'nlvl' . $ind}['sum_cred_ope'])), "TB", 0, 'R');
                 $solde_lv = bcsub(${'nlvl' . $ind}['solde_deb'], ${'nlvl' . 
$ind}['solde_cred']);
                 $side_lv = ($solde_lv > 0) ? "D" : "C";
                 $side_lv = ($solde_lv == 0) ? "" : $side_lv;
-                $pdf->write_cell(25, 6, nbm(abs($solde_lv)) . " $side_lv", 0, 
0, 'R');
+                $pdf->write_cell(25, 6, nbm(abs($solde_lv)) . " $side_lv", 
"TB", 0, 'R');
                 $pdf->line_new();
                 $pdf->SetFont('DejaVuCond', '', 7);
                 ${'lvl' . $ind . '_old'} = substr($r['poste'], 0, $ind);



reply via email to

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