Merge lp:~therp-nl/banking-addons/6.1-fix_post_date_vs_value_date_confusion into lp:banking-addons/6.1

Proposed by Stefan Rijnhart (Opener)
Status: Merged
Approved by: Guewen Baconnier @ Camptocamp
Approved revision: 193
Merged at revision: 193
Proposed branch: lp:~therp-nl/banking-addons/6.1-fix_post_date_vs_value_date_confusion
Merge into: lp:banking-addons/6.1
Diff against target: 115 lines (+12/-12)
5 files modified
account_banking/banking_import_transaction.py (+6/-6)
account_banking/parsers/models.py (+2/-2)
account_banking_nl_abnamro/abnamro.py (+2/-2)
account_banking_nl_ing/ing.py (+1/-1)
account_banking_nl_triodos/triodos.py (+1/-1)
To merge this branch: bzr merge lp:~therp-nl/banking-addons/6.1-fix_post_date_vs_value_date_confusion
Reviewer Review Type Date Requested Status
Holger Brunn (Therp) code review Approve
Yannick Vaucher @ Camptocamp code review, no tests Approve
Review via email: mp+206684@code.launchpad.net

Description of the change

Disambiguate the terminology concerning post date and value date. The only import filter that distinguished both dates was HBSC, which assigned value date to 'effective_date'. The recent CAMT filter copied this behaviour but as it turns out, the meaning of the value date (or rather the post date) was not honoured in processing the statement lines.

This branch implements using the post date for basically everything: statement line date, base date for determining statement reference, lookup of reconcilable items.

A more extensive fix for 7.0, which also takes care of the clarification in column names and titles is here: https://code.launchpad.net/~therp-nl/banking-addons/7.0-fix_post_date_vs_value_date_confusion/+merge/206683.

To post a comment you must log in.
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

LGTM Thanks

review: Approve (code review, no tests)
Revision history for this message
Holger Brunn (Therp) (hbrunn) :
review: Approve (code review)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'account_banking/banking_import_transaction.py'
--- account_banking/banking_import_transaction.py 2014-01-11 16:04:03 +0000
+++ account_banking/banking_import_transaction.py 2014-02-17 10:51:54 +0000
@@ -77,7 +77,7 @@
77 ('type', '=', 'in_invoice'),77 ('type', '=', 'in_invoice'),
78 ('partner_id', '=', account_info.bank_partner_id.id),78 ('partner_id', '=', account_info.bank_partner_id.id),
79 ('company_id', '=', account_info.company_id.id),79 ('company_id', '=', account_info.company_id.id),
80 ('date_invoice', '=', trans.effective_date),80 ('date_invoice', '=', trans.execution_date),
81 ('reference', '=', reference),81 ('reference', '=', reference),
82 ('amount_total', '=', amount),82 ('amount_total', '=', amount),
83 ]83 ]
@@ -104,7 +104,7 @@
104 period_id = period_id,104 period_id = period_id,
105 journal_id = account_info.invoice_journal_id.id,105 journal_id = account_info.invoice_journal_id.id,
106 account_id = account_info.bank_partner_id.property_account_payable.id,106 account_id = account_info.bank_partner_id.property_account_payable.id,
107 date_invoice = trans.effective_date,107 date_invoice = trans.execution_date,
108 reference_type = 'none',108 reference_type = 'none',
109 reference = reference,109 reference = reference,
110 name = trans.reference or trans.message,110 name = trans.reference or trans.message,
@@ -1218,7 +1218,7 @@
1218 # Link accounting period1218 # Link accounting period
1219 period_id = get_period(1219 period_id = get_period(
1220 self.pool, cr, uid,1220 self.pool, cr, uid,
1221 str2date(transaction.effective_date,'%Y-%m-%d'), company,1221 str2date(transaction.execution_date, '%Y-%m-%d'), company,
1222 results['log'])1222 results['log'])
1223 if not period_id:1223 if not period_id:
1224 results['trans_skipped_cnt'] += 11224 results['trans_skipped_cnt'] += 1
@@ -1391,7 +1391,7 @@
1391 if not transaction.statement_line_id:1391 if not transaction.statement_line_id:
1392 values.update(dict(1392 values.update(dict(
1393 name = '%s.%s' % (transaction.statement, transaction.transaction),1393 name = '%s.%s' % (transaction.statement, transaction.transaction),
1394 date = transaction.effective_date,1394 date = transaction.execution_date,
1395 amount = transaction.transferred_amount,1395 amount = transaction.transferred_amount,
1396 statement_id = transaction.statement_id.id,1396 statement_id = transaction.statement_id.id,
1397 note = transaction.message,1397 note = transaction.message,
@@ -1590,8 +1590,8 @@
1590 'reference': fields.char('reference', size=1024),1590 'reference': fields.char('reference', size=1024),
1591 'local_account': fields.char('local_account', size=24),1591 'local_account': fields.char('local_account', size=24),
1592 'local_currency': fields.char('local_currency', size=16),1592 'local_currency': fields.char('local_currency', size=16),
1593 'execution_date': fields.date('execution_date'),1593 'execution_date': fields.date('Posted date'),
1594 'effective_date': fields.date('effective_date'),1594 'effective_date': fields.date('Value date'),
1595 'remote_account': fields.char('remote_account', size=24),1595 'remote_account': fields.char('remote_account', size=24),
1596 'remote_currency': fields.char('remote_currency', size=16),1596 'remote_currency': fields.char('remote_currency', size=16),
1597 'exchange_rate': fields.float('exchange_rate'),1597 'exchange_rate': fields.float('exchange_rate'),
15981598
=== modified file 'account_banking/parsers/models.py'
--- account_banking/parsers/models.py 2013-10-28 14:52:50 +0000
+++ account_banking/parsers/models.py 2014-02-17 10:51:54 +0000
@@ -86,10 +86,10 @@
86 # The currency the bank used to process the transferred amount86 # The currency the bank used to process the transferred amount
8787
88 'execution_date',88 'execution_date',
89 # The requested execution date of the action - order date if you like89 # The posted date of the action
9090
91 'effective_date',91 'effective_date',
92 # The real execution date of the action92 # The value date of the action
9393
94 'remote_account',94 'remote_account',
95 # The account of the other party95 # The account of the other party
9696
=== modified file 'account_banking_nl_abnamro/abnamro.py'
--- account_banking_nl_abnamro/abnamro.py 2013-06-04 14:35:21 +0000
+++ account_banking_nl_abnamro/abnamro.py 2014-02-17 10:51:54 +0000
@@ -68,7 +68,7 @@
68 self.execution_date = str2date(self.date, '%Y%m%d')68 self.execution_date = str2date(self.date, '%Y%m%d')
69 self.effective_date = str2date(self.date, '%Y%m%d')69 self.effective_date = str2date(self.date, '%Y%m%d')
70 # Set statement_id based on week number70 # Set statement_id based on week number
71 self.statement_id = self.effective_date.strftime('%Yw%W')71 self.statement_id = self.execution_date.strftime('%Yw%W')
72 self.id = str(subno).zfill(4)72 self.id = str(subno).zfill(4)
7373
74class transaction(models.mem_bank_transaction):74class transaction(models.mem_bank_transaction):
@@ -368,7 +368,7 @@
368 msg = transaction_message(line, subno)368 msg = transaction_message(line, subno)
369 if not statement_id:369 if not statement_id:
370 statement_id = self.get_unique_statement_id(370 statement_id = self.get_unique_statement_id(
371 cr, msg.effective_date.strftime('%Yw%W'))371 cr, msg.execution_date.strftime('%Yw%W'))
372 msg.statement_id = statement_id372 msg.statement_id = statement_id
373 if stmnt:373 if stmnt:
374 stmnt.import_transaction(msg)374 stmnt.import_transaction(msg)
375375
=== modified file 'account_banking_nl_ing/ing.py'
--- account_banking_nl_ing/ing.py 2012-10-04 08:56:19 +0000
+++ account_banking_nl_ing/ing.py 2014-02-17 10:51:54 +0000
@@ -224,7 +224,7 @@
224 msg = transaction_message(line, subno)224 msg = transaction_message(line, subno)
225 if not statement_id:225 if not statement_id:
226 statement_id = self.get_unique_statement_id(226 statement_id = self.get_unique_statement_id(
227 cr, msg.effective_date.strftime('%Yw%W'))227 cr, msg.execution_date.strftime('%Yw%W'))
228 msg.statement_id = statement_id228 msg.statement_id = statement_id
229 if stmnt:229 if stmnt:
230 stmnt.import_transaction(msg)230 stmnt.import_transaction(msg)
231231
=== modified file 'account_banking_nl_triodos/triodos.py'
--- account_banking_nl_triodos/triodos.py 2013-05-19 20:32:36 +0000
+++ account_banking_nl_triodos/triodos.py 2014-02-17 10:51:54 +0000
@@ -212,7 +212,7 @@
212 msg = transaction_message(line, subno)212 msg = transaction_message(line, subno)
213 if not statement_id:213 if not statement_id:
214 statement_id = self.get_unique_statement_id(214 statement_id = self.get_unique_statement_id(
215 cr, msg.effective_date.strftime('%Yw%W'))215 cr, msg.execution_date.strftime('%Yw%W'))
216 msg.statement_id = statement_id216 msg.statement_id = statement_id
217 if stmnt:217 if stmnt:
218 stmnt.import_transaction(msg)218 stmnt.import_transaction(msg)

Subscribers

People subscribed via source and target branches