From: Joe Hunt Date: Thu, 24 Jun 2010 11:18:54 +0000 (+0000) Subject: Rewritten function gl_account_in_company_defaults in gl_db_accounts.inc X-Git-Tag: v2.4.2~19^2~830 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=ee7f610a0669b4dd4a85d19c1969573a82ee1826;p=fa-stable.git Rewritten function gl_account_in_company_defaults in gl_db_accounts.inc More test on tags due to db error in reports with tags. --- diff --git a/CHANGELOG.txt b/CHANGELOG.txt index e053ce9d..b04261af 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -19,6 +19,14 @@ Legend: ! -> Note $ -> Affected files +24-Jun-2010 Joe Hunt +# Rewritten function gl_account_in_company_defaults in gl_db_accounts.inc +$ /gl/includes/db/gl_db_accounts.inc +# More test on tags due to db error in reports with tags. +$ /reporting/rep705.php + /reporting/rep706.php + /reporting/rep707.php + 23-Jun-2010 Chaitanya/Joe Hunt ! Changed memo message in supp invoice price variance $ /purchasing/includes/db/invoice_db.inc diff --git a/gl/includes/db/gl_db_accounts.inc b/gl/includes/db/gl_db_accounts.inc index a4004d81..f085cfe8 100644 --- a/gl/includes/db/gl_db_accounts.inc +++ b/gl/includes/db/gl_db_accounts.inc @@ -88,22 +88,22 @@ function get_gl_account_name($code) function gl_account_in_company_defaults($acc) { - $sql= "SELECT COUNT(*) FROM ".TB_PREF."company WHERE debtors_act=$acc - OR pyt_discount_act=$acc - OR creditors_act=$acc - OR bank_charge_act=$acc - OR exchange_diff_act=$acc - OR profit_loss_year_act=$acc - OR retained_earnings_act=$acc - OR freight_act=$acc - OR default_sales_act=$acc - OR default_sales_discount_act=$acc - OR default_prompt_payment_act=$acc - OR default_inventory_act=$acc - OR default_cogs_act=$acc - OR default_adj_act=$acc - OR default_inv_sales_act=$acc - OR default_assembly_act=$acc"; + $sql= "SELECT COUNT(*) FROM ".TB_PREF."sys_prefs WHERE (name='debtors_act' + OR name='pyt_discount_act' + OR name='creditors_act' + OR name='bank_charge_act' + OR name='exchange_diff_act' + OR name='profit_loss_year_act' + OR name='retained_earnings_act' + OR name='freight_act' + OR name='default_sales_act' + OR name='default_sales_discount_act' + OR name='default_prompt_payment_act' + OR name='default_inventory_act' + OR name='default_cogs_act' + OR name='default_adj_act' + OR name='default_inv_sales_act' + OR name='default_assembly_act') AND value=$acc"; $result = db_query($sql,"Couldn't test for default company GL codes"); $myrow = db_fetch_row($result); diff --git a/reporting/rep705.php b/reporting/rep705.php index e035869f..001f91fe 100644 --- a/reporting/rep705.php +++ b/reporting/rep705.php @@ -84,7 +84,7 @@ function display_type ($type, $typename, $yr, $mo, $convert, &$dec, &$rep, $dime $result = get_gl_accounts(null, null, $type); while ($account=db_fetch($result)) { - if ($tags != -1) + if ($tags != -1 && is_array($tags) && $tags[0] != false) { if (!is_record_in_tags($tags, TAG_ACCOUNT, $account['account_code'])) continue; diff --git a/reporting/rep706.php b/reporting/rep706.php index 2fa624a6..f5f321bf 100644 --- a/reporting/rep706.php +++ b/reporting/rep706.php @@ -40,7 +40,7 @@ function display_type ($type, $typename, $from, $to, $convert, &$dec, &$rep, $di $result = get_gl_accounts(null, null, $type); while ($account=db_fetch($result)) { - if ($tags != -1) + if ($tags != -1 && is_array($tags) && $tags[0] != false) { if (!is_record_in_tags($tags, TAG_ACCOUNT, $account['account_code'])) continue; diff --git a/reporting/rep707.php b/reporting/rep707.php index 1d1f2fe3..85ef695f 100644 --- a/reporting/rep707.php +++ b/reporting/rep707.php @@ -41,7 +41,7 @@ function display_type ($type, $typename, $from, $to, $begin, $end, $compare, $co $result = get_gl_accounts(null, null, $type); while ($account=db_fetch($result)) { - if ($tags != -1) + if ($tags != -1 && is_array($tags) && $tags[0] != false) { if (!is_record_in_tags($tags, TAG_ACCOUNT, $account['account_code'])) continue;