diff --git a/account_banking/__openerp__.py b/account_banking/__openerp__.py index ae6f66bc1..bff6beabc 100644 --- a/account_banking/__openerp__.py +++ b/account_banking/__openerp__.py @@ -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', diff --git a/account_banking/banking_import_transaction.py b/account_banking/banking_import_transaction.py index a9b9ac132..da9bc5235 100644 --- a/account_banking/banking_import_transaction.py +++ b/account_banking/banking_import_transaction.py @@ -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'), diff --git a/account_banking/i18n/account_banking.pot b/account_banking/i18n/account_banking.pot index 70aace93e..b1e913fd5 100644 --- a/account_banking/i18n/account_banking.pot +++ b/account_banking/i18n/account_banking.pot @@ -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 diff --git a/account_banking/i18n/da.po b/account_banking/i18n/da.po index aa6d68319..d6215938d 100644 --- a/account_banking/i18n/da.po +++ b/account_banking/i18n/da.po @@ -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 diff --git a/account_banking/i18n/en.po b/account_banking/i18n/en.po index 5515eb7a5..76ebf8230 100644 --- a/account_banking/i18n/en.po +++ b/account_banking/i18n/en.po @@ -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 diff --git a/account_banking/i18n/es_ES.po b/account_banking/i18n/es_ES.po index 7e430e057..708a2157b 100644 --- a/account_banking/i18n/es_ES.po +++ b/account_banking/i18n/es_ES.po @@ -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 diff --git a/account_banking/i18n/hr.po b/account_banking/i18n/hr.po index bc32fed99..2aa026afd 100644 --- a/account_banking/i18n/hr.po +++ b/account_banking/i18n/hr.po @@ -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 diff --git a/account_banking/i18n/hu.po b/account_banking/i18n/hu.po index caaf530ab..c6eb11e26 100644 --- a/account_banking/i18n/hu.po +++ b/account_banking/i18n/hu.po @@ -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 diff --git a/account_banking/i18n/nb.po b/account_banking/i18n/nb.po index 785fd134f..bb3887c69 100644 --- a/account_banking/i18n/nb.po +++ b/account_banking/i18n/nb.po @@ -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 diff --git a/account_banking/i18n/nl.po b/account_banking/i18n/nl.po index b715cbad4..dd2ada971 100644 --- a/account_banking/i18n/nl.po +++ b/account_banking/i18n/nl.po @@ -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 diff --git a/account_banking/i18n/pt_BR.po b/account_banking/i18n/pt_BR.po index 8589d7769..4b0cae34f 100644 --- a/account_banking/i18n/pt_BR.po +++ b/account_banking/i18n/pt_BR.po @@ -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 diff --git a/account_banking/i18n/ro.po b/account_banking/i18n/ro.po index be1f65318..301a0321a 100644 --- a/account_banking/i18n/ro.po +++ b/account_banking/i18n/ro.po @@ -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 diff --git a/account_banking/i18n/tr.po b/account_banking/i18n/tr.po index 219457cac..c1809a036 100644 --- a/account_banking/i18n/tr.po +++ b/account_banking/i18n/tr.po @@ -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 diff --git a/account_banking/migrations/7.0.0.3/pre-migration.py b/account_banking/migrations/7.0.0.3/pre-migration.py new file mode 100644 index 000000000..0a1c80c6c --- /dev/null +++ b/account_banking/migrations/7.0.0.3/pre-migration.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (C) 2014 Therp BV (). +# 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 . +# +############################################################################## + +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 + """) diff --git a/account_banking/parsers/models.py b/account_banking/parsers/models.py index b33231ff2..4e88ea66e 100644 --- a/account_banking/parsers/models.py +++ b/account_banking/parsers/models.py @@ -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 diff --git a/account_banking_camt/camt.py b/account_banking_camt/camt.py index c925cb86f..8a30ff60c 100644 --- a/account_banking_camt/camt.py +++ b/account_banking_camt/camt.py @@ -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) } diff --git a/account_banking_fi_patu/patu.py b/account_banking_fi_patu/patu.py index a1e12e879..329f8c7a3 100644 --- a/account_banking_fi_patu/patu.py +++ b/account_banking_fi_patu/patu.py @@ -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", diff --git a/account_banking_nl_abnamro/abnamro.py b/account_banking_nl_abnamro/abnamro.py index 977383e00..c556b2f8e 100644 --- a/account_banking_nl_abnamro/abnamro.py +++ b/account_banking_nl_abnamro/abnamro.py @@ -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) diff --git a/account_banking_nl_girotel/girotel.py b/account_banking_nl_girotel/girotel.py index 5fe48c49f..1bea6bb09 100644 --- a/account_banking_nl_girotel/girotel.py +++ b/account_banking_nl_girotel/girotel.py @@ -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 = { diff --git a/account_banking_nl_ing/ing.py b/account_banking_nl_ing/ing.py index 929384c6a..6384f1314 100644 --- a/account_banking_nl_ing/ing.py +++ b/account_banking_nl_ing/ing.py @@ -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) diff --git a/account_banking_nl_multibank/multibank.py b/account_banking_nl_multibank/multibank.py index 885479a46..5eee004df 100644 --- a/account_banking_nl_multibank/multibank.py +++ b/account_banking_nl_multibank/multibank.py @@ -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', diff --git a/account_banking_nl_triodos/triodos.py b/account_banking_nl_triodos/triodos.py index dea453d2d..deca77764 100644 --- a/account_banking_nl_triodos/triodos.py +++ b/account_banking_nl_triodos/triodos.py @@ -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) diff --git a/account_banking_uk_hsbc/hsbc_mt940.py b/account_banking_uk_hsbc/hsbc_mt940.py index fc3dd65fd..5016ba1e2 100644 --- a/account_banking_uk_hsbc/hsbc_mt940.py +++ b/account_banking_uk_hsbc/hsbc_mt940.py @@ -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',