X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=purchasing%2Fincludes%2Fpurchasing_db.inc;h=28f9c720fa4fbbfd79f225df0582813085ec28be;hb=6c40a3be4a79826087d7abbdd11b483f19decc2a;hp=69df53b4a6e4052d4dadbcebcf559d7e76994bdf;hpb=9116377b75b35aed960ce77a4dc033a0c72bec97;p=fa-stable.git diff --git a/purchasing/includes/purchasing_db.inc b/purchasing/includes/purchasing_db.inc index 69df53b4..28f9c720 100644 --- a/purchasing/includes/purchasing_db.inc +++ b/purchasing/includes/purchasing_db.inc @@ -102,16 +102,16 @@ 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).")"; // the description should only be updated here. + .db_escape($uom).", 1, ".db_escape($description).")"; db_query($sql,"The supplier purchasing details could not be added"); return; } - $price = round($price * $data['conversion_factor'], user_price_dec()); + //$price = round($price * $data['conversion_factor'], user_price_dec()); $sql = "UPDATE ".TB_PREF."purch_data SET price=".db_escape($price); if ($uom != "") $sql .= ",suppliers_uom=".db_escape($uom); - //if ($description != "") should only be updateded if $data === false (see above) - // $sql .= ",supplier_description=".db_escape($description); + if ($description != "") + $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;