diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index f396b437f11d6..273d6e636f404 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -658,12 +658,14 @@ $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 @@ $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 @@ $date_start_fill, $date_end_fill, $fournprice, - $buyingprice + $buyingprice, + $fk_parent_line ); if ($result >= 0) { @@ -1224,7 +1228,7 @@ } // 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;