Skip to content

Commit

Permalink
FIX missing fk_parent_line parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
hregis committed Aug 30, 2024
1 parent 4a2e001 commit e1fdc28
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions htdocs/compta/facture/card-rec.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -876,7 +879,8 @@
$date_start_fill,
$date_end_fill,
$fournprice,
$buyingprice
$buyingprice,
$fk_parent_line
);

if ($result >= 0) {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit e1fdc28

Please sign in to comment.