noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 02/30: Task #1123 - Visualisation/présentati


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 02/30: Task #1123 - Visualisation/présentation de la balance: SOLDE #1123 : PRINTBAL ajout du solde quand on utilise les sous-niveaux
Date: Tue, 02 Jun 2015 22:29:02 +0000

sparkyx pushed a commit to branch master
in repository noalyss.

commit 78b812cf6179bfe20b88f82b9cefcaae099607ff
Author: Dany De Bontridder <address@hidden>
Date:   Wed May 27 21:24:28 2015 +0200

    Task #1123 - Visualisation/présentation de la balance: SOLDE
    #1123 : PRINTBAL ajout du solde quand on utilise les sous-niveaux
---
 include/balance.inc.php        |   14 ++++++++++++++
 include/export_balance_pdf.php |   13 ++++++++++---
 2 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/include/balance.inc.php b/include/balance.inc.php
index c2d452c..3a1ab5c 100644
--- a/include/balance.inc.php
+++ b/include/balance.inc.php
@@ -288,11 +288,16 @@ if ( isset($_GET['view'] ) )
         echo '<th>Cr&eacute;dit N-1</th>';
         echo '<th>Solde D&eacute;biteur N-1</th>';
         echo '<th>Solde Cr&eacute;diteur N-1</th>';
+        if ( isset($_GET['lvl1']) || isset($_GET['lvl2']) || 
isset($_GET['lvl3'])) 
+            echo '<th>Solde  N-1</th>';
+            
     }
     echo '<th>D&eacute;bit</th>';
     echo '<th>Cr&eacute;dit</th>';
     echo '<th>Solde D&eacute;biteur </th>';
     echo '<th>Solde Cr&eacute;diteur</th>';
+    if ( isset($_GET['lvl1']) || isset($_GET['lvl2']) || isset($_GET['lvl3'])) 
+        echo '<th>Solde</th>';
     $i=0;
     if ( $previous == 1) {
         
$a_sum=array('sum_cred','sum_deb','solde_deb','solde_cred','sum_cred_previous','sum_deb_previous','solde_deb_previous','solde_cred_previous');
@@ -339,11 +344,18 @@ if ( isset($_GET['view'] ) )
                     echo td(nbm(${'lvl'.$ind}['sum_cred_previous']),' 
class="previous_year" style="font-weight:bold;" ');
                     echo 
td(nbm(${'lvl'.$ind}['solde_deb_previous']),'class="previous_year" 
style="font-weight:bold;"');
                     echo 
td(nbm(${'lvl'.$ind}['solde_cred_previous']),'class="previous_year" 
style="font-weight:bold;"');
+                    
$delta_previous=bcsub(${'lvl'.$ind}['solde_cred_previous'],${'lvl'.$ind}['solde_deb_previous']);
+                    $side_previous=($delta_previous > 0 ) ? "C":"D";
+                    echo td(nbm($delta_previous)." 
$side_previous",'class="previous_year"  
style="text-align:right;font-weight:bold;"  ');
+                    
                 }
                echo 
td(nbm(${'lvl'.$ind}['sum_deb']),'style="text-align:right;font-weight:bold;"  
');
                echo 
td(nbm(${'lvl'.$ind}['sum_cred']),'style="text-align:right;font-weight:bold;"');
                echo 
td(nbm(${'lvl'.$ind}['solde_deb']),'style="text-align:right;font-weight:bold;"');
                echo 
td(nbm(${'lvl'.$ind}['solde_cred']),'style="text-align:right;font-weight:bold;"');
+                
$delta=bcsub(${'lvl'.$ind}['solde_cred'],${'lvl'.$ind}['solde_deb']);
+                $side=($delta > 0 ) ? "C":"D";
+                echo td(nbm($delta)." 
$side",'style="text-align:right;font-weight:bold;"  ');
 
                echo '</tr>';
                ${'lvl'.$ind.'_old'}=mb_substr($r['poste'],0,$ind);
@@ -368,11 +380,13 @@ if ( isset($_GET['view'] ) )
             echo td(nbm($r['sum_cred_previous']),' class="previous_year" ');
             echo td(nbm($r['solde_deb_previous']),' class="previous_year"');
             echo td(nbm($r['solde_cred_previous']),'class="previous_year" ');
+            if ( isset($_GET['lvl1']) || isset($_GET['lvl2']) || 
isset($_GET['lvl3']))             echo '<td></td>';
         }
         echo td(nbm($r['sum_deb']),'style="text-align:right;"');
        echo td(nbm($r['sum_cred']),'style="text-align:right;"');
        echo td(nbm($r['solde_deb']),'style="text-align:right;"');
        echo td(nbm($r['solde_cred']),'style="text-align:right;"');
+        if ( isset($_GET['lvl1']) || isset($_GET['lvl2']) || 
isset($_GET['lvl3']))             echo '<td></td>';
         echo '</TR>';
 
     }
diff --git a/include/export_balance_pdf.php b/include/export_balance_pdf.php
index 79f3a97..9f36f64 100644
--- a/include/export_balance_pdf.php
+++ b/include/export_balance_pdf.php
@@ -37,7 +37,7 @@ require_once ('header_print.php');
 require_once('class_dossier.php');
 require_once('class_pdf.php');
 $gDossier=dossier::id();
-
+bcscale(4);
 $cn=new Database($gDossier);
 $rep=new Database();
 require_once ('class_user.php');
@@ -160,13 +160,20 @@ if (! empty($array))
            if ( ${'lvl'.$ind.'_old'} != substr($r['poste'],0,$ind))
              {
                $pdf->SetFont('DejaVu','B',7);
-               $pdf->LongLine(30,6,"Totaux ".$ind);
-               $pdf->LongLine(60,6,${'lvl'.$ind.'_old'});
+               $pdf->LongLine(30,6,${'lvl'.$ind.'_old'});
+                
$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->Cell(30,6,"n-1 : " .nbm($delta_previous)." 
$side_previous",0,0,'R');
+                     $pdf->Cell(30,6," n : ".nbm($delta)." $side",0,0,'R');
                     
$pdf->Cell(22,6,nbm(${'nlvl'.$ind}['sum_deb_previous']),0,0,'R');
                     
$pdf->Cell(22,6,nbm(${'nlvl'.$ind}['sum_cred_previous']),0,0,'R');
                     
$pdf->Cell(22,6,nbm(${'nlvl'.$ind}['solde_deb_previous']),0,0,'R');
                     
$pdf->Cell(22,6,nbm(${'nlvl'.$ind}['solde_cred_previous']),0,0,'R');
+                } else {
+                     $pdf->Cell(60,6,nbm($delta)." $side",0,0,'R');
                 }
                $pdf->Cell(25,6,nbm(${'nlvl'.$ind}['sum_deb']),0,0,'R');
                $pdf->Cell(25,6,nbm(${'nlvl'.$ind}['sum_cred']),0,0,'R');



reply via email to

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