Add nb of invoice to help cash fence
This commit is contained in:
parent
1306918eb0
commit
527ef8bdc8
@ -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 '<td></td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr>';
|
||||
// Initial amount
|
||||
print '<td>'.$langs->trans("NbOfInvoices").'</td>';
|
||||
print '<td align="center">';
|
||||
print '</td>';
|
||||
// Amount per payment type
|
||||
$i=0;
|
||||
foreach($arrayofpaymentmode as $key => $val)
|
||||
{
|
||||
print '<td align="center"'.($i == 0 ? ' class="hide0"':'').'>';
|
||||
print $theoricalnbofinvoiceforterminal[$terminalid][$key];
|
||||
print '</td>';
|
||||
$i++;
|
||||
}
|
||||
// Save
|
||||
print '<td align="center"></td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr>';
|
||||
// Initial amount
|
||||
print '<td>'.$langs->trans("TheoricalAmount").'</td>';
|
||||
|
||||
@ -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
|
||||
CashFenceDone=Cash fence done for the period
|
||||
NbOfInvoices=Nb of invoices
|
||||
Loading…
Reference in New Issue
Block a user