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
1=== modified file 'account_banking/banking_import_transaction.py'
2--- account_banking/banking_import_transaction.py 2014-01-11 16:04:03 +0000
3+++ account_banking/banking_import_transaction.py 2014-02-17 10:51:54 +0000
4@@ -77,7 +77,7 @@
5 ('type', '=', 'in_invoice'),
6 ('partner_id', '=', account_info.bank_partner_id.id),
7 ('company_id', '=', account_info.company_id.id),
8- ('date_invoice', '=', trans.effective_date),
9+ ('date_invoice', '=', trans.execution_date),
10 ('reference', '=', reference),
11 ('amount_total', '=', amount),
12 ]
13@@ -104,7 +104,7 @@
14 period_id = period_id,
15 journal_id = account_info.invoice_journal_id.id,
16 account_id = account_info.bank_partner_id.property_account_payable.id,
17- date_invoice = trans.effective_date,
18+ date_invoice = trans.execution_date,
19 reference_type = 'none',
20 reference = reference,
21 name = trans.reference or trans.message,
22@@ -1218,7 +1218,7 @@
23 # Link accounting period
24 period_id = get_period(
25 self.pool, cr, uid,
26- str2date(transaction.effective_date,'%Y-%m-%d'), company,
27+ str2date(transaction.execution_date, '%Y-%m-%d'), company,
28 results['log'])
29 if not period_id:
30 results['trans_skipped_cnt'] += 1
31@@ -1391,7 +1391,7 @@
32 if not transaction.statement_line_id:
33 values.update(dict(
34 name = '%s.%s' % (transaction.statement, transaction.transaction),
35- date = transaction.effective_date,
36+ date = transaction.execution_date,
37 amount = transaction.transferred_amount,
38 statement_id = transaction.statement_id.id,
39 note = transaction.message,
40@@ -1590,8 +1590,8 @@
41 'reference': fields.char('reference', size=1024),
42 'local_account': fields.char('local_account', size=24),
43 'local_currency': fields.char('local_currency', size=16),
44- 'execution_date': fields.date('execution_date'),
45- 'effective_date': fields.date('effective_date'),
46+ 'execution_date': fields.date('Posted date'),
47+ 'effective_date': fields.date('Value date'),
48 'remote_account': fields.char('remote_account', size=24),
49 'remote_currency': fields.char('remote_currency', size=16),
50 'exchange_rate': fields.float('exchange_rate'),
51
52=== modified file 'account_banking/parsers/models.py'
53--- account_banking/parsers/models.py 2013-10-28 14:52:50 +0000
54+++ account_banking/parsers/models.py 2014-02-17 10:51:54 +0000
55@@ -86,10 +86,10 @@
56 # The currency the bank used to process the transferred amount
57
58 'execution_date',
59- # The requested execution date of the action - order date if you like
60+ # The posted date of the action
61
62 'effective_date',
63- # The real execution date of the action
64+ # The value date of the action
65
66 'remote_account',
67 # The account of the other party
68
69=== modified file 'account_banking_nl_abnamro/abnamro.py'
70--- account_banking_nl_abnamro/abnamro.py 2013-06-04 14:35:21 +0000
71+++ account_banking_nl_abnamro/abnamro.py 2014-02-17 10:51:54 +0000
72@@ -68,7 +68,7 @@
73 self.execution_date = str2date(self.date, '%Y%m%d')
74 self.effective_date = str2date(self.date, '%Y%m%d')
75 # Set statement_id based on week number
76- self.statement_id = self.effective_date.strftime('%Yw%W')
77+ self.statement_id = self.execution_date.strftime('%Yw%W')
78 self.id = str(subno).zfill(4)
79
80 class transaction(models.mem_bank_transaction):
81@@ -368,7 +368,7 @@
82 msg = transaction_message(line, subno)
83 if not statement_id:
84 statement_id = self.get_unique_statement_id(
85- cr, msg.effective_date.strftime('%Yw%W'))
86+ cr, msg.execution_date.strftime('%Yw%W'))
87 msg.statement_id = statement_id
88 if stmnt:
89 stmnt.import_transaction(msg)
90
91=== modified file 'account_banking_nl_ing/ing.py'
92--- account_banking_nl_ing/ing.py 2012-10-04 08:56:19 +0000
93+++ account_banking_nl_ing/ing.py 2014-02-17 10:51:54 +0000
94@@ -224,7 +224,7 @@
95 msg = transaction_message(line, subno)
96 if not statement_id:
97 statement_id = self.get_unique_statement_id(
98- cr, msg.effective_date.strftime('%Yw%W'))
99+ cr, msg.execution_date.strftime('%Yw%W'))
100 msg.statement_id = statement_id
101 if stmnt:
102 stmnt.import_transaction(msg)
103
104=== modified file 'account_banking_nl_triodos/triodos.py'
105--- account_banking_nl_triodos/triodos.py 2013-05-19 20:32:36 +0000
106+++ account_banking_nl_triodos/triodos.py 2014-02-17 10:51:54 +0000
107@@ -212,7 +212,7 @@
108 msg = transaction_message(line, subno)
109 if not statement_id:
110 statement_id = self.get_unique_statement_id(
111- cr, msg.effective_date.strftime('%Yw%W'))
112+ cr, msg.execution_date.strftime('%Yw%W'))
113 msg.statement_id = statement_id
114 if stmnt:
115 stmnt.import_transaction(msg)

Subscribers

People subscribed via source and target branches