X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=inventory%2Fmanage%2Fitems.php;fp=inventory%2Fmanage%2Fitems.php;h=f0644a98a53a4ac8711ae43e809086000018768c;hb=89e8ca2be9235215ac2e2bf5e58d7eedd2dda84d;hp=fb3905a5ce3fa6047a53b1a2681cc94d494c6caa;hpb=5a7ef37131354aabdcf04c639a903e5876b743e4;p=fa-stable.git diff --git a/inventory/manage/items.php b/inventory/manage/items.php index fb3905a5..f0644a98 100644 --- a/inventory/manage/items.php +++ b/inventory/manage/items.php @@ -232,10 +232,9 @@ if (isset($_POST['addupdate'])) if (file_exists($filename)) unlink($filename); } - - if (!$new_item) - { /*so its an existing one */ - update_item($_POST['NewStockID'], $_POST['description'], + + write_item(get_post('stock_id'), + $_POST['NewStockID'], $_POST['description'], $_POST['long_description'], $_POST['category_id'], $_POST['tax_type_id'], get_post('units'), get_post('mb_flag'), $_POST['sales_account'], @@ -244,29 +243,16 @@ if (isset($_POST['addupdate'])) $_POST['dimension_id'], $_POST['dimension2_id'], check_value('no_sale'), check_value('editable'), check_value('no_purchase'), get_post('depreciation_method'), input_num('depreciation_rate'), input_num('depreciation_factor'), get_post('depreciation_start', null), - get_post('fa_class_id'), get_post('vat_category'), get_post('shipper')); + get_post('fa_class_id'), get_post('vat_category'), get_post('shipper', 0), check_value('inactive')); - update_record_status($_POST['NewStockID'], $_POST['inactive'], - 'stock_master', 'stock_id'); - update_record_status($_POST['NewStockID'], $_POST['inactive'], - 'item_codes', 'item_code'); + if (!$new_item) + { /*so its an existing one */ set_focus('stock_id'); $Ajax->activate('stock_id'); // in case of status change display_notification(_("Item has been updated.")); } else { //it is a NEW part - - add_item($_POST['NewStockID'], $_POST['description'], - $_POST['long_description'], $_POST['category_id'], $_POST['tax_type_id'], - $_POST['units'], get_post('mb_flag'), $_POST['sales_account'], - $_POST['inventory_account'], $_POST['cogs_account'], - $_POST['adjustment_account'], $_POST['wip_account'], - $_POST['dimension_id'], $_POST['dimension2_id'], - check_value('no_sale'), check_value('editable'), check_value('no_purchase'), - get_post('depreciation_method'), input_num('depreciation_rate'), input_num('depreciation_factor'), get_post('depreciation_start', null), - get_post('fa_class_id'), get_post('vat_category'), get_post('shipper')); - display_notification(_("A new item has been added.")); $_POST['stock_id'] = $_POST['NewStockID'] = $_POST['description'] = $_POST['long_description'] = '';