summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYingtong Li <runassudo@yingtongli.me>2020-04-08 16:50:10 +1000
committerYingtong Li <runassudo@yingtongli.me>2020-04-08 16:50:10 +1000
commit3168b524791f5258876fd0c6debeda9475fae932 (patch)
treed9d3bb9839d480a4120811b1f69ea21d27880fea
parentfbe0396a8e1b6d03d0b479387aa84ae970b41cd5 (diff)
Fix ABA output
-rw-r--r--sstreasury/aba.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/sstreasury/aba.py b/sstreasury/aba.py
index db7a2d2..bd57532 100644
--- a/sstreasury/aba.py
+++ b/sstreasury/aba.py
@@ -43,21 +43,21 @@ def write_detail(f, dest_bsb='', dest_account='', indicator=' ', transaction_cod
f.write('{: >9}'.format(dest_account).encode('ascii')) # Account Number
f.write(indicator.encode('ascii')) # Indicator
f.write('{:02}'.format(transaction_code).encode('ascii')) # Transaction Code
- f.write('{:010}'.format(cents).encode('ascii')) # Amount
+ f.write('{:010}'.format(round(cents)).encode('ascii')) # Amount
f.write('{: <32}'.format(dest_name).encode('ascii')) # Title of Account
f.write('{: <18}'.format(reference).encode('ascii')) # Lodgement Reference
f.write('{}-{}'.format(src_bsb[:3], src_bsb[-3:]).encode('ascii')) # Trace BSB
f.write('{: >9}'.format(src_account).encode('ascii')) # Trace Account Number
f.write('{: <16}'.format(src_name).encode('ascii')) # Name of Remitter
- f.write('{:08}'.format(tax_withheld).encode('ascii')) # Amount of Withholding Tax
+ f.write('{:08}'.format(round(tax_withheld)).encode('ascii')) # Amount of Withholding Tax
f.write(b'\r\n')
def write_total(f, credit_cents=0, num_detail_records=0):
f.write(b'7') # Record Type 7
f.write(b'999-999') # BSB Format Filler
f.write(b' ' * 12) # Blank
- f.write('{:010}'.format(credit_cents).encode('ascii')) # File (User) Net Total Amount
- f.write('{:010}'.format(credit_cents).encode('ascii')) # File (User) Credit Total Amount
+ f.write('{:010}'.format(round(credit_cents)).encode('ascii')) # File (User) Net Total Amount
+ f.write('{:010}'.format(round(credit_cents)).encode('ascii')) # File (User) Credit Total Amount
f.write(b'0' * 10) # File (User) Debit Total Amount
f.write(b' ' * 24) # Blank
f.write('{:06}'.format(num_detail_records).encode('ascii')) # File (user) count of Records Type 1
Contact (issues, pull requests, etc.) at git@yingtongli.me. Generated by cgit.