+ start_outer_table(TABLESTYLE2);
+
+ table_section(1);
+
+ table_section_title(_("Item"));
+
+ //------------------------------------------------------------------------------------
+ if ($new_item)
+ {
+ text_row(_("Item Code:"), 'NewStockID', null, 21, 20);
+
+ $_POST['inactive'] = 0;
+ }
+ else
+ { // Must be modifying an existing item
+ if (get_post('NewStockID') != get_post('stock_id') || get_post('addupdate')) { // first item display
+
+ $_POST['NewStockID'] = $_POST['stock_id'];
+
+ $myrow = get_item($_POST['NewStockID']);
+
+ $_POST['long_description'] = $myrow["long_description"];
+ $_POST['description'] = $myrow["description"];
+ $_POST['category_id'] = $myrow["category_id"];
+ $_POST['tax_type_id'] = $myrow["tax_type_id"];
+ $_POST['units'] = $myrow["units"];
+ $_POST['mb_flag'] = $myrow["mb_flag"];
+
+ $_POST['sales_account'] = $myrow['sales_account'];
+ $_POST['inventory_account'] = $myrow['inventory_account'];
+ $_POST['cogs_account'] = $myrow['cogs_account'];
+ $_POST['adjustment_account'] = $myrow['adjustment_account'];
+ $_POST['assembly_account'] = $myrow['assembly_account'];
+ $_POST['dimension_id'] = $myrow['dimension_id'];
+ $_POST['dimension2_id'] = $myrow['dimension2_id'];
+ $_POST['no_sale'] = $myrow['no_sale'];
+ $_POST['del_image'] = 0;
+ $_POST['inactive'] = $myrow["inactive"];
+ $_POST['editable'] = $myrow["editable"];
+ }
+ label_row(_("Item Code:"),$_POST['NewStockID']);
+ hidden('NewStockID', $_POST['NewStockID']);
+ set_focus('description');