Skip to content

Commit

Permalink
Merge pull request #3 from coopiteasy/9.0-payment-amount-direction
Browse files Browse the repository at this point in the history
[IMP] cep: amount sign depends on direction
  • Loading branch information
robinkeunen authored Jan 29, 2021
2 parents 51501d8 + 8d6ff49 commit 4c80343
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion csv_export_payment/models/csv_export_payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,17 @@ def get_row(self, record):
)
invoice = payment.invoice_ids

if payment.partner_type == 'customer':
if payment.payment_type == 'inbound':
amount = payment.amount
if payment.payment_type == 'outbound':
amount = - payment.amount
if payment.partner_type == 'supplier':
if payment.payment_type == 'inbound':
amount = - payment.amount
if payment.payment_type == 'outbound':
amount = payment.amount

row = (
payment.name,
payment.journal_id.code,
Expand All @@ -53,7 +64,7 @@ def get_row(self, record):
payment.partner_id.export_reference,
invoice.number,
invoice.journal_id.code,
str(payment.amount),
str(amount),
)

row = tuple(self.replace_line_return(s) for s in row)
Expand Down

0 comments on commit 4c80343

Please sign in to comment.