From 0989b5929353dcd59ccc913c856d39c90c0f6c07 Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Mon, 14 Sep 2009 20:40:25 +0000 Subject: [PATCH 1/1] A couple of minor bugs in tax report when displaying supplier credit notes --- CHANGELOG.txt | 4 ++++ purchasing/includes/db/invoice_db.inc | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 7a2bedd5..c6cd42ff 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -19,6 +19,10 @@ Legend: ! -> Note $ -> Affected files +14-Sep-2009 Joe Hunt +# A couple of minor bugs in tax report when displaying supplier credit notes +$ /purchasing/includes/db/invoice_db.inc + 05-Sep-2009 Joe Hunt # Changed Class Type to Class Name in GL Account groups $ /gl/manage/gl_account_types.php diff --git a/purchasing/includes/db/invoice_db.inc b/purchasing/includes/db/invoice_db.inc index a9636b33..4703f802 100644 --- a/purchasing/includes/db/invoice_db.inc +++ b/purchasing/includes/db/invoice_db.inc @@ -188,6 +188,8 @@ function add_supp_invoice($supp_trans, $invoice_no=0) // do not receive as ref b $entered_gl_code->amount, $memo_); // store tax details if the gl account is a tax account + if (!$supp_trans->is_invoice) + $entered_gl_code->amount = -$entered_gl_code->amount; add_gl_tax_details($entered_gl_code->gl_code, $trans_type, $invoice_id, $entered_gl_code->amount, $ex_rate, $date_, $supp_trans->supp_reference); @@ -269,12 +271,17 @@ function add_supp_invoice($supp_trans, $invoice_no=0) // do not receive as ref b { if (!$supp_trans->is_invoice) + { + $taxitem['Net'] = -$taxitem['Net']; $taxitem['Value'] = -$taxitem['Value']; + } // here we suppose that tax is never included in price (we are company customer). add_trans_tax_details($trans_type, $invoice_id, $taxitem['tax_type_id'], $taxitem['rate'], 0, $taxitem['Value'], $taxitem['Net'], $ex_rate, $date_, $supp_trans->supp_reference); + if (!$supp_trans->is_invoice) + $taxitem['Value'] = -$taxitem['Value']; $total += add_gl_trans_supplier($trans_type, $invoice_id, $date_, $taxitem['purchasing_gl_code'], 0, 0, $taxitem['Value'], $supp_trans->supplier_id, -- 2.30.2