From 12f53a84814672abac73b1902f564be725f7b9da Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Jul 2024 11:14:11 +0200 Subject: [PATCH] Debug v20 --- htdocs/compta/prelevement/factures.php | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php index 1dc1fd3d76d84..827e2e9fc0780 100644 --- a/htdocs/compta/prelevement/factures.php +++ b/htdocs/compta/prelevement/factures.php @@ -323,16 +323,18 @@ $invoicetmpsupplier = new FactureFournisseur($db); } - while ($i < min($num, $limit)) { + $imaxinloop = ($limit ? min($num, $limit) : $num); + while ($i < $imaxinloop) { $obj = $db->fetch_object($resql); + $itemurl = ''; $partyurl = ''; - if ($salaryBonPl && ($salarytmp instanceof Salary) && ($user instanceof User)) { + if ($salaryBonPl && ($salarytmp instanceof Salary) && ($usertmp instanceof User)) { $salarytmp->fetch($obj->salaryid); $usertmp->fetch($obj->userid); $itemurl = $salarytmp->getNomUrl(1); $partyurl = $usertmp->getNomUrl(1); - } elseif ($invoicetmp instanceof Facture && $invoicetmpsupplier instanceof FactureFournisseur) { + } elseif ($invoicetmpcustomer instanceof Facture && $invoicetmpsupplier instanceof FactureFournisseur) { if ($obj->type == 'bank-transfer') { $invoicetmp = $invoicetmpsupplier; } else { @@ -351,9 +353,15 @@ print $itemurl; print "\n"; - if ($object->type == 'bank-transfer' && !$salaryBonPl && $invoicetmp instanceof Facture) { - print ''; - print dol_escape_htmltag($invoicetmp->ref_supplier); + if ($object->type == 'bank-transfer' && !$salaryBonPl) { + $labeltoshow = ''; + if ($invoicetmp instanceof Facture) { + $labeltoshow = $invoicetmp->ref_supplier; + } + print ''; + if ($invoicetmp instanceof Facture) { + print dol_escape_htmltag($invoicetmp->ref_supplier); + } print "\n"; }