mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
[RFR] Disambiguate posted date and value date
This commit is contained in:
@@ -77,7 +77,7 @@ class banking_import_transaction(osv.osv):
|
||||
('type', '=', 'in_invoice'),
|
||||
('partner_id', '=', 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),
|
||||
]
|
||||
@@ -104,7 +104,7 @@ class banking_import_transaction(osv.osv):
|
||||
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,
|
||||
@@ -1218,7 +1218,7 @@ class banking_import_transaction(osv.osv):
|
||||
# Link accounting period
|
||||
period_id = get_period(
|
||||
self.pool, cr, uid,
|
||||
str2date(transaction.effective_date,'%Y-%m-%d'), company,
|
||||
str2date(transaction.execution_date, '%Y-%m-%d'), company,
|
||||
results['log'])
|
||||
if not period_id:
|
||||
results['trans_skipped_cnt'] += 1
|
||||
@@ -1391,7 +1391,7 @@ class banking_import_transaction(osv.osv):
|
||||
if not transaction.statement_line_id:
|
||||
values.update(dict(
|
||||
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,
|
||||
@@ -1590,8 +1590,8 @@ class banking_import_transaction(osv.osv):
|
||||
'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'),
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -68,7 +68,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):
|
||||
@@ -368,7 +368,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)
|
||||
|
||||
@@ -224,7 +224,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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user