diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php
index 764ca818f7f..94cd53b5424 100644
--- a/htdocs/compta/paiement.php
+++ b/htdocs/compta/paiement.php
@@ -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 '
';
print '| '.$arraytitle.' | ';
print ''.$langs->trans('Date').' | ';
+ print ''.$langs->trans('DateMaxPayment').' | ';
if (!empty($conf->multicurrency->enabled)) print ''.$langs->trans('Currency').' | ';
if (!empty($conf->multicurrency->enabled)) print ''.$langs->trans('MulticurrencyAmountTTC').' | ';
if (!empty($conf->multicurrency->enabled)) print ''.$multicurrencyalreadypayedlabel.' | ';
@@ -629,7 +630,25 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
// Date
print ''.dol_print_date($db->jdate($objp->df),'day')." | \n";
-
+
+ // Date Max Payment
+ if ($objp->dlr > 0 )
+ {
+ print '';
+ print dol_print_date($db->jdate($objp->dlr), 'day');
+
+ if ($invoice->hasDelay())
+ {
+ print img_warning($langs->trans('Late'));
+ }
+
+ print ' | ';
+ }
+ else
+ {
+ print '-- | ';
+ }
+
// Currency
if (!empty($conf->multicurrency->enabled)) print ''.$objp->multicurrency_code." | \n";
diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php
index fdd358933d9..7946f98cb66 100644
--- a/htdocs/fourn/facture/paiement.php
+++ b/htdocs/fourn/facture/paiement.php
@@ -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 ''.$langs->trans('Invoice').' | ';
print ''.$langs->trans('RefSupplier').' | ';
print ''.$langs->trans('Date').' | ';
+ print ''.$langs->trans('DateMaxPayment').' | ';
if (!empty($conf->multicurrency->enabled)) print ''.$langs->trans('Currency').' | ';
if (!empty($conf->multicurrency->enabled)) print ''.$langs->trans('MulticurrencyAmountTTC').' | ';
if (!empty($conf->multicurrency->enabled)) print ''.$langs->trans('MulticurrencyAlreadyPaid').' | ';
@@ -569,7 +570,25 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
{
print '!!! | ';
}
-
+
+ // Date Max Payment
+ if ($objp->dlr > 0 )
+ {
+ print '';
+ print dol_print_date($db->jdate($objp->dlr), 'day');
+
+ if ($invoice->hasDelay())
+ {
+ print img_warning($langs->trans('Late'));
+ }
+
+ print ' | ';
+ }
+ else
+ {
+ print '-- | ';
+ }
+
// Multicurrency
if (!empty($conf->multicurrency->enabled))
{
@@ -661,7 +680,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
{
// Print total
print '
';
- print '| '.$langs->trans('TotalTTC').': | ';
+ print ''.$langs->trans('TotalTTC').': | ';
if (!empty($conf->multicurrency->enabled)) print ' | ';
if (!empty($conf->multicurrency->enabled)) print ' | ';
if (!empty($conf->multicurrency->enabled)) print ' | ';