FIX missing fk_parent_line parameter (#30806)

This commit is contained in:
Regis Houssin 2024-08-31 19:28:47 +02:00 committed by GitHub
parent 4a2e001f1c
commit 1e2f23f8b2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;