From 7070dc682c32d219649a49fba627981f071c724e Mon Sep 17 00:00:00 2001 From: Stefan Rijnhart Date: Wed, 11 Jul 2012 12:37:31 +0200 Subject: [PATCH 01/26] [FIX] Unclear error message when no period exists for bank statement date --- account_banking/wizard/bank_import.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/account_banking/wizard/bank_import.py b/account_banking/wizard/bank_import.py index 6e2139341..9dc222272 100644 --- a/account_banking/wizard/bank_import.py +++ b/account_banking/wizard/bank_import.py @@ -263,6 +263,16 @@ class banking_import(osv.osv_memory): ('date_stop','>=',statement.date), ('special', '=', False)]) + if not period_ids: + results.log.append( + _('No period found covering statement date %(date)s, ' + 'statement %(id)s skipped') % { + 'date': statement.date, + 'id': statement.id, + } + ) + continue + # Create the bank statement record statement_id = statement_obj.create(cursor, uid, dict( name = statement.id, From 2845dfc00fc88a684a26d78630514e2ad009fcb2 Mon Sep 17 00:00:00 2001 From: Stefan Rijnhart Date: Tue, 9 Oct 2012 14:53:06 +0200 Subject: [PATCH 02/26] [IMP] ABN-AMRO: process SEPA feedback string [IMP] Framework: use bic info from transaction if available when creating bank --- account_banking/banking_import_transaction.py | 3 +- account_banking/wizard/banktools.py | 3 +- account_banking_nl_abnamro/abnamro.py | 35 ++++++++++++++++--- 3 files changed, 34 insertions(+), 7 deletions(-) diff --git a/account_banking/banking_import_transaction.py b/account_banking/banking_import_transaction.py index 330a0710d..7e84a5ff9 100644 --- a/account_banking/banking_import_transaction.py +++ b/account_banking/banking_import_transaction.py @@ -1319,7 +1319,8 @@ class banking_import_transaction(osv.osv): transaction.remote_owner, transaction.remote_owner_address, transaction.remote_owner_city, - country_code, results['log'] + country_code, results['log'], + bic=transaction.remote_bank_bic ) partner_banks = partner_bank_obj.browse( cr, uid, [partner_bank_id] diff --git a/account_banking/wizard/banktools.py b/account_banking/wizard/banktools.py index cebf60259..60ac532d3 100644 --- a/account_banking/wizard/banktools.py +++ b/account_banking/wizard/banktools.py @@ -318,7 +318,7 @@ def get_or_create_bank(pool, cursor, uid, bic, online=False, code=None, def create_bank_account(pool, cursor, uid, partner_id, account_number, holder_name, address, city, - country_code, log + country_code, log, bic=False, ): ''' Create a matching bank account with this holder for this partner. @@ -328,7 +328,6 @@ def create_bank_account(pool, cursor, uid, partner_id, owner_name = holder_name, ) bankcode = None - bic = None country_obj = pool.get('res.country') # Are we dealing with IBAN? diff --git a/account_banking_nl_abnamro/abnamro.py b/account_banking_nl_abnamro/abnamro.py index 8ae4e5824..e32fce902 100644 --- a/account_banking_nl_abnamro/abnamro.py +++ b/account_banking_nl_abnamro/abnamro.py @@ -88,6 +88,7 @@ class transaction(models.mem_bank_transaction): 'GIRO': bt.ORDER, 'INTL': bt.ORDER, # international order 'UNKN': bt.ORDER, # everything else + 'SEPA': bt.ORDER, } def __init__(self, line, *args, **kwargs): @@ -134,18 +135,34 @@ class transaction(models.mem_bank_transaction): size = 33 res = [] while(len(line) > col * size): - if line[col * size : (col + 1) * size - 1].strip(): - res.append(line[col * size : (col + 1) * size - 1]) + separation = (col + 1) * size - 1 + if line[col * size : separation].strip(): + part = line[col * size : separation] + # If the separation character is not a space, add it anyway + # presumably for sepa feedback strings only + if (len(line) > separation + and line[separation] != ' '): + part += line[separation] + res.append(part) col += 1 return res + def get_sepa_dict(field): + items = field[1:].split('/') # skip leading slash + sepa_dict = {} + while items: + sepa_dict[items.pop(0)] = items.pop(1).strip() + return sepa_dict + def parse_type(field): # here we process the first field, which identifies the statement type # and in case of certain types contains additional information transfer_type = 'UNKN' remote_account = False remote_owner = False - if field.startswith('GIRO '): + if field.startswith('/TRTP/'): + transfer_type = 'SEPA' + elif field.startswith('GIRO '): transfer_type = 'GIRO' # columns 6 to 14 contain the left or right aligned account number remote_account = field[:15].strip().zfill(10) @@ -176,8 +193,18 @@ class transaction(models.mem_bank_transaction): fields = split_blob(self.blob) (self.transfer_type, self.remote_account, self.remote_owner) = parse_type(fields[0]) + if self.transfer_type == 'SEPA': + sepa_dict = get_sepa_dict(''.join(fields)) + sepa_type = sepa_dict.get('TRTP') + if sepa_type != 'SEPA OVERBOEKING': + raise ValueError,_('Sepa transaction type %s not handled yet') + self.remote_account = sepa_dict.get('IBAN',False) + self.remote_bank_bic = sepa_dict.get('BIC', False) + self.remote_owner = sepa_dict.get('NAME', False) + self.reference = sepa_dict.get('REMI', False) + # extract other information depending on type - if self.transfer_type == 'GIRO': + elif self.transfer_type == 'GIRO': self.message = ' '.join(field.strip() for field in fields[1:]) elif self.transfer_type == 'BEA': From e2acb3ec928e13c28be225f43bf85552d35fcdb3 Mon Sep 17 00:00:00 2001 From: Stefan Rijnhart Date: Sat, 27 Oct 2012 21:13:25 +0200 Subject: [PATCH 03/26] [RFR] SEPA message string parts is known to contain its own separator --- account_banking_nl_abnamro/abnamro.py | 29 +++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/account_banking_nl_abnamro/abnamro.py b/account_banking_nl_abnamro/abnamro.py index e32fce902..da0bf2dee 100644 --- a/account_banking_nl_abnamro/abnamro.py +++ b/account_banking_nl_abnamro/abnamro.py @@ -148,10 +148,35 @@ class transaction(models.mem_bank_transaction): return res def get_sepa_dict(field): + """ + Parses a subset of SEPA feedback strings as occur + in this non-SEPA csv format. + + The string consists of slash separated KEY/VALUE pairs, + but the slash is allowed to and known to occur in VALUE as well! + """ items = field[1:].split('/') # skip leading slash sepa_dict = {} + prev_key = False + known_keys = ['TRTP', 'IBAN', 'BIC', 'NAME', 'RTRN', 'EREF', + 'SWOC', 'REMI', ] while items: - sepa_dict[items.pop(0)] = items.pop(1).strip() + if len(items) == 1: + raise osv.except_osv( + _('Error !'), + _("unable to parse SEPA string: %s") % field) + key = items.pop(0) + if key not in known_keys: + # either an unknown key or a value containing a slash + if prev_key: + sepa_dict[prev_key] = sepa_dict[prev_key] + '/' + key + else: + raise osv.except_osv( + _('Error !'), + _("unable to parse SEPA string: %s") % field) + else: + sepa_dict[key] = items.pop(0).strip() + prev_key = key return sepa_dict def parse_type(field): @@ -201,7 +226,7 @@ class transaction(models.mem_bank_transaction): self.remote_account = sepa_dict.get('IBAN',False) self.remote_bank_bic = sepa_dict.get('BIC', False) self.remote_owner = sepa_dict.get('NAME', False) - self.reference = sepa_dict.get('REMI', False) + self.reference = sepa_dict.get('REMI', '') # extract other information depending on type elif self.transfer_type == 'GIRO': From eeaa42e36805c5579fa8e76fa6ad7906293821a1 Mon Sep 17 00:00:00 2001 From: Stefan Rijnhart Date: Sat, 27 Oct 2012 21:53:50 +0200 Subject: [PATCH 04/26] [RFR] Improve parsing of GIRO transactions feedback string --- account_banking_nl_abnamro/abnamro.py | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/account_banking_nl_abnamro/abnamro.py b/account_banking_nl_abnamro/abnamro.py index da0bf2dee..8e951f22f 100644 --- a/account_banking_nl_abnamro/abnamro.py +++ b/account_banking_nl_abnamro/abnamro.py @@ -189,11 +189,16 @@ class transaction(models.mem_bank_transaction): transfer_type = 'SEPA' elif field.startswith('GIRO '): transfer_type = 'GIRO' - # columns 6 to 14 contain the left or right aligned account number - remote_account = field[:15].strip().zfill(10) - # column 15 contains a space - # columns 16 to 31 contain remote owner - remote_owner = field[16:32].strip() or False + # field has markup 'GIRO ACCOUNT OWNER' + # separated by clusters of space of varying size + account_match = re.match('\s*([0-9]+)\s(.*)$', field[5:]) + if account_match: + remote_account = account_match.group(1).zfill(10) + remote_owner = account_match.group(2).strip() or '' + else: + raise osv.except_osv( + _('Error !'), + _('unable to parse GIRO string: %s') % field) elif field.startswith('BEA '): transfer_type = 'BEA' # columns 6 to 16 contain the terminal identifier @@ -230,6 +235,10 @@ class transaction(models.mem_bank_transaction): # extract other information depending on type elif self.transfer_type == 'GIRO': + if not self.remote_owner and len(fields) > 1: + # OWNER is listed in the second field if not in the first + self.remote_owner = fields[1].strip() or False + fields = [fields[0]] + fields[2:] self.message = ' '.join(field.strip() for field in fields[1:]) elif self.transfer_type == 'BEA': @@ -271,11 +280,12 @@ class transaction(models.mem_bank_transaction): if not self.reference: # the reference is sometimes flagged by the prefix "BETALINGSKENM." # but can be any numeric line really - refexpr = re.compile("^\s*(BETALINGSKENM\.)?\s*([0-9]+ ?)+\s*$") for field in fields[1:]: - m = refexpr.match(field) + m = re.match( + "^\s*((BETALINGSKENM\.)|(ACCEPTGIRO))?\s*([0-9]+([ /][0-9]+)*)\s*$", + field) if m: - self.reference = m.group(2) + self.reference = m.group(4) break class statement(models.mem_bank_statement): From 1d06bd93b7a1ce6ffe70e25c069be81f2b6ba152 Mon Sep 17 00:00:00 2001 From: Stefan Rijnhart Date: Wed, 31 Oct 2012 16:20:18 +0100 Subject: [PATCH 05/26] [FIX] Use meaningful dates when converting currencies --- account_banking/banking_import_transaction.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/account_banking/banking_import_transaction.py b/account_banking/banking_import_transaction.py index 330a0710d..4b9589d7a 100644 --- a/account_banking/banking_import_transaction.py +++ b/account_banking/banking_import_transaction.py @@ -494,7 +494,7 @@ class banking_import_transaction(osv.osv): if from_curr_id != to_curr_id: amount_currency = statement_line_pool._convert_currency( cr, uid, from_curr_id, to_curr_id, move_line_amount, - round=True, date=time.strftime('%Y-%m-%d'), + round=True, date=transaction.move_line_id.date, context=context) else: amount_currency = move_line_amount @@ -1560,7 +1560,7 @@ class banking_import_transaction(osv.osv): from_curr_id = transaction.move_line_id.currency_id and transaction.move_line_id.currency_id.id or transaction.statement_id.company_id.currency_id.id if from_curr_id != to_curr_id: amount_currency = stline_pool._convert_currency(cr, uid, from_curr_id, to_curr_id, move_line_amount, round=True, - date=time.strftime('%Y-%m-%d'), context=context) + date=transaction.statement_line_id.date, context=context) else: amount_currency = move_line_amount sign = 1 From 8b9a62e1c8fd4ce6f9acc57cfcff41aa9bb4fa26 Mon Sep 17 00:00:00 2001 From: Stefan Rijnhart Date: Wed, 31 Oct 2012 16:22:37 +0100 Subject: [PATCH 06/26] [FIX] Removed unused import --- account_banking/banking_import_transaction.py | 1 - 1 file changed, 1 deletion(-) diff --git a/account_banking/banking_import_transaction.py b/account_banking/banking_import_transaction.py index 4b9589d7a..a8e14ac05 100644 --- a/account_banking/banking_import_transaction.py +++ b/account_banking/banking_import_transaction.py @@ -25,7 +25,6 @@ ############################################################################## from osv import osv, fields -import time import netsvc import base64 import datetime From 9fc4657d34c86c5db70e3536a4b74591d5ea1de4 Mon Sep 17 00:00:00 2001 From: Erwin van der Ploeg | Endian Solutions Date: Thu, 1 Nov 2012 18:25:16 +0100 Subject: [PATCH 07/26] [FIX] Update Dutch translations --- account_banking_nl_clieop/i18n/nl.po | 345 +++++++++++++++++++++ account_banking_nl_clieop/i18n/nl_NL.po | 395 ------------------------ 2 files changed, 345 insertions(+), 395 deletions(-) create mode 100644 account_banking_nl_clieop/i18n/nl.po delete mode 100644 account_banking_nl_clieop/i18n/nl_NL.po diff --git a/account_banking_nl_clieop/i18n/nl.po b/account_banking_nl_clieop/i18n/nl.po new file mode 100644 index 000000000..0b60f0b7d --- /dev/null +++ b/account_banking_nl_clieop/i18n/nl.po @@ -0,0 +1,345 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * account_banking_nl_clieop +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 6.1\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-11-01 16:23+0000\n" +"PO-Revision-Date: 2012-11-01 18:11+0100\n" +"Last-Translator: Erwin van der Ploeg | Endian Solutions " +"\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: \n" +"X-Generator: Poedit 1.5.4\n" + +#. module: account_banking_nl_clieop +#: selection:banking.export.clieop.wizard,batchtype:0 +msgid "Direct Debits" +msgstr "Incasso opdrachten" + +#. module: account_banking_nl_clieop +#: code:addons\account_banking_nl_clieop\account_banking_nl_clieop.py:39 +#: code:addons\account_banking_nl_clieop\wizard\export_clieop.py:94 +#: selection:banking.export.clieop,testcode:0 +#: selection:banking.export.clieop.wizard,testcode:0 +#, python-format +msgid "No" +msgstr "Nee" + +#. module: account_banking_nl_clieop +#: code:addons\account_banking_nl_clieop\wizard\export_clieop.py:290 +#, python-format +msgid "There is insufficient information" +msgstr "Er is onvoldoende informatie" + +#. module: account_banking_nl_clieop +#: view:banking.export.clieop.wizard:0 +#: selection:banking.export.clieop.wizard,state:0 +msgid "Create" +msgstr "Nieuw" + +#. module: account_banking_nl_clieop +#: field:banking.export.clieop,no_transactions:0 +#: field:banking.export.clieop.wizard,no_transactions:0 +msgid "Number of Transactions" +msgstr "Aantal transacties" + +#. module: account_banking_nl_clieop +#: code:addons\account_banking_nl_clieop\wizard\export_clieop.py:211 +#, python-format +msgid "You can't create ClieOp orders more than 30 days in advance." +msgstr "" +"Het is niet mogelijk een ClieOp betaalopdracht te maken, 30 dagen van te " +"voren." + +#. module: account_banking_nl_clieop +#: field:banking.export.clieop,state:0 +#: field:banking.export.clieop.wizard,state:0 +msgid "State" +msgstr "Status" + +#. module: account_banking_nl_clieop +#: help:banking.export.clieop.wizard,test:0 +msgid "" +"Select this if you want your bank to run a test process rather then execute " +"your orders for real." +msgstr "" +"Selecteer dit indien u wilt dat uw bank een test uitvoert in plaats van een " +"werkelijke verwerking." + +#. module: account_banking_nl_clieop +#: field:banking.export.clieop,identification:0 +#: field:banking.export.clieop.wizard,identification:0 +msgid "Identification" +msgstr "Identificatie" + +#. module: account_banking_nl_clieop +#: view:banking.export.clieop:0 +msgid "Processing Information" +msgstr "Verwerkingsinformatie" + +#. module: account_banking_nl_clieop +#: help:banking.export.clieop.wizard,fixed_message:0 +msgid "" +"A fixed message to apply to all transactions in addition to the individual " +"messages." +msgstr "" +"Een vast bericht dat alle transacties betreft, als toevoeging op de " +"Individuele berichten." + +#. module: account_banking_nl_clieop +#: model:ir.model,name:account_banking_nl_clieop.model_banking_export_clieop +msgid "banking.export.clieop" +msgstr "banking.export.clieop" + +#. module: account_banking_nl_clieop +#: field:banking.export.clieop,check_no_accounts:0 +#: field:banking.export.clieop.wizard,check_no_accounts:0 +msgid "Check Number Accounts" +msgstr "Controlegetal rekeningen" + +#. module: account_banking_nl_clieop +#: field:banking.export.clieop.wizard,batchtype:0 +msgid "Type" +msgstr "Type" + +#. module: account_banking_nl_clieop +#: selection:banking.export.clieop,state:0 +msgid "Sent" +msgstr "Verzonden" + +#. module: account_banking_nl_clieop +#: view:banking.export.clieop:0 +msgid "ClieOp Information" +msgstr "ClieOp-informatie" + +#. module: account_banking_nl_clieop +#: view:banking.export.clieop.wizard:0 +#: selection:banking.export.clieop.wizard,state:0 +msgid "Finish" +msgstr "Gereed" + +#. module: account_banking_nl_clieop +#: code:addons\account_banking_nl_clieop\wizard\export_clieop.py:216 +#, python-format +msgid "You can only combine payment orders of the same type" +msgstr "U kunt alleen maar betaalopdrachten van hetzelfde type combineren." + +#. module: account_banking_nl_clieop +#: selection:banking.export.clieop,filetype:0 +#: selection:banking.export.clieop.wizard,filetype:0 +msgid "Salary Payment Batch" +msgstr "Salarisbetalingsbatch" + +#. module: account_banking_nl_clieop +#: selection:banking.export.clieop,state:0 +msgid "Reconciled" +msgstr "Afgeletterd" + +#. module: account_banking_nl_clieop +#: code:addons\account_banking_nl_clieop\wizard\export_clieop.py:252 +#, python-format +msgid "Your bank account has to have a valid account number" +msgstr "Uw bankrekening moet een geldig rekeningnummer hebben." + +#. module: account_banking_nl_clieop +#: view:banking.export.clieop.wizard:0 +msgid "Reference for further communication" +msgstr "Referentie voor verdere communicatie" + +#. module: account_banking_nl_clieop +#: field:banking.export.clieop,duplicates:0 +msgid "Number of Duplicates" +msgstr "Aantal duplicaten" + +#. module: account_banking_nl_clieop +#: help:banking.export.clieop.wizard,reference:0 +msgid "" +"The bank will use this reference in feedback communication to refer to this " +"run. Only five characters are available." +msgstr "" +"De bank zal deze referentie gebruiken in de teruggekoppelde communicatie " +"betreffende deze batch. Er zijn maar 5 karakters beschikbaar." + +#. module: account_banking_nl_clieop +#: view:banking.export.clieop.wizard:0 +msgid "Processing Details" +msgstr "Verwerking details" + +#. module: account_banking_nl_clieop +#: field:banking.export.clieop,testcode:0 +#: field:banking.export.clieop.wizard,test:0 +#: field:banking.export.clieop.wizard,testcode:0 +msgid "Test Run" +msgstr "Testverwerking" + +#. module: account_banking_nl_clieop +#: selection:banking.export.clieop,filetype:0 +#: selection:banking.export.clieop.wizard,filetype:0 +msgid "Direct Debit Batch" +msgstr "Incassobatch" + +#. module: account_banking_nl_clieop +#: field:banking.export.clieop,prefered_date:0 +#: field:banking.export.clieop.wizard,prefered_date:0 +msgid "Prefered Processing Date" +msgstr "Gewenste verwerkingsdatum" + +#. module: account_banking_nl_clieop +#: field:banking.export.clieop,file:0 +#: field:banking.export.clieop.wizard,file_id:0 +msgid "ClieOp File" +msgstr "ClieOp-bestand" + +#. module: account_banking_nl_clieop +#: field:banking.export.clieop.wizard,file:0 +msgid "File" +msgstr "Bestand" + +#. module: account_banking_nl_clieop +#: code:addons\account_banking_nl_clieop\wizard\export_clieop.py:312 +#, python-format +msgid "You cannot send international bank transfers through ClieOp3!" +msgstr "" +"Het is niet mogelijk om een internationale betaling te doen met behulp van " +"ClieOp3!" + +#. module: account_banking_nl_clieop +#: field:banking.export.clieop.wizard,execution_date:0 +msgid "Execution Date" +msgstr "Uitvoeringsdatum" + +#. module: account_banking_nl_clieop +#: field:banking.export.clieop.wizard,fixed_message:0 +msgid "Fixed Message" +msgstr "Vast bericht" + +#. module: account_banking_nl_clieop +#: field:banking.export.clieop,filetype:0 +#: field:banking.export.clieop.wizard,filetype:0 +msgid "File Type" +msgstr "Bestandsformaat" + +#. module: account_banking_nl_clieop +#: model:ir.actions.act_window,name:account_banking_nl_clieop.act_banking_export_clieop_payment_order +#: model:ir.actions.act_window,name:account_banking_nl_clieop.action_account_banking_clieops +#: model:ir.ui.menu,name:account_banking_nl_clieop.menu_action_account_banking_exported_clieop_files +msgid "Generated ClieOp3 Files" +msgstr "Gegenereerde ClieOp3-bestanden" + +#. module: account_banking_nl_clieop +#: selection:banking.export.clieop.wizard,batchtype:0 +msgid "Payments" +msgstr "Betalingen" + +#. module: account_banking_nl_clieop +#: code:addons\account_banking_nl_clieop\wizard\export_clieop.py:210 +#: code:addons\account_banking_nl_clieop\wizard\export_clieop.py:215 +#: code:addons\account_banking_nl_clieop\wizard\export_clieop.py:251 +#: code:addons\account_banking_nl_clieop\wizard\export_clieop.py:289 +#: code:addons\account_banking_nl_clieop\wizard\export_clieop.py:311 +#, python-format +msgid "Error" +msgstr "Fout" + +#. module: account_banking_nl_clieop +#: selection:banking.export.clieop.wizard,batchtype:0 +msgid "Salary Payments" +msgstr "Salaris betalingen" + +#. module: account_banking_nl_clieop +#: code:addons\account_banking_nl_clieop\wizard\export_clieop.py:348 +#: view:banking.export.clieop:0 view:banking.export.clieop.wizard:0 +#: model:ir.model,name:account_banking_nl_clieop.model_banking_export_clieop_wizard +#, python-format +msgid "Client Opdrachten Export" +msgstr "Betaalopdrachten export" + +#. module: account_banking_nl_clieop +#: view:banking.export.clieop.wizard:0 +msgid "Additional message for all transactions" +msgstr "Additionele berichten voor alle transacties" + +#. module: account_banking_nl_clieop +#: help:banking.export.clieop.wizard,execution_date:0 +msgid "" +"This is the date the file should be processed by the bank. Don't choose a " +"date beyond the nearest date in your payments. The latest allowed date is 30 " +"days from now.\n" +"Please keep in mind that banks only execute on working days and typically " +"use a delay of two days between execution date and effective transfer date." +msgstr "" +"Dit si de datum waarop het bestand moet worden verwerkt door de bank. Kies " +"geen datum verder dan de dichtsbijzijnde datum in uw betalingen. De laatst " +"toegestane datum is 30 fagen vanaf nu. \n" +"Houd u er rekening mee dat banken alleen bestanden verwerken op werkdagen en " +"normaliter een vertraging hanteren van twee dagen tussen de uitvoeringsdatum " +"en de effectieve overboekingsdatum." + +#. module: account_banking_nl_clieop +#: field:banking.export.clieop,total_amount:0 +#: field:banking.export.clieop.wizard,total_amount:0 +msgid "Total Amount" +msgstr "Totaalbedrag" + +#. module: account_banking_nl_clieop +#: field:banking.export.clieop.wizard,reference:0 +msgid "Reference" +msgstr "Referentie" + +#. module: account_banking_nl_clieop +#: view:banking.export.clieop:0 +msgid "Payment order" +msgstr "Betaalopdracht" + +#. module: account_banking_nl_clieop +#: view:banking.export.clieop:0 +#: field:banking.export.clieop,payment_order_ids:0 +#: field:banking.export.clieop.wizard,payment_order_ids:0 +msgid "Payment Orders" +msgstr "Betalingsopdrachten" + +#. module: account_banking_nl_clieop +#: view:banking.export.clieop:0 +msgid "General Information" +msgstr "Algemene informatie" + +#. module: account_banking_nl_clieop +#: field:banking.export.clieop,daynumber:0 +msgid "ClieOp Transaction nr of the Day" +msgstr "ClieOp dagtransactienummer" + +#. module: account_banking_nl_clieop +#: view:banking.export.clieop.wizard:0 +msgid "Cancel" +msgstr "Annuleren" + +#. module: account_banking_nl_clieop +#: selection:banking.export.clieop,state:0 +msgid "Draft" +msgstr "Concept" + +#. module: account_banking_nl_clieop +#: code:addons\account_banking_nl_clieop\account_banking_nl_clieop.py:39 +#: code:addons\account_banking_nl_clieop\wizard\export_clieop.py:94 +#: selection:banking.export.clieop,testcode:0 +#: selection:banking.export.clieop.wizard,testcode:0 +#, python-format +msgid "Yes" +msgstr "Ja" + +#. module: account_banking_nl_clieop +#: selection:banking.export.clieop,filetype:0 +#: selection:banking.export.clieop.wizard,filetype:0 +msgid "Payment Batch" +msgstr "Betalingsbatch" + +#. module: account_banking_nl_clieop +#: field:banking.export.clieop,date_generated:0 +msgid "Generation Date" +msgstr "Aanmaakdatum" diff --git a/account_banking_nl_clieop/i18n/nl_NL.po b/account_banking_nl_clieop/i18n/nl_NL.po deleted file mode 100644 index 56d088ae8..000000000 --- a/account_banking_nl_clieop/i18n/nl_NL.po +++ /dev/null @@ -1,395 +0,0 @@ -# Translation of OpenERP Server. -# This file contains the translation of the following modules: -# * account_banking_nl_clieop -# -msgid "" -msgstr "" -"Project-Id-Version: OpenERP Server 5.0.7\n" -"Report-Msgid-Bugs-To: support@openerp.com\n" -"POT-Creation-Date: 2011-02-12 13:29:33+0000\n" -"PO-Revision-Date: 2010-01-07 22:22:23+0000\n" -"Last-Translator: <>\n" -"Language-Team: \n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: \n" - -#. module: account_banking_nl_clieop -#: constraint:ir.model:0 -msgid "" -"The Object name must start with x_ and not contain any special character !" -msgstr "" -"De objectnaam moet beginnen met x_ en mag geen speciale karakters bevatten !" - -#. module: account_banking_nl_clieop -#: selection:account_banking_nl_clieop.banking_export_clieop,init,batchtype:0 -msgid "Direct Debits" -msgstr "Incasso-batch" - -#. module: account_banking_nl_clieop -#: code:addons/account_banking_nl_clieop/wizard/export_clieop.py:0 -#, python-format -msgid "" -"There is insufficient information.\r\n" -"'\n" -" 'Both destination address and account '\n" -" 'number must be provided" -msgstr "" -"Er is onvoldoende informatie.\r\n" -"'\n" -" 'Zowel begunstigde als extern rekeningnummer '\n" -" 'dienen bekende te zijn" - -#. module: account_banking_nl_clieop -#: selection:account_banking_nl_clieop.banking_export_clieop,create,testcode:0 -#: code:addons/account_banking_nl_clieop/account_banking_nl_clieop.py:0 -#: code:addons/account_banking_nl_clieop/wizard/export_clieop.py:0 -#: selection:banking.export.clieop,testcode:0 -#, python-format -msgid "No" -msgstr "Nee" - -#. module: account_banking_nl_clieop -#: model:ir.module.module,shortdesc:account_banking_nl_clieop.module_meta_information -msgid "Account Banking NL ClieOp" -msgstr "Account Banking NL ClieOp" - -#. module: account_banking_nl_clieop -#: wizard_field:account_banking_nl_clieop.banking_export_clieop,create,no_transactions:0 -#: field:banking.export.clieop,no_transactions:0 -msgid "Number of Transactions" -msgstr "Aantal transacties" - -#. module: account_banking_nl_clieop -#: model:ir.actions.wizard,name:account_banking_nl_clieop.wizard_account_banking_export_clieop -msgid "Export ClieOp File" -msgstr "Exporteer ClieOp-bestand" - -#. module: account_banking_nl_clieop -#: wizard_field:account_banking_nl_clieop.banking_export_clieop,create,prefered_date:0 -#: field:banking.export.clieop,prefered_date:0 -msgid "Prefered Processing Date" -msgstr "Gewenste verwerkingsdatum" - -#. module: account_banking_nl_clieop -#: model:payment.type,name:account_banking_nl_clieop.export_clieop_pay -msgid "ClieOp3 Payment Batch" -msgstr "ClieOp3 betalingsbatch" - -#. module: account_banking_nl_clieop -#: field:banking.export.clieop,state:0 -msgid "State" -msgstr "Status" - -#. module: account_banking_nl_clieop -#: help:account_banking_nl_clieop.banking_export_clieop,init,test:0 -msgid "" -"Select this if you want your bank to run a test process rather then execute " -"your orders for real." -msgstr "" -"Kies dit als u wilt dat de bank een testrun draait in plaats van uw " -"opdrachten te verwerken." - -#. module: account_banking_nl_clieop -#: selection:banking.export.clieop,state:0 -msgid "Draft" -msgstr "Concept" - -#. module: account_banking_nl_clieop -#: view:banking.export.clieop:0 -msgid "Processing Information" -msgstr "Verwerkingsinformatie" - -#. module: account_banking_nl_clieop -#: help:account_banking_nl_clieop.banking_export_clieop,init,fixed_message:0 -msgid "" -"A fixed message to apply to all transactions in addition to the individual " -"messages." -msgstr "" -"Een vast bericht om toe te voegen aan alle transacties in toevoeging op de " -"individuele berichten." - -#. module: account_banking_nl_clieop -#: wizard_field:account_banking_nl_clieop.banking_export_clieop,create,check_no_accounts:0 -#: field:banking.export.clieop,check_no_accounts:0 -msgid "Check Number Accounts" -msgstr "Controlegetal rekeningen" - -#. module: account_banking_nl_clieop -#: constraint:ir.actions.act_window:0 -msgid "Invalid model name in the action definition." -msgstr "Ongeldige naam in actie-definitie." - -#. module: account_banking_nl_clieop -#: wizard_button:account_banking_nl_clieop.banking_export_clieop,create,save:0 -msgid "Save" -msgstr "Opslaan" - -#. module: account_banking_nl_clieop -#: wizard_field:account_banking_nl_clieop.banking_export_clieop,init,batchtype:0 -msgid "Type" -msgstr "Soort" - -#. module: account_banking_nl_clieop -#: selection:banking.export.clieop,state:0 -msgid "Sent" -msgstr "Verzonden" - -#. module: account_banking_nl_clieop -#: wizard_field:account_banking_nl_clieop.banking_export_clieop,create,log:0 -msgid "Log" -msgstr "Log" - -#. module: account_banking_nl_clieop -#: view:banking.export.clieop:0 -msgid "ClieOp Information" -msgstr "ClieOp-informatie" - -#. module: account_banking_nl_clieop -#: model:ir.model,name:account_banking_nl_clieop.model_banking_export_clieop -msgid "ClieOp3 Export" -msgstr "ClieOp3-export" - -#. module: account_banking_nl_clieop -#: code:addons/account_banking_nl_clieop/wizard/export_clieop.py:0 -#, python-format -msgid "You can only combine payment orders of the same type" -msgstr "U kunt alleen betalingsopdrachten van dezelfde soort combineren" - -#. module: account_banking_nl_clieop -#: selection:account_banking_nl_clieop.banking_export_clieop,create,filetype:0 -#: selection:banking.export.clieop,filetype:0 -msgid "Salary Payment Batch" -msgstr "Salarisbetalingsbatch" - -#. module: account_banking_nl_clieop -#: selection:banking.export.clieop,state:0 -msgid "Reconciled" -msgstr "Afgeletterd" - -#. module: account_banking_nl_clieop -#: code:addons/account_banking_nl_clieop/wizard/export_clieop.py:0 -#, python-format -msgid "Your bank account has to have a valid account number" -msgstr "Uw bankrekening dient een geldig rekeningnummer te hebben" - -#. module: account_banking_nl_clieop -#: wizard_view:account_banking_nl_clieop.banking_export_clieop,init:0 -msgid "Reference for further communication" -msgstr "Referentie voor verdere communicatie" - -#. module: account_banking_nl_clieop -#: field:banking.export.clieop,duplicates:0 -msgid "Number of Duplicates" -msgstr "Aantal duplicaten" - -#. module: account_banking_nl_clieop -#: help:account_banking_nl_clieop.banking_export_clieop,init,reference:0 -msgid "" -"The bank will use this reference in feedback communication to refer to this " -"run. Only five characters are available." -msgstr "" -"De bank zal dit gebruiken in terugkoppelingsberichten om te referen aan deze " -"verwerking. Slechts vijf tekens zijn beschikbaar." - -#. module: account_banking_nl_clieop -#: wizard_view:account_banking_nl_clieop.banking_export_clieop,init:0 -msgid "Processing Details" -msgstr "Verwerkingsdetails" - -#. module: account_banking_nl_clieop -#: model:payment.type,name:account_banking_nl_clieop.export_clieop_sal -msgid "ClieOp3 Salary Payment Batch" -msgstr "ClieOp3 salarisverwerking" - -#. module: account_banking_nl_clieop -#: wizard_button:account_banking_nl_clieop.banking_export_clieop,init,create:0 -msgid "Create" -msgstr "Maak" - -#. module: account_banking_nl_clieop -#: selection:account_banking_nl_clieop.banking_export_clieop,create,filetype:0 -#: selection:banking.export.clieop,filetype:0 -msgid "Direct Debit Batch" -msgstr "Incassobatch" - -#. module: account_banking_nl_clieop -#: constraint:ir.ui.view:0 -msgid "Invalid XML for View Architecture!" -msgstr "Ongeldige XML voor overzicht" - -#. module: account_banking_nl_clieop -#: wizard_field:account_banking_nl_clieop.banking_export_clieop,create,file:0 -#: field:banking.export.clieop,file:0 -msgid "ClieOp File" -msgstr "ClieOp-bestand" - -#. module: account_banking_nl_clieop -#: code:addons/account_banking_nl_clieop/wizard/export_clieop.py:0 -#, python-format -msgid "" -"You cannot send international bank transfers '\n" -" 'through ClieOp3!" -msgstr "" -"U kunt geen internationale betalingen met ClieOp3'\n" -" ' insturen!" - -#. module: account_banking_nl_clieop -#: code:addons/account_banking_nl_clieop/wizard/export_clieop.py:0 -#, python-format -msgid "You can\'t create ClieOp orders more than 30 days in advance." -msgstr "U kunt geen ClieOp opdrachten aanmaken voor meer dan 30 dagen vooruit." - -#. module: account_banking_nl_clieop -#: wizard_field:account_banking_nl_clieop.banking_export_clieop,init,execution_date:0 -msgid "Execution Date" -msgstr "Uitvoeringsdatum" - -#. module: account_banking_nl_clieop -#: wizard_field:account_banking_nl_clieop.banking_export_clieop,init,fixed_message:0 -msgid "Fixed Message" -msgstr "Vast bericht" - -#. module: account_banking_nl_clieop -#: wizard_field:account_banking_nl_clieop.banking_export_clieop,create,filetype:0 -#: field:banking.export.clieop,filetype:0 -msgid "File Type" -msgstr "Bestandsformaat" - -#. module: account_banking_nl_clieop -#: model:payment.type,name:account_banking_nl_clieop.export_clieop_inc -msgid "ClieOp3 Direct Debit Batch" -msgstr "ClieOp3 incassoverwerking" - -#. module: account_banking_nl_clieop -#: wizard_field:account_banking_nl_clieop.banking_export_clieop,create,testcode:0 -#: wizard_field:account_banking_nl_clieop.banking_export_clieop,init,test:0 -#: field:banking.export.clieop,testcode:0 -msgid "Test Run" -msgstr "Testverwerking" - -#. module: account_banking_nl_clieop -#: selection:account_banking_nl_clieop.banking_export_clieop,init,batchtype:0 -msgid "Payments" -msgstr "Betalingen" - -#. module: account_banking_nl_clieop -#: code:addons/account_banking_nl_clieop/wizard/export_clieop.py:0 -#, python-format -msgid "Error" -msgstr "Fout" - -#. module: account_banking_nl_clieop -#: selection:account_banking_nl_clieop.banking_export_clieop,init,batchtype:0 -msgid "Salary Payments" -msgstr "Salarisbetalingen" - -#. module: account_banking_nl_clieop -#: wizard_view:account_banking_nl_clieop.banking_export_clieop,create:0 -#: wizard_view:account_banking_nl_clieop.banking_export_clieop,init:0 -#: view:banking.export.clieop:0 -msgid "Client Opdrachten Export" -msgstr "Client Opdrachten Export" - -#. module: account_banking_nl_clieop -#: wizard_view:account_banking_nl_clieop.banking_export_clieop,init:0 -msgid "Additional message for all transactions" -msgstr "Toegevoegd bericht voor alle transacties" - -#. module: account_banking_nl_clieop -#: model:ir.actions.act_window,name:account_banking_nl_clieop.action_account_banking_clieops -#: model:ir.ui.menu,name:account_banking_nl_clieop.menu_action_account_banking_exported_clieop_files -msgid "Generated ClieOp3 Files" -msgstr "Gegenereerde ClieOp3-bestanden" - -#. module: account_banking_nl_clieop -#: model:ir.module.module,description:account_banking_nl_clieop.module_meta_information -msgid "" -"\n" -" Module to export payment orders in ClieOp format.\n" -"\n" -" ClieOp format is used by Dutch banks to batch national bank transfers.\n" -" This module uses the account_banking logic.\n" -" " -msgstr "" -"\n" -" Module voor het exporteren van betalingsopdrachten in ClieOp-formaat.\n" -"\n" -" ClieOp-formaat wordt gebruikt door Nederlandse banks voor " -"batchverwerking van national banktransacties.\n" -" Deze module gebruikt de account_banking logica.\n" -" " - -#. module: account_banking_nl_clieop -#: wizard_field:account_banking_nl_clieop.banking_export_clieop,init,reference:0 -msgid "Reference" -msgstr "Referentie" - -#. module: account_banking_nl_clieop -#: help:account_banking_nl_clieop.banking_export_clieop,init,execution_date:0 -msgid "" -"This is the date the file should be processed by the bank. Don't choose a " -"date beyond the nearest date in your payments. The latest allowed date is 30 " -"days from now.\n" -"Please keep in mind that banks only execute on working days and typically " -"use a delay of two days between execution date and effective transfer date." -msgstr "" -"Dit is de datum dat het bestand verwerkt dient te worden door de bank. Kies " -"geen datum verder dan 30 dagen vooruit.\n" -"Onthoud dat veel banken in alleen verwerken op werkdagen en dat er doorgaans " -"twee dagen vertraging zit tussen verwerkingsdatum en effectieve datum.\n" - -#. module: account_banking_nl_clieop -#: field:banking.export.clieop,payment_order_ids:0 -msgid "Payment Orders" -msgstr "Betalingsopdrachten" - -#. module: account_banking_nl_clieop -#: view:banking.export.clieop:0 -msgid "General Information" -msgstr "Algemene informatie" - -#. module: account_banking_nl_clieop -#: wizard_field:account_banking_nl_clieop.banking_export_clieop,create,total_amount:0 -#: field:banking.export.clieop,total_amount:0 -msgid "Total Amount" -msgstr "Totaalbedrag" - -#. module: account_banking_nl_clieop -#: field:banking.export.clieop,daynumber:0 -msgid "ClieOp Transaction nr of the Day" -msgstr "ClieOp dagtransactienummer" - -#. module: account_banking_nl_clieop -#: wizard_button:account_banking_nl_clieop.banking_export_clieop,create,cancel:0 -#: wizard_button:account_banking_nl_clieop.banking_export_clieop,init,end:0 -msgid "Cancel" -msgstr "Annuleren" - -#. module: account_banking_nl_clieop -#: wizard_field:account_banking_nl_clieop.banking_export_clieop,create,identification:0 -#: field:banking.export.clieop,identification:0 -msgid "Identification" -msgstr "Identificatie" - -#. module: account_banking_nl_clieop -#: selection:account_banking_nl_clieop.banking_export_clieop,create,testcode:0 -#: code:addons/account_banking_nl_clieop/account_banking_nl_clieop.py:0 -#: code:addons/account_banking_nl_clieop/wizard/export_clieop.py:0 -#: selection:banking.export.clieop,testcode:0 -#, python-format -msgid "Yes" -msgstr "Ja" - -#. module: account_banking_nl_clieop -#: selection:account_banking_nl_clieop.banking_export_clieop,create,filetype:0 -#: selection:banking.export.clieop,filetype:0 -msgid "Payment Batch" -msgstr "Betalingsbatch" - -#. module: account_banking_nl_clieop -#: field:banking.export.clieop,date_generated:0 -msgid "Generation Date" -msgstr "Aanmaakdatum" From 4a9da30c1bd3a488315aef9ded6c5bf53e0f504c Mon Sep 17 00:00:00 2001 From: Stefan Rijnhart Date: Thu, 1 Nov 2012 18:36:07 +0100 Subject: [PATCH 08/26] [FIX] Translation of 'Create' according to OpenERP defaults --- account_banking_nl_clieop/i18n/nl.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_banking_nl_clieop/i18n/nl.po b/account_banking_nl_clieop/i18n/nl.po index 0b60f0b7d..fba6a514a 100644 --- a/account_banking_nl_clieop/i18n/nl.po +++ b/account_banking_nl_clieop/i18n/nl.po @@ -41,7 +41,7 @@ msgstr "Er is onvoldoende informatie" #: view:banking.export.clieop.wizard:0 #: selection:banking.export.clieop.wizard,state:0 msgid "Create" -msgstr "Nieuw" +msgstr "Aanmaken" #. module: account_banking_nl_clieop #: field:banking.export.clieop,no_transactions:0 From c8ff9764726e4858c9fb95cbb5b303ab22027728 Mon Sep 17 00:00:00 2001 From: Stefan Rijnhart Date: Mon, 12 Nov 2012 13:09:48 +0100 Subject: [PATCH 09/26] [ADD] module bank_statement_instant_voucher --- bank_statement_instant_voucher/__init__.py | 1 + bank_statement_instant_voucher/__openerp__.py | 56 ++++ bank_statement_instant_voucher/i18n/nl.po | 158 ++++++++++ .../model/__init__.py | 2 + .../model/account_bank_statement_line.py | 48 +++ .../model/account_voucher_instant.py | 273 ++++++++++++++++++ .../view/account_bank_statement_line.xml | 21 ++ .../view/account_voucher_instant.xml | 48 +++ 8 files changed, 607 insertions(+) create mode 100644 bank_statement_instant_voucher/__init__.py create mode 100644 bank_statement_instant_voucher/__openerp__.py create mode 100644 bank_statement_instant_voucher/i18n/nl.po create mode 100644 bank_statement_instant_voucher/model/__init__.py create mode 100644 bank_statement_instant_voucher/model/account_bank_statement_line.py create mode 100644 bank_statement_instant_voucher/model/account_voucher_instant.py create mode 100644 bank_statement_instant_voucher/view/account_bank_statement_line.xml create mode 100644 bank_statement_instant_voucher/view/account_voucher_instant.xml diff --git a/bank_statement_instant_voucher/__init__.py b/bank_statement_instant_voucher/__init__.py new file mode 100644 index 000000000..16e8b082f --- /dev/null +++ b/bank_statement_instant_voucher/__init__.py @@ -0,0 +1 @@ +import model diff --git a/bank_statement_instant_voucher/__openerp__.py b/bank_statement_instant_voucher/__openerp__.py new file mode 100644 index 000000000..5a811d541 --- /dev/null +++ b/bank_statement_instant_voucher/__openerp__.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# This module copyright (C) 2012 Therp BV (). +# +# 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 . +# +############################################################################## +{ + "name": "Bank statement instant voucher", + "version": "1.0r028", + "author": "Therp BV", + "category": 'Base', + 'complexity': "normal", + "description": """ +This module adds a new button on the bank statement line that allows the +accountant to instantly create a sales or purchase voucher based on the +values of the bank statement line. + +This module does not depend on account_banking, but if this module is +installed, the bank statement line will be reconciled automatically +in the confirmation step of the wizard. + +If account_banking is not installed, the accountant will still have to +reconcile the associated move line with the move line from the bank +statement line manually. + +If the wizard is cancelled,the created voucher will be deleted again. + +Known limitations: + +Currency conversion and payment difference writeoff are not yet +supported. + """, + 'website': 'http://therp.nl', + 'images': [], + 'depends': ['account_voucher'], + 'data': [ + 'view/account_voucher_instant.xml', + 'view/account_bank_statement_line.xml', + ], + "license": 'AGPL-3', +} +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/bank_statement_instant_voucher/i18n/nl.po b/bank_statement_instant_voucher/i18n/nl.po new file mode 100644 index 000000000..d6cfa507e --- /dev/null +++ b/bank_statement_instant_voucher/i18n/nl.po @@ -0,0 +1,158 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * bank_statement_instant_voucher +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 6.1\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-11-12 10:42+0000\n" +"PO-Revision-Date: 2012-11-12 10:42+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: bank_statement_instant_voucher +#: view:account.voucher.instant:0 +msgid "Confirm" +msgstr "Bevestig" + +#. module: bank_statement_instant_voucher +#: code:addons/bank_statement_instant_voucher/model/account_voucher_instant.py:71 +#, python-format +msgid "Voucher for statement line %s.%s" +msgstr "Journaalbon voor bankafschrift %s.%s" + +#. module: bank_statement_instant_voucher +#: field:account.voucher.instant,state:0 +msgid "State" +msgstr "Status" + +#. module: bank_statement_instant_voucher +#: code:addons/bank_statement_instant_voucher/model/account_voucher_instant.py:201 +#, python-format +msgid "The voucher could not be posted." +msgstr "De journaalbon kon niet worden bevestigd." + +#. module: bank_statement_instant_voucher +#: selection:account.voucher.instant,state:0 +msgid "ready" +msgstr "ready" + +#. module: bank_statement_instant_voucher +#: model:ir.model,name:bank_statement_instant_voucher.model_account_voucher_instant +msgid "Instant Voucher" +msgstr "Instant journaalbon" + +#. module: bank_statement_instant_voucher +#: selection:account.voucher.instant,state:0 +msgid "confirm" +msgstr "confirm" + +#. module: bank_statement_instant_voucher +#: view:account.bank.statement:0 +#: model:ir.actions.act_window,name:bank_statement_instant_voucher.act_instant_voucher +msgid "Create matching voucher" +msgstr "Bijpassende journaalbon aanmaken" + +#. module: bank_statement_instant_voucher +#: code:addons/bank_statement_instant_voucher/model/account_voucher_instant.py:137 +#, python-format +msgid "Cannot determine statement line" +msgstr "Kan de bankafschriftregel niet afleiden" + +#. module: bank_statement_instant_voucher +#: selection:account.voucher.instant,state:0 +msgid "init" +msgstr "init" + +#. module: bank_statement_instant_voucher +#: code:addons/bank_statement_instant_voucher/model/account_voucher_instant.py:209 +#, python-format +msgid "The voucher's move line could not be posted." +msgstr "De journaalposten van de journaalbon konden niet geboekt worden" + +#. module: bank_statement_instant_voucher +#: model:ir.model,name:bank_statement_instant_voucher.model_account_bank_statement_line +msgid "Bank Statement Line" +msgstr "Bankafschriftregel" + +#. module: bank_statement_instant_voucher +#: view:account.voucher.instant:0 +msgid "Create voucher" +msgstr "Journaalbon aanmaken" + +#. module: bank_statement_instant_voucher +#: code:addons/bank_statement_instant_voucher/model/account_voucher_instant.py:214 +#, python-format +msgid "The amount on the bank statement line needs to be the same as on the voucher. Write-off is not yet supported." +msgstr "Het bedrag op het bankafschrift dient gelijk te zijn aan het bedrag op de journaalbon. Afschrijven is nog niet ondersteund." + +#. module: bank_statement_instant_voucher +#: code:addons/bank_statement_instant_voucher/model/account_voucher_instant.py:59 +#: code:addons/bank_statement_instant_voucher/model/account_voucher_instant.py:136 +#: code:addons/bank_statement_instant_voucher/model/account_voucher_instant.py:190 +#: code:addons/bank_statement_instant_voucher/model/account_voucher_instant.py:200 +#: code:addons/bank_statement_instant_voucher/model/account_voucher_instant.py:208 +#: code:addons/bank_statement_instant_voucher/model/account_voucher_instant.py:213 +#: code:addons/bank_statement_instant_voucher/model/account_voucher_instant.py:224 +#, python-format +msgid "Error" +msgstr "Fout" + +#. module: bank_statement_instant_voucher +#: code:addons/bank_statement_instant_voucher/model/account_voucher_instant.py:60 +#, python-format +msgid "No %s journal defined" +msgstr "Geen %s-dagboek ingesteld" + +#. module: bank_statement_instant_voucher +#: constraint:account.bank.statement.line:0 +msgid "The amount of the voucher must be the same amount as the one on the statement line" +msgstr "Het bedrag op de bon moet hetzelfde bedrag zijn dat vermeld staat op de afschriftregel" + +#. module: bank_statement_instant_voucher +#: field:account.voucher.instant,balance:0 +msgid "Balance" +msgstr "Balans" + +#. module: bank_statement_instant_voucher +#: field:account.voucher.instant,statement_line_id:0 +msgid "Bank statement line" +msgstr "Bankafschriftregel" + +#. module: bank_statement_instant_voucher +#: field:account.voucher.instant,ref:0 +msgid "Reference" +msgstr "Referentie" + +#. module: bank_statement_instant_voucher +#: code:addons/bank_statement_instant_voucher/model/account_voucher_instant.py:191 +#, python-format +msgid "Currency on the bank statement line needs to be the same as on the voucher. Currency conversion is not yet supported." +msgstr "De valuta van de bankafschriftregel dient gelijk te zijn aan die op de journaalbon. Omrekenen tussen valuta is nog niet ondersteund." + +#. module: bank_statement_instant_voucher +#: code:addons/bank_statement_instant_voucher/model/account_voucher_instant.py:225 +#, python-format +msgid "Cannot match a confirmed statement line" +msgstr "Kan een bevestigde bankafschriftregel niet afletteren" + +#. module: bank_statement_instant_voucher +#: field:account.voucher.instant,voucher_id:0 +msgid "Voucher" +msgstr "Journaalbon" + +#. module: bank_statement_instant_voucher +#: view:account.voucher.instant:0 +msgid "Cancel" +msgstr "Annuleer" + +#. module: bank_statement_instant_voucher +#: field:account.voucher.instant,partner_id:0 +msgid "Partner" +msgstr "Relatie" + diff --git a/bank_statement_instant_voucher/model/__init__.py b/bank_statement_instant_voucher/model/__init__.py new file mode 100644 index 000000000..bb3faa358 --- /dev/null +++ b/bank_statement_instant_voucher/model/__init__.py @@ -0,0 +1,2 @@ +import account_voucher_instant +import account_bank_statement_line diff --git a/bank_statement_instant_voucher/model/account_bank_statement_line.py b/bank_statement_instant_voucher/model/account_bank_statement_line.py new file mode 100644 index 000000000..f2f655c49 --- /dev/null +++ b/bank_statement_instant_voucher/model/account_bank_statement_line.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# This module copyright (C) 2012 Therp BV (). +# +# 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 . +# +############################################################################## + +from osv import osv, fields +class account_bank_statement_line(osv.osv): + _inherit = 'account.bank.statement.line' + def create_instant_voucher(self, cr, uid, ids, context=None): + res = False + if ids: + if isinstance(ids, (int, float)): + ids = [ids] + if context is None: + context = {} + local_context = context.copy() + context['active_id'] = ids[0] + wizard_obj = self.pool.get('account.voucher.instant') + res = { + 'name': wizard_obj._description, + 'view_type': 'form', + 'view_mode': 'form', + 'res_model': wizard_obj._name, + 'domain': [], + 'context': context, + 'type': 'ir.actions.act_window', + 'target': 'new', + 'res_id': False, + 'nodestroy': False, + } + return res + diff --git a/bank_statement_instant_voucher/model/account_voucher_instant.py b/bank_statement_instant_voucher/model/account_voucher_instant.py new file mode 100644 index 000000000..106e73627 --- /dev/null +++ b/bank_statement_instant_voucher/model/account_voucher_instant.py @@ -0,0 +1,273 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# This module copyright (C) 2012 Therp BV (). +# +# 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 . +# +############################################################################## + +from osv import osv, fields +from tools.translate import _ + +import decimal_precision as dp + +class instant_voucher(osv.osv_memory): + _name = 'account.voucher.instant' + _description = 'Instant Voucher' + + def cancel(self, cr, uid, ids, context=None): + """ + Delete the voucher and close window + """ + instant = self.browse(cr, uid, ids[0], context=context) + if instant.voucher_id: + self.pool.get('account.voucher').cancel_voucher( + cr, uid, [instant.voucher_id.id], context=context) + self.pool.get('account.voucher').unlink( + cr, uid, [instant.voucher_id.id], context=context) + return {'type': 'ir.actions.act_window_close'} + + def create_voucher(self, cr, uid, ids, context=None): + """ + Create a fully fledged voucher counterpart for the + statement line. User only needs to process taxes and may + adapt cost/income account. + """ + voucher_pool = self.pool.get('account.voucher') + period_pool = self.pool.get('account.period') + instant = self.browse(cr, uid, ids[0], context=context) + line = instant.statement_line_id + voucher_type = line.amount < 0 and 'purchase' or 'sale' + journal_ids = self.pool.get('account.journal').search( + cr, uid, [('company_id', '=', line.company_id.id), + ('type', '=', voucher_type)]) + if not journal_ids: + osv.exept_osv( + _('Error'), + _('No %s journal defined') % voucher_type) + + journal = self.pool.get('account.journal').browse( + cr, uid, journal_ids[0], context=context) + if journal.type in ('sale', 'sale_refund'): + line_account_id = (journal.default_credit_account_id and + journal.default_credit_account_id.id or False) + elif journal.type in ('purchase', 'expense', 'purchase_refund'): + line_account_id = (journal.default_debit_account_id and + journal.default_debit_account_id.id or False) + vals = { + 'name': _('Voucher for statement line %s.%s') % (line.statement_id.name, line.name), + 'reference': line.ref or False, + 'company_id': line.company_id.id, + 'partner_id': instant.partner_id.id, + 'date': line.date or res.get('line.date', False), + 'account_id': line.account_id.id, + 'type': voucher_type, + 'line_ids': [(0, 0, {'amount': abs(line.amount), + 'account_id': line_account_id, + 'type': line.amount < 0 and 'dr' or 'cr', + 'name': line.ref or False, + })], + 'amount': line.amount and abs(line.amount) or res.get('amount', False), + 'journal_id': journal_ids[0], + } + if vals['date']: + period_ids = period_pool.find(cr, uid, vals['date'], context=context) + if period_ids: + vals['period_id'] = period_ids[0] + voucher_id = voucher_pool.create( + cr, uid, vals, context=context) + self.write( + cr, uid, ids[0], + {'voucher_id': voucher_id, + 'state': 'ready', + }, context=context) + return { + 'name': self._description, + 'view_type': 'form', + 'view_mode': 'form', + 'res_model': self._name, + 'domain': [], + 'context': context, + 'type': 'ir.actions.act_window', + 'target': 'new', + 'res_id': ids[0], + 'nodestroy': False, + } + + def dummy(self, cr, uid, ids, context=None): + return { + 'name': self._description, + 'view_type': 'form', + 'view_mode': 'form', + 'res_model': self._name, + 'domain': [], + 'context': context, + 'type': 'ir.actions.act_window', + 'target': 'new', + 'res_id': ids[0], + 'nodestroy': False, + } + + def default_get(self, cr, uid, fields_list, context=None): + """ + Gather sane default values from the originating statement line + """ + res = super(instant_voucher, self).default_get( + cr, uid, fields_list, context=context) + if 'statement_line_id' in fields_list: + res['statement_line_id'] = ( + context.get('active_id') or + context.get('active_ids') and context.get('active_ids')[0]) + if not res['statement_line_id']: + raise osv.except_osv( + _('Error'), + _('Cannot determine statement line')) + line = self.pool.get('account.bank.statement.line').browse( + cr, uid, res['statement_line_id'], context=context) + if 'balance' in fields_list: + res['balance'] = line.amount + if 'ref' in fields_list: + res['ref'] = line.ref + if 'partner_id' in fields_list: + if line.partner_id: + res['partner_id'] = line.partner_id.id + return res + + def _get_balance(self, cr, uid, ids, field_name, args, context=None): + """ + Compute the expected residual + TODO: currency conversion + """ + res = {} + for instant in self.browse(cr, uid, ids, context=context): + if instant.voucher_id and instant.voucher_id.state == 'posted': + amount = instant.statement_line_id.amount + counteramount = 0.0 + for line in instant.voucher_id.move_ids: + if line.account_id.id == instant.statement_line_id.account_id.id: + counteramount = line.debit - line.credit + for line in instant.voucher_id.move_ids: + if line.account_id.id == instant.statement_line_id.account_id.id: + counteramount = line.debit - line.credit + else: + amount = abs(instant.statement_line_id.amount) + counteramount = abs(instant.voucher_id and instant.voucher_id.amount or 0.0) + res[instant.id] = amount - counteramount + return res + + def confirm(self, cr, uid, ids, context=None): + """ + Post the voucher if necessary + Post the voucher's move lines if necessary + Sanity checks on currency and residual = 0.0 + + If Banking Addons are installed, perform matching and reconciliation. + If not, the user is left to manual reconciliation of OpenERP. + """ + statement_line_obj = self.pool.get('account.bank.statement.line') + voucher_obj = self.pool.get('account.voucher') + move_obj = self.pool.get('account.move') + instant = self.browse(cr, uid, ids[0], context=context) + voucher_currency = (instant.voucher_id.currency_id and + instant.voucher_id.currency_id or + instant.voucher_id.company_id.currency_id) + if (instant.statement_line_id.statement_id.currency.id != + voucher_currency.id): + raise osv.except_osv( + _("Error"), + _("Currency on the bank statement line needs to be the " + "same as on the voucher. Currency conversion is not yet " + "supported.")) + if instant.voucher_id.state != 'posted': + voucher_obj.proforma_voucher( + cr, uid, [instant.voucher_id.id], context=context) + instant.refresh() + if instant.voucher_id.state != 'posted': + raise osv.except_osv( + _("Error"), + _("The voucher could not be posted.")) + if instant.voucher_id.move_id.state != 'posted': + move_obj.post( + cr, uid, [instant.voucher_id.move_id.id], context=context) + instant.refresh() + if instant.voucher_id.move_id.state != 'posted': + raise osv.except_osv( + _("Error"), + _("The voucher's move line could not be posted.")) + if not self.pool.get('res.currency').is_zero( + cr, uid, voucher_currency, instant.balance): + raise osv.except_osv( + _("Error"), + _("The amount on the bank statement line needs to be the " + "same as on the voucher. Write-off is not yet " + "supported.")) + # Banking addons integration: + # Gather the info needed to match the bank statement line + # and trigger its posting and reconciliation. + if ('import_transaction_id' in statement_line_obj._columns + and instant.statement_line_id.import_transaction_id): + if instant.statement_line_id.state == 'confirmed': + raise osv.except_osv( + _("Error"), + _("Cannot match a confirmed statement line")) + for line in instant.voucher_id.move_ids: + if line.account_id.id == instant.statement_line_id.account_id.id: + self.pool.get('banking.import.transaction').write( + cr, uid, instant.statement_line_id.import_transaction_id.id, + { + 'move_line_id': line.id, + 'move_line_ids': [(6, 0, [line.id])], + 'match_type': 'move', + 'invoice_id': False, + 'invoice_ids': [(6, 0, [])], + }, context=context) + + statement_line_obj.confirm( + cr, uid, [instant.statement_line_id.id], context=context) + break + return {'type': 'ir.actions.act_window_close'} + + _columns = { + 'balance': fields.function( + _get_balance, + type='float', + digits_compute=dp.get_precision('Account'), + string="Balance",), + 'partner_id': fields.many2one( + 'res.partner', + 'Partner', + required=True), + 'statement_line_id': fields.many2one( + 'account.bank.statement.line', + 'Bank statement line', + readonly=True), + 'ref': fields.related( + 'statement_line_id', 'ref', + type="char", size="48", + readonly=True, + string="Reference"), + 'voucher_id': fields.many2one( + 'account.voucher', + 'Voucher', + readonly=True), + 'state': fields.selection( + [('init', 'init'), + ('ready', 'ready'), + ('confirm', 'confirm')], + 'State'), + } + + _defaults = {'state': 'init'} diff --git a/bank_statement_instant_voucher/view/account_bank_statement_line.xml b/bank_statement_instant_voucher/view/account_bank_statement_line.xml new file mode 100644 index 000000000..0e467c0f0 --- /dev/null +++ b/bank_statement_instant_voucher/view/account_bank_statement_line.xml @@ -0,0 +1,21 @@ + + + + + Add instant voucher button to bank statement line on statement form + + account.bank.statement + form + + + +