X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=inventory%2Fmanage%2Fitem_codes.php;h=d423b9211ae7d5b3d689915ce3772537ad25eac0;hb=8638cffdf5eb106d2c9a6f8ee68b9f91427ace2f;hp=3c2bee1a51addfc5442bef3e1b14a14860048591;hpb=6575a94814ea66506cc2637908c3419995302a3e;p=fa-stable.git
diff --git a/inventory/manage/item_codes.php b/inventory/manage/item_codes.php
index 3c2bee1a..d423b921 100644
--- a/inventory/manage/item_codes.php
+++ b/inventory/manage/item_codes.php
@@ -1,9 +1,19 @@
.
+***********************************************************************/
+$page_security = 'SA_FORITEMCODE';
+$path_to_root = "../..";
include_once($path_to_root . "/includes/session.inc");
-page(_("Foreign Item Codes"));
+page(_($help_context = "Foreign Item Codes"));
include_once($path_to_root . "/includes/date_functions.inc");
include_once($path_to_root . "/includes/ui.inc");
@@ -25,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'] == '')
@@ -87,13 +97,13 @@ if (list_updated('stock_id'))
//--------------------------------------------------------------------------------------------------
-start_form(false, true);
+start_form();
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);
+echo stock_purchasable_items_list('stock_id', $_POST['stock_id'], false, true);
echo "
";
@@ -107,7 +117,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"), "", "");
@@ -142,23 +152,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);
@@ -169,7 +180,7 @@ stock_categories_list_row(_("Category:"), 'category_id', null);
end_table(1);
-submit_add_or_update_center($selected_id == -1, '', true);
+submit_add_or_update_center($selected_id == -1, '', 'both');
end_form();
end_page();