From 97d74c95984eb5ef3eb69dc42283d8b4a3afb712 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Sat, 29 Nov 2014 11:38:21 +0100 Subject: [PATCH] --- 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 927af1ca4..1389bd100 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 e20f6b9f4..b41acb8c5 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 ''; echo ''; -echo td('Uniquement les opérations non lettrées'); +echo td(_('Uniquement les opérations non lettrées')); echo td($letter->input()); echo ''; echo ''; -echo td('Uniquement les comptes non soldés'); +echo td(_('Uniquement les comptes non soldés')); echo td($solded->input()); echo ''; // echo ''; -print HtmlInput::submit('bt_html','Visualisation'); +print HtmlInput::submit('bt_html',_('Visualisation')); echo ''; echo '
'; @@ -155,7 +155,8 @@ if ( isset( $_REQUEST['bt_html'] ) ) echo ''; $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 ' + + + + + + + + '. + ''; + /* + * 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'] ) ) '; } - echo ' - + echo ' +
@@ -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 '
'.$current_exercice.''.''.''.'Total du compte '.$poste_id['pcm_val'].''.''.''.($solde_d > 0 ? nbm( $solde_d) : '').''.($solde_c > 0 ? nbm( $solde_c) : '').''.nbm( abs($solde_c-$solde_d)).''; + if ($solde_c > $solde_d ) echo _("Crédit"); + if ($solde_c < $solde_d ) echo _("Débit"); + if ($solde_c == $solde_d ) echo "="; + echo '
'.$html_let.'
'.''.'
'.$current_exercice.' '.''.' '.''.'Total du compte '.$poste_id['pcm_val'].''.' '.''.'