From e0af2feced0795c627439a2a3e62d3d6885b1423 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sat, 18 Apr 2015 18:06:02 +0200 Subject: [PATCH] Fix : on impayees remain to pay did not include deposits --- htdocs/compta/facture/impayees.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/htdocs/compta/facture/impayees.php b/htdocs/compta/facture/impayees.php index 467d2b0636a..b0001e706a9 100644 --- a/htdocs/compta/facture/impayees.php +++ b/htdocs/compta/facture/impayees.php @@ -649,13 +649,12 @@ if ($resql) print ''.price($objp->total_ttc).''; print ''; $cn=$facturestatic->getSumCreditNotesUsed(); - if (! empty($objp->am)) print price($objp->am); - if (! empty($objp->am) && ! empty($cn)) print '+'; - if (! empty($cn)) print price($cn); + $dep=$facturestatic->getSumDepositsUsed(); + print price($objp->am + $cn + $dep); print ''; // Remain to receive - print ''.((! empty($objp->am) || ! empty($cn))?price($objp->total_ttc-$objp->am-$cn):' ').''; + print ''.price($objp->total_ttc-$objp->am-$cn-$dep).''; // Status of invoice print ''; @@ -685,7 +684,7 @@ if ($resql) $total_ht+=$objp->total_ht; $total_tva+=($objp->total_tva + $tx1 + $tx2 + $revenuestamp); $total_ttc+=$objp->total_ttc; - $total_paid+=$objp->am + $cn; + $total_paid+=$objp->am + $cn + $dep; $i++; }