[RFR] Disambiguate posted date and value date

This commit is contained in:
Stefan Rijnhart
2014-02-14 16:48:43 +01:00
parent 5154e3488f
commit deb51bf68b
5 changed files with 12 additions and 12 deletions

View File

@@ -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'),

View File

@@ -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

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)