X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=inventory%2Fincludes%2Fdb%2Fitems_db.inc;h=e336155254177289c0af78e8a2ac0448287beda6;hb=34c15f2f88c2b4d8a18ca40f76df3b9748e463e1;hp=f9f60a47b37e9d7617203712767edc908d7230c1;hpb=c55119ade6f4c6bd4acdfa55c46870187f408978;p=fa-stable.git diff --git a/inventory/includes/db/items_db.inc b/inventory/includes/db/items_db.inc index f9f60a47..e3361552 100644 --- a/inventory/includes/db/items_db.inc +++ b/inventory/includes/db/items_db.inc @@ -1,5 +1,14 @@ . +***********************************************************************/ function update_item($stock_id, $description, $long_description, $category_id, $tax_type_id, $sales_account, $inventory_account, $cogs_account, $adjustment_account, $assembly_account, $dimension_id, $dimension2_id) @@ -18,6 +27,8 @@ function update_item($stock_id, $description, $long_description, $category_id, $ WHERE stock_id='$stock_id'"; db_query($sql, "The item could not be updated"); + + update_item_code(-1, $stock_id, $stock_id, $description, $category_id, 1, 0); } function add_item($stock_id, $description, $long_description, $category_id, $tax_type_id, $units, $mb_flag, @@ -38,6 +49,8 @@ function add_item($stock_id, $description, $long_description, $category_id, $tax SELECT ".TB_PREF."locations.loc_code, '$stock_id' FROM ".TB_PREF."locations"; db_query($sql, "The item locstock could not be added"); + + add_item_code($stock_id, $stock_id, $description, $category_id, 1, 0); } function delete_item($stock_id) @@ -60,6 +73,8 @@ function delete_item($stock_id) /*and cascade delete the bill of material if any */ $sql = "DELETE FROM ".TB_PREF."bom WHERE parent='$stock_id'"; db_query($sql, "could not delete stock item bom"); + + delete_item_kit($stock_id); } function get_item($stock_id)