+ table_section_title(_("Other"));
+
+ // Add image upload for New Item - by Joe
+ file_row(_("Image File (.jpg)") . ":", 'pic', 'pic');
+ // Add Image upload for New Item - by Joe
+ $stock_img_link = "";
+ $check_remove_image = false;
+ if (isset($_POST['NewStockID']) && file_exists(company_path().'/images/'
+ .item_img_name($_POST['NewStockID']).".jpg"))
+ {
+ // 31/08/08 - rand() call is necessary here to avoid caching problems.
+ $stock_img_link .= "<img id='item_img' alt = '[".$_POST['NewStockID'].".jpg".
+ "]' src='".company_path().'/images/'.item_img_name($_POST['NewStockID']).
+ ".jpg?nocache=".rand()."'"." height='".$SysPrefs->pic_height."' border='0'>";
+ $check_remove_image = true;
+ }
+ else
+ {
+ $stock_img_link .= _("No image");
+ }
+
+ label_row(" ", $stock_img_link);
+ if ($check_remove_image)
+ check_row(_("Delete Image:"), 'del_image');
+
+ record_status_list_row(_("Item status:"), 'inactive');
+ if (get_post('fixed_asset')) {
+ table_section_title(_("Values"));
+ if (!$new_item) {
+ hidden('material_cost');
+ hidden('purchase_cost');
+ label_row(_("Initial Value").":", price_format($_POST['purchase_cost']), "", "align='right'");
+ label_row(_("Depreciations").":", price_format($_POST['purchase_cost'] - $_POST['material_cost']), "", "align='right'");
+ label_row(_("Current Value").':', price_format($_POST['material_cost']), "", "align='right'");
+ }
+ }
+ end_outer_table(1);
+
+ div_start('controls');
+ if (@$_REQUEST['popup']) hidden('popup', 1);
+ if (!isset($_POST['NewStockID']) || $new_item)
+ {
+ submit_center('addupdate', _("Insert New Item"), true, '', 'default');
+ }
+ else
+ {
+ submit_center_first('addupdate', _("Update Item"), '',
+ $page_nested ? true : 'default');
+ submit_return('select', get_post('stock_id'),
+ _("Select this items and return to document entry."));
+ submit('clone', _("Clone This Item"), true, '', true);
+ submit('delete', _("Delete This Item"), true, '', true);
+ submit_center_last('cancel', _("Cancel"), _("Cancel Edition"), 'cancel');
+ }