From 0fe39d4e4b16467db2d276e0e7901854c439bda3 Mon Sep 17 00:00:00 2001 From: a-schild Date: Tue, 7 Jul 2015 18:33:09 +0200 Subject: [PATCH] Show due date when creating payments, so user can select the bills to pay --- htdocs/fourn/facture/paiement.php | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index ba3f82c78e0..f82dd93904b 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -5,11 +5,9 @@ * Copyright (C) 2004 Christophe Combelles * Copyright (C) 2005 Marc Barilley / Ocebo * Copyright (C) 2005-2012 Regis Houssin -<<<<<<< HEAD * Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com> -======= - * Copyright (C) 2015 Marcos García ->>>>>>> refs/remotes/origin/3.6 + * Copyright (C) 2015 Marcos García + * Copyright (C) 2015 Andre Schild * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -322,7 +320,7 @@ 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.datef as df'; + $sql = 'SELECT f.rowid as facid, f.ref, f.ref_supplier, f.total_ht, f.total_ttc, f.datef as df, date_lim_reglement as duedate'; $sql.= ', SUM(pf.amount) as am'; $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'; @@ -330,7 +328,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie $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.datef'; + $sql.= ' GROUP BY f.rowid, f.ref, f.ref_supplier, f.total_ht, f.total_ttc, f.datef, f.date_lim_reglement'; $resql = $db->query($sql); if ($resql) { @@ -356,6 +354,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''.$langs->trans('Ref').''; print ''.$langs->trans('RefSupplier').''; print ''.$langs->trans('Date').''; + print ''.$langs->trans('DateMaxPayment').''; print ''.$langs->trans('AmountTTC').''; print ''.$langs->trans('AlreadyPaid').''; print ''.$langs->trans('RemainderToPay').''; @@ -386,6 +385,15 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie { print '!!!'; } + if ($objp->duedate > 0 ) + { + print ''; + print dol_print_date($db->jdate($objp->duedate), 'day').''; + } + else + { + print '!!!'; + } print ''.price($objp->total_ttc).''; print ''.price($objp->am).''; print ''.price($objp->total_ttc - $objp->am).''; @@ -404,7 +412,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie { // Print total print ''; - print ''.$langs->trans('TotalTTC').':'; + print ''.$langs->trans('TotalTTC').':'; print ''.price($total_ttc).''; print ''.price($totalrecu).''; print ''.price($total_ttc - $totalrecu).'';