Merge pull request #9854 from atm-john/NEW_missing_payment_date_col
NEW Add due date column in payment lists
This commit is contained in:
commit
c9dca22df2
@ -526,7 +526,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
*/
|
||||
|
||||
$sql = 'SELECT f.rowid as facid, f.facnumber, f.total_ttc, f.multicurrency_code, f.multicurrency_total_ttc, f.type,';
|
||||
$sql.= ' f.datef as df, f.fk_soc as socid';
|
||||
$sql.= ' f.datef as df, f.fk_soc as socid, f.date_lim_reglement as dlr';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'facture as f';
|
||||
$sql.= ' WHERE f.entity IN ('.getEntity('facture', $conf->entity).')';
|
||||
$sql.= ' AND (f.fk_soc = '.$facture->socid;
|
||||
@ -578,6 +578,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$arraytitle.'</td>';
|
||||
print '<td align="center">'.$langs->trans('Date').'</td>';
|
||||
print '<td align="center">'.$langs->trans('DateMaxPayment').'</td>';
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td>'.$langs->trans('Currency').'</td>';
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td align="right">'.$langs->trans('MulticurrencyAmountTTC').'</td>';
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td align="right">'.$multicurrencyalreadypayedlabel.'</td>';
|
||||
@ -629,7 +630,25 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
|
||||
// Date
|
||||
print '<td align="center">'.dol_print_date($db->jdate($objp->df),'day')."</td>\n";
|
||||
|
||||
|
||||
// Date Max Payment
|
||||
if ($objp->dlr > 0 )
|
||||
{
|
||||
print '<td align="center">';
|
||||
print dol_print_date($db->jdate($objp->dlr), 'day');
|
||||
|
||||
if ($invoice->hasDelay())
|
||||
{
|
||||
print img_warning($langs->trans('Late'));
|
||||
}
|
||||
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td align="center"><b>--</b></td>';
|
||||
}
|
||||
|
||||
// Currency
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td align="center">'.$objp->multicurrency_code."</td>\n";
|
||||
|
||||
|
||||
@ -473,14 +473,14 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
* Autres factures impayees
|
||||
*/
|
||||
$sql = 'SELECT f.rowid as facid, f.ref, f.ref_supplier, f.total_ht, f.total_ttc, f.multicurrency_total_ttc, f.datef as df,';
|
||||
$sql.= ' SUM(pf.amount) as am, SUM(pf.multicurrency_amount) as multicurrency_am';
|
||||
$sql.= ' SUM(pf.amount) as am, SUM(pf.multicurrency_amount) as multicurrency_am, f.date_lim_reglement as dlr';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as f';
|
||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON pf.fk_facturefourn = f.rowid';
|
||||
$sql.= " WHERE f.entity = ".$conf->entity;
|
||||
$sql.= ' AND f.fk_soc = '.$object->socid;
|
||||
$sql.= ' AND f.paye = 0';
|
||||
$sql.= ' AND f.fk_statut = 1'; // Statut=0 => non validee, Statut=2 => annulee
|
||||
$sql.= ' GROUP BY f.rowid, f.ref, f.ref_supplier, f.total_ht, f.total_ttc, f.multicurrency_total_ttc, f.datef';
|
||||
$sql.= ' GROUP BY f.rowid, f.ref, f.ref_supplier, f.total_ht, f.total_ttc, f.multicurrency_total_ttc, f.datef, f.date_lim_reglement';
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@ -511,6 +511,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
print '<td>'.$langs->trans('Invoice').'</td>';
|
||||
print '<td>'.$langs->trans('RefSupplier').'</td>';
|
||||
print '<td align="center">'.$langs->trans('Date').'</td>';
|
||||
print '<td align="center">'.$langs->trans('DateMaxPayment').'</td>';
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td>'.$langs->trans('Currency').'</td>';
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td align="right">'.$langs->trans('MulticurrencyAmountTTC').'</td>';
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td align="right">'.$langs->trans('MulticurrencyAlreadyPaid').'</td>';
|
||||
@ -569,7 +570,25 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
{
|
||||
print '<td align="center"><b>!!!</b></td>';
|
||||
}
|
||||
|
||||
|
||||
// Date Max Payment
|
||||
if ($objp->dlr > 0 )
|
||||
{
|
||||
print '<td align="center">';
|
||||
print dol_print_date($db->jdate($objp->dlr), 'day');
|
||||
|
||||
if ($invoice->hasDelay())
|
||||
{
|
||||
print img_warning($langs->trans('Late'));
|
||||
}
|
||||
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td align="center"><b>--</b></td>';
|
||||
}
|
||||
|
||||
// Multicurrency
|
||||
if (!empty($conf->multicurrency->enabled))
|
||||
{
|
||||
@ -661,7 +680,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
{
|
||||
// Print total
|
||||
print '<tr class="liste_total">';
|
||||
print '<td colspan="3" align="left">'.$langs->trans('TotalTTC').':</td>';
|
||||
print '<td colspan="4" align="left">'.$langs->trans('TotalTTC').':</td>';
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td> </td>';
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td> </td>';
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td> </td>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user