X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fdata_checks.inc;fp=includes%2Fdata_checks.inc;h=765a59dfd8df9d939fb14c44d342272860c86ba9;hb=ab8f88b77c9a7e687e10b08d2fe04409a701d1ac;hp=7cc5586d4652e6c370109a3c668aebad75a47fee;hpb=4cdd49c280b3988a05f5c4639979106aff778237;p=fa-stable.git diff --git a/includes/data_checks.inc b/includes/data_checks.inc index 7cc5586d..765a59df 100644 --- a/includes/data_checks.inc +++ b/includes/data_checks.inc @@ -153,8 +153,8 @@ function check_db_has_sales_people($msg) { display_error($msg, true); end_page(); - exit; - } + exit; + } } function db_has_sales_areas() @@ -674,3 +674,19 @@ function check_reference($reference, $trans_type, $trans_no=0, $context=null, $l } 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.")); +}