noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 01/12:


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 01/12:
Date: Sat, 29 Nov 2014 16:15:33 +0000

sparkyx pushed a commit to branch master
in repository noalyss.

commit 97d74c95984eb5ef3eb69dc42283d8b4a3afb712
Author: Dany De Bontridder <address@hidden>
Date:   Sat Nov 29 11:38:21 2014 +0100
---
 include/export_gl_pdf.php          |   47 +++++++++++++++++++++++++++++++---
 include/impress_gl_comptes.inc.php |   48 ++++++++++++++++++++++++++++++-----
 2 files changed, 83 insertions(+), 12 deletions(-)

diff --git a/include/export_gl_pdf.php b/include/export_gl_pdf.php
index 927af1c..1389bd1 100644
--- a/include/export_gl_pdf.php
+++ b/include/export_gl_pdf.php
@@ -118,7 +118,7 @@ foreach ($a_poste as $poste)
     $solde = 0.0;
     $solde_d = 0.0;
     $solde_c = 0.0;
-
+    $current_exercice="";
     foreach ($Poste->row as $detail)
     {
 
@@ -134,16 +134,53 @@ foreach ($a_poste as $poste)
                [8] => 17OD-01-1 [jr_internal] => 17OD-01-1
                [9] => ODS1 [jr_pj_number] => ODS1 ) 1
          */
+         /*
+             * separation per exercice
+             */
+            if ( $current_exercice == "") 
$current_exercice=$detail['p_exercice'];
+            
+            if ( $current_exercice != $detail['p_exercice']) {
+                
+                $pdf->SetFont('DejaVuCond','B',8);
+                $i=0;
+                $pdf->Cell($width[$i], 6, $current_exercice, 0, 0, $lor[$i]);
+                $i++;
+                $pdf->Cell($width[$i], 6, '', 0, 0, $lor[$i]);
+                $i++;
+                $pdf->Cell($width[$i], 6, '', 0, 0, $lor[$i]);
+                $i++;
+                $pdf->Cell($width[$i], 6, '', 0, 0, $lor[$i]);
+                $i++;
+                $pdf->Cell($width[$i], 6, 'Total du compte '.$Poste->id, 0, 0, 
'R');
+                $i++;
+                $pdf->Cell($width[$i], 6, ($solde_d  > 0 ? nbm($solde_d)  : 
''), 0, 0, $lor[$i]);
+                $i++;
+                $pdf->Cell($width[$i], 6, ($solde_c  > 0 ? nbm( $solde_c)  : 
''), 0, 0, $lor[$i]);
+                $i++;
+                $pdf->Cell($width[$i], 6, nbm(abs($solde_c-$solde_d)), 0, 0, 
$lor[$i]);
+                $i++;
+                $pdf->Cell(5, 6, ($solde_c > $solde_d ? 'C' : 'D'), 0, 0, 'L');
+                /*
+                * reset total and current_exercice
+                */
+                $current_exercice=$detail['p_exercice'];
+                $solde = 0.0;
+                $solde_d = 0.0;
+                $solde_c = 0.0;
+                $pdf->Ln();
+                $pdf->SetFont('DejaVuCond','',7);
+
+            }
 
         if ($detail['cred_montant'] > 0)
         {
-            $solde   -= $detail['cred_montant'];
-            $solde_c += $detail['cred_montant'];
+            $solde   = bcsub ($solde,$detail['cred_montant']);
+            $solde_c = bcadd($solde_c,$detail['cred_montant']);
         }
         if ($detail['deb_montant'] > 0)
         {
-            $solde   += $detail['deb_montant'];
-            $solde_d += $detail['deb_montant'];
+            $solde   = bcadd($solde,$detail['deb_montant']);
+            $solde_d = bcadd($solde_d,$detail['deb_montant']);
         }
 
         $i = 0;
diff --git a/include/impress_gl_comptes.inc.php 
b/include/impress_gl_comptes.inc.php
index e20f6b9..b41acb8 100644
--- a/include/impress_gl_comptes.inc.php
+++ b/include/impress_gl_comptes.inc.php
@@ -85,19 +85,19 @@ echo td(_("Jusqu'au poste")).td($to_poste->input());
 echo '</tr>';
 
 echo '<tr>';
-echo td('Uniquement les opérations non lettrées');
+echo td(_('Uniquement les opérations non lettrées'));
 echo td($letter->input());
 echo '</tr>';
 
 echo '<tr>';
-echo td('Uniquement les comptes non soldés');
+echo td(_('Uniquement les comptes non soldés'));
 echo td($solded->input());
 echo '</tr>';
 
 
 //
 echo '</TABLE>';
-print HtmlInput::submit('bt_html','Visualisation');
+print HtmlInput::submit('bt_html',_('Visualisation'));
 
 echo '</FORM>';
 echo '<hr>';
@@ -155,7 +155,8 @@ if ( isset( $_REQUEST['bt_html'] ) )
     echo '<table class="result">';
        $l=(isset($_REQUEST['letter']))?2:0;
        $s=(isset($_REQUEST['solded']))?1:0;
-
+    
+    
     foreach ($a_poste as $poste_id )
     {
         $Poste=new Acc_Account_Ledger ($cn, $poste_id['pcm_val']);
@@ -167,7 +168,7 @@ if ( isset( $_REQUEST['bt_html'] ) )
         {
             continue;
         }
-
+        
 
         echo '<tr >
         <td colspan="8" style="width:auto">
@@ -191,9 +192,42 @@ if ( isset( $_REQUEST['bt_html'] ) )
         $solde_c = 0.0;
        bcscale(2);
        $i=0;
+        $current_exercice="";
+
         foreach ($Poste->row as $detail)
         {
+            /*
+             * separation per exercice
+             */
+            if ( $current_exercice == "") 
$current_exercice=$detail['p_exercice'];
+            
+            if ( $current_exercice != $detail['p_exercice']) {
+                echo '<tr class="highlight">
+               <td>'.$current_exercice.'</td>
+               <td>'.''.'</td>
+               <td>'.'Total du compte '.$poste_id['pcm_val'].'</td>
+               <td>'.''.'</td>
+               <td align="right">'.($solde_d  > 0 ? nbm( $solde_d)  : 
'').'</td>
+               <td align="right">'.($solde_c  > 0 ? nbm( $solde_c)  : 
'').'</td>
+               <td align="right">'.nbm( abs($solde_c-$solde_d)).'</td>
+               <td>';
+               if ($solde_c > $solde_d ) echo _("Crédit");
+               if ($solde_c < $solde_d )  echo _("Débit");
+               if ($solde_c == $solde_d )  echo "=";
+
+             echo '</td>'.
+               '</tr>';
+             /*
+              * reset total and current_exercice
+              */
+                $current_exercice=$detail['p_exercice'];
+                $solde = 0.0;
+                $solde_d = 0.0;
+                $solde_c = 0.0;
 
+            }
+            
+            
             if ($detail['cred_montant'] > 0)
             {
              $solde=bcsub($solde, $detail['cred_montant']);
@@ -224,8 +258,8 @@ if ( isset( $_REQUEST['bt_html'] ) )
             <td  style="text-align:right;color:red">'.$html_let.'</td>
             </tr>';
         }
-        echo '<tr >
-        <td>'.''.'</td>
+        echo '<tr class="hightlight">
+        <td>'.$current_exercice.'</td>
         <td>'.''.'</td>
         <td>'.'<b>'.'Total du compte '.$poste_id['pcm_val'].'</b>'.'</td>
         <td>'.''.'</td>



reply via email to

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