mirror of
https://github.com/OCA/bank-statement-import.git
synced 2025-01-20 12:37:43 +02:00
Merge pull request #91 from akretion/8.0-fix-ofx-balance
[8.0][FIX] Start/end balance on OFX statement
This commit is contained in:
@@ -83,12 +83,12 @@ class AccountBankStatementImport(models.TransientModel):
|
||||
"The file might not be valid.\n\n %s" % e.message
|
||||
))
|
||||
|
||||
balance = float(ofx.account.statement.balance)
|
||||
vals_bank_statement = {
|
||||
'name': ofx.account.number,
|
||||
'transactions': transactions,
|
||||
'balance_start': ofx.account.statement.balance,
|
||||
'balance_end_real':
|
||||
float(ofx.account.statement.balance) + total_amt,
|
||||
'balance_start': balance - total_amt,
|
||||
'balance_end_real': balance,
|
||||
}
|
||||
return ofx.account.statement.currency, ofx.account.number, [
|
||||
vals_bank_statement]
|
||||
|
||||
@@ -23,8 +23,8 @@ class TestOfxFile(TransactionCase):
|
||||
bank_statement.import_file()
|
||||
bank_st_record = self.bank_statement_model.search(
|
||||
[('name', '=', '123456')])[0]
|
||||
self.assertEquals(bank_st_record.balance_start, 2156.56)
|
||||
self.assertEquals(bank_st_record.balance_end_real, 1796.56)
|
||||
self.assertEquals(bank_st_record.balance_start, 2516.56)
|
||||
self.assertEquals(bank_st_record.balance_end_real, 2156.56)
|
||||
|
||||
line = bank_st_record.line_ids[0]
|
||||
self.assertEquals(line.name, 'Agrolait')
|
||||
|
||||
Reference in New Issue
Block a user