[RFR] Disambiguate posted date and value date

[RFR] Rename 'effective date' to standard 'value date'
This commit is contained in:
unknown
2014-03-31 12:09:10 +02:00
committed by Holger Brunn
23 changed files with 98 additions and 67 deletions

View File

@@ -26,7 +26,7 @@
{
'name': 'Account Banking',
'version': '0.2',
'version': '0.3',
'license': 'AGPL-3',
'author': 'Banking addons community',
'website': 'https://launchpad.net/banking-addons',

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

@@ -288,7 +288,7 @@ msgstr ""
#. module: account_banking
#: field:banking.import.transaction,execution_date:0
msgid "execution_date"
msgid "Posted date"
msgstr ""
#. module: account_banking
@@ -785,8 +785,8 @@ msgid "Payment Difference"
msgstr ""
#. module: account_banking
#: field:banking.import.transaction,effective_date:0
msgid "effective_date"
#: field:banking.import.transaction,value_date:0
msgid "Value date"
msgstr ""
#. module: account_banking

View File

@@ -293,7 +293,7 @@ msgstr ""
#. module: account_banking
#: field:banking.import.transaction,execution_date:0
msgid "execution_date"
msgid "Posted date"
msgstr ""
#. module: account_banking
@@ -801,8 +801,8 @@ msgid "Payment Difference"
msgstr ""
#. module: account_banking
#: field:banking.import.transaction,effective_date:0
msgid "effective_date"
#: field:banking.import.transaction,value_date:0
msgid "Value date"
msgstr ""
#. module: account_banking

View File

@@ -292,7 +292,7 @@ msgstr ""
#. module: account_banking
#: field:banking.import.transaction,execution_date:0
msgid "execution_date"
msgid "Posted date"
msgstr ""
#. module: account_banking
@@ -807,8 +807,8 @@ msgid "Payment Difference"
msgstr ""
#. module: account_banking
#: field:banking.import.transaction,effective_date:0
msgid "effective_date"
#: field:banking.import.transaction,value_date:0
msgid "Value date"
msgstr ""
#. module: account_banking

View File

@@ -293,7 +293,7 @@ msgstr ""
#. module: account_banking
#: field:banking.import.transaction,execution_date:0
msgid "execution_date"
msgid "Posted date"
msgstr ""
#. module: account_banking
@@ -801,8 +801,8 @@ msgid "Payment Difference"
msgstr ""
#. module: account_banking
#: field:banking.import.transaction,effective_date:0
msgid "effective_date"
#: field:banking.import.transaction,value_date:0
msgid "Value date"
msgstr ""
#. module: account_banking

View File

@@ -293,7 +293,7 @@ msgstr ""
#. module: account_banking
#: field:banking.import.transaction,execution_date:0
msgid "execution_date"
msgid "Posted date"
msgstr ""
#. module: account_banking
@@ -807,8 +807,8 @@ msgid "Payment Difference"
msgstr ""
#. module: account_banking
#: field:banking.import.transaction,effective_date:0
msgid "effective_date"
#: field:banking.import.transaction,value_date:0
msgid "Value date"
msgstr ""
#. module: account_banking

View File

@@ -303,7 +303,7 @@ msgstr "Tranzakciós adat"
#. module: account_banking
#: field:banking.import.transaction,execution_date:0
msgid "execution_date"
msgid "Posted date"
msgstr "execution_date"
#. module: account_banking
@@ -814,8 +814,8 @@ msgid "Payment Difference"
msgstr ""
#. module: account_banking
#: field:banking.import.transaction,effective_date:0
msgid "effective_date"
#: field:banking.import.transaction,value_date:0
msgid "Value date"
msgstr ""
#. module: account_banking

View File

@@ -293,7 +293,7 @@ msgstr ""
#. module: account_banking
#: field:banking.import.transaction,execution_date:0
msgid "execution_date"
msgid "Posted date"
msgstr ""
#. module: account_banking
@@ -801,8 +801,8 @@ msgid "Payment Difference"
msgstr ""
#. module: account_banking
#: field:banking.import.transaction,effective_date:0
msgid "effective_date"
#: field:banking.import.transaction,value_date:0
msgid "Value date"
msgstr ""
#. module: account_banking

View File

@@ -301,8 +301,8 @@ msgstr "Transactie gegevens"
#. module: account_banking
#: field:banking.import.transaction,execution_date:0
msgid "execution_date"
msgstr "execution_date"
msgid "Posted date"
msgstr "Boekdatum"
#. module: account_banking
#: field:banking.import.line,account_id:0
@@ -822,9 +822,9 @@ msgid "Payment Difference"
msgstr "Betaalverschil"
#. module: account_banking
#: field:banking.import.transaction,effective_date:0
msgid "effective_date"
msgstr "effective_date"
#: field:banking.import.transaction,value_date:0
msgid "Value date"
msgstr "Valutadatum"
#. module: account_banking
#: view:account.bank.statement.line:0

View File

@@ -293,7 +293,7 @@ msgstr ""
#. module: account_banking
#: field:banking.import.transaction,execution_date:0
msgid "execution_date"
msgid "Posted date"
msgstr ""
#. module: account_banking
@@ -801,8 +801,8 @@ msgid "Payment Difference"
msgstr ""
#. module: account_banking
#: field:banking.import.transaction,effective_date:0
msgid "effective_date"
#: field:banking.import.transaction,value_date:0
msgid "Value date"
msgstr ""
#. module: account_banking

View File

@@ -293,7 +293,7 @@ msgstr ""
#. module: account_banking
#: field:banking.import.transaction,execution_date:0
msgid "execution_date"
msgid "Posted date"
msgstr ""
#. module: account_banking
@@ -801,8 +801,8 @@ msgid "Payment Difference"
msgstr ""
#. module: account_banking
#: field:banking.import.transaction,effective_date:0
msgid "effective_date"
#: field:banking.import.transaction,value_date:0
msgid "Value date"
msgstr ""
#. module: account_banking

View File

@@ -293,7 +293,7 @@ msgstr ""
#. module: account_banking
#: field:banking.import.transaction,execution_date:0
msgid "execution_date"
msgid "Posted date"
msgstr ""
#. module: account_banking
@@ -801,8 +801,8 @@ msgid "Payment Difference"
msgstr ""
#. module: account_banking
#: field:banking.import.transaction,effective_date:0
msgid "effective_date"
#: field:banking.import.transaction,value_date:0
msgid "Value date"
msgstr ""
#. module: account_banking

View File

@@ -0,0 +1,31 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 Therp BV (<http://therp.nl>).
# All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
def migrate(cr, version):
if not version:
return
# Rename value date column
cr.execute(
"""
ALTER TABLE banking_import_transaction
RENAME COLUMN effective_date TO value_date
""")

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
'value_date',
# The value date of the action
'remote_account',
# The account of the other party

View File

@@ -182,7 +182,7 @@ CAMT Format parser
"""
entry_details = {
'execution_date': self.xpath(node, './ns:BookgDt/ns:Dt')[0].text,
'effective_date': self.xpath(node, './ns:ValDt/ns:Dt')[0].text,
'value_date': self.xpath(node, './ns:ValDt/ns:Dt')[0].text,
'transfer_type': self.get_transfer_type(node),
'transferred_amount': self.parse_amount(node)
}

View File

@@ -39,7 +39,7 @@ class transaction(models.mem_bank_transaction):
"remote_currency": "currency",
"transferred_amount": "amount",
"execution_date": "recorddate",
"effective_date": "paymentdate",
"value_date": "paymentdate",
"transfer_type": "eventtype",
"reference": "refnr",
"eventcode": "eventcode",

View File

@@ -67,9 +67,9 @@ class transaction_message(object):
self.transferred_amount = float(
self.transferred_amount.replace(',', '.'))
self.execution_date = str2date(self.date, '%Y%m%d')
self.effective_date = str2date(self.date, '%Y%m%d')
self.value_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):
@@ -77,7 +77,7 @@ class transaction(models.mem_bank_transaction):
Implementation of transaction communication class for account_banking.
'''
attrnames = ['local_account', 'local_currency', 'transferred_amount',
'blob', 'execution_date', 'effective_date', 'id',
'blob', 'execution_date', 'value_date', 'id',
]
type_map = {
@@ -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

@@ -120,7 +120,7 @@ class transaction_message(object):
self.remote_account = self.remote_account.zfill(10)
else:
self.remote_account = False
self.execution_date = self.effective_date = self.date
self.execution_date = self.value_date = self.date
self.remote_owner = self.remote_owner.rstrip()
self.message = self.message.rstrip()
self.genid()
@@ -137,7 +137,7 @@ class transaction(models.mem_bank_transaction):
'''
attrnames = [ 'statement_id', 'remote_account', 'remote_owner',
'remote_currency', 'transferred_amount', 'execution_date',
'effective_date', 'transfer_type', 'message',
'value_date', 'transfer_type', 'message',
]
type_map = {

View File

@@ -68,10 +68,10 @@ class transaction_message(object):
if self.debcred == 'Af':
self.transferred_amount = -self.transferred_amount
try:
self.execution_date = self.effective_date = str2date(self.date, '%Y%m%d')
self.execution_date = self.value_date = str2date(self.date, '%Y%m%d')
except ValueError:
self.execution_date = self.effective_date = str2date(self.date, '%d-%m-%Y')
self.statement_id = '' #self.effective_date.strftime('%Yw%W')
self.execution_date = self.value_date = str2date(self.date, '%d-%m-%Y')
self.statement_id = '' #self.value_date.strftime('%Yw%W')
self.id = str(subno).zfill(4)
self.reference = ''
# Normalize basic account numbers
@@ -85,7 +85,7 @@ class transaction(models.mem_bank_transaction):
'''
attrnames = ['local_account', 'remote_account',
'remote_owner', 'transferred_amount',
'execution_date', 'effective_date', 'transfer_type',
'execution_date', 'value_date', 'transfer_type',
'id', 'reference', 'statement_id', 'message',
]
@@ -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

@@ -44,7 +44,7 @@ class transaction_message(object):
attrnames = [
'date', 'local_account', 'remote_account', 'remote_owner', 'u1', 'u2',
'u3', 'local_currency', 'start_balance', 'remote_currency',
'transferred_amount', 'execution_date', 'effective_date', 'nr1',
'transferred_amount', 'execution_date', 'value_date', 'nr1',
'transfer_type', 'nr2', 'reference', 'message', 'statement_id'
]
@@ -82,7 +82,7 @@ class transaction_message(object):
self.start_balance = float(self.start_balance)
self.transferred_amount = float(self.transferred_amount)
self.execution_date = str2date(self.execution_date, '%d-%m-%Y')
self.effective_date = str2date(self.effective_date, '%d-%m-%Y')
self.value_date = str2date(self.value_date, '%d-%m-%Y')
self.id = str(subno).zfill(4)
class transaction(models.mem_bank_transaction):
@@ -91,7 +91,7 @@ class transaction(models.mem_bank_transaction):
'''
attrnames = ['local_account', 'local_currency', 'remote_account',
'remote_owner', 'remote_currency', 'transferred_amount',
'execution_date', 'effective_date', 'transfer_type',
'execution_date', 'value_date', 'transfer_type',
'reference', 'message', 'statement_id', 'id',
]
@@ -152,7 +152,7 @@ class transaction(models.mem_bank_transaction):
have their transfer_type set to 'OPN'.
'''
return (self.transferred_amount and self.execution_date and
self.effective_date) and (
self.value_date) and (
self.remote_account or
self.transfer_type in [
'KST', 'PRV', 'BTL', 'BEA', 'OPN', 'KNT', 'DIV',

View File

@@ -65,8 +65,8 @@ class transaction_message(object):
if self.debcred == 'Debet':
self.transferred_amount = -self.transferred_amount
self.execution_date = str2date(self.date, '%d-%m-%Y')
self.effective_date = str2date(self.date, '%d-%m-%Y')
self.statement_id = '' # self.effective_date.strftime('%Yw%W') # Set statement_id based on week number
self.value_date = str2date(self.date, '%d-%m-%Y')
self.statement_id = ''
self.id = str(subno).zfill(4)
# Normalize basic account numbers
self.remote_account = self.remote_account.replace('.', '').zfill(10)
@@ -78,7 +78,7 @@ class transaction(models.mem_bank_transaction):
'''
attrnames = ['local_account', 'remote_account',
'remote_owner', 'transferred_amount',
'execution_date', 'effective_date', 'transfer_type',
'execution_date', 'value_date', 'transfer_type',
'reference', 'id',
]
@@ -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)

View File

@@ -40,7 +40,7 @@ class transaction(models.mem_bank_transaction):
mapping = {
'execution_date' : 'valuedate',
'effective_date' : 'valuedate',
'value_date' : 'valuedate',
'local_currency' : 'currency',
'transfer_type' : 'bookingcode',
'reference' : 'custrefno',