X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fdata_checks.inc;h=4b9689045e410c42e3140451a32bdc41cee30dd9;hb=05f197c5d4ca05cd0b476ec367229cfa3107a312;hp=765a59dfd8df9d939fb14c44d342272860c86ba9;hpb=ab8f88b77c9a7e687e10b08d2fe04409a701d1ac;p=fa-stable.git diff --git a/includes/data_checks.inc b/includes/data_checks.inc index 765a59df..4b968904 100644 --- a/includes/data_checks.inc +++ b/includes/data_checks.inc @@ -348,15 +348,16 @@ function db_has_fixed_asset_classes() function db_has_depreciable_fixed_assets() { $year = get_current_fiscalyear(); - $y = date('Y', strtotime($year['end'])); + $begin = date2sql(add_months(sql2date($year['begin']), -1)); + $end = date2sql(add_months(sql2date($year['end']), -1)); return check_empty_result("SELECT COUNT(*) FROM ".TB_PREF."stock_master WHERE mb_flag='F' AND material_cost > 0 AND stock_id IN ( SELECT stock_id FROM ".TB_PREF."stock_moves WHERE type=".ST_SUPPRECEIVE." AND qty!=0 ) AND stock_id NOT IN ( SELECT stock_id FROM ".TB_PREF."stock_moves WHERE (type=".ST_CUSTDELIVERY." OR type=".ST_INVADJUST.") AND qty!=0 ) - AND depreciation_date < '".$y."-12-01' - AND depreciation_date >= '".($y-1)."-12-01'"); + AND depreciation_date <= '".$end."' + AND depreciation_date >='".$begin."'"); } function check_db_has_depreciable_fixed_assets($msg) @@ -685,8 +686,3 @@ function check_sys_pref($name, $msg, $empty = '') 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.")); -}