From: Joe Hunt Date: Sat, 9 Oct 2010 23:21:45 +0000 (+0000) Subject: Master bug in class supp_trans get_items_total. Minor bug in gl_db_trans.inc X-Git-Tag: v2.4.2~19^2~586 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=4dd9e2012244dfe3f11b233c49278cfd96cf534b;p=fa-stable.git Master bug in class supp_trans get_items_total. Minor bug in gl_db_trans.inc Wrong tax report and wrong supp trans/gl records with gl item lines. --- diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 0da137c4..eca8006c 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -19,6 +19,12 @@ Legend: ! -> Note $ -> Affected files +10-Oct-2010 Joe Hunt +# Master bug in class supp_trans get_items_total. Minor bug in gl_db_trans.inc + Wrong tax report and wrong supp trans/gl records with gl item lines. +$ /purchasing/includes/supp_trans_class.inc + /gl/includes/db/gl_db_trans.inc + 06-Oct-2010 Jusz Dobrowolski # Fixed gettext for extension links. $ /reporting/includes/reports_classes.inc diff --git a/gl/includes/db/gl_db_trans.inc b/gl/includes/db/gl_db_trans.inc index e6416967..96963d43 100644 --- a/gl/includes/db/gl_db_trans.inc +++ b/gl/includes/db/gl_db_trans.inc @@ -337,7 +337,8 @@ function add_gl_tax_details($gl_code, $trans_type, $trans_no, $amount, $ex_rate, if(!$tax_type) return; // $gl_code is not tax account $tax = get_tax_type($tax_type); - if ($gl_code == $tax['sales_gl_code']) + //if ($gl_code == $tax['sales_gl_code']) + if ($trans_type == ST_SALESINVOICE || $trans_type == ST_CUSTDELIVERY || $trans_type == ST_CUSTCREDIT) $amount = -$amount; // we have to restore net amount as we cannot know the base amount if ($tax['rate'] == 0) { diff --git a/purchasing/includes/supp_trans_class.inc b/purchasing/includes/supp_trans_class.inc index 293b59a7..0647b96f 100644 --- a/purchasing/includes/supp_trans_class.inc +++ b/purchasing/includes/supp_trans_class.inc @@ -164,12 +164,12 @@ class supp_trans foreach ($this->grn_items as $ln_itm) $total += round($ln_itm->this_quantity_inv * $ln_itm->chg_price, user_price_dec()); - return $total; - foreach ($this->gl_codes as $gl_line) - { - $total += $gl_line->amount; + { //////// 2010-10-10 Joe Hunt + if (!is_tax_account($gl_line->gl_code)) + $total += $gl_line->amount; } + return $total; } } /* end of class defintion */