From deb51bf68b5f80820e23b78d44044d89278d3f75 Mon Sep 17 00:00:00 2001 From: Stefan Rijnhart Date: Fri, 14 Feb 2014 16:48:43 +0100 Subject: [PATCH] [RFR] Disambiguate posted date and value date --- account_banking/banking_import_transaction.py | 12 ++++++------ account_banking/parsers/models.py | 4 ++-- account_banking_nl_abnamro/abnamro.py | 4 ++-- account_banking_nl_ing/ing.py | 2 +- account_banking_nl_triodos/triodos.py | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/account_banking/banking_import_transaction.py b/account_banking/banking_import_transaction.py index a9b9ac132..b9ba5cfb7 100644 --- a/account_banking/banking_import_transaction.py +++ b/account_banking/banking_import_transaction.py @@ -74,7 +74,7 @@ class banking_import_transaction(orm.Model): ('type', '=', 'in_invoice'), ('partner_id', 'child_of', account_info.bank_partner_id.id), ('company_id', '=', account_info.company_id.id), - ('date_invoice', '=', trans.effective_date), + ('date_invoice', '=', trans.execution_date), ('reference', '=', reference), ('amount_total', '=', amount), ] @@ -101,7 +101,7 @@ class banking_import_transaction(orm.Model): period_id = period_id, journal_id = account_info.invoice_journal_id.id, account_id = account_info.bank_partner_id.property_account_payable.id, - date_invoice = trans.effective_date, + date_invoice = trans.execution_date, reference_type = 'none', reference = reference, name = trans.reference or trans.message, @@ -943,7 +943,7 @@ class banking_import_transaction(orm.Model): # Link accounting period period_id = banktools.get_period( - self.pool, cr, uid, transaction.effective_date, + self.pool, cr, uid, transaction.execution_date, company, results['log']) if not period_id: results['trans_skipped_cnt'] += 1 @@ -959,7 +959,7 @@ class banking_import_transaction(orm.Model): else: values = { 'name': '%s.%s' % (transaction.statement, transaction.transaction), - 'date': transaction.effective_date, + 'date': transaction.execution_date, 'amount': transaction.transferred_amount, 'statement_id': transaction.statement_id.id, 'note': transaction.message, @@ -1290,8 +1290,8 @@ class banking_import_transaction(orm.Model): 'reference': fields.char('reference', size=1024), 'local_account': fields.char('local_account', size=24), 'local_currency': fields.char('local_currency', size=16), - 'execution_date': fields.date('execution_date'), - 'effective_date': fields.date('effective_date'), + 'execution_date': fields.date('Posted date'), + 'effective_date': fields.date('Value date'), 'remote_account': fields.char('remote_account', size=24), 'remote_currency': fields.char('remote_currency', size=16), 'exchange_rate': fields.float('exchange_rate'), diff --git a/account_banking/parsers/models.py b/account_banking/parsers/models.py index b33231ff2..cbbf60d71 100644 --- a/account_banking/parsers/models.py +++ b/account_banking/parsers/models.py @@ -86,10 +86,10 @@ class mem_bank_transaction(object): # The currency the bank used to process the transferred amount 'execution_date', - # The requested execution date of the action - order date if you like + # The posted date of the action 'effective_date', - # The real execution date of the action + # The value date of the action 'remote_account', # The account of the other party diff --git a/account_banking_nl_abnamro/abnamro.py b/account_banking_nl_abnamro/abnamro.py index 977383e00..da597fab8 100644 --- a/account_banking_nl_abnamro/abnamro.py +++ b/account_banking_nl_abnamro/abnamro.py @@ -69,7 +69,7 @@ class transaction_message(object): self.execution_date = str2date(self.date, '%Y%m%d') self.effective_date = str2date(self.date, '%Y%m%d') # Set statement_id based on week number - self.statement_id = self.effective_date.strftime('%Yw%W') + self.statement_id = self.execution_date.strftime('%Yw%W') self.id = str(subno).zfill(4) class transaction(models.mem_bank_transaction): @@ -369,7 +369,7 @@ each file covers a period of two weeks. msg = transaction_message(line, subno) if not statement_id: statement_id = self.get_unique_statement_id( - cr, msg.effective_date.strftime('%Yw%W')) + cr, msg.execution_date.strftime('%Yw%W')) msg.statement_id = statement_id if stmnt: stmnt.import_transaction(msg) diff --git a/account_banking_nl_ing/ing.py b/account_banking_nl_ing/ing.py index 929384c6a..8b680cfed 100644 --- a/account_banking_nl_ing/ing.py +++ b/account_banking_nl_ing/ing.py @@ -279,7 +279,7 @@ Statements. msg = transaction_message(line, subno) if not statement_id: statement_id = self.get_unique_statement_id( - cr, msg.effective_date.strftime('%Yw%W')) + cr, msg.execution_date.strftime('%Yw%W')) msg.statement_id = statement_id if stmnt: stmnt.import_transaction(msg) diff --git a/account_banking_nl_triodos/triodos.py b/account_banking_nl_triodos/triodos.py index dea453d2d..4ceb9fa32 100644 --- a/account_banking_nl_triodos/triodos.py +++ b/account_banking_nl_triodos/triodos.py @@ -212,7 +212,7 @@ Statements. msg = transaction_message(line, subno) if not statement_id: statement_id = self.get_unique_statement_id( - cr, msg.effective_date.strftime('%Yw%W')) + cr, msg.execution_date.strftime('%Yw%W')) msg.statement_id = statement_id if stmnt: stmnt.import_transaction(msg)