When saving a Payment to a Customer in Bank Payments (normally payment to suppliers...
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Sat, 18 Jul 2009 11:17:03 +0000 (11:17 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Sat, 18 Jul 2009 11:17:03 +0000 (11:17 +0000)
Wrong presentation in customer/supplier balance if using bank payments for customers and bank deposits for suppliers (very rare)

CHANGELOG.txt
reporting/rep101.php
reporting/rep201.php
sales/includes/db/cust_trans_db.inc

index 889758eb6b106d180f52df82a6b51b5702fa3d31..26833f772ddf1950279af2dc2bbf8deecd7c5ba2 100644 (file)
@@ -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
index d8ad7d6482609716822809baf196877370b5aefd..1745d93d6986a38a5948d8249f58175018fa9ffb 100644 (file)
@@ -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];
index 380af70de90695a291a7237e9ec257671aeb3605..29f543324aa6b070c4a12bd195de904fc0437232 100644 (file)
@@ -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];
index 7beb733cde6559b7e728c79d6d0900bc011a77c2..dbfa8572736ae656cadac0f059a61cade18898fb 100644 (file)
@@ -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);