X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=inventory%2Fcost_update.php;h=be6a19e64e898b0c4576d2a849bfce5fd31971c6;hb=b6ae2ddcd0cbc571edd01157ca1c8d44bbe071ef;hp=48e75ebaa986635ea885ce5815c5f8c06aa5a144;hpb=f12dbe7523bb1abc6cd69b009ef8f0be838f5348;p=fa-stable.git diff --git a/inventory/cost_update.php b/inventory/cost_update.php index 48e75eba..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); //-------------------------------------------------------------------------------------- @@ -29,8 +40,8 @@ if (isset($_GET['stock_id'])) if (isset($_POST['UpdateData'])) { - $old_cost = $_POST['OldMaterialCost'] + $_POST['OldLabourCost'] - + $_POST['OldOverheadCost']; + $old_cost = get_standard_cost($_POST['stock_id']); + $new_cost = input_num('material_cost') + input_num('labour_cost') + input_num('overhead_cost'); @@ -59,8 +70,9 @@ if (isset($_POST['UpdateData'])) if ($update_no > 0) { - display_note(get_gl_view_str(systypes::cost_update(), $update_no, _("View the GL Journal Entries for this Cost Update")), 0, 1); + display_notification(get_gl_view_str(ST_COSTUPDATE, $update_no, _("View the GL Journal Entries for this Cost Update"))); } + } } @@ -68,46 +80,47 @@ 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 "