From 2360dc52dd69c4049d70407691433c8fba0dd933 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Sun, 6 Oct 2013 17:21:10 +0200 Subject: [PATCH] Update societe.class.php --- htdocs/societe/class/societe.class.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 47556296c2f..a3815b937ae 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2785,6 +2785,13 @@ class Societe extends CommonObject */ function get_OutstandingBill() { + /* Accurate value of remain to pay is to sum remaintopay for each invoice + $paiement = $invoice->getSommePaiement(); + $creditnotes=$invoice->getSumCreditNotesUsed(); + $deposits=$invoice->getSumDepositsUsed(); + $alreadypayed=price2num($paiement + $creditnotes + $deposits,'MT'); + $remaintopay=price2num($invoice->total_ttc - $paiement - $creditnotes - $deposits,'MT'); + */ $sql = "SELECT sum(total) as amount FROM ".MAIN_DB_PREFIX."facture as f"; $sql .= " WHERE fk_soc = ". $this->id; $sql .= " AND paye = 0";