[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édit N-1</th>';
echo '<th>Solde Débiteur N-1</th>';
echo '<th>Solde Créditeur N-1</th>';
+ if ( isset($_GET['lvl1']) || isset($_GET['lvl2']) ||
isset($_GET['lvl3']))
+ echo '<th>Solde N-1</th>';
+
}
echo '<th>Débit</th>';
echo '<th>Crédit</th>';
echo '<th>Solde Débiteur </th>';
echo '<th>Solde Cré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');
- [Noalyss-commit] [noalyss] branch master updated (38c52bf -> 255124b), Dany De Bontridder, 2015/06/02
- [Noalyss-commit] [noalyss] 01/30: Task #1118 - Partage de notes via le Pense-bête #1118 : partage de note Correction bug, Dany De Bontridder, 2015/06/02
- [Noalyss-commit] [noalyss] 03/30: Merge tag 'rel6803', Dany De Bontridder, 2015/06/02
- [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,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 05/30: Icon in the menu, Dany De Bontridder, 2015/06/02
- [Noalyss-commit] [noalyss] 06/30: #1118 : partage de note Esthétique Zoom des notes partagées, Dany De Bontridder, 2015/06/02
- [Noalyss-commit] [noalyss] 04/30: Icon in the menu, Dany De Bontridder, 2015/06/02
- [Noalyss-commit] [noalyss] 07/30: Improve method HtmlInput::title_box, Dany De Bontridder, 2015/06/02
- [Noalyss-commit] [noalyss] 08/30: #1118 : partage de note Ne peut partager note non sauvée, Dany De Bontridder, 2015/06/02
- [Noalyss-commit] [noalyss] 09/30: #1118 : partage de note Esthétique zoom, Dany De Bontridder, 2015/06/02
- [Noalyss-commit] [noalyss] 10/30: Database improve : new function get_affected returns the number of rows affected by the last query, Dany De Bontridder, 2015/06/02
- [Noalyss-commit] [noalyss] 13/30: Administration user : add condition if no folder exists + esthetic, Dany De Bontridder, 2015/06/02
- [Noalyss-commit] [noalyss] 11/30: Remove table priv_user, the local admin and plugin user are obsolete, Dany De Bontridder, 2015/06/02
- [Noalyss-commit] [noalyss] 16/30: Administration user : esthetic, Dany De Bontridder, 2015/06/02