From 1e2f23f8b2b90aa9e76bf81af50c977fce0bb4d2 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 31 Aug 2024 19:28:47 +0200 Subject: [PATCH] FIX missing fk_parent_line parameter (#30806) --- htdocs/compta/facture/card-rec.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index f396b437f11..273d6e636f4 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -658,12 +658,14 @@ if (empty($reshook)) { $info_bits |= 0x01; } + $fk_parent_line = GETPOST('fk_parent_line', 'int'); + if ($usercanproductignorepricemin && (!empty($price_min) && (price2num($pu_ht) * (1 - price2num($remise_percent) / 100) < price2num($price_min)))) { $mesg = $langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)); setEventMessages($mesg, null, 'errors'); } else { // Insert line - $result = $object->addline($desc, $pu_ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, $idprod, $remise_percent, $price_base_type, $info_bits, '', $pu_ttc, $type, -1, $special_code, $label, $fk_unit, 0, $date_start_fill, $date_end_fill, $fournprice, $buyingprice); + $result = $object->addline($desc, $pu_ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, $idprod, $remise_percent, $price_base_type, $info_bits, '', $pu_ttc, $type, -1, $special_code, $label, $fk_unit, 0, $date_start_fill, $date_end_fill, $fournprice, $buyingprice, $fk_parent_line); if ($result > 0) { // Define output language and generate document @@ -849,6 +851,7 @@ if (empty($reshook)) { $date_start_fill = GETPOST('date_start_fill', 'int'); $date_end_fill = GETPOST('date_end_fill', 'int'); + $fk_parent_line = GETPOST('fk_parent_line', 'int'); // Update line if (!$error) { @@ -876,7 +879,8 @@ if (empty($reshook)) { $date_start_fill, $date_end_fill, $fournprice, - $buyingprice + $buyingprice, + $fk_parent_line ); if ($result >= 0) { @@ -1224,7 +1228,7 @@ if ($action == 'create') { } // Call Hook formConfirm - $parameters = array('formConfirm' => $formconfirm); + $parameters = array('formConfirm' => $formconfirm, 'lineid' => $lineid); $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook if (empty($reshook)) { $formconfirm .= $hookmanager->resPrint;