Skip to content

Commit

Permalink
[FIX] fix reversed line (in current paypal export, the last line is t…
Browse files Browse the repository at this point in the history
…he last created) and take the fee in the balance start
  • Loading branch information
RobinetDenisAcsone committed May 17, 2018
1 parent ff5441f commit 43f7e33
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,16 +178,15 @@ def _parse_file(self, data_file):
other_currency_line = {}
final_lines.append(wline)

# PayPal statements start with the end !
final_lines.reverse()
j = 0
for fline in final_lines:
j += 1
commission_total += fline['commission']

if j == 1:
start_date_str = fline['date']
start_balance = fline['balance'] - fline['amount']
start_balance = fline['balance'] - (
fline['amount'] + fline['commission'])
end_date_str = fline['date']
end_balance = fline['balance']
partners = False
Expand Down

0 comments on commit 43f7e33

Please sign in to comment.