diff --git a/htdocs/compta/cashcontrol/cashcontrol_card.php b/htdocs/compta/cashcontrol/cashcontrol_card.php index d494b5777f2..314a4641f12 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_card.php +++ b/htdocs/compta/cashcontrol/cashcontrol_card.php @@ -228,6 +228,7 @@ if ($action=="create" || $action=="start") $initialbalanceforterminal=array(); $theoricalamountforterminal=array(); + $theoricalnbofinvoiceforterminal=array(); if (GETPOST('posnumber','alpha') != '' && GETPOST('posnumber','alpha') != '' && GETPOST('posnumber','alpha') != '-1') { @@ -269,8 +270,7 @@ if ($action=="create" || $action=="start") { /*$sql = "SELECT SUM(amount) as total FROM ".MAIN_DB_PREFIX."bank"; $sql.= " WHERE fk_account = ".$bankid;*/ - - $sql = "SELECT SUM(pf.amount) as total"; + $sql = "SELECT SUM(pf.amount) as total, COUNT(*) as nb"; $sql.= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf, ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."paiement as p, ".MAIN_DB_PREFIX."c_paiement as cp"; $sql.= " WHERE pf.fk_facture = f.rowid AND p.rowid = pf.fk_paiement AND cp.id = p.fk_paiement"; $sql.= " AND f.module_source = '".$db->escape($posmodule)."'"; @@ -299,6 +299,7 @@ if ($action=="create" || $action=="start") if ($obj) { $theoricalamountforterminal[$terminalid][$key] = price2num($theoricalamountforterminal[$terminalid][$key] + $obj->total); + $theoricalnbofinvoiceforterminal[$terminalid][$key] = $obj->nb; } } else dol_print_error($db); @@ -415,6 +416,24 @@ if ($action=="create" || $action=="start") print ''; print ''; + print ''; + // Initial amount + print ''.$langs->trans("NbOfInvoices").''; + print ''; + print ''; + // Amount per payment type + $i=0; + foreach($arrayofpaymentmode as $key => $val) + { + print ''; + print $theoricalnbofinvoiceforterminal[$terminalid][$key]; + print ''; + $i++; + } + // Save + print ''; + print ''; + print ''; // Initial amount print ''.$langs->trans("TheoricalAmount").''; diff --git a/htdocs/langs/en_US/cashdesk.lang b/htdocs/langs/en_US/cashdesk.lang index ba14b343954..836a9489b25 100644 --- a/htdocs/langs/en_US/cashdesk.lang +++ b/htdocs/langs/en_US/cashdesk.lang @@ -45,4 +45,5 @@ SearchProduct=Search product AmountAtEndOfPeriod=Amount at end of period (day, month or year) TheoricalAmount=Theorical amount RealAmount=Real amount -CashFenceDone=Cash fence done for the period \ No newline at end of file +CashFenceDone=Cash fence done for the period +NbOfInvoices=Nb of invoices \ No newline at end of file