X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=inventory%2Fcost_update.php;h=be6a19e64e898b0c4576d2a849bfce5fd31971c6;hb=b6ae2ddcd0cbc571edd01157ca1c8d44bbe071ef;hp=16544599b89fac222e8c7ba76192cd4022581ceb;hpb=6183e9450dcd7e4c747889c10903f6ff1b0add33;p=fa-stable.git diff --git a/inventory/cost_update.php b/inventory/cost_update.php index 16544599..be6a19e6 100644 --- a/inventory/cost_update.php +++ b/inventory/cost_update.php @@ -1,20 +1,31 @@ . +***********************************************************************/ +$page_security = 'SA_STANDARDCOST'; +if (!@$_GET['popup']) + $path_to_root = ".."; +else + $path_to_root = "../.."; -$page_security = 2; -$path_to_root=".."; include_once($path_to_root . "/includes/session.inc"); - include_once($path_to_root . "/includes/date_functions.inc"); include_once($path_to_root . "/includes/ui.inc"); include_once($path_to_root . "/includes/banking.inc"); -include_once($path_to_root . "/includes/manufacturing.inc"); include_once($path_to_root . "/includes/data_checks.inc"); - include_once($path_to_root . "/inventory/includes/inventory_db.inc"); + $js = ""; -if ($use_popup_windows) +if ($SysPrefs->use_popup_windows) $js .= get_js_open_window(900, 500); -page(_("Inventory Item Cost Update"), false, false, "", $js); +page(_($help_context = "Inventory Item Cost Update"), false, false, "", $js); //-------------------------------------------------------------------------------------- @@ -26,12 +37,11 @@ if (isset($_GET['stock_id'])) } //-------------------------------------------------------------------------------------- - if (isset($_POST['UpdateData'])) { - $old_cost = input_num('OldMaterialCost') + input_num('OldLabourCost') - + input_num('OldOverheadCost'); + $old_cost = get_standard_cost($_POST['stock_id']); + $new_cost = input_num('material_cost') + input_num('labour_cost') + input_num('overhead_cost'); @@ -52,59 +62,65 @@ if (isset($_POST['UpdateData'])) if ($should_update) { - $update_no = stock_cost_update($_POST['stock_id'], - input_num('material_cost'), input_num('labour_cost'), + $update_no = stock_cost_update($_POST['stock_id'], + input_num('material_cost'), input_num('labour_cost'), input_num('overhead_cost'), $old_cost); - display_note(_("Cost has been updated.")); + display_notification(_("Cost has been updated.")); if ($update_no > 0) { - display_note(get_gl_view_str(systypes::cost_update(), $update_no, _("View the GL Journal Entries for this Cost Update")), 1, 0); + display_notification(get_gl_view_str(ST_COSTUPDATE, $update_no, _("View the GL Journal Entries for this Cost Update"))); } + } } +if (list_updated('stock_id')) + $Ajax->activate('cost_table'); //----------------------------------------------------------------------------------------- -start_form(false, true); +$action = $_SERVER['PHP_SELF']; +if ($page_nested) + $action .= "?stock_id=".get_post('stock_id'); +start_form(false, false, $action); if (!isset($_POST['stock_id'])) $_POST['stock_id'] = get_global_stock_item(); -echo "