From 9116377b75b35aed960ce77a4dc033a0c72bec97 Mon Sep 17 00:00:00 2001 From: Joe Date: Wed, 19 Apr 2023 07:24:56 +0200 Subject: [PATCH] Supplier description is overwritten when receiving items. Fixed. --- purchasing/includes/purchasing_db.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/purchasing/includes/purchasing_db.inc b/purchasing/includes/purchasing_db.inc index 121c90df..69df53b4 100644 --- a/purchasing/includes/purchasing_db.inc +++ b/purchasing/includes/purchasing_db.inc @@ -102,7 +102,7 @@ function add_or_update_purchase_data($supplier_id, $stock_id, $price, $descripti $sql = "INSERT INTO ".TB_PREF."purch_data (supplier_id, stock_id, price, suppliers_uom, conversion_factor, supplier_description) VALUES (".db_escape($supplier_id) .", ".db_escape($stock_id).", ".db_escape($price).", " - .db_escape($uom).", 1, ".db_escape($description).")"; + .db_escape($uom).", 1, ".db_escape($description).")"; // the description should only be updated here. db_query($sql,"The supplier purchasing details could not be added"); return; } @@ -110,8 +110,8 @@ function add_or_update_purchase_data($supplier_id, $stock_id, $price, $descripti $sql = "UPDATE ".TB_PREF."purch_data SET price=".db_escape($price); if ($uom != "") $sql .= ",suppliers_uom=".db_escape($uom); - if ($description != "") - $sql .= ",supplier_description=".db_escape($description); + //if ($description != "") should only be updateded if $data === false (see above) + // $sql .= ",supplier_description=".db_escape($description); $sql .= " WHERE stock_id=".db_escape($stock_id)." AND supplier_id=".db_escape($supplier_id); db_query($sql,"The supplier purchasing details could not be updated"); return true; -- 2.30.2