From d0508d557b92468b694f89fa1dec88bda9c8f9b6 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 30 Sep 2021 14:56:02 +0200 Subject: [PATCH] fix: checkbox for line selection between supplier order and supplier invoice was infective --- htdocs/fourn/facture/card.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index c063e636a91..690c232cb64 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -668,6 +668,7 @@ if (empty($reshook)) elseif ($action == 'add' && $usercancreate) { if ($socid > 0) $object->socid = GETPOST('socid', 'int'); + $selectedLines = GETPOST('toselect', 'array'); $db->begin(); @@ -980,6 +981,8 @@ if (empty($reshook)) $num = count($lines); for ($i = 0; $i < $num; $i++) // TODO handle subprice < 0 { + if (!in_array($lines[$i]->id, $selectedLines)) continue; // Skip unselected lines + $desc = ($lines[$i]->desc ? $lines[$i]->desc : $lines[$i]->libelle); $product_type = ($lines[$i]->product_type ? $lines[$i]->product_type : 0); @@ -2239,9 +2242,6 @@ if ($action == 'create') print ''; print ''; - print "\n"; - - // Show origin lines if (is_object($objectsrc)) { @@ -2256,6 +2256,8 @@ if ($action == 'create') print ''; } + + print "\n"; } else {