Skip to content

Commit

Permalink
Update card.php
Browse files Browse the repository at this point in the history
Assign a subprice value of 0 to user selected lines without a vendor product price when creating a supplier order from a client order
  • Loading branch information
sonikf authored Apr 12, 2024
1 parent 4353296 commit 5540423
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions htdocs/fourn/commande/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -1335,6 +1335,7 @@
if ($origin == "commande") {
$productsupplier = new ProductFournisseur($db);
$result = $productsupplier->find_min_price_product_fournisseur($lines[$i]->fk_product, $lines[$i]->qty, $object->socid);
$lines[$i]->subprice = 0;
if ($result > 0) {
$ref_supplier = $productsupplier->ref_supplier;
$product_fourn_price_id = $productsupplier->product_fourn_price_id;
Expand All @@ -1351,8 +1352,6 @@
if ($resql) {
$num_row = $db->num_rows($resql);
if (empty($num_row)) {
// No matching supplier price is found in the table, we set to 1 so user is forced to change
$li->subprice = 1;
$li->remise_percent = 0;
} else {
$obj = $db->fetch_object($resql);
Expand Down

0 comments on commit 5540423

Please sign in to comment.