From 55404231337cc4efb686793f999262d7ec2148c4 Mon Sep 17 00:00:00 2001 From: sonikf <93765174+sonikf@users.noreply.github.com> Date: Fri, 12 Apr 2024 13:09:16 +0300 Subject: [PATCH] Update card.php Assign a subprice value of 0 to user selected lines without a vendor product price when creating a supplier order from a client order --- htdocs/fourn/commande/card.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 17c3d09835b9c..849a7c9fefa9c 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -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; @@ -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);