From 1d38dc11c6c376b46b89bb0b0eb77c3d0d695fb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 7 May 2021 21:28:35 +0200 Subject: [PATCH 1/6] uniformize supplier cards --- htdocs/compta/facture/prelevement.php | 16 +++++----------- htdocs/fourn/facture/card.php | 12 +++--------- htdocs/fourn/facture/contact.php | 27 ++++++++++++--------------- htdocs/fourn/facture/document.php | 26 +++++++++++--------------- htdocs/fourn/facture/note.php | 21 +++++++++------------ 5 files changed, 40 insertions(+), 62 deletions(-) diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index 719c92ca6f0..a7262b7c398 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -315,23 +315,17 @@ if ($object->id > 0) { $facidavoir = $object->getListIdAvoirFromInvoice(); if (count($facidavoir) > 0) { - print ' ('.$langs->transnoentities("InvoiceHasAvoir"); - $i = 0; - foreach ($facidavoir as $id) { - if ($i == 0) { - print ' '; - } else { - print ','; - } + $invoicecredits = array(); + foreach ($facidavoir as $facid) { if ($type == 'bank-transfer') { $facavoir = new FactureFournisseur($db); } else { $facavoir = new Facture($db); } - $facavoir->fetch($id); - print $facavoir->getNomUrl(1); + $facavoir->fetch($facid); + $invoicecredits[] = $facavoir->getNomUrl(1); } - print ')'; + print ' ('.$langs->transnoentities("InvoiceHasAvoir") . implode(',', $invoicecredits) . ')'; } /* if ($facidnext > 0) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index fc18bbc5501..7a09e9393bb 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2695,19 +2695,13 @@ if ($action == 'create') { $facidavoir = $object->getListIdAvoirFromInvoice(); if (count($facidavoir) > 0) { - print ' ('.$langs->transnoentities("InvoiceHasAvoir"); - $i = 0; + $invoicecredits = array(); foreach ($facidavoir as $id) { - if ($i == 0) { - print ' '; - } else { - print ','; - } $facavoir = new FactureFournisseur($db); $facavoir->fetch($id); - print $facavoir->getNomUrl(1); + $invoicecredits[] = $facavoir->getNomUrl(1); } - print ')'; + print ' ('.$langs->transnoentities("InvoiceHasAvoir") . implode(',', $invoicecredits) . ')'; } if (isset($facidnext) && $facidnext > 0) { $facthatreplace = new FactureFournisseur($db); diff --git a/htdocs/fourn/facture/contact.php b/htdocs/fourn/facture/contact.php index 236c3cd6948..65471cd59ff 100644 --- a/htdocs/fourn/facture/contact.php +++ b/htdocs/fourn/facture/contact.php @@ -1,8 +1,9 @@ - * Copyright (C) 2005-2015 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2017 Ferran Marcet +/* Copyright (C) 2005 Patrick Rouillon + * Copyright (C) 2005-2015 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2017 Ferran Marcet + * Copyright (C) 2021 Frédéric France * * 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 @@ -180,7 +181,9 @@ if ($id > 0 || !empty($ref)) { // Type print ''.$langs->trans('Type').''; + print ''; print $object->getLibType(); + print ''; if ($object->type == FactureFournisseur::TYPE_REPLACEMENT) { $facreplaced = new FactureFournisseur($db); $facreplaced->fetch($object->fk_facture_source); @@ -194,19 +197,13 @@ if ($id > 0 || !empty($ref)) { $facidavoir = $object->getListIdAvoirFromInvoice(); if (count($facidavoir) > 0) { - print ' ('.$langs->transnoentities("InvoiceHasAvoir"); - $i = 0; - foreach ($facidavoir as $fid) { - if ($i == 0) { - print ' '; - } else { - print ','; - } + $invoicecredits = array(); + foreach ($facidavoir as $facid) { $facavoir = new FactureFournisseur($db); - $facavoir->fetch($fid); - print $facavoir->getNomUrl(1); + $facavoir->fetch($facid); + $invoicecredits[] = $facavoir->getNomUrl(1); } - print ')'; + print ' ('.$langs->transnoentities("InvoiceHasAvoir") . implode(',', $invoicecredits) . ')'; } if ($facidnext > 0) { $facthatreplace = new FactureFournisseur($db); diff --git a/htdocs/fourn/facture/document.php b/htdocs/fourn/facture/document.php index f75a8bd8ef3..237285d036a 100644 --- a/htdocs/fourn/facture/document.php +++ b/htdocs/fourn/facture/document.php @@ -5,7 +5,8 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2016 Alexandre Spangaro - * Copyright (C) 2017 Ferran Marcet + * Copyright (C) 2017 Ferran Marcet + * Copyright (C) 2021 Frédéric France * * 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 @@ -170,7 +171,9 @@ if ($object->id > 0) { // Type print ''.$langs->trans('Type').''; + print ''; print $object->getLibType(); + print ''; if ($object->type == FactureFournisseur::TYPE_REPLACEMENT) { $facreplaced = new FactureFournisseur($db); $facreplaced->fetch($object->fk_facture_source); @@ -184,24 +187,17 @@ if ($object->id > 0) { $facidavoir = $object->getListIdAvoirFromInvoice(); if (count($facidavoir) > 0) { - print ' ('.$langs->transnoentities("InvoiceHasAvoir"); - $i = 0; - foreach ($facidavoir as $id) { - if ($i == 0) { - print ' '; - } else { - print ','; - } + $invoicecredits = array(); + foreach ($facidavoir as $facid) { $facavoir = new FactureFournisseur($db); - $facavoir->fetch($id); - print $facavoir->getNomUrl(1); + $facavoir->fetch($facid); + $invoicecredits[] = $facavoir->getNomUrl(1); } - print ')'; + print ' ('.$langs->transnoentities("InvoiceHasAvoir") . implode(',', $invoicecredits) . ')'; } /* - if ($facidnext > 0) - { - $facthatreplace=new FactureFournisseur($db); + if ($facidnext > 0) { + $facthatreplace = new FactureFournisseur($db); $facthatreplace->fetch($facidnext); print ' ('.$langs->transnoentities("ReplacedByInvoice",$facthatreplace->getNomUrl(1)).')'; } diff --git a/htdocs/fourn/facture/note.php b/htdocs/fourn/facture/note.php index 2f749af54f7..5bbf1fdcba6 100644 --- a/htdocs/fourn/facture/note.php +++ b/htdocs/fourn/facture/note.php @@ -3,7 +3,8 @@ * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2013 Florian Henry - * Copyright (C) 2017 Ferran Marcet + * Copyright (C) 2017 Ferran Marcet + * Copyright (C) 2021 Frédéric France * * 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 @@ -144,7 +145,9 @@ if ($object->id > 0) { // Type print ''.$langs->trans('Type').''; + print ''; print $object->getLibType(); + print ''; if ($object->type == FactureFournisseur::TYPE_REPLACEMENT) { $facreplaced = new FactureFournisseur($db); $facreplaced->fetch($object->fk_facture_source); @@ -158,19 +161,13 @@ if ($object->id > 0) { $facidavoir = $object->getListIdAvoirFromInvoice(); if (count($facidavoir) > 0) { - print ' ('.$langs->transnoentities("InvoiceHasAvoir"); - $i = 0; - foreach ($facidavoir as $fid) { - if ($i == 0) { - print ' '; - } else { - print ','; - } + $invoicecredits = array(); + foreach ($facidavoir as $facid) { $facavoir = new FactureFournisseur($db); - $facavoir->fetch($fid); - print $facavoir->getNomUrl(1); + $facavoir->fetch($facid); + $invoicecredits[] = $facavoir->getNomUrl(1); } - print ')'; + print ' ('.$langs->transnoentities("InvoiceHasAvoir") . implode(',', $invoicecredits) . ')'; } if ($facidnext > 0) { $facthatreplace = new FactureFournisseur($db); From 3b13c4a2691da3c90dbab0d5758c1d3e2a43b0e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 9 May 2021 21:03:39 +0200 Subject: [PATCH 2/6] fix syntax error --- htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php index 4cb80e0a81e..6e89c6f00ad 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php @@ -1369,7 +1369,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders $pdf->SetTextColor(0, 0, 0); $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posx, $posy - 5); - $pdf->MultiCell(80, 5, $outputlangs->transnoentities("BillFrom", 0, 'L'); + $pdf->MultiCell(80, 5, $outputlangs->transnoentities("BillFrom"), 0, 'L'); $pdf->SetXY($posx, $posy); $pdf->SetFillColor(230, 230, 230); $pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1); From bccd1b9a41196b2cc00f0ce83e325d393d2525da Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 11 May 2021 19:21:08 +0200 Subject: [PATCH 3/6] Update prelevement.php --- htdocs/compta/facture/prelevement.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index a7262b7c398..f5ac0f19509 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -325,7 +325,7 @@ if ($object->id > 0) { $facavoir->fetch($facid); $invoicecredits[] = $facavoir->getNomUrl(1); } - print ' ('.$langs->transnoentities("InvoiceHasAvoir") . implode(',', $invoicecredits) . ')'; + print ' ('.$langs->transnoentities("InvoiceHasAvoir") . (count($invoicecredits) ? ' ' : '') . implode(',', $invoicecredits) . ')'; } /* if ($facidnext > 0) From 1c477d21313ab2b8bd7126dd595d8cc5ff4b6909 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 11 May 2021 19:21:38 +0200 Subject: [PATCH 4/6] Update card.php --- htdocs/fourn/facture/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 7a09e9393bb..30c37bb4d88 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2701,7 +2701,7 @@ if ($action == 'create') { $facavoir->fetch($id); $invoicecredits[] = $facavoir->getNomUrl(1); } - print ' ('.$langs->transnoentities("InvoiceHasAvoir") . implode(',', $invoicecredits) . ')'; + print ' ('.$langs->transnoentities("InvoiceHasAvoir") . (count($invoicecredits) ? ' ' : '') . implode(',', $invoicecredits) . ')'; } if (isset($facidnext) && $facidnext > 0) { $facthatreplace = new FactureFournisseur($db); From 70451050aebab0ffa3c1c086cf0295ed0caf7d2b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 11 May 2021 19:22:46 +0200 Subject: [PATCH 5/6] Update contact.php --- htdocs/fourn/facture/contact.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/contact.php b/htdocs/fourn/facture/contact.php index 65471cd59ff..3ee6fe10d14 100644 --- a/htdocs/fourn/facture/contact.php +++ b/htdocs/fourn/facture/contact.php @@ -203,7 +203,7 @@ if ($id > 0 || !empty($ref)) { $facavoir->fetch($facid); $invoicecredits[] = $facavoir->getNomUrl(1); } - print ' ('.$langs->transnoentities("InvoiceHasAvoir") . implode(',', $invoicecredits) . ')'; + print ' ('.$langs->transnoentities("InvoiceHasAvoir") . (count($invoicecredits) ? ' ' : '') . implode(',', $invoicecredits) . ')'; } if ($facidnext > 0) { $facthatreplace = new FactureFournisseur($db); From 6bec5d7e3cb46918aa6558f9eeb8ca115d5cb4f0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 11 May 2021 19:23:46 +0200 Subject: [PATCH 6/6] Update document.php --- htdocs/fourn/facture/document.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/document.php b/htdocs/fourn/facture/document.php index 237285d036a..d7c11045f03 100644 --- a/htdocs/fourn/facture/document.php +++ b/htdocs/fourn/facture/document.php @@ -193,7 +193,7 @@ if ($object->id > 0) { $facavoir->fetch($facid); $invoicecredits[] = $facavoir->getNomUrl(1); } - print ' ('.$langs->transnoentities("InvoiceHasAvoir") . implode(',', $invoicecredits) . ')'; + print ' ('.$langs->transnoentities("InvoiceHasAvoir") . (count($invoicecredits) ? ' ' : '') . implode(',', $invoicecredits) . ')'; } /* if ($facidnext > 0) {