From 28fa0e4e5d26f1c43ac0dd5aef8bbbb79a2c1942 Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Fri, 10 Apr 2020 11:49:20 +0200 Subject: [PATCH] FIX missing selectedlines on supplier order but checkbox are displayed --- htdocs/fourn/commande/card.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 981279db9dc..00843a07118 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1086,7 +1086,7 @@ if (empty($reshook)) if ($action == 'add' && $user->rights->fournisseur->commande->creer) { $error = 0; - + $selectedLines = GETPOST('toselect', 'array'); if ($socid < 1) { setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentities('Supplier')), null, 'errors'); @@ -1178,6 +1178,7 @@ if (empty($reshook)) for ($i = 0; $i < $num; $i++) { + if (!in_array($lines[$i]->id, $selectedLines)) continue; if (empty($lines[$i]->subprice) || $lines[$i]->qty <= 0) continue; @@ -1756,7 +1757,7 @@ if ($action == 'create') print ''; print ''; - print "\n"; + // Show origin lines if (!empty($origin) && !empty($originid) && is_object($objectsrc)) @@ -1766,10 +1767,11 @@ if ($action == 'create') print ''; - $objectsrc->printOriginLinesList(); + $objectsrc->printOriginLinesList('', $selectedLines); print '
'; } + print "\n"; } elseif (!empty($object->id)) {