Use ofx file data for statement total_amount and start/end balance
issue8879 review262751002
This commit is contained in:
+5
-1
@@ -58,7 +58,11 @@ class StatementImport(metaclass=PoolMeta):
|
||||
raise ImportStatementError(
|
||||
gettext('account_statement_ofx.msg_import_no_statement'))
|
||||
statement.date = ofx_account.statement.balance_date.date()
|
||||
statement.total_amount = ofx_account.statement.balance
|
||||
total_amount = sum(
|
||||
t.amount for t in ofx_account.statement.transactions)
|
||||
statement.total_amount = total_amount
|
||||
statement.start_balance = ofx_account.statement.balance - total_amount
|
||||
statement.end_balance = ofx_account.statement.balance
|
||||
statement.number_of_lines = len(ofx_account.statement.transactions)
|
||||
return statement
|
||||
|
||||
|
||||
+2
-2
@@ -48,11 +48,11 @@ NEWFILEUID:NONE
|
||||
</STMTTRN>
|
||||
</BANKTRANLIST>
|
||||
<LEDGERBAL>
|
||||
<BALAMT>100.00
|
||||
<BALAMT>500.00
|
||||
<DTASOF>20180222
|
||||
</LEDGERBAL>
|
||||
<AVAILBAL>
|
||||
<BALAMT>100.00
|
||||
<BALAMT>500.00
|
||||
<DTASOF>20180222
|
||||
</AVAILBAL>
|
||||
</STMTRS>
|
||||
|
||||
@@ -102,6 +102,10 @@ Check Statement::
|
||||
Decimal('100.00')
|
||||
>>> statement.number_of_lines
|
||||
1
|
||||
>>> statement.start_balance
|
||||
Decimal('400.00')
|
||||
>>> statement.end_balance
|
||||
Decimal('500.00')
|
||||
>>> len(statement.origins)
|
||||
1
|
||||
>>> origin, = statement.origins
|
||||
|
||||
Reference in New Issue
Block a user