Skip to content

Commit

Permalink
FIX: reload $object after updating lines
Browse files Browse the repository at this point in the history
  • Loading branch information
altairis-noe committed Nov 22, 2024
1 parent 1f386fb commit b5b8298
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions htdocs/comm/propal/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -976,6 +976,7 @@
$result = $object->updateline($line->id, $line->subprice, $line->qty, $line->remise_percent, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, $line->desc, 'HT', $line->info_bits, $line->special_code, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->product_type, $alldate_start, $alldate_end, $line->array_options, $line->fk_unit, $line->multicurrency_subprice);
}
}
$object->fetch($id);
} elseif ($action == 'addline' && GETPOST('submitforalllines', 'alpha') && GETPOST('vatforalllines', 'alpha') !== '' && $usercancreate) {
// Define a vat_rate for all lines
$vat_rate = (GETPOST('vatforalllines') ? GETPOST('vatforalllines') : 0);
Expand All @@ -985,6 +986,7 @@
foreach ($object->lines as $line) {
$result = $object->updateline($line->id, $line->subprice, $line->qty, $line->remise_percent, $vat_rate, $localtax1_rate, $localtax2_rate, $line->desc, 'HT', $line->info_bits, $line->special_code, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->product_type, $line->date_start, $line->date_end, $line->array_options, $line->fk_unit, $line->multicurrency_subprice);
}
$object->fetch($id);
} elseif ($action == 'addline' && GETPOST('submitforalllines', 'alpha') && GETPOST('remiseforalllines', 'alpha') !== '' && $usercancreate) {
// Define a discount for all lines
$remise_percent = (GETPOST('remiseforalllines') ? GETPOST('remiseforalllines') : 0);
Expand Down Expand Up @@ -1027,6 +1029,7 @@
$line->subprice = (float) $subprice;
$line->multicurrency_subprice = $multicurrency_subprice;
}
$object->fetch($id);
} elseif ($action == 'addline' && !GETPOST('submitforalllines', 'alpha') && !GETPOST('submitforallmargins', 'alpha') && $usercancreate) { // Add line
// Set if we used free entry or predefined product
$predef = '';
Expand Down

0 comments on commit b5b8298

Please sign in to comment.