X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=inventory%2Fmanage%2Fitem_codes.php;h=3a8c199f7c95b6c6806890b888f4da114380d287;hb=17b390efcf904072b02ec866b2a427490471a260;hp=af88a52044a021b059f8e00fbdb02a14636d94e6;hpb=d2cc0860eccf02eaefcd90731ac3af141a841529;p=fa-stable.git diff --git a/inventory/manage/item_codes.php b/inventory/manage/item_codes.php index af88a520..3a8c199f 100644 --- a/inventory/manage/item_codes.php +++ b/inventory/manage/item_codes.php @@ -35,10 +35,10 @@ if ($Mode=='ADD_ITEM' || $Mode=='UPDATE_ITEM') display_error( _("There is no item selected.")); set_focus('stock_id'); } - elseif (!check_num('quantity', 0)) + elseif (!input_num('quantity')) { $input_error = 1; - display_error( _("The price entered was not numeric.")); + display_error( _("The price entered was not positive number.")); set_focus('quantity'); } elseif ($_POST['description'] == '') @@ -103,7 +103,9 @@ if (!isset($_POST['stock_id'])) $_POST['stock_id'] = get_global_stock_item(); echo "
" . _("Item:"). " "; -stock_purchasable_items_list('stock_id', $_POST['stock_id'], false, true); +//Chaitanya : Manufcatured item visible +echo stock_items_list('stock_id', $_POST['stock_id'], false, true); +//echo stock_purchasable_items_list('stock_id', $_POST['stock_id'], false, true); echo "
"; @@ -117,7 +119,7 @@ $dflt_cat = $result['category_id']; $result = get_all_item_codes($_POST['stock_id']); div_start('code_table'); - start_table("$table_style width=60%"); + start_table(TABLESTYLE, "width='60%'"); $th = array(_("EAN/UPC Code"), _("Quantity"), _("Units"), _("Description"),_("Category"), "", ""); @@ -152,23 +154,24 @@ div_end(); //----------------------------------------------------------------------------------------------- -if ($Mode =='Edit') -{ - $myrow = get_item_code($selected_id); - $_POST['item_code'] = $myrow["item_code"]; - $_POST['quantity'] = $myrow["quantity"]; - $_POST['description'] = $myrow["description"]; - $_POST['category_id'] = $myrow["category_id"]; -} - else { - $_POST['quantity'] = 1; - $_POST['description'] = $dflt_desc; - $_POST['category_id'] = $dflt_cat; +if ($selected_id != '') { + if ($Mode =='Edit') + { + $myrow = get_item_code($selected_id); + $_POST['item_code'] = $myrow["item_code"]; + $_POST['quantity'] = $myrow["quantity"]; + $_POST['description'] = $myrow["description"]; + $_POST['category_id'] = $myrow["category_id"]; + } + hidden('selected_id', $selected_id); +} else { + $_POST['quantity'] = 1; + $_POST['description'] = $dflt_desc; + $_POST['category_id'] = $dflt_cat; } echo "
"; -hidden('selected_id', $selected_id); -start_table($table_style2); +start_table(TABLESTYLE2); hidden('code_id', $selected_id); @@ -184,4 +187,3 @@ submit_add_or_update_center($selected_id == -1, '', 'both'); end_form(); end_page(); -?>