From bed5084bcfd2e5deab487e2034cbf064c08a7729 Mon Sep 17 00:00:00 2001 From: atm-john Date: Tue, 23 Oct 2018 21:44:45 +0200 Subject: [PATCH 1/6] Add missing Max payment date col --- htdocs/compta/paiement.php | 23 +++++++++++++++++++++-- htdocs/fourn/facture/paiement.php | 25 ++++++++++++++++++++++--- 2 files changed, 43 insertions(+), 5 deletions(-) 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..20ef0d4b9aa 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -473,7 +473,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.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; @@ -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 ' '; From 2a6478a2c42c0fb2b0b90455664d809b1cc5bb65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 24 Oct 2018 08:15:00 +0200 Subject: [PATCH 2/6] fix phpcs --- htdocs/product/class/product.class.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index f8326a60721..24689e7b193 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -3556,7 +3556,6 @@ class Product extends CommonObject } else { return false; } - } /** @@ -4864,4 +4863,4 @@ class Product extends CommonObject dol_print_error($this->db); } } -} \ No newline at end of file +} From 4747e93e39df7a09f4867b9a57dfd45464dc01fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 24 Oct 2018 08:18:21 +0200 Subject: [PATCH 3/6] Update pdf_eratosthene.modules.php --- .../modules/commande/doc/pdf_eratosthene.modules.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index 4b11c61b078..3c2189e05c4 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -714,7 +714,7 @@ class pdf_eratosthene extends ModelePDFCommandes } } - /** phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** * Show payments table * * @param TCPDF $pdf Object PDF @@ -725,12 +725,10 @@ class pdf_eratosthene extends ModelePDFCommandes */ private function drawPaymentsTable(&$pdf, $object, $posy, $outputlangs) { - // phpcs:enable - } - /** phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** * Show miscellaneous information (payment mode, payment term, ...) * * @param TCPDF $pdf Object PDF @@ -741,7 +739,6 @@ class pdf_eratosthene extends ModelePDFCommandes */ private function drawInfoTable(&$pdf, $object, $posy, $outputlangs) { - // phpcs:enable global $conf; $default_font_size = pdf_getPDFFontSize($outputlangs); @@ -917,7 +914,7 @@ class pdf_eratosthene extends ModelePDFCommandes } - /** phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** * Show total to pay * * @param TCPDF $pdf Object PDF @@ -929,7 +926,6 @@ class pdf_eratosthene extends ModelePDFCommandes */ private function drawTotalTable(&$pdf, $object, $deja_regle, $posy, $outputlangs) { - // phpcs:enable global $conf,$mysoc; $default_font_size = pdf_getPDFFontSize($outputlangs); From d9d346aab28ec1ebc4153fb6b63fde59a502cfb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 24 Oct 2018 08:22:17 +0200 Subject: [PATCH 4/6] Update pdf_sponge.modules.php --- .../core/modules/facture/doc/pdf_sponge.modules.php | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 4032a6c41a5..d03d60f50fe 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -849,7 +849,7 @@ class pdf_sponge extends ModelePDFFactures } - /** phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** * Show payments table * * @param PDF $pdf Object PDF @@ -860,7 +860,6 @@ class pdf_sponge extends ModelePDFFactures */ function drawPaymentsTable(&$pdf, $object, $posy, $outputlangs) { - // phpcs:enable global $conf; $sign=1; @@ -989,7 +988,7 @@ class pdf_sponge extends ModelePDFFactures } - /** phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** * Show miscellaneous information (payment mode, payment term, ...) * * @param PDF $pdf Object PDF @@ -1000,7 +999,6 @@ class pdf_sponge extends ModelePDFFactures */ private function drawInfoTable(&$pdf, $object, $posy, $outputlangs) { - // phpcs:enable global $conf; $default_font_size = pdf_getPDFFontSize($outputlangs); @@ -1147,7 +1145,7 @@ class pdf_sponge extends ModelePDFFactures } - /** phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** * Show total to pay * * @param PDF $pdf Object PDF @@ -1159,7 +1157,6 @@ class pdf_sponge extends ModelePDFFactures */ private function drawTotalTable(&$pdf, $object, $deja_regle, $posy, $outputlangs) { - // phpcs:enable global $conf,$mysoc; $sign=1; @@ -1828,9 +1825,6 @@ class pdf_sponge extends ModelePDFFactures return pdf_pagefoot($pdf,$outputlangs,'INVOICE_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,$showdetails,$hidefreetext); } - - - /** * Define Array Column Field * From 2bc208675f88e282325395ba18d4efc5553e4c81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 24 Oct 2018 09:06:54 +0200 Subject: [PATCH 5/6] Update pdf_cyan.modules.php --- htdocs/core/modules/propale/doc/pdf_cyan.modules.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 9dcc14bf384..e43734039ca 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -875,7 +875,7 @@ class pdf_cyan extends ModelePDFPropales } } - /** phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** * Show payments table * * @param TCPDF $pdf Object PDF @@ -886,11 +886,9 @@ class pdf_cyan extends ModelePDFPropales */ private function drawPaymentsTable(&$pdf, $object, $posy, $outputlangs) { - // phpcs:enable } - - /** phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** * Show miscellaneous information (payment mode, payment term, ...) * * @param TCPDF $pdf Object PDF @@ -901,7 +899,6 @@ class pdf_cyan extends ModelePDFPropales */ function drawInfoTable(&$pdf, $object, $posy, $outputlangs) { - // phpcs:enable global $conf; $default_font_size = pdf_getPDFFontSize($outputlangs); From a380d3e89b09d7bc29e3517b35a56f0953d4b58a Mon Sep 17 00:00:00 2001 From: John BOTELLA Date: Wed, 24 Oct 2018 09:19:57 +0200 Subject: [PATCH 6/6] Fix missing group by in query --- htdocs/fourn/facture/paiement.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 20ef0d4b9aa..7946f98cb66 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -480,7 +480,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.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) {