X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=inventory%2Fmanage%2Fsales_kits.php;h=ab4831f0914dba831479355b4c4a5375cefc638c;hb=f2343f51b0ed0d9abd2ec98b64f202beb9716d37;hp=09cb731a5a7e0fd667c60f3f53ddba81112d8c02;hpb=902f1015d874c33bd7946b17de2ad80b4f2144b6;p=fa-stable.git diff --git a/inventory/manage/sales_kits.php b/inventory/manage/sales_kits.php index 09cb731a..ab4831f0 100644 --- a/inventory/manage/sales_kits.php +++ b/inventory/manage/sales_kits.php @@ -13,14 +13,12 @@ $page_security = 'SA_SALESKIT'; $path_to_root = "../.."; include_once($path_to_root . "/includes/session.inc"); -page(_("Sales Kits & Alias Codes")); +page(_($help_context = "Sales Kits & Alias Codes")); include_once($path_to_root . "/includes/date_functions.inc"); include_once($path_to_root . "/includes/ui.inc"); include_once($path_to_root . "/includes/data_checks.inc"); -include_once($path_to_root . "/includes/manufacturing.inc"); - check_db_has_stock_items(_("There are no items defined in the system.")); simple_page_mode(true); @@ -34,11 +32,9 @@ if (isset($_GET['item_code'])) //-------------------------------------------------------------------------------------------------- function display_kit_items($selected_kit) { - global $table_style; - $result = get_item_kit($selected_kit); -div_start('bom'); - start_table("$table_style width=60%"); + div_start('bom'); + start_table(TABLESTYLE, "width='60%'"); $th = array(_("Stock Item"), _("Description"), _("Quantity"), _("Units"), '',''); table_header($th); @@ -75,7 +71,7 @@ function update_component($kit_code, $selected_item) set_focus('quantity'); return; } - elseif ($_POST['description'] == '') + elseif (get_post('description') == '') { display_error( _("Item code description cannot be empty.")); set_focus('description'); @@ -84,14 +80,14 @@ function update_component($kit_code, $selected_item) elseif ($selected_item == -1) // adding new item or new alias/kit { if (get_post('item_code') == '') { // New kit/alias definition - $kit = get_item_kit($_POST['kit_code']); + $kit = get_item_kit($kit_code); if (db_num_rows($kit)) { $input_error = 1; display_error( _("This item code is already assigned to stock item or sale kit.")); set_focus('kit_code'); return; } - if (get_post('kit_code') == '') { + if ($kit_code == '') { display_error( _("Kit/alias code cannot be empty.")); set_focus('kit_code'); return; @@ -99,21 +95,20 @@ function update_component($kit_code, $selected_item) } } - if (check_item_in_kit($selected_item, $kit_code, $_POST['component'], true)) { + if (check_item_in_kit($selected_item, $kit_code, get_post('component'), true)) { display_error(_("The selected component contains directly or on any lower level the kit under edition. Recursive kits are not allowed.")); set_focus('component'); return; } /*Now check to see that the component is not already in the kit */ - if (check_item_in_kit($selected_item, $kit_code, $_POST['component'])) { + if (check_item_in_kit($selected_item, $kit_code, get_post('component'))) { display_error(_("The selected component is already in this kit. You can modify it's quantity but it cannot appear more than once in the same kit.")); set_focus('component'); return; } if ($selected_item == -1) { // new item alias/kit - if ($_POST['item_code']=='') { - $kit_code = $_POST['kit_code']; + if (get_post('item_code') == '') { $selected_kit = $_POST['item_code'] = $kit_code; $msg = _("New alias code has been created."); } @@ -125,7 +120,7 @@ function update_component($kit_code, $selected_item) display_notification($msg); } else { - $props = get_kit_props($_POST['item_code']); + $props = get_kit_props(get_post('item_code')); update_item_code($selected_item, $kit_code, get_post('component'), $props['description'], $props['category_id'], input_num('quantity'), 0); display_notification(_("Component of selected kit has been updated.")); @@ -183,7 +178,7 @@ if ($Mode == 'RESET') start_form(); echo "