'no_zero_lines_amount', 'show_po_item_codes', 'accounts_alpha', 'loc_notification', 'print_invoice_no',
'allow_negative_prices', 'print_item_images_on_quote',
'allow_negative_stock'=> 0, 'accumulate_shipping'=> 0,
- 'po_over_receive' => 0.0, 'po_over_charge' => 0.0, 'default_credit_limit'=>0.0
+ 'po_over_receive' => 0.0, 'po_over_charge' => 0.0, 'default_credit_limit'=>0.0,
+ 'wip_act'
)));
display_notification(_("The general GL setup has been updated."));
$_POST['print_item_images_on_quote'] = $myrow['print_item_images_on_quote'];
$_POST['default_loss_on_asset_disposal_act'] = $myrow['default_loss_on_asset_disposal_act'];
$_POST['depreciation_period'] = $myrow['depreciation_period'];
+$_POST['wip_act'] = $myrow['wip_act'];
//---------------
text_row(_("Work Order Required By After:"), 'default_workorder_required', $_POST['default_workorder_required'], 6, 6, '', "", _("days"));
+gl_all_accounts_list_row(_("Work In Progress Account:"), 'wip_act', $_POST['wip_act']);
+
//----------------
end_outer_table(1);
{
display_error($msg, true);
end_page();
- exit;
- }
+ exit;
+ }
}
function db_has_sales_areas()
}
return true;
}
+
+function check_sys_pref($name, $msg, $empty = '')
+{
+ global $path_to_root;
+
+ if (get_company_pref($name) === $empty)
+ {
+ display_error(menu_link("/admin/gl_setup.php", $msg), true);
+ display_footer_exit();
+ }
+}
+
+function check_wip_account()
+{
+ check_sys_pref('wip_act', _("You have to set Work In Progress Account in GL Setup before you can use this function."));
+}
_("Required By") => array('type'=>'date', 'ord'=>''),
array('insert'=>true, 'fun'=> 'edit_link'),
array('insert'=>true, 'fun'=> 'release_link'),
- array('insert'=>true, 'fun'=> 'produce_link'),
array('insert'=>true, 'fun'=> 'costs_link'),
+ array('insert'=>true, 'fun'=> 'produce_link'),
array('insert'=>true, 'fun'=> 'view_gl_link')
);
$js .= get_js_date_picker();
page(_($help_context = "Produce or Unassemble Finished Items From Work Order"), false, false, "", $js);
+check_wip_account();
+
if (isset($_GET['trans_no']) && $_GET['trans_no'] != "")
{
$_POST['selected_id'] = $_GET['trans_no'];
page(_($help_context = "Issue Items to Work Order"), false, false, "", $js);
+check_wip_account();
//-----------------------------------------------------------------------------------------------
if (isset($_GET['AddedID']))
INSERT INTO `0_sys_prefs` VALUES ('depreciation_period', 'glsetup.company', 'tinyint', '1', '1');
INSERT INTO `0_sys_prefs` VALUES ('use_manufacturing','setup.company', 'tinyint', 1, '1');
INSERT INTO `0_sys_prefs` VALUES ('use_fixed_assets','setup.company', 'tinyint', 1, '1');
+INSERT INTO `0_sys_prefs` VALUES ('wip_act', 'glsetup.manuf', 'varchar', '15', '1530');
-- --------------------------------------------------------
INSERT INTO `0_sys_prefs` VALUES ('depreciation_period', 'glsetup.company', 'tinyint', '1', '1');
INSERT INTO `0_sys_prefs` VALUES ('use_manufacturing','setup.company', 'tinyint', 1, '1');
INSERT INTO `0_sys_prefs` VALUES ('use_fixed_assets','setup.company', 'tinyint', 1, '1');
+INSERT INTO `0_sys_prefs` VALUES ('wip_act', 'glsetup.manuf', 'varchar', '15', '1530');
-- --------------------------------------------------------