Mysqli errors: Trying to access array offset on value of type bool. Fixed. Please...
[fa-stable.git] / inventory / manage / sales_kits.php
index 2f4066787f548658e938f07cb28bae179122d044..849564dd75c32792a44e53862c10867e29e31d84 100644 (file)
@@ -13,7 +13,11 @@ $page_security = 'SA_SALESKIT';
 $path_to_root = "../..";
 include_once($path_to_root . "/includes/session.inc");
 
-page(_($help_context = "Sales Kits & Alias Codes"));
+$js = "";
+if ($SysPrefs->use_popup_windows && $SysPrefs->use_popup_search)
+       $js .= get_js_open_window(900, 500);
+
+page(_($help_context = "Sales Kits & Alias Codes"), false, false, "", $js);
 
 include_once($path_to_root . "/includes/date_functions.inc");
 include_once($path_to_root . "/includes/ui.inc");
@@ -42,7 +46,7 @@ function display_kit_items($selected_kit)
                label_cell($myrow["stock_id"]);
                label_cell($myrow["comp_name"]);
         qty_cell($myrow["quantity"], false, 
-                       $myrow["units"] == '' ? 0 : get_qty_dec($myrow["comp_name"]));
+                       $myrow["units"] == '' ? 0 : get_qty_dec($myrow["stock_id"]));
         label_cell($myrow["units"] == '' ? _('kit') : $myrow["units"]);
                edit_button_cell("Edit".$myrow['id'], _("Edit"));
                delete_button_cell("Delete".$myrow['id'], _("Delete"));
@@ -192,7 +196,7 @@ $selected_kit = $_POST['item_code'];
 if (get_post('item_code') == '') {
 // New sales kit entry
        start_table(TABLESTYLE2);
-       text_row(_("Alias/kit code:"), 'kit_code', null, 20, 21);
+       text_row(_("Alias/kit code:"), 'kit_code', null, 20, 20);
 } else
 {
         // Kit selected so display bom or edit component
@@ -220,8 +224,8 @@ if (get_post('item_code') == '') {
 
        if (get_post('item_code') == '') { // new kit/alias
                if ($Mode!='ADD_ITEM' && $Mode!='UPDATE_ITEM') {
-                       $_POST['description'] = $props['description'];
-                       $_POST['category'] = $props['category_id'];
+                       $_POST['description'] = is_array($props) ? $props['description'] : '';
+                       $_POST['category'] = is_array($props) ? $props['category_id'] : '';
                }
                text_row(_("Description:"), 'description', null, 50, 200);
                stock_categories_list_row(_("Category:"), 'category', null);