From aaf6cb30ee4eaa4e1818075da6ed26faaf0d2ff4 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Mon, 27 Oct 2003 12:38:45 +0000 Subject: [PATCH] =?UTF-8?q?Ajoute=20le=20montant=20d=E9j=E0=20r=E9gl=E9=20?= =?UTF-8?q?dans=20la=20facture?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/facture/pdf_bulot.modules.php | 66 +++++++++++++------ 1 file changed, 46 insertions(+), 20 deletions(-) diff --git a/htdocs/includes/modules/facture/pdf_bulot.modules.php b/htdocs/includes/modules/facture/pdf_bulot.modules.php index 7a54b70a9b9..863a21039f5 100644 --- a/htdocs/includes/modules/facture/pdf_bulot.modules.php +++ b/htdocs/includes/modules/facture/pdf_bulot.modules.php @@ -219,33 +219,59 @@ Class pdf_bulot { $pdf->SetXY (132, $tab2_top + 0); $pdf->MultiCell(42, $tab2_hl, "Total HT", 0, 'R', 0); - - $pdf->SetXY (132, $tab2_top + $tab2_hl); - $pdf->MultiCell(42, $tab2_hl, "Remise", 0, 'R', 0); - - $pdf->SetXY (132, $tab2_top + $tab2_hl * 2); - $pdf->MultiCell(42, $tab2_hl, "Total HT aprés remise", 0, 'R', 0); - - $pdf->SetXY (132, $tab2_top + $tab2_hl * 3); - $pdf->MultiCell(42, $tab2_hl, "Total TVA", 0, 'R', 0); - - $pdf->SetXY (132, $tab2_top + $tab2_hl * 4); - $pdf->MultiCell(42, $tab2_hl, "Total TTC", 0, 'R', 1); - + $pdf->SetXY (174, $tab2_top + 0); $pdf->MultiCell(26, $tab2_hl, price($fac->total_ht + $fac->remise), 0, 'R', 0); - $pdf->SetXY (174, $tab2_top + $tab2_hl); - $pdf->MultiCell(26, $tab2_hl, price($fac->remise), 0, 'R', 0); + if ($fac->remise > 0) + { + $pdf->SetXY (132, $tab2_top + $tab2_hl); + $pdf->MultiCell(42, $tab2_hl, "Remise", 0, 'R', 0); + + $pdf->SetXY (174, $tab2_top + $tab2_hl); + $pdf->MultiCell(26, $tab2_hl, price($fac->remise), 0, 'R', 0); + + $pdf->SetXY (132, $tab2_top + $tab2_hl * 2); + $pdf->MultiCell(42, $tab2_hl, "Total HT aprés remise", 0, 'R', 0); - $pdf->SetXY (174, $tab2_top + $tab2_hl * 2); - $pdf->MultiCell(26, $tab2_hl, price($fac->total_ht), 0, 'R', 0); - - $pdf->SetXY (174, $tab2_top + $tab2_hl * 3); + $pdf->SetXY (174, $tab2_top + $tab2_hl * 2); + $pdf->MultiCell(26, $tab2_hl, price($fac->total_ht), 0, 'R', 0); + + $index = 3; + } + else + { + $index = 1; + } + + $pdf->SetXY (132, $tab2_top + $tab2_hl * $index); + $pdf->MultiCell(42, $tab2_hl, "Total TVA", 0, 'R', 0); + + $pdf->SetXY (174, $tab2_top + $tab2_hl * $index); $pdf->MultiCell(26, $tab2_hl, price($fac->total_tva), 0, 'R', 0); + + $pdf->SetXY (132, $tab2_top + $tab2_hl * ($index+1)); + $pdf->MultiCell(42, $tab2_hl, "Total TTC", 0, 'R', 1); - $pdf->SetXY (174, $tab2_top + $tab2_hl * 4); + $pdf->SetXY (174, $tab2_top + $tab2_hl * ($index+1)); $pdf->MultiCell(26, $tab2_hl, price($fac->total_ttc), 0, 'R', 1); + + $deja_regle = $fac->getSommePaiement(); + + if ($deja_regle > 0) + { + $pdf->SetXY (132, $tab2_top + $tab2_hl * ($index+2)); + $pdf->MultiCell(42, $tab2_hl, "Déjà réglé", 0, 'R', 0); + + $pdf->SetXY (174, $tab2_top + $tab2_hl * ($index+2)); + $pdf->MultiCell(26, $tab2_hl, price($deja_regle), 0, 'R', 0); + + $pdf->SetXY (132, $tab2_top + $tab2_hl * ($index+3)); + $pdf->MultiCell(42, $tab2_hl, "Reste à payer", 0, 'R', 1); + + $pdf->SetXY (174, $tab2_top + $tab2_hl * ($index+3)); + $pdf->MultiCell(26, $tab2_hl, price($fac->total_ttc - $deja_regle), 0, 'R', 1); + } } /* *