diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index 719c92ca6f0..f5ac0f19509 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") . (count($invoicecredits) ? ' ' : '') . implode(',', $invoicecredits) . ')'; } /* if ($facidnext > 0) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index fc18bbc5501..30c37bb4d88 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") . (count($invoicecredits) ? ' ' : '') . 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..3ee6fe10d14 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") . (count($invoicecredits) ? ' ' : '') . 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..d7c11045f03 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") . (count($invoicecredits) ? ' ' : '') . 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);