X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=inventory%2Fincludes%2Fdb%2Fitems_prices_db.inc;fp=inventory%2Fincludes%2Fdb%2Fitems_prices_db.inc;h=5fee90e7c7f47d872e8d86aafdc7452543f0fcc0;hb=89e8ca2be9235215ac2e2bf5e58d7eedd2dda84d;hp=5a474e7c1bbcec34d67e4a117eaf8a64ddbd0afe;hpb=5a7ef37131354aabdcf04c639a903e5876b743e4;p=fa-stable.git diff --git a/inventory/includes/db/items_prices_db.inc b/inventory/includes/db/items_prices_db.inc index 5a474e7c..5fee90e7 100644 --- a/inventory/includes/db/items_prices_db.inc +++ b/inventory/includes/db/items_prices_db.inc @@ -11,26 +11,32 @@ ***********************************************************************/ function add_item_price($stock_id, $sales_type_id, $curr_abrev, $price) { + begin_transaction(__FUNCTION__, func_get_args()); $sql = "INSERT INTO ".TB_PREF."prices (stock_id, sales_type_id, curr_abrev, price) VALUES (".db_escape($stock_id).", ".db_escape($sales_type_id) .", ".db_escape($curr_abrev).", ".db_escape($price).")"; db_query($sql,"an item price could not be added"); + commit_transaction(); } function update_item_price($price_id, $sales_type_id, $curr_abrev, $price) { + begin_transaction(__FUNCTION__, func_get_args()); $sql = "UPDATE ".TB_PREF."prices SET sales_type_id=".db_escape($sales_type_id).", curr_abrev=".db_escape($curr_abrev).", price=".db_escape($price)." WHERE id=".db_escape($price_id); db_query($sql,"an item price could not be updated"); + commit_transaction(); } function delete_item_price($price_id) { + begin_transaction(__FUNCTION__, func_get_args()); $sql="DELETE FROM ".TB_PREF."prices WHERE id= ".db_escape($price_id); db_query($sql,"an item price could not be deleted"); + commit_transaction(); } function get_prices($stock_id)