summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYingtong Li <runassudo@yingtongli.me>2020-05-13 11:18:57 +1000
committerYingtong Li <runassudo@yingtongli.me>2020-05-13 11:18:57 +1000
commitbbd775789f038f07446ca0f9d0f82ce7d75620ad (patch)
tree2e0575595eb47afa598a139bd5c9d7938ca5077b
parent787b16733dc4df1a8078bd4f0413a6fece68b9ed (diff)
Include claim purpose when exporting to Xero
-rw-r--r--sstreasury/xero.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/sstreasury/xero.py b/sstreasury/xero.py
index 4700e46..ec07a70 100644
--- a/sstreasury/xero.py
+++ b/sstreasury/xero.py
@@ -27,13 +27,13 @@ def write_row(writer, d):
writer.writerow(d)
def write_claim(writer, claim):
- for item in claim.items:
+ for i, item in enumerate(claim.items):
write_row(writer, {
'*ContactName': claim.payee_name,
'*InvoiceNumber': 'RE-{}'.format(claim.id),
'*InvoiceDate': timezone.now().strftime('%d/%m/%Y'),
'*DueDate': timezone.now().strftime('%d/%m/%Y'),
- 'Description': item['Description'],
+ 'Description': '{} - {}'.format(claim.purpose, item['Description']) if i == 0 else item['Description'],
'*Quantity': str(item['Units']),
'*UnitAmount': str(item['Unit price']),
#'*AccountCode': '850', # Suspense
Contact (issues, pull requests, etc.) at git@yingtongli.me. Generated by cgit.