take care of transaction's net amounts (closes #1694)

The account balance is impacted by the net amount, because Paypal's fee is
deducted at source.
This commit is contained in:
Romain Bignon 2014-12-18 11:33:15 +01:00
commit 2edc1b0627

View file

@ -108,10 +108,14 @@ class NewPartHistoryPage(Page):
raw = transaction['displayType']
t.parse(date=date, raw=raw)
try:
amount = transaction['displayAmount']
amount = transaction['netAmount']
except KeyError:
return
t.set_amount(amount)
if transaction['isCredit']:
t.set_amount(credit=amount)
else:
t.set_amount(debit=amount)
t._currency = transaction['currencyCode']
return t