From 871a5224ee89ce79dc67b5c8b260d43d586d6dde Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Sat, 18 Jul 2009 11:17:03 +0000 Subject: [PATCH] When saving a Payment to a Customer in Bank Payments (normally payment to suppliers) it was saved with wrong sign in debtor_trans (very rare). Wrong presentation in customer/supplier balance if using bank payments for customers and bank deposits for suppliers (very rare) --- CHANGELOG.txt | 7 +++++++ reporting/rep101.php | 2 +- reporting/rep201.php | 2 +- sales/includes/db/cust_trans_db.inc | 4 +++- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 889758eb..26833f77 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -19,6 +19,13 @@ Legend: ! -> Note $ -> Affected files +18-Jul-2009 Joe Hunt +# When saving a Payment to a Customer in Bank Payments (normally payment to suppliers) it was saved with wrong sign in debtor_trans (very rare). +$ /sales/includes/db/cust_trans_db.inc +# Wrong presentation in customer/supplier balance if using bank payments for customers and bank deposits for suppliers (very rare) +$ /reporting/rep101.php + /reporting/rep201.php + 13-Jul-2009 Joe Hunt # Bug in Tax Inquiry and Tax Report when entering in Journal Entry $ /gl/includes/db/gl_db_banking.inc diff --git a/reporting/rep101.php b/reporting/rep101.php index d8ad7d64..1745d93d 100644 --- a/reporting/rep101.php +++ b/reporting/rep101.php @@ -152,7 +152,7 @@ function print_customer_balances() else $item[3] = ($trans['TotalAmount'] + $trans['Allocated']) * $rate; */ - if ($trans['type'] == 10) + if ($trans['type'] == 10 || $trans['type'] == 1) $item[3] = $item[0] + $item[1] - $item[2]; else $item[3] = $item[0] - $item[1] + $item[2]; diff --git a/reporting/rep201.php b/reporting/rep201.php index 380af70d..29f54332 100644 --- a/reporting/rep201.php +++ b/reporting/rep201.php @@ -149,7 +149,7 @@ function print_supplier_balances() else $item[3] = ($trans['TotalAmount'] + $trans['Allocated']) * $rate; */ - if ($trans['type'] == 20) + if ($trans['type'] == 20 || $trans['type'] == 2) $item[3] = $item[0] + $item[1] - $item[2]; else $item[3] = $item[0] - $item[1] + $item[2]; diff --git a/sales/includes/db/cust_trans_db.inc b/sales/includes/db/cust_trans_db.inc index 7beb733c..dbfa8572 100644 --- a/sales/includes/db/cust_trans_db.inc +++ b/sales/includes/db/cust_trans_db.inc @@ -101,7 +101,9 @@ function write_customer_trans($trans_type, $trans_no, $debtor_no, $BranchNo, $SQLDueDate = "000-00-00"; else $SQLDueDate = date2sql($due_date); - + + if ($trans_type == systypes::bank_payment()) + $Total = -$Total; if ($trans_no==0) { $trans_no = get_next_trans_no($trans_type); -- 2.30.2