From: Joe Date: Wed, 19 Apr 2023 05:24:56 +0000 (+0200) Subject: Supplier description is overwritten when receiving items. Fixed. X-Git-Url: https://delta.frontaccounting.com/gitweb/?p=fa-stable.git;a=commitdiff_plain;h=9116377b75b35aed960ce77a4dc033a0c72bec97 Supplier description is overwritten when receiving items. Fixed. --- 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;