From 819bb6f7ab215570162141de8bd15e4da6bba597 Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Mon, 11 Aug 2014 12:00:46 +0200 Subject: [PATCH 1/7] [FIX] add workflow transition for sending batches --- account_direct_debit/workflow/account_payment.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/account_direct_debit/workflow/account_payment.xml b/account_direct_debit/workflow/account_payment.xml index 7ea27c523..ca6cc14b8 100644 --- a/account_direct_debit/workflow/account_payment.xml +++ b/account_direct_debit/workflow/account_payment.xml @@ -21,5 +21,11 @@ test_undo_done() undo_done + + + + + done + From 3c97e9f841ebd927e01ed5db8cdd46dff6776975 Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Fri, 25 Jul 2014 15:25:54 +0200 Subject: [PATCH 2/7] [ADD] import account_banking_sepa_direct_debit and deps --- account_banking_pain_base/__init__.py | 26 + account_banking_pain_base/__openerp__.py | 51 + .../banking_export_pain.py | 439 +++++++++ account_banking_pain_base/company.py | 82 ++ account_banking_pain_base/company_view.xml | 24 + .../i18n/account_banking_pain_base.pot | 146 +++ account_banking_pain_base/i18n/fr.po | 172 ++++ account_banking_pain_base/i18n/nl.po | 172 ++++ account_banking_pain_base/payment_line.py | 52 + .../payment_line_view.xml | 41 + account_banking_pain_base/payment_mode.py | 39 + .../payment_mode_view.xml | 22 + account_banking_payment_export/__init__.py | 1 + account_banking_payment_export/__openerp__.py | 85 ++ .../data/payment_mode_type.xml | 14 + .../demo/banking_demo.xml | 78 ++ .../i18n/account_banking_payment_export.pot | 145 +++ account_banking_payment_export/i18n/nl.po | 151 +++ .../migrations/7.0.0.1.165/pre-migration.py | 33 + .../model/__init__.py | 7 + .../model/account_move_line.py | 98 ++ .../model/account_payment.py | 90 ++ .../model/bank_payment_manual.py | 59 ++ .../model/payment_mode.py | 61 ++ .../model/payment_mode_type.py | 71 ++ .../model/payment_order_create.py | 199 ++++ .../security/ir.model.access.csv | 2 + .../view/account_payment.xml | 23 + .../view/bank_payment_manual.xml | 18 + .../view/payment_mode.xml | 21 + .../view/payment_mode_type.xml | 59 ++ .../view/payment_order_create_view.xml | 23 + account_banking_sepa_direct_debit/__init__.py | 25 + .../__openerp__.py | 62 ++ .../account_banking_sdd.py | 440 +++++++++ .../account_banking_sdd_view.xml | 77 ++ .../account_invoice_view.xml | 22 + .../account_payment_view.xml | 26 + account_banking_sepa_direct_debit/company.py | 90 ++ .../company_view.xml | 23 + .../data/mandate_reference_sequence.xml | 21 + .../data/pain.008.001.02.xsd | 879 +++++++++++++++++ .../data/pain.008.001.03.xsd | 925 ++++++++++++++++++ .../data/pain.008.001.04.xsd | 892 +++++++++++++++++ .../data/payment_type_sdd.xml | 35 + .../account_banking_sepa_direct_debit.pot | 633 ++++++++++++ account_banking_sepa_direct_debit/i18n/fr.po | 749 ++++++++++++++ account_banking_sepa_direct_debit/i18n/nl.po | 754 ++++++++++++++ .../mandate_expire_cron.xml | 26 + .../res_partner_bank_view.xml | 48 + .../sdd_mandate_view.xml | 152 +++ .../security/ir.model.access.csv | 4 + .../original_mandate_required_security.xml | 17 + .../sepa_direct_debit_demo.xml | 27 + .../static/src/img/icon.png | Bin 0 -> 6892 bytes .../wizard/__init__.py | 23 + .../wizard/export_sdd.py | 451 +++++++++ .../wizard/export_sdd_view.xml | 37 + 58 files changed, 8942 insertions(+) create mode 100644 account_banking_pain_base/__init__.py create mode 100644 account_banking_pain_base/__openerp__.py create mode 100644 account_banking_pain_base/banking_export_pain.py create mode 100644 account_banking_pain_base/company.py create mode 100644 account_banking_pain_base/company_view.xml create mode 100644 account_banking_pain_base/i18n/account_banking_pain_base.pot create mode 100644 account_banking_pain_base/i18n/fr.po create mode 100644 account_banking_pain_base/i18n/nl.po create mode 100644 account_banking_pain_base/payment_line.py create mode 100644 account_banking_pain_base/payment_line_view.xml create mode 100644 account_banking_pain_base/payment_mode.py create mode 100644 account_banking_pain_base/payment_mode_view.xml create mode 100644 account_banking_payment_export/__init__.py create mode 100644 account_banking_payment_export/__openerp__.py create mode 100644 account_banking_payment_export/data/payment_mode_type.xml create mode 100644 account_banking_payment_export/demo/banking_demo.xml create mode 100644 account_banking_payment_export/i18n/account_banking_payment_export.pot create mode 100644 account_banking_payment_export/i18n/nl.po create mode 100644 account_banking_payment_export/migrations/7.0.0.1.165/pre-migration.py create mode 100644 account_banking_payment_export/model/__init__.py create mode 100644 account_banking_payment_export/model/account_move_line.py create mode 100644 account_banking_payment_export/model/account_payment.py create mode 100644 account_banking_payment_export/model/bank_payment_manual.py create mode 100644 account_banking_payment_export/model/payment_mode.py create mode 100644 account_banking_payment_export/model/payment_mode_type.py create mode 100644 account_banking_payment_export/model/payment_order_create.py create mode 100644 account_banking_payment_export/security/ir.model.access.csv create mode 100644 account_banking_payment_export/view/account_payment.xml create mode 100644 account_banking_payment_export/view/bank_payment_manual.xml create mode 100644 account_banking_payment_export/view/payment_mode.xml create mode 100644 account_banking_payment_export/view/payment_mode_type.xml create mode 100644 account_banking_payment_export/view/payment_order_create_view.xml create mode 100644 account_banking_sepa_direct_debit/__init__.py create mode 100644 account_banking_sepa_direct_debit/__openerp__.py create mode 100644 account_banking_sepa_direct_debit/account_banking_sdd.py create mode 100644 account_banking_sepa_direct_debit/account_banking_sdd_view.xml create mode 100644 account_banking_sepa_direct_debit/account_invoice_view.xml create mode 100644 account_banking_sepa_direct_debit/account_payment_view.xml create mode 100644 account_banking_sepa_direct_debit/company.py create mode 100644 account_banking_sepa_direct_debit/company_view.xml create mode 100644 account_banking_sepa_direct_debit/data/mandate_reference_sequence.xml create mode 100644 account_banking_sepa_direct_debit/data/pain.008.001.02.xsd create mode 100644 account_banking_sepa_direct_debit/data/pain.008.001.03.xsd create mode 100644 account_banking_sepa_direct_debit/data/pain.008.001.04.xsd create mode 100644 account_banking_sepa_direct_debit/data/payment_type_sdd.xml create mode 100644 account_banking_sepa_direct_debit/i18n/account_banking_sepa_direct_debit.pot create mode 100644 account_banking_sepa_direct_debit/i18n/fr.po create mode 100644 account_banking_sepa_direct_debit/i18n/nl.po create mode 100644 account_banking_sepa_direct_debit/mandate_expire_cron.xml create mode 100644 account_banking_sepa_direct_debit/res_partner_bank_view.xml create mode 100644 account_banking_sepa_direct_debit/sdd_mandate_view.xml create mode 100644 account_banking_sepa_direct_debit/security/ir.model.access.csv create mode 100644 account_banking_sepa_direct_debit/security/original_mandate_required_security.xml create mode 100644 account_banking_sepa_direct_debit/sepa_direct_debit_demo.xml create mode 100644 account_banking_sepa_direct_debit/static/src/img/icon.png create mode 100644 account_banking_sepa_direct_debit/wizard/__init__.py create mode 100644 account_banking_sepa_direct_debit/wizard/export_sdd.py create mode 100644 account_banking_sepa_direct_debit/wizard/export_sdd_view.xml diff --git a/account_banking_pain_base/__init__.py b/account_banking_pain_base/__init__.py new file mode 100644 index 000000000..6662843e6 --- /dev/null +++ b/account_banking_pain_base/__init__.py @@ -0,0 +1,26 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# PAIN Base module for OpenERP +# Copyright (C) 2013 Akretion (http://www.akretion.com) +# @author: Alexis de Lattre +# +# 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 . import payment_line +from . import payment_mode +from . import company +from . import banking_export_pain diff --git a/account_banking_pain_base/__openerp__.py b/account_banking_pain_base/__openerp__.py new file mode 100644 index 000000000..71c52d5d0 --- /dev/null +++ b/account_banking_pain_base/__openerp__.py @@ -0,0 +1,51 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# PAIN base module for OpenERP +# Copyright (C) 2013 Akretion (http://www.akretion.com) +# @author: Alexis de Lattre +# +# 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': 'Account Banking PAIN Base Module', + 'summary': 'Base module for PAIN file generation', + 'version': '0.1', + 'license': 'AGPL-3', + 'author': 'Akretion, Noviat', + 'website': 'http://openerp-community-association.org/', + 'category': 'Hidden', + 'depends': ['account_banking_payment_export'], + 'external_dependencies': { + 'python': ['unidecode', 'lxml'], + }, + 'data': [ + 'payment_line_view.xml', + 'payment_mode_view.xml', + 'company_view.xml', + ], + 'description': ''' +Base module for PAIN file generation +==================================== + +This module contains fields and functions that are used by the module for SEPA Credit Transfer (account_banking_sepa_credit_transfer) and SEPA Direct Debit (account_banking_sepa_direct_debit). This module doesn't provide any functionnality by itself. + +This module is part of the banking addons: https://launchpad.net/banking-addons + +This module was started during the Akretion-Noviat code sprint of November 21st 2013 in Epiais les Louvres (France). + ''', + 'active': False, + 'installable': True, +} diff --git a/account_banking_pain_base/banking_export_pain.py b/account_banking_pain_base/banking_export_pain.py new file mode 100644 index 000000000..279dc5f5a --- /dev/null +++ b/account_banking_pain_base/banking_export_pain.py @@ -0,0 +1,439 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# PAIN Base module for OpenERP +# Copyright (C) 2013 Akretion (http://www.akretion.com) +# @author: Alexis de Lattre +# +# 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 openerp.osv import orm +from openerp.tools.translate import _ +from openerp.tools.safe_eval import safe_eval +from datetime import datetime +from unidecode import unidecode +from lxml import etree +from openerp import tools +import logging +import base64 + +logger = logging.getLogger(__name__) + + +class banking_export_pain(orm.AbstractModel): + _name = 'banking.export.pain' + + def _validate_iban(self, cr, uid, iban, context=None): + '''if IBAN is valid, returns IBAN + if IBAN is NOT valid, raises an error message''' + partner_bank_obj = self.pool.get('res.partner.bank') + if partner_bank_obj.is_iban_valid(cr, uid, iban, context=context): + return iban.replace(' ', '') + else: + raise orm.except_orm( + _('Error:'), _("This IBAN is not valid : %s") % iban) + + def _prepare_field( + self, cr, uid, field_name, field_value, eval_ctx, max_size=0, + gen_args=None, context=None): + '''This function is designed to be inherited !''' + if gen_args is None: + gen_args = {} + assert isinstance(eval_ctx, dict), 'eval_ctx must contain a dict' + try: + value = safe_eval(field_value, eval_ctx) + # SEPA uses XML ; XML = UTF-8 ; UTF-8 = support for all characters + # But we are dealing with banks... + # and many banks don't want non-ASCCI characters ! + # cf section 1.4 "Character set" of the SEPA Credit Transfer + # Scheme Customer-to-bank guidelines + if gen_args.get('convert_to_ascii'): + value = unidecode(value) + unallowed_ascii_chars = [ + '"', '#', '$', '%', '&', '*', ';', '<', '>', '=', '@', + '[', ']', '^', '_', '`', '{', '}', '|', '~', '\\', '!'] + for unallowed_ascii_char in unallowed_ascii_chars: + value = value.replace(unallowed_ascii_char, '-') + except: + line = eval_ctx.get('line') + if line: + raise orm.except_orm( + _('Error:'), + _("Cannot compute the '%s' of the Payment Line with " + "reference '%s'.") + % (field_name, line.name)) + else: + raise orm.except_orm( + _('Error:'), + _("Cannot compute the '%s'.") % field_name) + if not isinstance(value, (str, unicode)): + raise orm.except_orm( + _('Field type error:'), + _("The type of the field '%s' is %s. It should be a string " + "or unicode.") + % (field_name, type(value))) + if not value: + raise orm.except_orm( + _('Error:'), + _("The '%s' is empty or 0. It should have a non-null value.") + % field_name) + if max_size and len(value) > max_size: + value = value[0:max_size] + return value + + def _prepare_export_sepa( + self, cr, uid, total_amount, transactions_count, xml_string, + gen_args, context=None): + return { + 'batch_booking': gen_args['sepa_export'].batch_booking, + 'charge_bearer': gen_args['sepa_export'].charge_bearer, + 'total_amount': total_amount, + 'nb_transactions': transactions_count, + 'file': base64.encodestring(xml_string), + 'payment_order_ids': [( + 6, 0, [x.id for x in gen_args['sepa_export'].payment_order_ids] + )], + } + + def _validate_xml(self, cr, uid, xml_string, gen_args, context=None): + xsd_etree_obj = etree.parse( + tools.file_open(gen_args['pain_xsd_file'])) + official_pain_schema = etree.XMLSchema(xsd_etree_obj) + + try: + root_to_validate = etree.fromstring(xml_string) + official_pain_schema.assertValid(root_to_validate) + except Exception, e: + logger.warning( + "The XML file is invalid against the XML Schema Definition") + logger.warning(xml_string) + logger.warning(e) + raise orm.except_orm( + _('Error:'), + _("The generated XML file is not valid against the official " + "XML Schema Definition. The generated XML file and the " + "full error have been written in the server logs. Here " + "is the error, which may give you an idea on the cause " + "of the problem : %s") + % str(e)) + return True + + def finalize_sepa_file_creation( + self, cr, uid, ids, xml_root, total_amount, transactions_count, + gen_args, context=None): + xml_string = etree.tostring( + xml_root, pretty_print=True, encoding='UTF-8', + xml_declaration=True) + logger.debug( + "Generated SEPA XML file in format %s below" + % gen_args['pain_flavor']) + logger.debug(xml_string) + self._validate_xml(cr, uid, xml_string, gen_args, context=context) + + file_id = gen_args['file_obj'].create( + cr, uid, self._prepare_export_sepa( + cr, uid, total_amount, transactions_count, + xml_string, gen_args, context=context), + context=context) + + self.write( + cr, uid, ids, { + 'file_id': file_id, + 'state': 'finish', + }, context=context) + + action = { + 'name': 'SEPA File', + 'type': 'ir.actions.act_window', + 'view_type': 'form', + 'view_mode': 'form,tree', + 'res_model': self._name, + 'res_id': ids[0], + 'target': 'new', + } + return action + + def generate_group_header_block( + self, cr, uid, parent_node, gen_args, context=None): + group_header_1_0 = etree.SubElement(parent_node, 'GrpHdr') + message_identification_1_1 = etree.SubElement( + group_header_1_0, 'MsgId') + message_identification_1_1.text = self._prepare_field( + cr, uid, 'Message Identification', + 'sepa_export.payment_order_ids[0].reference', + {'sepa_export': gen_args['sepa_export']}, 35, + gen_args=gen_args, context=context) + creation_date_time_1_2 = etree.SubElement(group_header_1_0, 'CreDtTm') + creation_date_time_1_2.text = datetime.strftime( + datetime.today(), '%Y-%m-%dT%H:%M:%S') + if gen_args.get('pain_flavor') == 'pain.001.001.02': + # batch_booking is in "Group header" with pain.001.001.02 + # and in "Payment info" in pain.001.001.03/04 + batch_booking = etree.SubElement(group_header_1_0, 'BtchBookg') + batch_booking.text = \ + str(gen_args['sepa_export'].batch_booking).lower() + nb_of_transactions_1_6 = etree.SubElement( + group_header_1_0, 'NbOfTxs') + control_sum_1_7 = etree.SubElement(group_header_1_0, 'CtrlSum') + # Grpg removed in pain.001.001.03 + if gen_args.get('pain_flavor') == 'pain.001.001.02': + grouping = etree.SubElement(group_header_1_0, 'Grpg') + grouping.text = 'GRPD' + self.generate_initiating_party_block( + cr, uid, group_header_1_0, gen_args, + context=context) + return group_header_1_0, nb_of_transactions_1_6, control_sum_1_7 + + def generate_start_payment_info_block( + self, cr, uid, parent_node, payment_info_ident, + priority, local_instrument, sequence_type, requested_date, + eval_ctx, gen_args, context=None): + payment_info_2_0 = etree.SubElement(parent_node, 'PmtInf') + payment_info_identification_2_1 = etree.SubElement( + payment_info_2_0, 'PmtInfId') + payment_info_identification_2_1.text = self._prepare_field( + cr, uid, 'Payment Information Identification', + payment_info_ident, eval_ctx, 35, + gen_args=gen_args, context=context) + payment_method_2_2 = etree.SubElement(payment_info_2_0, 'PmtMtd') + payment_method_2_2.text = gen_args['payment_method'] + if gen_args.get('pain_flavor') != 'pain.001.001.02': + batch_booking_2_3 = etree.SubElement(payment_info_2_0, 'BtchBookg') + batch_booking_2_3.text = \ + str(gen_args['sepa_export'].batch_booking).lower() + # The "SEPA Customer-to-bank + # Implementation guidelines" for SCT and SDD says that control sum + # and nb_of_transactions should be present + # at both "group header" level and "payment info" level + nb_of_transactions_2_4 = etree.SubElement( + payment_info_2_0, 'NbOfTxs') + control_sum_2_5 = etree.SubElement(payment_info_2_0, 'CtrlSum') + payment_type_info_2_6 = etree.SubElement( + payment_info_2_0, 'PmtTpInf') + if priority: + instruction_priority_2_7 = etree.SubElement( + payment_type_info_2_6, 'InstrPrty') + instruction_priority_2_7.text = priority + service_level_2_8 = etree.SubElement( + payment_type_info_2_6, 'SvcLvl') + service_level_code_2_9 = etree.SubElement(service_level_2_8, 'Cd') + service_level_code_2_9.text = 'SEPA' + if local_instrument: + local_instrument_2_11 = etree.SubElement( + payment_type_info_2_6, 'LclInstrm') + local_instr_code_2_12 = etree.SubElement( + local_instrument_2_11, 'Cd') + local_instr_code_2_12.text = local_instrument + if sequence_type: + sequence_type_2_14 = etree.SubElement( + payment_type_info_2_6, 'SeqTp') + sequence_type_2_14.text = sequence_type + + if gen_args['payment_method'] == 'DD': + request_date_tag = 'ReqdColltnDt' + else: + request_date_tag = 'ReqdExctnDt' + requested_date_2_17 = etree.SubElement( + payment_info_2_0, request_date_tag) + requested_date_2_17.text = requested_date + return payment_info_2_0, nb_of_transactions_2_4, control_sum_2_5 + + def generate_initiating_party_block( + self, cr, uid, parent_node, gen_args, context=None): + my_company_name = self._prepare_field( + cr, uid, 'Company Name', + 'sepa_export.payment_order_ids[0].mode.bank_id.partner_id.name', + {'sepa_export': gen_args['sepa_export']}, + gen_args.get('name_maxsize'), gen_args=gen_args, context=context) + initiating_party_1_8 = etree.SubElement(parent_node, 'InitgPty') + initiating_party_name = etree.SubElement(initiating_party_1_8, 'Nm') + initiating_party_name.text = my_company_name + initiating_party_identifier = self.pool['res.company'].\ + _get_initiating_party_identifier( + cr, uid, + gen_args['sepa_export'].payment_order_ids[0].company_id.id, + context=context) + initiating_party_issuer = gen_args['sepa_export'].\ + payment_order_ids[0].company_id.initiating_party_issuer + if initiating_party_identifier and initiating_party_issuer: + iniparty_id = etree.SubElement(initiating_party_1_8, 'Id') + iniparty_org_id = etree.SubElement(iniparty_id, 'OrgId') + iniparty_org_other = etree.SubElement(iniparty_org_id, 'Othr') + iniparty_org_other_id = etree.SubElement(iniparty_org_other, 'Id') + iniparty_org_other_id.text = initiating_party_identifier + iniparty_org_other_issuer = etree.SubElement( + iniparty_org_other, 'Issr') + iniparty_org_other_issuer.text = initiating_party_issuer + return True + + def generate_party_agent( + self, cr, uid, parent_node, party_type, party_type_label, + order, party_name, iban, bic, eval_ctx, gen_args, context=None): + '''Generate the piece of the XML file corresponding to BIC + This code is mutualized between TRF and DD''' + assert order in ('B', 'C'), "Order can be 'B' or 'C'" + try: + bic = self._prepare_field( + cr, uid, '%s BIC' % party_type_label, bic, eval_ctx, + gen_args=gen_args, context=context) + party_agent = etree.SubElement(parent_node, '%sAgt' % party_type) + party_agent_institution = etree.SubElement( + party_agent, 'FinInstnId') + party_agent_bic = etree.SubElement( + party_agent_institution, gen_args.get('bic_xml_tag')) + party_agent_bic.text = bic + except orm.except_orm: + if order == 'C': + if iban[0:2] != gen_args['initiating_party_country_code']: + raise orm.except_orm( + _('Error:'), + _("The bank account with IBAN '%s' of partner '%s' " + "must have an associated BIC because it is a " + "cross-border SEPA operation.") + % (iban, party_name)) + if order == 'B' or ( + order == 'C' and gen_args['payment_method'] == 'DD'): + party_agent = etree.SubElement( + parent_node, '%sAgt' % party_type) + party_agent_institution = etree.SubElement( + party_agent, 'FinInstnId') + party_agent_other = etree.SubElement( + party_agent_institution, 'Othr') + party_agent_other_identification = etree.SubElement( + party_agent_other, 'Id') + party_agent_other_identification.text = 'NOTPROVIDED' + # for Credit Transfers, in the 'C' block, if BIC is not provided, + # we should not put the 'Creditor Agent' block at all, + # as per the guidelines of the EPC + return True + + def generate_party_block( + self, cr, uid, parent_node, party_type, order, name, iban, bic, + eval_ctx, gen_args, context=None): + '''Generate the piece of the XML file corresponding to Name+IBAN+BIC + This code is mutualized between TRF and DD''' + assert order in ('B', 'C'), "Order can be 'B' or 'C'" + if party_type == 'Cdtr': + party_type_label = 'Creditor' + elif party_type == 'Dbtr': + party_type_label = 'Debtor' + party_name = self._prepare_field( + cr, uid, '%s Name' % party_type_label, name, eval_ctx, + gen_args.get('name_maxsize'), + gen_args=gen_args, context=context) + piban = self._prepare_field( + cr, uid, '%s IBAN' % party_type_label, iban, eval_ctx, + gen_args=gen_args, + context=context) + viban = self._validate_iban(cr, uid, piban, context=context) + # At C level, the order is : BIC, Name, IBAN + # At B level, the order is : Name, IBAN, BIC + if order == 'B': + gen_args['initiating_party_country_code'] = viban[0:2] + elif order == 'C': + self.generate_party_agent( + cr, uid, parent_node, party_type, party_type_label, + order, party_name, viban, bic, + eval_ctx, gen_args, context=context) + party = etree.SubElement(parent_node, party_type) + party_nm = etree.SubElement(party, 'Nm') + party_nm.text = party_name + party_account = etree.SubElement( + parent_node, '%sAcct' % party_type) + party_account_id = etree.SubElement(party_account, 'Id') + party_account_iban = etree.SubElement( + party_account_id, 'IBAN') + party_account_iban.text = viban + if order == 'B': + self.generate_party_agent( + cr, uid, parent_node, party_type, party_type_label, + order, party_name, viban, bic, + eval_ctx, gen_args, context=context) + return True + + def generate_remittance_info_block( + self, cr, uid, parent_node, line, gen_args, context=None): + + remittance_info_2_91 = etree.SubElement( + parent_node, 'RmtInf') + if line.state == 'normal': + remittance_info_unstructured_2_99 = etree.SubElement( + remittance_info_2_91, 'Ustrd') + remittance_info_unstructured_2_99.text = \ + self._prepare_field( + cr, uid, 'Remittance Unstructured Information', + 'line.communication', {'line': line}, 140, + gen_args=gen_args, + context=context) + else: + if not line.struct_communication_type: + raise orm.except_orm( + _('Error:'), + _("Missing 'Structured Communication Type' on payment " + "line with reference '%s'.") + % (line.name)) + remittance_info_structured_2_100 = etree.SubElement( + remittance_info_2_91, 'Strd') + creditor_ref_information_2_120 = etree.SubElement( + remittance_info_structured_2_100, 'CdtrRefInf') + if gen_args.get('pain_flavor') == 'pain.001.001.02': + creditor_ref_info_type_2_121 = etree.SubElement( + creditor_ref_information_2_120, 'CdtrRefTp') + creditor_ref_info_type_code_2_123 = etree.SubElement( + creditor_ref_info_type_2_121, 'Cd') + creditor_ref_info_type_issuer_2_125 = etree.SubElement( + creditor_ref_info_type_2_121, 'Issr') + creditor_reference_2_126 = etree.SubElement( + creditor_ref_information_2_120, 'CdtrRef') + else: + creditor_ref_info_type_2_121 = etree.SubElement( + creditor_ref_information_2_120, 'Tp') + creditor_ref_info_type_or_2_122 = etree.SubElement( + creditor_ref_info_type_2_121, 'CdOrPrtry') + creditor_ref_info_type_code_2_123 = etree.SubElement( + creditor_ref_info_type_or_2_122, 'Cd') + creditor_ref_info_type_issuer_2_125 = etree.SubElement( + creditor_ref_info_type_2_121, 'Issr') + creditor_reference_2_126 = etree.SubElement( + creditor_ref_information_2_120, 'Ref') + + creditor_ref_info_type_code_2_123.text = 'SCOR' + creditor_ref_info_type_issuer_2_125.text = \ + line.struct_communication_type + creditor_reference_2_126.text = \ + self._prepare_field( + cr, uid, 'Creditor Structured Reference', + 'line.communication', {'line': line}, 35, + gen_args=gen_args, + context=context) + return True + + def generate_creditor_scheme_identification( + self, cr, uid, parent_node, identification, identification_label, + eval_ctx, scheme_name_proprietary, gen_args, context=None): + csi_id = etree.SubElement( + parent_node, 'Id') + csi_privateid = csi_id = etree.SubElement(csi_id, 'PrvtId') + csi_other = etree.SubElement(csi_privateid, 'Othr') + csi_other_id = etree.SubElement(csi_other, 'Id') + csi_other_id.text = self._prepare_field( + cr, uid, identification_label, identification, eval_ctx, + gen_args=gen_args, context=context) + csi_scheme_name = etree.SubElement(csi_other, 'SchmeNm') + csi_scheme_name_proprietary = etree.SubElement( + csi_scheme_name, 'Prtry') + csi_scheme_name_proprietary.text = scheme_name_proprietary + return True diff --git a/account_banking_pain_base/company.py b/account_banking_pain_base/company.py new file mode 100644 index 000000000..94864d548 --- /dev/null +++ b/account_banking_pain_base/company.py @@ -0,0 +1,82 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# PAIN Base module for OpenERP +# Copyright (C) 2013 Akretion (http://www.akretion.com) +# Copyright (C) 2013 Noviat (http://www.noviat.com) +# @author: Alexis de Lattre +# @author: Luc de Meyer (Noviat) +# +# 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 openerp.osv import orm, fields + + +class res_company(orm.Model): + _inherit = 'res.company' + + _columns = { + 'initiating_party_issuer': fields.char( + 'Initiating Party Issuer', size=35, + help="This will be used as the 'Initiating Party Issuer' in the " + "PAIN files generated by OpenERP."), + } + + def _get_initiating_party_identifier( + self, cr, uid, company_id, context=None): + '''The code here may be different from one country to another. + If you need to add support for an additionnal country, you can + contribute your code here or inherit this function in the + localization modules for your country''' + assert isinstance(company_id, int), 'Only one company ID' + company = self.browse(cr, uid, company_id, context=context) + company_vat = company.vat + party_identifier = False + if company_vat: + country_code = company_vat[0:2].upper() + if country_code == 'BE': + party_identifier = company_vat[2:].replace(' ', '') + elif country_code == 'ES': + party_identifier = company.sepa_creditor_identifier + return party_identifier + + def _initiating_party_issuer_default(self, cr, uid, context=None): + '''If you need to add support for an additionnal country, you can + add an entry in the dict "party_issuer_per_country" here + or inherit this function in the localization modules for + your country''' + initiating_party_issuer = '' + # If your country require the 'Initiating Party Issuer', you should + # contribute the entry for your country in the dict below + party_issuer_per_country = { + 'BE': 'KBO-BCE', # KBO-BCE = the registry of companies in Belgium + } + company_id = self._company_default_get( + cr, uid, 'res.company', context=context) + if company_id: + company = self.browse(cr, uid, company_id, context=context) + country_code = company.country_id.code + initiating_party_issuer = party_issuer_per_country.get( + country_code, '') + return initiating_party_issuer + + def _initiating_party_issuer_def(self, cr, uid, context=None): + return self._initiating_party_issuer_default( + cr, uid, context=context) + + _defaults = { + 'initiating_party_issuer': _initiating_party_issuer_def, + } diff --git a/account_banking_pain_base/company_view.xml b/account_banking_pain_base/company_view.xml new file mode 100644 index 000000000..a98d9b641 --- /dev/null +++ b/account_banking_pain_base/company_view.xml @@ -0,0 +1,24 @@ + + + + + + + pain.group.on.res.company.form + res.company + + + + + + + + + + + + diff --git a/account_banking_pain_base/i18n/account_banking_pain_base.pot b/account_banking_pain_base/i18n/account_banking_pain_base.pot new file mode 100644 index 000000000..d4a7dbac5 --- /dev/null +++ b/account_banking_pain_base/i18n/account_banking_pain_base.pot @@ -0,0 +1,146 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * account_banking_pain_base +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2013-12-23 21:26+0000\n" +"PO-Revision-Date: 2013-12-23 21:26+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: account_banking_pain_base +#: field:res.company,initiating_party_issuer:0 +msgid "Initiating Party Issuer" +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:122 +#, python-format +msgid "The generated XML file is not valid against the official XML Schema Definition. The generated XML file and the full error have been written in the server logs. Here is the error, which may give you an idea on the cause of the problem : %s" +msgstr "" + +#. module: account_banking_pain_base +#: field:payment.line,priority:0 +msgid "Priority" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_payment_line +msgid "Payment Line" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_payment_mode +msgid "Payment Mode" +msgstr "" + +#. module: account_banking_pain_base +#: help:res.company,initiating_party_issuer:0 +msgid "This will be used as the 'Initiating Party Issuer' in the PAIN files generated by OpenERP." +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:351 +#, python-format +msgid "Missing 'Structured Communication Type' on payment line with reference '%s'." +msgstr "" + +#. module: account_banking_pain_base +#: selection:payment.line,priority:0 +msgid "Normal" +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:70 +#, python-format +msgid "Cannot compute the '%s' of the Payment Line with reference '%s'." +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:77 +#, python-format +msgid "Cannot compute the '%s'." +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:81 +#, python-format +msgid "The type of the field '%s' is %s. It should be a string or unicode." +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:47 +#: code:addons/account_banking_pain_base/banking_export_pain.py:69 +#: code:addons/account_banking_pain_base/banking_export_pain.py:76 +#: code:addons/account_banking_pain_base/banking_export_pain.py:86 +#: code:addons/account_banking_pain_base/banking_export_pain.py:121 +#: code:addons/account_banking_pain_base/banking_export_pain.py:350 +#, python-format +msgid "Error:" +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_res_company +msgid "Companies" +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:47 +#, python-format +msgid "This IBAN is not valid : %s" +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:80 +#, python-format +msgid "Field type error:" +msgstr "" + +#. module: account_banking_pain_base +#: field:payment.line,struct_communication_type:0 +msgid "Structured Communication Type" +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:87 +#, python-format +msgid "The '%s' is empty or 0. It should have a non-null value." +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_banking_export_pain +msgid "banking.export.pain" +msgstr "" + +#. module: account_banking_pain_base +#: help:payment.mode,convert_to_ascii:0 +msgid "If active, OpenERP will convert each accented caracter to the corresponding unaccented caracter, so that only ASCII caracters are used in the generated PAIN file." +msgstr "" + +#. module: account_banking_pain_base +#: help:payment.line,priority:0 +msgid "This field will be used as the 'Instruction Priority' in the generated PAIN file." +msgstr "" + +#. module: account_banking_pain_base +#: view:res.company:0 +msgid "Payment Initiation" +msgstr "" + +#. module: account_banking_pain_base +#: selection:payment.line,priority:0 +msgid "High" +msgstr "" + +#. module: account_banking_pain_base +#: field:payment.mode,convert_to_ascii:0 +msgid "Convert to ASCII" +msgstr "" + diff --git a/account_banking_pain_base/i18n/fr.po b/account_banking_pain_base/i18n/fr.po new file mode 100644 index 000000000..e58b8ece0 --- /dev/null +++ b/account_banking_pain_base/i18n/fr.po @@ -0,0 +1,172 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * account_banking_pain_base +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2013-12-23 21:26+0000\n" +"PO-Revision-Date: 2014-02-01 04:48+0000\n" +"Last-Translator: Alexis de Lattre \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2014-05-31 06:02+0000\n" +"X-Generator: Launchpad (build 17031)\n" + +#. module: account_banking_pain_base +#: field:res.company,initiating_party_issuer:0 +msgid "Initiating Party Issuer" +msgstr "Initiating Party Issuer" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:122 +#, python-format +msgid "" +"The generated XML file is not valid against the official XML Schema " +"Definition. The generated XML file and the full error have been written in " +"the server logs. Here is the error, which may give you an idea on the cause " +"of the problem : %s" +msgstr "" +"Le fichier XML généré n'est pas valide par rapport à la Définition du Schéma " +"XML officiel. Le fichier XML généré et le message d'erreur complet ont été " +"écrits dans les logs du serveur. Voici l'erreur, qui vous donnera peut-être " +"une idée sur la cause du problème : %s" + +#. module: account_banking_pain_base +#: field:payment.line,priority:0 +msgid "Priority" +msgstr "Priorité" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_payment_line +msgid "Payment Line" +msgstr "Ligne de paiement" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_payment_mode +msgid "Payment Mode" +msgstr "Mode de paiement" + +#. module: account_banking_pain_base +#: help:res.company,initiating_party_issuer:0 +msgid "" +"This will be used as the 'Initiating Party Issuer' in the PAIN files " +"generated by OpenERP." +msgstr "" +"Ce champ sera le 'Initiating Party Issuer' dans les fichiers PAIN générés " +"par OpenERP." + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:351 +#, python-format +msgid "" +"Missing 'Structured Communication Type' on payment line with reference '%s'." +msgstr "" +"Le 'Type de communication structuré' n'est pas renseigné sur la ligne de " +"paiement ayant la référence '%s'." + +#. module: account_banking_pain_base +#: selection:payment.line,priority:0 +msgid "Normal" +msgstr "Normal" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:70 +#, python-format +msgid "Cannot compute the '%s' of the Payment Line with reference '%s'." +msgstr "" +"Impossible de calculer le '%s' de la ligne de paiement ayant la référence " +"'%s'." + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:77 +#, python-format +msgid "Cannot compute the '%s'." +msgstr "Impossible de calculer le '%s'." + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:81 +#, python-format +msgid "The type of the field '%s' is %s. It should be a string or unicode." +msgstr "" +"Le type du champ '%s' est %s. Il devrait être de type string ou unicode." + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:47 +#: code:addons/account_banking_pain_base/banking_export_pain.py:69 +#: code:addons/account_banking_pain_base/banking_export_pain.py:76 +#: code:addons/account_banking_pain_base/banking_export_pain.py:86 +#: code:addons/account_banking_pain_base/banking_export_pain.py:121 +#: code:addons/account_banking_pain_base/banking_export_pain.py:350 +#, python-format +msgid "Error:" +msgstr "Erreur :" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_res_company +msgid "Companies" +msgstr "Sociétés" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:47 +#, python-format +msgid "This IBAN is not valid : %s" +msgstr "Cet IBAN n'est pas valide : %s" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:80 +#, python-format +msgid "Field type error:" +msgstr "Erreur dans le type de champ :" + +#. module: account_banking_pain_base +#: field:payment.line,struct_communication_type:0 +msgid "Structured Communication Type" +msgstr "Type de communication structurée" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:87 +#, python-format +msgid "The '%s' is empty or 0. It should have a non-null value." +msgstr "Le '%s' est vide ou égal à 0. Il devrait avoir une valeur non-nulle." + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_banking_export_pain +msgid "banking.export.pain" +msgstr "banking.export.pain" + +#. module: account_banking_pain_base +#: help:payment.mode,convert_to_ascii:0 +msgid "" +"If active, OpenERP will convert each accented caracter to the corresponding " +"unaccented caracter, so that only ASCII caracters are used in the generated " +"PAIN file." +msgstr "" +"Si actif, OpenERP convertira chaque caractère accentué en son équivalent non " +"accentué, de telle façon que seuls des caractères ASCII soient utilisés dans " +"le fichier PAIN généré." + +#. module: account_banking_pain_base +#: help:payment.line,priority:0 +msgid "" +"This field will be used as the 'Instruction Priority' in the generated PAIN " +"file." +msgstr "Ce champ sera le 'Instruction Priority' dans le fichier PAIN généré." + +#. module: account_banking_pain_base +#: view:res.company:0 +msgid "Payment Initiation" +msgstr "Payment Initiation" + +#. module: account_banking_pain_base +#: selection:payment.line,priority:0 +msgid "High" +msgstr "Élevé" + +#. module: account_banking_pain_base +#: field:payment.mode,convert_to_ascii:0 +msgid "Convert to ASCII" +msgstr "Convertir en ASCII" diff --git a/account_banking_pain_base/i18n/nl.po b/account_banking_pain_base/i18n/nl.po new file mode 100644 index 000000000..721d24f68 --- /dev/null +++ b/account_banking_pain_base/i18n/nl.po @@ -0,0 +1,172 @@ +# Dutch translation for banking-addons +# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 +# This file is distributed under the same license as the banking-addons package. +# FIRST AUTHOR , 2014. +# +msgid "" +msgstr "" +"Project-Id-Version: banking-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2013-12-23 21:26+0000\n" +"PO-Revision-Date: 2014-02-11 08:32+0000\n" +"Last-Translator: Erwin van der Ploeg (BAS Solutions) \n" +"Language-Team: Dutch \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2014-05-31 06:02+0000\n" +"X-Generator: Launchpad (build 17031)\n" + +#. module: account_banking_pain_base +#: field:res.company,initiating_party_issuer:0 +msgid "Initiating Party Issuer" +msgstr "Initiating Party Issuer" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:122 +#, python-format +msgid "" +"The generated XML file is not valid against the official XML Schema " +"Definition. The generated XML file and the full error have been written in " +"the server logs. Here is the error, which may give you an idea on the cause " +"of the problem : %s" +msgstr "" +"Het gegenereerde XML bestand is niet geldig volgens de officiële XML schema " +"definities. Het gegenereerde XML bestand en de volledige fout zijn " +"weggeschreven in de server log bestanden. Hier is de fout, wat u een idee " +"kunt geven over de oorzaak van het probleem: %s\"" + +#. module: account_banking_pain_base +#: field:payment.line,priority:0 +msgid "Priority" +msgstr "Prioriteit" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_payment_line +msgid "Payment Line" +msgstr "Betaalregel" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_payment_mode +msgid "Payment Mode" +msgstr "Betaalwijze" + +#. module: account_banking_pain_base +#: help:res.company,initiating_party_issuer:0 +msgid "" +"This will be used as the 'Initiating Party Issuer' in the PAIN files " +"generated by OpenERP." +msgstr "" +"Dit wordt gebruikt als de 'Initiating Party Issuer' in de PAIN bestanden " +"gegenereerd door OpenERP." + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:351 +#, python-format +msgid "" +"Missing 'Structured Communication Type' on payment line with reference '%s'." +msgstr "" +"Ontbrekende 'Structured Communication Type' op betaalregel met referentie " +"'%s'." + +#. module: account_banking_pain_base +#: selection:payment.line,priority:0 +msgid "Normal" +msgstr "Normaal" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:70 +#, python-format +msgid "Cannot compute the '%s' of the Payment Line with reference '%s'." +msgstr "Kan de '%s' niet berekenen van de betaalregel met referentie '%s'." + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:77 +#, python-format +msgid "Cannot compute the '%s'." +msgstr "Kan de '%s' niet berekenen." + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:81 +#, python-format +msgid "The type of the field '%s' is %s. It should be a string or unicode." +msgstr "Het type van veld '%s' is %s. Dit moet een string of unicode zijn." + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:47 +#: code:addons/account_banking_pain_base/banking_export_pain.py:69 +#: code:addons/account_banking_pain_base/banking_export_pain.py:76 +#: code:addons/account_banking_pain_base/banking_export_pain.py:86 +#: code:addons/account_banking_pain_base/banking_export_pain.py:121 +#: code:addons/account_banking_pain_base/banking_export_pain.py:350 +#, python-format +msgid "Error:" +msgstr "Fout:" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_res_company +msgid "Companies" +msgstr "Bedrijven" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:47 +#, python-format +msgid "This IBAN is not valid : %s" +msgstr "Deze IBAN is niet geldig : %s" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:80 +#, python-format +msgid "Field type error:" +msgstr "Veld type fout:" + +#. module: account_banking_pain_base +#: field:payment.line,struct_communication_type:0 +msgid "Structured Communication Type" +msgstr "Structured Communication Type" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/banking_export_pain.py:87 +#, python-format +msgid "The '%s' is empty or 0. It should have a non-null value." +msgstr "De '%s' is leeg of 0. Deze waarde zou niet nul moeten zijn." + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_banking_export_pain +msgid "banking.export.pain" +msgstr "banking.export.pain" + +#. module: account_banking_pain_base +#: help:payment.mode,convert_to_ascii:0 +msgid "" +"If active, OpenERP will convert each accented caracter to the corresponding " +"unaccented caracter, so that only ASCII caracters are used in the generated " +"PAIN file." +msgstr "" +"Indien aangevinkt, zal OpenERP elk geaccentueerde karakter omzetten in een " +"overeenkomstige ongeaccentueerde karakter, zodat alleen ASCII karakters " +"worden gebruikt in het gegenereerde PAIN bestand." + +#. module: account_banking_pain_base +#: help:payment.line,priority:0 +msgid "" +"This field will be used as the 'Instruction Priority' in the generated PAIN " +"file." +msgstr "" +"Dit veld wordt gebruikt als de 'Instruction Priority' in het gegenereerde " +"PAIN bestand." + +#. module: account_banking_pain_base +#: view:res.company:0 +msgid "Payment Initiation" +msgstr "Payment Initiation" + +#. module: account_banking_pain_base +#: selection:payment.line,priority:0 +msgid "High" +msgstr "Hoog" + +#. module: account_banking_pain_base +#: field:payment.mode,convert_to_ascii:0 +msgid "Convert to ASCII" +msgstr "Converteer naar ASCII" diff --git a/account_banking_pain_base/payment_line.py b/account_banking_pain_base/payment_line.py new file mode 100644 index 000000000..0dffbcf42 --- /dev/null +++ b/account_banking_pain_base/payment_line.py @@ -0,0 +1,52 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# PAIN Base module for OpenERP +# Copyright (C) 2013 Akretion (http://www.akretion.com) +# @author: Alexis de Lattre +# +# 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 openerp.osv import orm, fields + + +class payment_line(orm.Model): + _inherit = 'payment.line' + + def _get_struct_communication_types(self, cr, uid, context=None): + return [('ISO', 'ISO')] + + _columns = { + 'priority': fields.selection([ + ('NORM', 'Normal'), + ('HIGH', 'High'), + ], 'Priority', + help="This field will be used as the 'Instruction Priority' in " + "the generated PAIN file."), + # Update size from 64 to 140, because PAIN allows 140 caracters + 'communication': fields.char( + 'Communication', size=140, required=True, + help="Used as the message between ordering customer and current " + "company. Depicts 'What do you want to say to the recipient " + "about this order ?'"), + 'struct_communication_type': fields.selection( + _get_struct_communication_types, 'Structured Communication Type'), + } + + _defaults = { + 'priority': 'NORM', + 'struct_communication_type': 'ISO', + } diff --git a/account_banking_pain_base/payment_line_view.xml b/account_banking_pain_base/payment_line_view.xml new file mode 100644 index 000000000..f92b1bbf5 --- /dev/null +++ b/account_banking_pain_base/payment_line_view.xml @@ -0,0 +1,41 @@ + + + + + + + pain.base.payment.line.form + payment.line + + + + + + + + + + + + + + pain.base.payment.line.inside.order.form + payment.order + + + + + + + + + + + + + + diff --git a/account_banking_pain_base/payment_mode.py b/account_banking_pain_base/payment_mode.py new file mode 100644 index 000000000..540d01b67 --- /dev/null +++ b/account_banking_pain_base/payment_mode.py @@ -0,0 +1,39 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# PAIN Base module for OpenERP +# Copyright (C) 2013 Akretion (http://www.akretion.com) +# @author: Alexis de Lattre +# +# 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 openerp.osv import orm, fields + + +class payment_mode(orm.Model): + _inherit = 'payment.mode' + + _columns = { + 'convert_to_ascii': fields.boolean( + 'Convert to ASCII', + help="If active, OpenERP will convert each accented caracter to " + "the corresponding unaccented caracter, so that only ASCII " + "caracters are used in the generated PAIN file."), + } + + _defaults = { + 'convert_to_ascii': True, + } diff --git a/account_banking_pain_base/payment_mode_view.xml b/account_banking_pain_base/payment_mode_view.xml new file mode 100644 index 000000000..2deb24999 --- /dev/null +++ b/account_banking_pain_base/payment_mode_view.xml @@ -0,0 +1,22 @@ + + + + + + + add.convert_to_ascii.in.payment.mode.form + payment.mode + + + + + + + + + + diff --git a/account_banking_payment_export/__init__.py b/account_banking_payment_export/__init__.py new file mode 100644 index 000000000..36ec7207a --- /dev/null +++ b/account_banking_payment_export/__init__.py @@ -0,0 +1 @@ +from . import model \ No newline at end of file diff --git a/account_banking_payment_export/__openerp__.py b/account_banking_payment_export/__openerp__.py new file mode 100644 index 000000000..424be1620 --- /dev/null +++ b/account_banking_payment_export/__openerp__.py @@ -0,0 +1,85 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (C) 2009 EduSense BV (). +# (C) 2011 - 2013 Therp BV (). +# (C) 2013 - 2014 ACSONE SA (). +# +# All other contributions are (C) by their respective contributors +# +# 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 . +# +############################################################################## + +{ + 'name': 'Account Banking - Payments Export Infrastructure', + 'version': '0.1.165', + 'license': 'AGPL-3', + 'author': 'Banking addons community', + 'website': 'https://launchpad.net/banking-addons', + 'category': 'Banking addons', + 'depends': [ + 'account_payment', + 'base_iban', # for manual_bank_tranfer + ], + 'conflicts': [ + # lp:account-payment/account_payment_extension also adds + # a type field to payment.mode, with a very similar purpose. + # We can't add a dependency on account_payment_extension here + # because account_payment_extension adds many other features + # that probably conflict with other parts of lp:banking-addons. + # Proposal to resolve: make account_payment_extension depend + # on the present account_banking_payment_export module. + 'account_payment_extension', + ], + 'data': [ + 'view/account_payment.xml', + 'view/bank_payment_manual.xml', + 'view/payment_mode.xml', + 'view/payment_mode_type.xml', + 'view/payment_order_create_view.xml', + 'data/payment_mode_type.xml', + 'security/ir.model.access.csv', + ], + 'demo': ['demo/banking_demo.xml'], + 'description': ''' + Infrastructure to export payment orders + plus some bug fixes and obvious enhancements to payment orders + that will hopefully land in offical addons one day. + + This technical module provides the base infrastructure to export + payment orders for electronic banking. It provides the following + technical features: + * a new payment.mode.type model + * payment.mode now has a mandatory type + * a better implementation of payment_mode.suitable_bank_types() based on payment.mode.type + * the "make payment" button launches a wizard depending on the payment.mode.type + * a manual payment mode type is provided as an example, with a default "do nothing" wizard + + To enable the use of payment order to collect money for customers, + it adds a payment_order_type (payment|debit) as a basis of direct debit support + (this field becomes visible when account_direct_debit is installed). + Refactoring note: this field should ideally go in account_direct_debit, + but account_banking_payment currently depends on it. + + Bug fixes and enhancement that should land in official addons: + * make the search function of the payment export wizard extensible + * fix lp:1275478: allow payment of customer refunds + * display the maturity date of the move lines when you are in + the wizard to select the lines to pay + ''', + 'installable': True, +} diff --git a/account_banking_payment_export/data/payment_mode_type.xml b/account_banking_payment_export/data/payment_mode_type.xml new file mode 100644 index 000000000..c1e4a4abd --- /dev/null +++ b/account_banking_payment_export/data/payment_mode_type.xml @@ -0,0 +1,14 @@ + + + + + + Manual Bank Transfer + BANKMAN + + + + + diff --git a/account_banking_payment_export/demo/banking_demo.xml b/account_banking_payment_export/demo/banking_demo.xml new file mode 100644 index 000000000..fd29e4c51 --- /dev/null +++ b/account_banking_payment_export/demo/banking_demo.xml @@ -0,0 +1,78 @@ + + + + + + + Fortuneo Banque + FTNOFRP1XXX + 26 avenue des Champs Elysées + 75008 + Paris + + + + + La Banque Postale + PSSTFRPPXXX + 115 rue de Sèvres + 75007 + Paris + + + + + Société Générale + SOGEFRPPXXX + 1 avenue du Roi Fabien 1er + 75008 + Paris + + + + + FR76 4242 4242 4242 4242 4242 424 + iban + + + La Banque Postale + PSSTFRPPXXX + + + + FR20 1242 1242 1242 1242 1242 124 + iban + + + Société Générale + SOGEFRPPXXX + + + + FR66 1212 1212 1212 1212 1212 121 + iban + + + Fortuneo Banque + FTNOFRP1XXX + + + + Credit Trf Banque Postale + + + + + + + + Credit Trf Société Générale + + + + + + + + + diff --git a/account_banking_payment_export/i18n/account_banking_payment_export.pot b/account_banking_payment_export/i18n/account_banking_payment_export.pot new file mode 100644 index 000000000..bb2ac6301 --- /dev/null +++ b/account_banking_payment_export/i18n/account_banking_payment_export.pot @@ -0,0 +1,145 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * account_banking_payment_export +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2013-10-25 15:58+0000\n" +"PO-Revision-Date: 2013-10-25 15:58+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: account_banking_payment_export +#: help:payment.mode.type,name:0 +msgid "Payment Type" +msgstr "" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_payment_order +msgid "Payment Order" +msgstr "" + +#. module: account_banking_payment_export +#: view:payment.manual:0 +msgid "Please execute payment order manually, and click OK when succesfully sent." +msgstr "" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_payment_mode +msgid "Payment Mode" +msgstr "" + +#. module: account_banking_payment_export +#: code:addons/account_banking_payment_export/model/account_payment.py:69 +#, python-format +msgid "You can only combine payment orders of the same type" +msgstr "" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_payment_mode_type +msgid "Payment Mode Type" +msgstr "" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_account_move_line +msgid "Journal Items" +msgstr "" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_payment_manual +msgid "Send payment order(s) manually" +msgstr "" + +#. module: account_banking_payment_export +#: field:payment.mode.type,name:0 +msgid "Name" +msgstr "" + +#. module: account_banking_payment_export +#: help:payment.mode.type,ir_model_id:0 +msgid "Select the Payment Wizard for payments of this type. Leave empty for manual processing" +msgstr "" + +#. module: account_banking_payment_export +#: view:payment.manual:0 +msgid "Manual payment" +msgstr "" + +#. module: account_banking_payment_export +#: field:payment.manual,payment_order_ids:0 +msgid "Payment orders" +msgstr "" + +#. module: account_banking_payment_export +#: code:addons/account_banking_payment_export/model/account_payment.py:52 +#, python-format +msgid "Payment Order Export" +msgstr "" + +#. module: account_banking_payment_export +#: help:payment.mode,type:0 +msgid "Select the Payment Type for the Payment Mode." +msgstr "" + +#. module: account_banking_payment_export +#: view:payment.order:0 +msgid "launch_wizard" +msgstr "" + +#. module: account_banking_payment_export +#: help:payment.mode.type,code:0 +msgid "Specify the Code for Payment Type" +msgstr "" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_payment_order_create +msgid "payment.order.create" +msgstr "" + +#. module: account_banking_payment_export +#: code:addons/account_banking_payment_export/model/account_payment.py:68 +#, python-format +msgid "Error" +msgstr "" + +#. module: account_banking_payment_export +#: field:payment.mode.type,ir_model_id:0 +msgid "Payment wizard" +msgstr "" + +#. module: account_banking_payment_export +#: field:payment.mode,type:0 +msgid "Payment type" +msgstr "" + +#. module: account_banking_payment_export +#: field:payment.mode.type,code:0 +msgid "Code" +msgstr "" + +#. module: account_banking_payment_export +#: view:payment.manual:0 +msgid "OK" +msgstr "" + +#. module: account_banking_payment_export +#: view:payment.mode.type:0 +msgid "Payment mode" +msgstr "" + +#. module: account_banking_payment_export +#: view:payment.manual:0 +msgid "Cancel" +msgstr "" + +#. module: account_banking_payment_export +#: field:payment.mode.type,suitable_bank_types:0 +msgid "Suitable bank types" +msgstr "" + diff --git a/account_banking_payment_export/i18n/nl.po b/account_banking_payment_export/i18n/nl.po new file mode 100644 index 000000000..dea08f97f --- /dev/null +++ b/account_banking_payment_export/i18n/nl.po @@ -0,0 +1,151 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * account_banking_payment_export +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2013-10-25 15:58+0000\n" +"PO-Revision-Date: 2013-12-03 11:49+0000\n" +"Last-Translator: Erwin van der Ploeg (BAS Solutions) \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2014-05-31 06:02+0000\n" +"X-Generator: Launchpad (build 17031)\n" + +#. module: account_banking_payment_export +#: help:payment.mode.type,name:0 +msgid "Payment Type" +msgstr "Betaalwijze" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_payment_order +msgid "Payment Order" +msgstr "Betalingsopdracht" + +#. module: account_banking_payment_export +#: view:payment.manual:0 +msgid "" +"Please execute payment order manually, and click OK when succesfully sent." +msgstr "" +"Voer de betaalopdracht handmatig uit en klik OK, wanneer succesvol verzonden." + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_payment_mode +msgid "Payment Mode" +msgstr "Betaalwijze" + +#. module: account_banking_payment_export +#: code:addons/account_banking_payment_export/model/account_payment.py:69 +#, 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_payment_export +#: model:ir.model,name:account_banking_payment_export.model_payment_mode_type +msgid "Payment Mode Type" +msgstr "Betaalwijze soort" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_account_move_line +msgid "Journal Items" +msgstr "Boekingen" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_payment_manual +msgid "Send payment order(s) manually" +msgstr "Verzend betaalopdrachten handmatig" + +#. module: account_banking_payment_export +#: field:payment.mode.type,name:0 +msgid "Name" +msgstr "Naam" + +#. module: account_banking_payment_export +#: help:payment.mode.type,ir_model_id:0 +msgid "" +"Select the Payment Wizard for payments of this type. Leave empty for manual " +"processing" +msgstr "" +"Selecteer de wizard voor het verwerken van betalingen van dit type. Laat " +"leeg voor handmatige verwerking." + +#. module: account_banking_payment_export +#: view:payment.manual:0 +msgid "Manual payment" +msgstr "Handmatige betaling" + +#. module: account_banking_payment_export +#: field:payment.manual,payment_order_ids:0 +msgid "Payment orders" +msgstr "Betaalopdrachten" + +#. module: account_banking_payment_export +#: code:addons/account_banking_payment_export/model/account_payment.py:52 +#, python-format +msgid "Payment Order Export" +msgstr "Betaalopdracht export" + +#. module: account_banking_payment_export +#: help:payment.mode,type:0 +msgid "Select the Payment Type for the Payment Mode." +msgstr "Selecteer het type van de betaalmodus." + +#. module: account_banking_payment_export +#: view:payment.order:0 +msgid "launch_wizard" +msgstr "launch_wizard" + +#. module: account_banking_payment_export +#: help:payment.mode.type,code:0 +msgid "Specify the Code for Payment Type" +msgstr "Geef de code op voor het betaaltype" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_payment_order_create +msgid "payment.order.create" +msgstr "payment.order.create" + +#. module: account_banking_payment_export +#: code:addons/account_banking_payment_export/model/account_payment.py:68 +#, python-format +msgid "Error" +msgstr "Fout" + +#. module: account_banking_payment_export +#: field:payment.mode.type,ir_model_id:0 +msgid "Payment wizard" +msgstr "Betaalwizard" + +#. module: account_banking_payment_export +#: field:payment.mode,type:0 +msgid "Payment type" +msgstr "Betaaltype" + +#. module: account_banking_payment_export +#: field:payment.mode.type,code:0 +msgid "Code" +msgstr "Code" + +#. module: account_banking_payment_export +#: view:payment.manual:0 +msgid "OK" +msgstr "OK" + +#. module: account_banking_payment_export +#: view:payment.mode.type:0 +msgid "Payment mode" +msgstr "Betaalwijze" + +#. module: account_banking_payment_export +#: view:payment.manual:0 +msgid "Cancel" +msgstr "Annuleren" + +#. module: account_banking_payment_export +#: field:payment.mode.type,suitable_bank_types:0 +msgid "Suitable bank types" +msgstr "Geschikte banktypen" diff --git a/account_banking_payment_export/migrations/7.0.0.1.165/pre-migration.py b/account_banking_payment_export/migrations/7.0.0.1.165/pre-migration.py new file mode 100644 index 000000000..a420f05fd --- /dev/null +++ b/account_banking_payment_export/migrations/7.0.0.1.165/pre-migration.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (C) 2014 Akretion (http://www.akretion.com/) +# @author: Alexis de Lattre +# +# 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 + cr.execute( + "UPDATE payment_line SET communication = communication2, " + "communication2 = null " + "FROM payment_order " + "WHERE payment_line.order_id = payment_order.id " + "AND payment_order.state in ('draft', 'open') " + "AND payment_line.state = 'normal' " + "AND communication2 is not null") diff --git a/account_banking_payment_export/model/__init__.py b/account_banking_payment_export/model/__init__.py new file mode 100644 index 000000000..74ab85c8d --- /dev/null +++ b/account_banking_payment_export/model/__init__.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +from . import account_move_line +from . import account_payment +from . import bank_payment_manual +from . import payment_mode +from . import payment_mode_type +from . import payment_order_create diff --git a/account_banking_payment_export/model/account_move_line.py b/account_banking_payment_export/model/account_move_line.py new file mode 100644 index 000000000..67c8b849d --- /dev/null +++ b/account_banking_payment_export/model/account_move_line.py @@ -0,0 +1,98 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (C) 2004-2014 OpenERP S.A. (http://www.openerp.com/) +# (C) 2014 Akretion (http://www.akretion.com/) +# +# 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 openerp.osv import orm, fields +from operator import itemgetter + + +# All the code below aims at fixing one small issue in _to_pay_search() +# But _to_pay_search() is the search function of the field 'amount_to_pay' +# which is a field.function and these functions are not inheritable in OpenERP. +# So we have to inherit the field 'amount_to_pay' and duplicate the related +# functions +# If the patch that I proposed in this bug report +# https://bugs.launchpad.net/openobject-addons/+bug/1275478 +# is integrated in addons/account_payment, then we will be able to remove this +# file. -- Alexis de Lattre +class account_move_line(orm.Model): + _inherit = 'account.move.line' + + def amount_to_pay(self, cr, uid, ids, name, arg=None, context=None): + """ Return the amount still to pay regarding all the payemnt orders + (excepting cancelled orders)""" + if not ids: + return {} + cr.execute("""SELECT ml.id, + CASE WHEN ml.amount_currency < 0 + THEN - ml.amount_currency + ELSE ml.credit + END - + (SELECT coalesce(sum(amount_currency),0) + FROM payment_line pl + INNER JOIN payment_order po + ON (pl.order_id = po.id) + WHERE move_line_id = ml.id + AND po.state != 'cancel') AS amount + FROM account_move_line ml + WHERE id IN %s""", (tuple(ids),)) + r = dict(cr.fetchall()) + return r + + def _to_pay_search(self, cr, uid, obj, name, args, context=None): + if not args: + return [] + line_obj = self.pool.get('account.move.line') + query = line_obj._query_get(cr, uid, context={}) + where = ' and '.join(map(lambda x: '''(SELECT + CASE WHEN l.amount_currency < 0 + THEN - l.amount_currency + ELSE l.credit + END - coalesce(sum(pl.amount_currency), 0) + FROM payment_line pl + INNER JOIN payment_order po ON (pl.order_id = po.id) + WHERE move_line_id = l.id + AND po.state != 'cancel' + ) %(operator)s %%s ''' % {'operator': x[1]}, args)) + sql_args = tuple(map(itemgetter(2), args)) + + cr.execute(('''SELECT id + FROM account_move_line l + WHERE account_id IN (select id + FROM account_account + WHERE type in %s AND active) + AND reconcile_id IS null + AND credit > 0 + AND ''' + where + ' and ' + query), + (('payable', 'receivable'),)+sql_args ) + # The patch we have compared to the original function in + # addons/account_payment is just above : + # original code : type = 'payable' + # fixed code : type in ('payable', 'receivable') + + res = cr.fetchall() + if not res: + return [('id', '=', '0')] + return [('id', 'in', map(lambda x:x[0], res))] + + _columns = { + 'amount_to_pay': fields.function(amount_to_pay, + type='float', string='Amount to pay', fnct_search=_to_pay_search), + } diff --git a/account_banking_payment_export/model/account_payment.py b/account_banking_payment_export/model/account_payment.py new file mode 100644 index 000000000..fe69c290f --- /dev/null +++ b/account_banking_payment_export/model/account_payment.py @@ -0,0 +1,90 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (C) 2009 EduSense BV (). +# (C) 2011 - 2013 Therp BV (). +# +# All other contributions are (C) by their respective contributors +# +# 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 . +# +############################################################################## + +from openerp.osv import orm, fields +from openerp.tools.translate import _ +from openerp import netsvc + + +class payment_order(orm.Model): + _inherit = 'payment.order' + + _columns = { + 'payment_order_type': fields.selection( + [('payment', 'Payment'), ('debit', 'Direct debit')], + 'Payment order type', required=True, + readonly=True, states={'draft': [('readonly', False)]}, + ), + 'mode_type': fields.related( + 'mode', 'type', type='many2one', relation='payment.mode.type', + string='Payment Type'), + } + + _defaults = { + 'payment_order_type': 'payment', + } + + def launch_wizard(self, cr, uid, ids, context=None): + """ + Search for a wizard to launch according to the type. + If type is manual. just confirm the order. + Previously (pre-v6) in account_payment/wizard/wizard_pay.py + """ + if context == None: + context = {} + result = {} + orders = self.browse(cr, uid, ids, context) + order = orders[0] + # check if a wizard is defined for the first order + if order.mode.type and order.mode.type.ir_model_id: + context['active_ids'] = ids + wizard_model = order.mode.type.ir_model_id.model + wizard_obj = self.pool.get(wizard_model) + wizard_id = wizard_obj.create(cr, uid, {}, context) + result = { + 'name': wizard_obj._description or _('Payment Order Export'), + 'view_type': 'form', + 'view_mode': 'form', + 'res_model': wizard_model, + 'domain': [], + 'context': context, + 'type': 'ir.actions.act_window', + 'target': 'new', + 'res_id': wizard_id, + 'nodestroy': True, + } + else: + # should all be manual orders without type or wizard model + for order in orders[1:]: + if order.mode.type and order.mode.type.ir_model_id: + raise orm.except_orm( + _('Error'), + _('You can only combine payment orders of the same type') + ) + # process manual payments + wf_service = netsvc.LocalService('workflow') + for order_id in ids: + wf_service.trg_validate(uid, 'payment.order', order_id, 'done', cr) + return result diff --git a/account_banking_payment_export/model/bank_payment_manual.py b/account_banking_payment_export/model/bank_payment_manual.py new file mode 100644 index 000000000..8cfa35d53 --- /dev/null +++ b/account_banking_payment_export/model/bank_payment_manual.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (C) 2009 EduSense BV (). +# (C) 2011 - 2013 Therp BV (). +# +# All other contributions are (C) by their respective contributors +# +# 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 . +# +############################################################################## + +''' +This module contains a single "wizard" for confirming manual +bank transfers. +''' + +from openerp.osv import orm, fields +from openerp import netsvc + + +class payment_manual(orm.TransientModel): + _name = 'payment.manual' + _description = 'Send payment order(s) manually' + + _columns = { + 'payment_order_ids': fields.many2many('payment.order', + 'wiz_manual_payorders_rel', 'wizard_id', 'payment_order_id', + 'Payment orders', readonly=True), + } + + def create(self, cr, uid, vals, context=None): + payment_order_ids = context.get('active_ids', []) + vals.update({ + 'payment_order_ids': [[6, 0, payment_order_ids]], + }) + return super(payment_manual, self).create(cr, uid, + vals, context=context) + + def button_ok(self, cr, uid, ids, context=None): + wf_service = netsvc.LocalService('workflow') + for wiz in self.browse(cr, uid, ids, context=context): + for order_id in wiz.payment_order_ids: + wf_service.trg_validate( + uid, 'payment.order', order_id.id, 'done', cr) + return {'type': 'ir.actions.act_window_close'} diff --git a/account_banking_payment_export/model/payment_mode.py b/account_banking_payment_export/model/payment_mode.py new file mode 100644 index 000000000..cac103402 --- /dev/null +++ b/account_banking_payment_export/model/payment_mode.py @@ -0,0 +1,61 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (C) 2009 EduSense BV (). +# (C) 2011 - 2013 Therp BV (). +# +# All other contributions are (C) by their respective contributors +# +# 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 . +# +############################################################################## + +from openerp.osv import orm, fields + + +class payment_mode(orm.Model): + ''' Restoring the payment type from version 5, + used to select the export wizard (if any) ''' + _inherit = "payment.mode" + + def suitable_bank_types(self, cr, uid, payment_mode_id=None, context=None): + """ Reinstates functional code for suitable bank type filtering. + Current code in account_payment is disfunctional. + """ + res = [] + payment_mode = self.browse( + cr, uid, payment_mode_id, context) + if (payment_mode and payment_mode.type and + payment_mode.type.suitable_bank_types): + res = [t.code for t in payment_mode.type.suitable_bank_types] + return res + + _columns = { + 'type': fields.many2one( + 'payment.mode.type', 'Payment type', + required=True, + help='Select the Payment Type for the Payment Mode.' + ), + 'payment_order_type': fields.related( + 'type', 'payment_order_type', readonly=True, type='selection', + selection=[('payment', 'Payment'), ('debit', 'Direct debit')], + string="Payment Order Type"), + 'active': fields.boolean('Active'), + } + + _defaults = { + 'active': True, + } diff --git a/account_banking_payment_export/model/payment_mode_type.py b/account_banking_payment_export/model/payment_mode_type.py new file mode 100644 index 000000000..e65727715 --- /dev/null +++ b/account_banking_payment_export/model/payment_mode_type.py @@ -0,0 +1,71 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (C) 2009 EduSense BV (). +# (C) 2011 - 2013 Therp BV (). +# +# All other contributions are (C) by their respective contributors +# +# 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 . +# +############################################################################## + +from openerp.osv import orm, fields + + +class payment_mode_type(orm.Model): + _name = 'payment.mode.type' + _description = 'Payment Mode Type' + _columns = { + 'name': fields.char( + 'Name', size=64, required=True, + help='Payment Type' + ), + 'code': fields.char( + 'Code', size=64, required=True, + help='Specify the Code for Payment Type' + ), + 'suitable_bank_types': fields.many2many( + 'res.partner.bank.type', + 'bank_type_payment_type_rel', + 'pay_type_id', 'bank_type_id', + 'Suitable bank types', required=True), + 'ir_model_id': fields.many2one( + 'ir.model', 'Payment wizard', + help=('Select the Payment Wizard for payments of this type. ' + 'Leave empty for manual processing'), + domain=[('osv_memory', '=', True)], + ), + 'payment_order_type': fields.selection( + [('payment', 'Payment'), ('debit', 'Direct debit')], + 'Payment order type', required=True, + ), + 'active': fields.boolean('Active'), + } + + _defaults = { + 'payment_order_type': 'payment', + 'active': True, + } + + def _auto_init(self, cr, context=None): + r = super(payment_mode_type, self)._auto_init(cr, context=context) + # migrate xmlid from manual_bank_transfer to avoid dependency on account_banking + cr.execute("""UPDATE ir_model_data SET module='account_banking_payment_export' + WHERE module='account_banking' AND + name='manual_bank_tranfer' AND + model='payment.mode.type'""") + return r diff --git a/account_banking_payment_export/model/payment_order_create.py b/account_banking_payment_export/model/payment_order_create.py new file mode 100644 index 000000000..20d8c3ac1 --- /dev/null +++ b/account_banking_payment_export/model/payment_order_create.py @@ -0,0 +1,199 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (C) 2009 EduSense BV (). +# (C) 2011 - 2013 Therp BV (). +# +# All other contributions are (C) by their respective contributors +# +# 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 . +# +############################################################################## + +from openerp.osv import orm, fields +from openerp.tools.translate import _ + + +class payment_order_create(orm.TransientModel): + _inherit = 'payment.order.create' + + def extend_payment_order_domain( + self, cr, uid, payment_order, domain, context=None): + if payment_order.payment_order_type == 'payment': + domain += [ + ('account_id.type', 'in', ('payable', 'receivable')), + ('amount_to_pay', '>', 0) + ] + return True + + def search_entries(self, cr, uid, ids, context=None): + """ + This method taken from account_payment module. + We adapt the domain based on the payment_order_type + """ + line_obj = self.pool.get('account.move.line') + mod_obj = self.pool.get('ir.model.data') + if context is None: + context = {} + data = self.read(cr, uid, ids, ['duedate'], context=context)[0] + search_due_date = data['duedate'] + + ### start account_banking_payment ### + payment = self.pool.get('payment.order').browse( + cr, uid, context['active_id'], context=context) + # Search for move line to pay: + domain = [ + ('move_id.state', '=', 'posted'), + ('reconcile_id', '=', False), + ('company_id', '=', payment.mode.company_id.id), + ] + self.extend_payment_order_domain( + cr, uid, payment, domain, context=context) + ### end account_direct_debit ### + + domain = domain + [ + '|', ('date_maturity', '<=', search_due_date), + ('date_maturity', '=', False) + ] + line_ids = line_obj.search(cr, uid, domain, context=context) + context.update({'line_ids': line_ids}) + model_data_ids = mod_obj.search( + cr, uid,[ + ('model', '=', 'ir.ui.view'), + ('name', '=', 'view_create_payment_order_lines')], + context=context) + resource_id = mod_obj.read( + cr, uid, model_data_ids, fields=['res_id'], + context=context)[0]['res_id'] + return {'name': _('Entry Lines'), + 'context': context, + 'view_type': 'form', + 'view_mode': 'form', + 'res_model': 'payment.order.create', + 'views': [(resource_id, 'form')], + 'type': 'ir.actions.act_window', + 'target': 'new', + } + + def _prepare_payment_line(self, cr, uid, payment, line, context=None): + '''This function is designed to be inherited + The resulting dict is passed to the create method of payment.line''' + _today = fields.date.context_today(self, cr, uid, context=context) + if payment.date_prefered == "now": + #no payment date => immediate payment + date_to_pay = False + elif payment.date_prefered == 'due': + ### account_banking + # date_to_pay = line.date_maturity + date_to_pay = ( + line.date_maturity + if line.date_maturity and line.date_maturity > _today + else False) + ### end account banking + elif payment.date_prefered == 'fixed': + ### account_banking + # date_to_pay = payment.date_scheduled + date_to_pay = ( + payment.date_scheduled + if payment.date_scheduled and payment.date_scheduled > _today + else False) + ### end account banking + + ### account_banking + state = 'normal' + communication = line.ref or '-' + if line.invoice: + if line.invoice.type in ('in_invoice', 'in_refund'): + if line.invoice.reference_type == 'structured': + state = 'structured' + communication = line.invoice.reference + else: + if line.invoice.reference: + communication = line.invoice.reference + elif line.invoice.supplier_invoice_number: + communication = line.invoice.supplier_invoice_number + else: + # Make sure that the communication includes the + # customer invoice number (in the case of debit order) + communication = line.invoice.number.replace('/', '') + state = 'structured' + + # support debit orders when enabled + if (payment.payment_order_type == 'debit' and + 'amount_to_receive' in line): + amount_currency = line.amount_to_receive + else: + amount_currency = line.amount_to_pay + ### end account_banking + + ### account banking + # t = None + # line2bank = line_obj.line2bank(cr, uid, line_ids, t, context) + line2bank = self.pool['account.move.line'].line2bank( + cr, uid, [line.id], payment.mode.id, context) + ### end account banking + + res = { + 'move_line_id': line.id, + 'amount_currency': amount_currency, + 'bank_id': line2bank.get(line.id), + 'order_id': payment.id, + 'partner_id': line.partner_id and line.partner_id.id or False, + ### account banking + # 'communication': line.ref or '/' + 'communication': communication, + 'state': state, + ### end account banking + 'date': date_to_pay, + 'currency': (line.invoice and line.invoice.currency_id.id + or line.journal_id.currency.id + or line.journal_id.company_id.currency_id.id), + } + return res + + def create_payment(self, cr, uid, ids, context=None): + ''' + This method is a slightly modified version of the existing method on this + model in account_payment. + - pass the payment mode to line2bank() + - allow invoices to create influence on the payment process: not only 'Free' + references are allowed, but others as well + - check date_to_pay is not in the past. + ''' + if context is None: + context = {} + data = self.read(cr, uid, ids, [], context=context)[0] + line_ids = data['entries'] + if not line_ids: + return {'type': 'ir.actions.act_window_close'} + + payment = self.pool['payment.order'].browse( + cr, uid, context['active_id'], context=context) + ## Populate the current payment with new lines: + for line in self.pool['account.move.line'].browse( + cr, uid, line_ids, context=context): + vals = self._prepare_payment_line( + cr, uid, payment, line, context=context) + self.pool['payment.line'].create(cr, uid, vals, context=context) + # Force reload of payment order view as a workaround for lp:1155525 + return {'name': _('Payment Orders'), + 'context': context, + 'view_type': 'form', + 'view_mode': 'form,tree', + 'res_model': 'payment.order', + 'res_id': context['active_id'], + 'type': 'ir.actions.act_window', + } diff --git a/account_banking_payment_export/security/ir.model.access.csv b/account_banking_payment_export/security/ir.model.access.csv new file mode 100644 index 000000000..699f2d023 --- /dev/null +++ b/account_banking_payment_export/security/ir.model.access.csv @@ -0,0 +1,2 @@ +"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" +"access_payment_mode_type","payment.mode.type","model_payment_mode_type","account_payment.group_account_payment",1,1,1,1 diff --git a/account_banking_payment_export/view/account_payment.xml b/account_banking_payment_export/view/account_payment.xml new file mode 100644 index 000000000..3e9d35882 --- /dev/null +++ b/account_banking_payment_export/view/account_payment.xml @@ -0,0 +1,23 @@ + + + + + + + account.payment.order.form.banking-1 + + payment.order + + + launch_wizard + + + + + + + + + diff --git a/account_banking_payment_export/view/bank_payment_manual.xml b/account_banking_payment_export/view/bank_payment_manual.xml new file mode 100644 index 000000000..e350c9b6f --- /dev/null +++ b/account_banking_payment_export/view/bank_payment_manual.xml @@ -0,0 +1,18 @@ + + + + + Form for manual payment wizard + payment.manual + +
+
+
+
+
diff --git a/account_banking_payment_export/view/payment_mode.xml b/account_banking_payment_export/view/payment_mode.xml new file mode 100644 index 000000000..611b233e8 --- /dev/null +++ b/account_banking_payment_export/view/payment_mode.xml @@ -0,0 +1,21 @@ + + + + + + + payment.mode.form.inherit + payment.mode + + + + + + + + + + + diff --git a/account_banking_payment_export/view/payment_mode_type.xml b/account_banking_payment_export/view/payment_mode_type.xml new file mode 100644 index 000000000..a3bd21c25 --- /dev/null +++ b/account_banking_payment_export/view/payment_mode_type.xml @@ -0,0 +1,59 @@ + + + + + + payment.mode.tree.inherit + payment.mode + + + + + + + + + + + view.payment.mode.type.form + payment.mode.type + +
+ + + + + + + +
+
+
+ + + view.payment.mode.type.tree + payment.mode.type + + + + + + + + + + + + Payment Type + payment.mode.type + form + tree,form + {'active_test': False} + + + + +
+
diff --git a/account_banking_payment_export/view/payment_order_create_view.xml b/account_banking_payment_export/view/payment_order_create_view.xml new file mode 100644 index 000000000..8a6d69a47 --- /dev/null +++ b/account_banking_payment_export/view/payment_order_create_view.xml @@ -0,0 +1,23 @@ + + + + + + + add.context.to.display.maturity.date + payment.order.create + + + + {'journal_type': 'sale'} + 1 + + + + + + diff --git a/account_banking_sepa_direct_debit/__init__.py b/account_banking_sepa_direct_debit/__init__.py new file mode 100644 index 000000000..f852fb7bd --- /dev/null +++ b/account_banking_sepa_direct_debit/__init__.py @@ -0,0 +1,25 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# SEPA Direct Debit module for OpenERP +# Copyright (C) 2013 Akretion (http://www.akretion.com) +# @author: Alexis de Lattre +# +# 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 . import company +from . import wizard +from . import account_banking_sdd diff --git a/account_banking_sepa_direct_debit/__openerp__.py b/account_banking_sepa_direct_debit/__openerp__.py new file mode 100644 index 000000000..611127a84 --- /dev/null +++ b/account_banking_sepa_direct_debit/__openerp__.py @@ -0,0 +1,62 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# SEPA Direct Debit module for OpenERP +# Copyright (C) 2013 Akretion (http://www.akretion.com) +# @author: Alexis de Lattre +# +# 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': 'Account Banking SEPA Direct Debit', + 'summary': 'Create SEPA files for Direct Debit', + 'version': '0.1', + 'license': 'AGPL-3', + 'author': 'Akretion', + 'website': 'http://www.akretion.com', + 'category': 'Banking addons', + 'depends': ['account_direct_debit', 'account_banking_pain_base'], + 'external_dependencies': { + 'python': ['unidecode', 'lxml'], + }, + 'data': [ + 'security/original_mandate_required_security.xml', + 'account_banking_sdd_view.xml', + 'sdd_mandate_view.xml', + 'res_partner_bank_view.xml', + 'account_payment_view.xml', + 'company_view.xml', + 'mandate_expire_cron.xml', + 'account_invoice_view.xml', + 'wizard/export_sdd_view.xml', + 'data/payment_type_sdd.xml', + 'data/mandate_reference_sequence.xml', + 'security/ir.model.access.csv', + ], + 'demo': ['sepa_direct_debit_demo.xml'], + 'description': ''' +Module to export direct debit payment orders in SEPA XML file format. + +SEPA PAIN (PAyment INitiation) is the new european standard for Customer-to-Bank payment instructions. This module implements SEPA Direct Debit (SDD), more specifically PAIN versions 008.001.02, 008.001.03 and 008.001.04. It is part of the ISO 20022 standard, available on http://www.iso20022.org. + +The Implementation Guidelines for SEPA Direct Debit published by the European Payments Council (http://http://www.europeanpaymentscouncil.eu) use PAIN version 008.001.02. So if you don't know which version your bank supports, you should try version 008.001.02 first. + +This module uses the framework provided by the banking addons, cf https://launchpad.net/banking-addons + +Please contact Alexis de Lattre from Akretion for any help or question about this module. + ''', + 'active': False, + 'installable': True, +} diff --git a/account_banking_sepa_direct_debit/account_banking_sdd.py b/account_banking_sepa_direct_debit/account_banking_sdd.py new file mode 100644 index 000000000..87e50111b --- /dev/null +++ b/account_banking_sepa_direct_debit/account_banking_sdd.py @@ -0,0 +1,440 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# SEPA Direct Debit module for OpenERP +# Copyright (C) 2013 Akretion (http://www.akretion.com) +# @author: Alexis de Lattre +# +# 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 openerp.osv import orm, fields +from openerp.tools.translate import _ +from openerp.addons.decimal_precision import decimal_precision as dp +from unidecode import unidecode +from datetime import datetime +from dateutil.relativedelta import relativedelta +import logging + +NUMBER_OF_UNUSED_MONTHS_BEFORE_EXPIRY = 36 + +logger = logging.getLogger(__name__) + + +class banking_export_sdd(orm.Model): + '''SEPA Direct Debit export''' + _name = 'banking.export.sdd' + _description = __doc__ + _rec_name = 'filename' + + def _generate_filename(self, cr, uid, ids, name, arg, context=None): + res = {} + for sepa_file in self.browse(cr, uid, ids, context=context): + ref = sepa_file.payment_order_ids[0].reference + if ref: + label = unidecode(ref.replace('/', '-')) + else: + label = 'error' + res[sepa_file.id] = 'sdd_%s.xml' % label + return res + + _columns = { + 'payment_order_ids': fields.many2many( + 'payment.order', + 'account_payment_order_sdd_rel', + 'banking_export_sepa_id', 'account_order_id', + 'Payment Orders', + readonly=True), + 'nb_transactions': fields.integer( + 'Number of Transactions', readonly=True), + 'total_amount': fields.float( + 'Total Amount', digits_compute=dp.get_precision('Account'), + readonly=True), + 'batch_booking': fields.boolean( + 'Batch Booking', readonly=True, + help="If true, the bank statement will display only one credit " + "line for all the direct debits of the SEPA file ; if false, " + "the bank statement will display one credit line per direct " + "debit of the SEPA file."), + 'charge_bearer': fields.selection([ + ('SLEV', 'Following Service Level'), + ('SHAR', 'Shared'), + ('CRED', 'Borne by Creditor'), + ('DEBT', 'Borne by Debtor'), + ], 'Charge Bearer', readonly=True, + help="Following service level : transaction charges are to be " + "applied following the rules agreed in the service level and/or " + "scheme (SEPA Core messages must use this). Shared : " + "transaction charges on the creditor side are to be borne by " + "the creditor, transaction charges on the debtor side are to be " + "borne by the debtor. Borne by creditor : all transaction " + "charges are to be borne by the creditor. Borne by debtor : " + "all transaction charges are to be borne by the debtor."), + 'create_date': fields.datetime('Generation Date', readonly=True), + 'file': fields.binary('SEPA File', readonly=True), + 'filename': fields.function( + _generate_filename, type='char', size=256, + string='Filename', readonly=True, store=True), + 'state': fields.selection([ + ('draft', 'Draft'), + ('sent', 'Sent'), + ], 'State', readonly=True), + } + + _defaults = { + 'state': 'draft', + } + + +class sdd_mandate(orm.Model): + '''SEPA Direct Debit Mandate''' + _name = 'sdd.mandate' + _description = __doc__ + _rec_name = 'unique_mandate_reference' + _inherit = ['mail.thread'] + _order = 'signature_date desc' + _track = { + 'state': { + 'account_banking_sepa_direct_debit.mandate_valid': + lambda self, cr, uid, obj, ctx=None: + obj['state'] == 'valid', + 'account_banking_sepa_direct_debit.mandate_expired': + lambda self, cr, uid, obj, ctx=None: + obj['state'] == 'expired', + 'account_banking_sepa_direct_debit.mandate_cancel': + lambda self, cr, uid, obj, ctx=None: + obj['state'] == 'cancel', + }, + 'recurrent_sequence_type': { + 'account_banking_sepa_direct_debit.recurrent_sequence_type_first': + lambda self, cr, uid, obj, ctx=None: + obj['recurrent_sequence_type'] == 'first', + 'account_banking_sepa_direct_debit.' + 'recurrent_sequence_type_recurring': + lambda self, cr, uid, obj, ctx=None: + obj['recurrent_sequence_type'] == 'recurring', + 'account_banking_sepa_direct_debit.recurrent_sequence_type_final': + lambda self, cr, uid, obj, ctx=None: + obj['recurrent_sequence_type'] == 'final', + } + } + + _columns = { + 'partner_bank_id': fields.many2one( + 'res.partner.bank', 'Bank Account', track_visibility='onchange'), + 'partner_id': fields.related( + 'partner_bank_id', 'partner_id', type='many2one', + relation='res.partner', string='Partner', readonly=True), + 'company_id': fields.many2one('res.company', 'Company', required=True), + 'unique_mandate_reference': fields.char( + 'Unique Mandate Reference', size=35, readonly=True, + track_visibility='always'), + 'type': fields.selection([ + ('recurrent', 'Recurrent'), + ('oneoff', 'One-Off'), + ], 'Type of Mandate', required=True, track_visibility='always'), + 'recurrent_sequence_type': fields.selection([ + ('first', 'First'), + ('recurring', 'Recurring'), + ('final', 'Final'), + ], 'Sequence Type for Next Debit', track_visibility='onchange', + help="This field is only used for Recurrent mandates, not for " + "One-Off mandates."), + 'signature_date': fields.date( + 'Date of Signature of the Mandate', track_visibility='onchange'), + 'scan': fields.binary('Scan of the Mandate'), + 'last_debit_date': fields.date( + 'Date of the Last Debit', readonly=True), + 'state': fields.selection([ + ('draft', 'Draft'), + ('valid', 'Valid'), + ('expired', 'Expired'), + ('cancel', 'Cancelled'), + ], 'Status', + help="Only valid mandates can be used in a payment line. A " + "cancelled mandate is a mandate that has been cancelled by " + "the customer. A one-off mandate expires after its first use. " + "A recurrent mandate expires after it's final use or if it " + "hasn't been used for 36 months."), + 'payment_line_ids': fields.one2many( + 'payment.line', 'sdd_mandate_id', "Related Payment Lines"), + 'sepa_migrated': fields.boolean( + 'Migrated to SEPA', track_visibility='onchange', + help="If this field is not active, the mandate section of the " + "next direct debit file that include this mandate will contain " + "the 'Original Mandate Identification' and the 'Original " + "Creditor Scheme Identification'. This is required in a few " + "countries (Belgium for instance), but not in all countries. " + "If this is not required in your country, you should keep this " + "field always active."), + 'original_mandate_identification': fields.char( + 'Original Mandate Identification', size=35, + track_visibility='onchange', + help="When the field 'Migrated to SEPA' is not active, this " + "field will be used as the Original Mandate Identification in " + "the Direct Debit file."), + } + + _defaults = { + 'company_id': lambda self, cr, uid, context: + self.pool['res.company']._company_default_get( + cr, uid, 'sdd.mandate', context=context), + 'unique_mandate_reference': '/', + 'state': 'draft', + 'sepa_migrated': True, + } + + _sql_constraints = [( + 'mandate_ref_company_uniq', + 'unique(unique_mandate_reference, company_id)', + 'A Mandate with the same reference already exists for this company !' + )] + + def create(self, cr, uid, vals, context=None): + if vals.get('unique_mandate_reference', '/') == '/': + vals['unique_mandate_reference'] = \ + self.pool['ir.sequence'].next_by_code( + cr, uid, 'sdd.mandate.reference', context=context) + return super(sdd_mandate, self).create(cr, uid, vals, context=context) + + def _check_sdd_mandate(self, cr, uid, ids): + for mandate in self.browse(cr, uid, ids): + if (mandate.signature_date and + mandate.signature_date > + datetime.today().strftime('%Y-%m-%d')): + raise orm.except_orm( + _('Error:'), + _("The date of signature of mandate '%s' is in the " + "future !") + % mandate.unique_mandate_reference) + if mandate.state == 'valid' and not mandate.signature_date: + raise orm.except_orm( + _('Error:'), + _("Cannot validate the mandate '%s' without a date of " + "signature.") + % mandate.unique_mandate_reference) + if mandate.state == 'valid' and not mandate.partner_bank_id: + raise orm.except_orm( + _('Error:'), + _("Cannot validate the mandate '%s' because it is not " + "attached to a bank account.") + % mandate.unique_mandate_reference) + + if (mandate.signature_date and mandate.last_debit_date and + mandate.signature_date > mandate.last_debit_date): + raise orm.except_orm( + _('Error:'), + _("The mandate '%s' can't have a date of last debit " + "before the date of signature.") + % mandate.unique_mandate_reference) + if (mandate.type == 'recurrent' + and not mandate.recurrent_sequence_type): + raise orm.except_orm( + _('Error:'), + _("The recurrent mandate '%s' must have a sequence type.") + % mandate.unique_mandate_reference) + if (mandate.type == 'recurrent' and not mandate.sepa_migrated + and mandate.recurrent_sequence_type != 'first'): + raise orm.except_orm( + _('Error:'), + _("The recurrent mandate '%s' which is not marked as " + "'Migrated to SEPA' must have its recurrent sequence " + "type set to 'First'.") + % mandate.unique_mandate_reference) + if (mandate.type == 'recurrent' and not mandate.sepa_migrated + and not mandate.original_mandate_identification): + raise orm.except_orm( + _('Error:'), + _("You must set the 'Original Mandate Identification' " + "on the recurrent mandate '%s' which is not marked " + "as 'Migrated to SEPA'.") + % mandate.unique_mandate_reference) + return True + + _constraints = [ + (_check_sdd_mandate, "Error msg in raise", [ + 'last_debit_date', 'signature_date', 'state', 'partner_bank_id', + 'type', 'recurrent_sequence_type', 'sepa_migrated', + 'original_mandate_identification', + ]), + ] + + def mandate_type_change(self, cr, uid, ids, type): + if type == 'recurrent': + recurrent_sequence_type = 'first' + else: + recurrent_sequence_type = False + res = {'value': {'recurrent_sequence_type': recurrent_sequence_type}} + return res + + def mandate_partner_bank_change( + self, cr, uid, ids, partner_bank_id, type, recurrent_sequence_type, + last_debit_date, state): + res = {'value': {}} + if partner_bank_id: + partner_bank_read = self.pool['res.partner.bank'].read( + cr, uid, partner_bank_id, ['partner_id'])['partner_id'] + if partner_bank_read: + res['value']['partner_id'] = partner_bank_read[0] + if (state == 'valid' and partner_bank_id + and type == 'recurrent' + and recurrent_sequence_type != 'first'): + res['value']['recurrent_sequence_type'] = 'first' + res['warning'] = { + 'title': _('Mandate update'), + 'message': _( + "As you changed the bank account attached to this " + "mandate, the 'Sequence Type' has been set back to " + "'First'."), + } + return res + + def validate(self, cr, uid, ids, context=None): + to_validate_ids = [] + for mandate in self.browse(cr, uid, ids, context=context): + assert mandate.state == 'draft', 'Mandate should be in draft state' + to_validate_ids.append(mandate.id) + self.write( + cr, uid, to_validate_ids, {'state': 'valid'}, context=context) + return True + + def cancel(self, cr, uid, ids, context=None): + to_cancel_ids = [] + for mandate in self.browse(cr, uid, ids, context=context): + assert mandate.state in ('draft', 'valid'),\ + 'Mandate should be in draft or valid state' + to_cancel_ids.append(mandate.id) + self.write( + cr, uid, to_cancel_ids, {'state': 'cancel'}, context=context) + return True + + def back2draft(self, cr, uid, ids, context=None): + to_draft_ids = [] + for mandate in self.browse(cr, uid, ids, context=context): + assert mandate.state == 'cancel',\ + 'Mandate should be in cancel state' + to_draft_ids.append(mandate.id) + self.write( + cr, uid, to_draft_ids, {'state': 'draft'}, context=context) + return True + + def _sdd_mandate_set_state_to_expired(self, cr, uid, context=None): + logger.info('Searching for SDD Mandates that must be set to Expired') + expire_limit_date = datetime.today() + \ + relativedelta(months=-NUMBER_OF_UNUSED_MONTHS_BEFORE_EXPIRY) + expire_limit_date_str = expire_limit_date.strftime('%Y-%m-%d') + expired_mandate_ids = self.search(cr, uid, [ + '|', + ('last_debit_date', '=', False), + ('last_debit_date', '<=', expire_limit_date_str), + ('state', '=', 'valid'), + ('signature_date', '<=', expire_limit_date_str), + ], context=context) + if expired_mandate_ids: + self.write( + cr, uid, expired_mandate_ids, {'state': 'expired'}, + context=context) + logger.info( + 'The following SDD Mandate IDs has been set to expired: %s' + % expired_mandate_ids) + else: + logger.info('0 SDD Mandates must be set to Expired') + return True + + +class res_partner_bank(orm.Model): + _inherit = 'res.partner.bank' + + _columns = { + 'sdd_mandate_ids': fields.one2many( + 'sdd.mandate', 'partner_bank_id', 'SEPA Direct Debit Mandates'), + } + + +class payment_line(orm.Model): + _inherit = 'payment.line' + + _columns = { + 'sdd_mandate_id': fields.many2one( + 'sdd.mandate', 'SEPA Direct Debit Mandate', + domain=[('state', '=', 'valid')]), + } + + def create(self, cr, uid, vals, context=None): + '''If the customer invoice has a mandate, take it + otherwise, take the first valid mandate of the bank account''' + if context is None: + context = {} + if not vals: + vals = {} + partner_bank_id = vals.get('bank_id') + move_line_id = vals.get('move_line_id') + if (context.get('default_payment_order_type') == 'debit' + and 'sdd_mandate_id' not in vals): + if move_line_id: + line = self.pool['account.move.line'].browse( + cr, uid, move_line_id, context=context) + if (line.invoice and line.invoice.type == 'out_invoice' + and line.invoice.sdd_mandate_id): + vals.update({ + 'sdd_mandate_id': line.invoice.sdd_mandate_id.id, + 'bank_id': + line.invoice.sdd_mandate_id.partner_bank_id.id, + }) + if partner_bank_id and 'sdd_mandate_id' not in vals: + mandate_ids = self.pool['sdd.mandate'].search(cr, uid, [ + ('partner_bank_id', '=', partner_bank_id), + ('state', '=', 'valid'), + ], context=context) + if mandate_ids: + vals['sdd_mandate_id'] = mandate_ids[0] + return super(payment_line, self).create(cr, uid, vals, context=context) + + def _check_mandate_bank_link(self, cr, uid, ids): + for payline in self.browse(cr, uid, ids): + if (payline.sdd_mandate_id and payline.bank_id + and payline.sdd_mandate_id.partner_bank_id.id != + payline.bank_id.id): + raise orm.except_orm( + _('Error:'), + _("The payment line with reference '%s' has the bank " + "account '%s' which is not attached to the mandate " + "'%s' (this mandate is attached to the bank account " + "'%s').") % ( + payline.name, + self.pool['res.partner.bank'].name_get( + cr, uid, [payline.bank_id.id])[0][1], + payline.sdd_mandate_id.unique_mandate_reference, + self.pool['res.partner.bank'].name_get( + cr, uid, + [payline.sdd_mandate_id.partner_bank_id.id])[0][1], + )) + return True + + _constraints = [ + (_check_mandate_bank_link, 'Error msg in raise', + ['sdd_mandate_id', 'bank_id']), + ] + + +class account_invoice(orm.Model): + _inherit = 'account.invoice' + + _columns = { + 'sdd_mandate_id': fields.many2one( + 'sdd.mandate', 'SEPA Direct Debit Mandate', + domain=[('state', '=', 'valid')], readonly=True, + states={'draft': [('readonly', False)]}) + } diff --git a/account_banking_sepa_direct_debit/account_banking_sdd_view.xml b/account_banking_sepa_direct_debit/account_banking_sdd_view.xml new file mode 100644 index 000000000..f74b60353 --- /dev/null +++ b/account_banking_sepa_direct_debit/account_banking_sdd_view.xml @@ -0,0 +1,77 @@ + + + + + + + account.banking.export.sdd.form + banking.export.sdd + +
+
+ +
+ + + + + + + + + + + + + + + + +
+
+
+ + + + account.banking.export.sdd.tree + banking.export.sdd + + + + + + + + + + + + + SEPA Direct Debit Files + banking.export.sdd + form + tree,form + + + + + + + +
+
diff --git a/account_banking_sepa_direct_debit/account_invoice_view.xml b/account_banking_sepa_direct_debit/account_invoice_view.xml new file mode 100644 index 000000000..2ca480e54 --- /dev/null +++ b/account_banking_sepa_direct_debit/account_invoice_view.xml @@ -0,0 +1,22 @@ + + + + + + + add.sdd.mandate.on.customer.invoice.form + account.invoice + + + + + + + + + + diff --git a/account_banking_sepa_direct_debit/account_payment_view.xml b/account_banking_sepa_direct_debit/account_payment_view.xml new file mode 100644 index 000000000..74098c44e --- /dev/null +++ b/account_banking_sepa_direct_debit/account_payment_view.xml @@ -0,0 +1,26 @@ + + + + + + + sdd.payment.order.form + payment.order + + + + + + + + + + + + + + diff --git a/account_banking_sepa_direct_debit/company.py b/account_banking_sepa_direct_debit/company.py new file mode 100644 index 000000000..6d54ba8e6 --- /dev/null +++ b/account_banking_sepa_direct_debit/company.py @@ -0,0 +1,90 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# SEPA Direct Debit module for OpenERP +# Copyright (C) 2013 Akretion (http://www.akretion.com) +# @author: Alexis de Lattre +# +# 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 openerp.osv import orm, fields +import logging + +logger = logging.getLogger(__name__) + + +class res_company(orm.Model): + _inherit = 'res.company' + + _columns = { + 'sepa_creditor_identifier': fields.char( + 'SEPA Creditor Identifier', size=35, + help="Enter the Creditor Identifier that has been attributed " + "to your company to make SEPA Direct Debits. This identifier " + "is composed of :\n- your country ISO code (2 letters)\n- a " + "2-digits checkum\n- a 3-letters business code\n- a " + "country-specific identifier"), + 'original_creditor_identifier': fields.char( + 'Original Creditor Identifier', size=70), + } + + def is_sepa_creditor_identifier_valid( + self, cr, uid, sepa_creditor_identifier, context=None): + """Check if SEPA Creditor Identifier is valid + @param sepa_creditor_identifier: SEPA Creditor Identifier as str + or unicode + @return: True if valid, False otherwise + """ + if not isinstance(sepa_creditor_identifier, (str, unicode)): + return False + try: + sci_str = str(sepa_creditor_identifier) + except: + logger.warning( + "SEPA Creditor ID should contain only ASCII caracters.") + return False + sci = sci_str.lower() + if len(sci) < 9: + return False + before_replacement = sci[7:] + sci[0:2] + '00' + logger.debug( + "SEPA ID check before_replacement = %s" % before_replacement) + after_replacement = '' + for char in before_replacement: + if char.isalpha(): + after_replacement += str(ord(char)-87) + else: + after_replacement += char + logger.debug( + "SEPA ID check after_replacement = %s" % after_replacement) + if int(sci[2:4]) == (98 - (int(after_replacement) % 97)): + return True + else: + return False + + def _check_sepa_creditor_identifier(self, cr, uid, ids): + for company in self.browse(cr, uid, ids): + if company.sepa_creditor_identifier: + if not self.is_sepa_creditor_identifier_valid( + cr, uid, company.sepa_creditor_identifier): + return False + return True + + _constraints = [ + (_check_sepa_creditor_identifier, + "Invalid SEPA Creditor Identifier.", + ['sepa_creditor_identifier']), + ] diff --git a/account_banking_sepa_direct_debit/company_view.xml b/account_banking_sepa_direct_debit/company_view.xml new file mode 100644 index 000000000..e4c9e0b93 --- /dev/null +++ b/account_banking_sepa_direct_debit/company_view.xml @@ -0,0 +1,23 @@ + + + + + + + sepa_direct_debit.res.company.form + res.company + + + + + + + + + + + diff --git a/account_banking_sepa_direct_debit/data/mandate_reference_sequence.xml b/account_banking_sepa_direct_debit/data/mandate_reference_sequence.xml new file mode 100644 index 000000000..68075d526 --- /dev/null +++ b/account_banking_sepa_direct_debit/data/mandate_reference_sequence.xml @@ -0,0 +1,21 @@ + + + + + + + SDD Mandate Reference + sdd.mandate.reference + + + + SDD Mandate Reference + sdd.mandate.reference + RUM + + + + + + + diff --git a/account_banking_sepa_direct_debit/data/pain.008.001.02.xsd b/account_banking_sepa_direct_debit/data/pain.008.001.02.xsd new file mode 100644 index 000000000..ceafe505f --- /dev/null +++ b/account_banking_sepa_direct_debit/data/pain.008.001.02.xsd @@ -0,0 +1,879 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/account_banking_sepa_direct_debit/data/pain.008.001.03.xsd b/account_banking_sepa_direct_debit/data/pain.008.001.03.xsd new file mode 100644 index 000000000..358480dec --- /dev/null +++ b/account_banking_sepa_direct_debit/data/pain.008.001.03.xsd @@ -0,0 +1,925 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/account_banking_sepa_direct_debit/data/pain.008.001.04.xsd b/account_banking_sepa_direct_debit/data/pain.008.001.04.xsd new file mode 100644 index 000000000..ba8c68346 --- /dev/null +++ b/account_banking_sepa_direct_debit/data/pain.008.001.04.xsd @@ -0,0 +1,892 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/account_banking_sepa_direct_debit/data/payment_type_sdd.xml b/account_banking_sepa_direct_debit/data/payment_type_sdd.xml new file mode 100644 index 000000000..a17b3b21c --- /dev/null +++ b/account_banking_sepa_direct_debit/data/payment_type_sdd.xml @@ -0,0 +1,35 @@ + + + + + + + SEPA Direct Debit v02 (recommended) + pain.008.001.02 + + + debit + + + + SEPA Direct Debit v03 + pain.008.001.03 + + + debit + + + + SEPA Direct Debit v04 + pain.008.001.04 + + + debit + + + + + diff --git a/account_banking_sepa_direct_debit/i18n/account_banking_sepa_direct_debit.pot b/account_banking_sepa_direct_debit/i18n/account_banking_sepa_direct_debit.pot new file mode 100644 index 000000000..0db576726 --- /dev/null +++ b/account_banking_sepa_direct_debit/i18n/account_banking_sepa_direct_debit.pot @@ -0,0 +1,633 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * account_banking_sepa_direct_debit +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2013-12-23 22:24+0000\n" +"PO-Revision-Date: 2013-12-23 22:24+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: account_banking_sepa_direct_debit +#: model:mail.message.subtype,description:account_banking_sepa_direct_debit.mandate_valid +msgid "SEPA Direct Debit Mandate Validated" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: field:banking.export.sdd,filename:0 +#: field:banking.export.sdd.wizard,filename:0 +msgid "Filename" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/wizard/export_sdd.py:200 +#, python-format +msgid "The SEPA Direct Debit mandate with reference '%s' for partner '%s' has expired." +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:219 +#, python-format +msgid "Cannot validate the mandate '%s' without a date of signature." +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: selection:sdd.mandate,recurrent_sequence_type:0 +msgid "Final" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: selection:banking.export.sdd.wizard,state:0 +msgid "Finish" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: view:res.partner:0 +#: view:res.partner.bank:0 +msgid "SDD Mandates" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: constraint:payment.line:0 +#: constraint:sdd.mandate:0 +msgid "Error msg in raise" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: selection:banking.export.sdd,state:0 +msgid "Reconciled" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,recurrent_sequence_type:0 +msgid "Sequence Type for Next Debit" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: selection:banking.export.sdd,charge_bearer:0 +#: selection:banking.export.sdd.wizard,charge_bearer:0 +msgid "Borne by Creditor" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: model:ir.actions.act_window,name:account_banking_sepa_direct_debit.sdd_mandate_action +#: model:ir.ui.menu,name:account_banking_sepa_direct_debit.sdd_mandate_menu +#: view:res.partner.bank:0 +#: field:res.partner.bank,sdd_mandate_ids:0 +msgid "SEPA Direct Debit Mandates" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: view:banking.export.sdd.wizard:0 +#: view:sdd.mandate:0 +msgid "Validate" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: model:mail.message.subtype,description:account_banking_sepa_direct_debit.recurrent_sequence_type_recurring +#: model:mail.message.subtype,name:account_banking_sepa_direct_debit.recurrent_sequence_type_recurring +msgid "Sequence Type set to Recurring" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: view:banking.export.sdd.wizard:0 +msgid "Generate" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: model:mail.message.subtype,description:account_banking_sepa_direct_debit.mandate_cancel +msgid "SEPA Direct Debit Mandate Cancelled" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: selection:banking.export.sdd,charge_bearer:0 +#: selection:banking.export.sdd.wizard,charge_bearer:0 +msgid "Borne by Debtor" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:212 +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:218 +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:224 +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:232 +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:239 +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:245 +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:253 +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:395 +#: code:addons/account_banking_sepa_direct_debit/wizard/export_sdd.py:140 +#: code:addons/account_banking_sepa_direct_debit/wizard/export_sdd.py:192 +#: code:addons/account_banking_sepa_direct_debit/wizard/export_sdd.py:199 +#: code:addons/account_banking_sepa_direct_debit/wizard/export_sdd.py:209 +#, python-format +msgid "Error:" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,message_ids:0 +msgid "Messages" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,unique_mandate_reference:0 +msgid "Unique Mandate Reference" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: view:sdd.mandate:0 +#: selection:sdd.mandate,state:0 +msgid "Cancelled" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/wizard/export_sdd.py:141 +#, python-format +msgid "Payment Type Code '%s' is not supported. The only Payment Type Code supported for SEPA Direct Debit are 'pain.008.001.02', 'pain.008.001.03' and 'pain.008.001.04'." +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: help:sdd.mandate,message_unread:0 +msgid "If checked new messages require your attention." +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: field:banking.export.sdd.wizard,file_id:0 +msgid "SDD File" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: model:mail.message.subtype,description:account_banking_sepa_direct_debit.mandate_expired +msgid "SEPA Direct Debit Mandate has Expired" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:246 +#, python-format +msgid "The recurrent mandate '%s' which is not marked as 'Migrated to SEPA' must have its recurrent sequence type set to 'First'." +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: help:banking.export.sdd,charge_bearer:0 +#: help:banking.export.sdd.wizard,charge_bearer:0 +msgid "Following service level : transaction charges are to be applied following the rules agreed in the service level and/or scheme (SEPA Core messages must use this). Shared : transaction charges on the creditor side are to be borne by the creditor, transaction charges on the debtor side are to be borne by the debtor. Borne by creditor : all transaction charges are to be borne by the creditor. Borne by debtor : all transaction charges are to be borne by the debtor." +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: view:sdd.mandate:0 +msgid "Reference" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: view:banking.export.sdd:0 +msgid "SEPA Direct Debit" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: view:banking.export.sdd.wizard:0 +msgid "SEPA Direct Debit XML file generation" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: help:sdd.mandate,message_summary:0 +msgid "Holds the Chatter summary (number of messages, ...). This summary is directly in html format in order to be inserted in kanban views." +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: model:ir.model,name:account_banking_sepa_direct_debit.model_payment_line +msgid "Payment Line" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: field:banking.export.sdd,create_date:0 +msgid "Generation Date" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:396 +#, python-format +msgid "The payment line with reference '%s' has the bank account '%s' which is not attached to the mandate '%s' (this mandate is attached to the bank account '%s')." +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: selection:banking.export.sdd.wizard,state:0 +msgid "Create" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: field:banking.export.sdd,nb_transactions:0 +#: field:banking.export.sdd.wizard,nb_transactions:0 +msgid "Number of Transactions" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: view:sdd.mandate:0 +#: selection:sdd.mandate,type:0 +msgid "One-Off" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: field:banking.export.sdd,state:0 +#: field:banking.export.sdd.wizard,state:0 +msgid "State" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:240 +#, python-format +msgid "The recurrent mandate '%s' must have a sequence type." +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,message_follower_ids:0 +msgid "Followers" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,message_unread:0 +msgid "Unread Messages" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: view:banking.export.sdd:0 +#: field:banking.export.sdd,payment_order_ids:0 +#: field:banking.export.sdd.wizard,payment_order_ids:0 +msgid "Payment Orders" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: view:sdd.mandate:0 +msgid "Type" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: selection:banking.export.sdd,state:0 +msgid "Sent" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: field:res.company,original_creditor_identifier:0 +msgid "Original Creditor Identifier" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: selection:sdd.mandate,recurrent_sequence_type:0 +msgid "Recurring" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: help:res.company,sepa_creditor_identifier:0 +msgid "Enter the Creditor Identifier that has been attributed to your company to make SEPA Direct Debits. This identifier is composed of :\n" +"- your country ISO code (2 letters)\n" +"- a 2-digits checkum\n" +"- a 3-letters business code\n" +"- a country-specific identifier" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: sql_constraint:sdd.mandate:0 +msgid "A Mandate with the same reference already exists for this company !" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: help:sdd.mandate,state:0 +msgid "Only valid mandates can be used in a payment line. A cancelled mandate is a mandate that has been cancelled by the customer. A one-off mandate expires after its first use. A recurrent mandate expires after it's final use or if it hasn't been used for 36 months." +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: help:sdd.mandate,recurrent_sequence_type:0 +msgid "This field is only used for Recurrent mandates, not for One-Off mandates." +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:213 +#, python-format +msgid "The date of signature of mandate '%s' is in the future !" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: view:sdd.mandate:0 +msgid "Signature Date" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: field:banking.export.sdd,charge_bearer:0 +#: field:banking.export.sdd.wizard,charge_bearer:0 +msgid "Charge Bearer" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,partner_id:0 +msgid "Partner" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: selection:sdd.mandate,recurrent_sequence_type:0 +msgid "First" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,signature_date:0 +msgid "Date of Signature of the Mandate" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: model:mail.message.subtype,name:account_banking_sepa_direct_debit.mandate_cancel +msgid "Mandate Cancelled" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: model:ir.actions.act_window,name:account_banking_sepa_direct_debit.act_banking_export_sdd_payment_order +msgid "Generated SEPA Direct Debit Files" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: help:sdd.mandate,sepa_migrated:0 +msgid "If this field is not active, the mandate section of the next direct debit file that include this mandate will contain the 'Original Mandate Identification' and the 'Original Creditor Scheme Identification'. This is required in a few countries (Belgium for instance), but not in all countries. If this is not required in your country, you should keep this field always active." +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,company_id:0 +msgid "Company" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: model:ir.model,name:account_banking_sepa_direct_debit.model_banking_export_sdd_wizard +msgid "Export SEPA Direct Debit File" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: help:banking.export.sdd,batch_booking:0 +#: help:banking.export.sdd.wizard,batch_booking:0 +msgid "If true, the bank statement will display only one credit line for all the direct debits of the SEPA file ; if false, the bank statement will display one credit line per direct debit of the SEPA file." +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:225 +#, python-format +msgid "Cannot validate the mandate '%s' because it is not attached to a bank account." +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: selection:banking.export.sdd,state:0 +#: view:sdd.mandate:0 +#: selection:sdd.mandate,state:0 +msgid "Draft" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:290 +#, python-format +msgid "Mandate update" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: selection:banking.export.sdd,charge_bearer:0 +#: selection:banking.export.sdd.wizard,charge_bearer:0 +msgid "Shared" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: field:banking.export.sdd,batch_booking:0 +#: field:banking.export.sdd.wizard,batch_booking:0 +msgid "Batch Booking" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,sepa_migrated:0 +msgid "Migrated to SEPA" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,state:0 +msgid "Status" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: field:banking.export.sdd,total_amount:0 +#: field:banking.export.sdd.wizard,total_amount:0 +msgid "Total Amount" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: model:ir.actions.act_window,name:account_banking_sepa_direct_debit.action_account_banking_sdd +#: model:ir.ui.menu,name:account_banking_sepa_direct_debit.menu_account_banking_sdd +msgid "SEPA Direct Debit Files" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: selection:banking.export.sdd,charge_bearer:0 +#: selection:banking.export.sdd.wizard,charge_bearer:0 +msgid "Following Service Level" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:233 +#, python-format +msgid "The mandate '%s' can't have a date of last debit before the date of signature." +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: model:mail.message.subtype,description:account_banking_sepa_direct_debit.recurrent_sequence_type_final +#: model:mail.message.subtype,name:account_banking_sepa_direct_debit.recurrent_sequence_type_final +msgid "Sequence Type set to Final" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,message_is_follower:0 +msgid "Is a Follower" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: help:sdd.mandate,original_mandate_identification:0 +msgid "When the field 'Migrated to SEPA' is not active, this field will be used as the Original Mandate Identification in the Direct Debit file." +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: view:payment.order:0 +msgid "SDD Mandate" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,original_mandate_identification:0 +msgid "Original Mandate Identification" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: model:ir.model,name:account_banking_sepa_direct_debit.model_res_company +msgid "Companies" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,message_summary:0 +msgid "Summary" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: model:res.groups,name:account_banking_sepa_direct_debit.group_original_mandate_required +msgid "Original Mandate Required (SEPA)" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: field:account.invoice,sdd_mandate_id:0 +#: model:ir.model,name:account_banking_sepa_direct_debit.model_sdd_mandate +#: field:payment.line,sdd_mandate_id:0 +#: view:sdd.mandate:0 +msgid "SEPA Direct Debit Mandate" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/wizard/export_sdd.py:193 +#, python-format +msgid "Missing SEPA Direct Debit mandate on the payment line with partner '%s' and Invoice ref '%s'." +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/wizard/export_sdd.py:210 +#, python-format +msgid "The mandate with reference '%s' for partner '%s' has type set to 'One-Off' and it has a last debit date set to '%s', so we can't use it." +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,scan:0 +msgid "Scan of the Mandate" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,last_debit_date:0 +msgid "Date of the Last Debit" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: model:mail.message.subtype,name:account_banking_sepa_direct_debit.mandate_expired +msgid "Mandate Expired" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: constraint:res.company:0 +msgid "Invalid SEPA Creditor Identifier." +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: model:ir.model,name:account_banking_sepa_direct_debit.model_res_partner_bank +msgid "Bank Accounts" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: model:ir.actions.act_window,help:account_banking_sepa_direct_debit.sdd_mandate_action +msgid "

\n" +" Click to create a new SEPA Direct Debit Mandate.\n" +"

\n" +" A SEPA Direct Debit Mandate is a document signed by your customer that gives you the autorization to do one or several direct debits on his bank account.\n" +"

\n" +" " +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: view:banking.export.sdd:0 +msgid "General Information" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: view:sdd.mandate:0 +#: selection:sdd.mandate,state:0 +msgid "Valid" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: model:ir.model,name:account_banking_sepa_direct_debit.model_account_invoice +msgid "Invoice" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: view:banking.export.sdd.wizard:0 +#: view:sdd.mandate:0 +msgid "Cancel" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: view:sdd.mandate:0 +#: field:sdd.mandate,payment_line_ids:0 +msgid "Related Payment Lines" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: view:sdd.mandate:0 +#: selection:sdd.mandate,type:0 +msgid "Recurrent" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,type:0 +msgid "Type of Mandate" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: model:mail.message.subtype,name:account_banking_sepa_direct_debit.mandate_valid +msgid "Mandate Validated" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: field:banking.export.sdd,file:0 +msgid "SEPA File" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: field:res.company,sepa_creditor_identifier:0 +msgid "SEPA Creditor Identifier" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: model:ir.model,name:account_banking_sepa_direct_debit.model_banking_export_sdd +msgid "SEPA Direct Debit export" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: view:sdd.mandate:0 +#: selection:sdd.mandate,state:0 +msgid "Expired" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,partner_bank_id:0 +msgid "Bank Account" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:254 +#, python-format +msgid "You must set the 'Original Mandate Identification' on the recurrent mandate '%s' which is not marked as 'Migrated to SEPA'." +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: model:mail.message.subtype,description:account_banking_sepa_direct_debit.recurrent_sequence_type_first +#: model:mail.message.subtype,name:account_banking_sepa_direct_debit.recurrent_sequence_type_first +msgid "Sequence Type set to First" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:291 +#, python-format +msgid "As you changed the bank account attached to this mandate, the 'Sequence Type' has been set back to 'First'." +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: help:sdd.mandate,message_ids:0 +msgid "Messages and communication history" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: view:sdd.mandate:0 +msgid "Search SEPA Direct Debit Mandates" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: field:banking.export.sdd.wizard,file:0 +msgid "File" +msgstr "" + diff --git a/account_banking_sepa_direct_debit/i18n/fr.po b/account_banking_sepa_direct_debit/i18n/fr.po new file mode 100644 index 000000000..3744da850 --- /dev/null +++ b/account_banking_sepa_direct_debit/i18n/fr.po @@ -0,0 +1,749 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * account_banking_sepa_direct_debit +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2013-12-23 22:24+0000\n" +"PO-Revision-Date: 2014-02-01 04:49+0000\n" +"Last-Translator: Alexis de Lattre \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2014-05-31 06:02+0000\n" +"X-Generator: Launchpad (build 17031)\n" + +#. module: account_banking_sepa_direct_debit +#: model:mail.message.subtype,description:account_banking_sepa_direct_debit.mandate_valid +msgid "SEPA Direct Debit Mandate Validated" +msgstr "Mandat de prélèvement SEPA validé" + +#. module: account_banking_sepa_direct_debit +#: field:banking.export.sdd,filename:0 +#: field:banking.export.sdd.wizard,filename:0 +msgid "Filename" +msgstr "Nom du fichier" + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/wizard/export_sdd.py:200 +#, python-format +msgid "" +"The SEPA Direct Debit mandate with reference '%s' for partner '%s' has " +"expired." +msgstr "" +"Le mandat de prélèvement SEPA portant la référence '%s' pour le partenaire " +"'%s' a expiré." + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:219 +#, python-format +msgid "Cannot validate the mandate '%s' without a date of signature." +msgstr "Impossible de valider le mandat '%s' sans date de signature." + +#. module: account_banking_sepa_direct_debit +#: selection:sdd.mandate,recurrent_sequence_type:0 +msgid "Final" +msgstr "Final" + +#. module: account_banking_sepa_direct_debit +#: selection:banking.export.sdd.wizard,state:0 +msgid "Finish" +msgstr "Finir" + +#. module: account_banking_sepa_direct_debit +#: view:res.partner:0 +#: view:res.partner.bank:0 +msgid "SDD Mandates" +msgstr "Mandats SEPA" + +#. module: account_banking_sepa_direct_debit +#: constraint:payment.line:0 +#: constraint:sdd.mandate:0 +msgid "Error msg in raise" +msgstr "Error msg in raise" + +#. module: account_banking_sepa_direct_debit +#: selection:banking.export.sdd,state:0 +msgid "Reconciled" +msgstr "Réconcilié" + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,recurrent_sequence_type:0 +msgid "Sequence Type for Next Debit" +msgstr "Type de séquence pour le prochain prélèvement" + +#. module: account_banking_sepa_direct_debit +#: selection:banking.export.sdd,charge_bearer:0 +#: selection:banking.export.sdd.wizard,charge_bearer:0 +msgid "Borne by Creditor" +msgstr "Supportés par le créancier" + +#. module: account_banking_sepa_direct_debit +#: model:ir.actions.act_window,name:account_banking_sepa_direct_debit.sdd_mandate_action +#: model:ir.ui.menu,name:account_banking_sepa_direct_debit.sdd_mandate_menu +#: view:res.partner.bank:0 +#: field:res.partner.bank,sdd_mandate_ids:0 +msgid "SEPA Direct Debit Mandates" +msgstr "Mandats de prélèvement SEPA" + +#. module: account_banking_sepa_direct_debit +#: view:banking.export.sdd.wizard:0 +#: view:sdd.mandate:0 +msgid "Validate" +msgstr "Valider" + +#. module: account_banking_sepa_direct_debit +#: model:mail.message.subtype,description:account_banking_sepa_direct_debit.recurrent_sequence_type_recurring +#: model:mail.message.subtype,name:account_banking_sepa_direct_debit.recurrent_sequence_type_recurring +msgid "Sequence Type set to Recurring" +msgstr "Type de séquence mis à Recurring" + +#. module: account_banking_sepa_direct_debit +#: view:banking.export.sdd.wizard:0 +msgid "Generate" +msgstr "Générer" + +#. module: account_banking_sepa_direct_debit +#: model:mail.message.subtype,description:account_banking_sepa_direct_debit.mandate_cancel +msgid "SEPA Direct Debit Mandate Cancelled" +msgstr "Mandat de prélèvement SEPA annulé" + +#. module: account_banking_sepa_direct_debit +#: selection:banking.export.sdd,charge_bearer:0 +#: selection:banking.export.sdd.wizard,charge_bearer:0 +msgid "Borne by Debtor" +msgstr "Supportés par le débiteur" + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:212 +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:218 +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:224 +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:232 +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:239 +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:245 +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:253 +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:395 +#: code:addons/account_banking_sepa_direct_debit/wizard/export_sdd.py:140 +#: code:addons/account_banking_sepa_direct_debit/wizard/export_sdd.py:192 +#: code:addons/account_banking_sepa_direct_debit/wizard/export_sdd.py:199 +#: code:addons/account_banking_sepa_direct_debit/wizard/export_sdd.py:209 +#, python-format +msgid "Error:" +msgstr "Erreur :" + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,message_ids:0 +msgid "Messages" +msgstr "Messages" + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,unique_mandate_reference:0 +msgid "Unique Mandate Reference" +msgstr "Référence unique de mandat" + +#. module: account_banking_sepa_direct_debit +#: view:sdd.mandate:0 +#: selection:sdd.mandate,state:0 +msgid "Cancelled" +msgstr "Annulé" + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/wizard/export_sdd.py:141 +#, python-format +msgid "" +"Payment Type Code '%s' is not supported. The only Payment Type Code " +"supported for SEPA Direct Debit are 'pain.008.001.02', 'pain.008.001.03' and " +"'pain.008.001.04'." +msgstr "" +"Le code du Type de paiement '%s' n'est pas supporté. Les seuls codes de Type " +"de paiement supportés pour les prélèvements SEPA sont 'pain.008.001.02', " +"'pain.008.001.03' et 'pain.008.001.04'." + +#. module: account_banking_sepa_direct_debit +#: help:sdd.mandate,message_unread:0 +msgid "If checked new messages require your attention." +msgstr "If checked new messages require your attention." + +#. module: account_banking_sepa_direct_debit +#: field:banking.export.sdd.wizard,file_id:0 +msgid "SDD File" +msgstr "Fichier de prélèvement SEPA" + +#. module: account_banking_sepa_direct_debit +#: model:mail.message.subtype,description:account_banking_sepa_direct_debit.mandate_expired +msgid "SEPA Direct Debit Mandate has Expired" +msgstr "Le mandat de prélèvement SEPA a expiré" + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:246 +#, python-format +msgid "" +"The recurrent mandate '%s' which is not marked as 'Migrated to SEPA' must " +"have its recurrent sequence type set to 'First'." +msgstr "" +"Le mandat récurrent '%s' dont l'option 'Migré à SEPA' n'est pas activée doit " +"avec sa séquence mise à 'First'." + +#. module: account_banking_sepa_direct_debit +#: help:banking.export.sdd,charge_bearer:0 +#: help:banking.export.sdd.wizard,charge_bearer:0 +msgid "" +"Following service level : transaction charges are to be applied following " +"the rules agreed in the service level and/or scheme (SEPA Core messages must " +"use this). Shared : transaction charges on the creditor side are to be borne " +"by the creditor, transaction charges on the debtor side are to be borne by " +"the debtor. Borne by creditor : all transaction charges are to be borne by " +"the creditor. Borne by debtor : all transaction charges are to be borne by " +"the debtor." +msgstr "" +"Suivant le niveau de service : la répartition des frais bancaires suit les " +"règles pré-établies dans le schema ou dans le contrat avec la banque (les " +"messages SEPA Core doivent utiliser ce paramètre). Partagés : les frais " +"bancaires côté débiteur sont à la charge du débiteur, les frais bancaires " +"côté créancier sont à la charge du créancier. Supportés par le créancier : " +"tous les frais bancaires sont à la charge du créancier. Supportés par le " +"débiteur : tous les frais bancaires sont à la charge du débiteur." + +#. module: account_banking_sepa_direct_debit +#: view:sdd.mandate:0 +msgid "Reference" +msgstr "Référence" + +#. module: account_banking_sepa_direct_debit +#: view:banking.export.sdd:0 +msgid "SEPA Direct Debit" +msgstr "Prélèvement SEPA" + +#. module: account_banking_sepa_direct_debit +#: view:banking.export.sdd.wizard:0 +msgid "SEPA Direct Debit XML file generation" +msgstr "Génération de fichiers de prélèvement SEPA XML" + +#. module: account_banking_sepa_direct_debit +#: help:sdd.mandate,message_summary:0 +msgid "" +"Holds the Chatter summary (number of messages, ...). This summary is " +"directly in html format in order to be inserted in kanban views." +msgstr "" +"Holds the Chatter summary (number of messages, ...). This summary is " +"directly in html format in order to be inserted in kanban views." + +#. module: account_banking_sepa_direct_debit +#: model:ir.model,name:account_banking_sepa_direct_debit.model_payment_line +msgid "Payment Line" +msgstr "Ligne de paiement" + +#. module: account_banking_sepa_direct_debit +#: field:banking.export.sdd,create_date:0 +msgid "Generation Date" +msgstr "Date de génération" + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:396 +#, python-format +msgid "" +"The payment line with reference '%s' has the bank account '%s' which is not " +"attached to the mandate '%s' (this mandate is attached to the bank account " +"'%s')." +msgstr "" +"La ligne de paiement portant la référence '%s' est configurée avec le compte " +"bancaire '%s' qui n'est pas rattaché au mandat '%s' (ce mandat est rattaché " +"au compte bancaire '%s')." + +#. module: account_banking_sepa_direct_debit +#: selection:banking.export.sdd.wizard,state:0 +msgid "Create" +msgstr "Créer" + +#. module: account_banking_sepa_direct_debit +#: field:banking.export.sdd,nb_transactions:0 +#: field:banking.export.sdd.wizard,nb_transactions:0 +msgid "Number of Transactions" +msgstr "Nombre de transactions" + +#. module: account_banking_sepa_direct_debit +#: view:sdd.mandate:0 +#: selection:sdd.mandate,type:0 +msgid "One-Off" +msgstr "One-Off" + +#. module: account_banking_sepa_direct_debit +#: field:banking.export.sdd,state:0 +#: field:banking.export.sdd.wizard,state:0 +msgid "State" +msgstr "État" + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:240 +#, python-format +msgid "The recurrent mandate '%s' must have a sequence type." +msgstr "Le mandat récurrent '%s' doit avoir un type de séquence." + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,message_follower_ids:0 +msgid "Followers" +msgstr "Followers" + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,message_unread:0 +msgid "Unread Messages" +msgstr "Unread Messages" + +#. module: account_banking_sepa_direct_debit +#: view:banking.export.sdd:0 +#: field:banking.export.sdd,payment_order_ids:0 +#: field:banking.export.sdd.wizard,payment_order_ids:0 +msgid "Payment Orders" +msgstr "Ordres de paiement" + +#. module: account_banking_sepa_direct_debit +#: view:sdd.mandate:0 +msgid "Type" +msgstr "Type" + +#. module: account_banking_sepa_direct_debit +#: selection:banking.export.sdd,state:0 +msgid "Sent" +msgstr "Envoyé" + +#. module: account_banking_sepa_direct_debit +#: field:res.company,original_creditor_identifier:0 +msgid "Original Creditor Identifier" +msgstr "Ancien Identifiant Créancier" + +#. module: account_banking_sepa_direct_debit +#: selection:sdd.mandate,recurrent_sequence_type:0 +msgid "Recurring" +msgstr "Recurring" + +#. module: account_banking_sepa_direct_debit +#: help:res.company,sepa_creditor_identifier:0 +msgid "" +"Enter the Creditor Identifier that has been attributed to your company to " +"make SEPA Direct Debits. This identifier is composed of :\n" +"- your country ISO code (2 letters)\n" +"- a 2-digits checkum\n" +"- a 3-letters business code\n" +"- a country-specific identifier" +msgstr "" +"Entrez l'Identifiant créancier qui a été attribué à votre société pour " +"réaliser des prélèvements SEPA. Cet identifiant est composé de :\n" +"- du code ISO de votre pays (2 lettres)\n" +"- un code de contrôle à 2 chiffres\n" +"- un code d'activité à 3 lettres\n" +"- un identifiant national" + +#. module: account_banking_sepa_direct_debit +#: sql_constraint:sdd.mandate:0 +msgid "A Mandate with the same reference already exists for this company !" +msgstr "Un mandat avec la même référence existe déjà pour cette société !" + +#. module: account_banking_sepa_direct_debit +#: help:sdd.mandate,state:0 +msgid "" +"Only valid mandates can be used in a payment line. A cancelled mandate is a " +"mandate that has been cancelled by the customer. A one-off mandate expires " +"after its first use. A recurrent mandate expires after it's final use or if " +"it hasn't been used for 36 months." +msgstr "" +"Seuls des mandats valides peuvent être utilisés dans une ligne de paiement. " +"Un mandate annulé est un mandat qui a été annulé par le client. Un mandat " +"One-Off expire à l'issue de sa première utilisation. Un mandate récurrent " +"expire après sa dernière utilisation ou si il n'a pas été utilisé pendant 36 " +"mois." + +#. module: account_banking_sepa_direct_debit +#: help:sdd.mandate,recurrent_sequence_type:0 +msgid "" +"This field is only used for Recurrent mandates, not for One-Off mandates." +msgstr "" +"Ce champ n'est utilisé que pour les mandats récurrents, pas pour les mandats " +"One-Off." + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:213 +#, python-format +msgid "The date of signature of mandate '%s' is in the future !" +msgstr "La date de signature du mandat '%s' est dans le futur !" + +#. module: account_banking_sepa_direct_debit +#: view:sdd.mandate:0 +msgid "Signature Date" +msgstr "Date de signature" + +#. module: account_banking_sepa_direct_debit +#: field:banking.export.sdd,charge_bearer:0 +#: field:banking.export.sdd.wizard,charge_bearer:0 +msgid "Charge Bearer" +msgstr "Répartition des frais" + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,partner_id:0 +msgid "Partner" +msgstr "Partenaire" + +#. module: account_banking_sepa_direct_debit +#: selection:sdd.mandate,recurrent_sequence_type:0 +msgid "First" +msgstr "First" + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,signature_date:0 +msgid "Date of Signature of the Mandate" +msgstr "Date de signature du mandat" + +#. module: account_banking_sepa_direct_debit +#: model:mail.message.subtype,name:account_banking_sepa_direct_debit.mandate_cancel +msgid "Mandate Cancelled" +msgstr "Mandat annulé" + +#. module: account_banking_sepa_direct_debit +#: model:ir.actions.act_window,name:account_banking_sepa_direct_debit.act_banking_export_sdd_payment_order +msgid "Generated SEPA Direct Debit Files" +msgstr "Fichiers de prélèvement SEPA générés" + +#. module: account_banking_sepa_direct_debit +#: help:sdd.mandate,sepa_migrated:0 +msgid "" +"If this field is not active, the mandate section of the next direct debit " +"file that include this mandate will contain the 'Original Mandate " +"Identification' and the 'Original Creditor Scheme Identification'. This is " +"required in a few countries (Belgium for instance), but not in all " +"countries. If this is not required in your country, you should keep this " +"field always active." +msgstr "" +"Si cette option n'est pas activée, la section qui concerne le mandat dans le " +"prochain fichier de prélèvement qui incluera ce mandat contiendra les champs " +"'Original Mandate Identification' et 'Original Creditor Scheme " +"Identification'. Ces champs sont requis dans certains pays (en Belgique " +"notamment), mais pas dans tous les pays. Si ces champs ne sont pas requis " +"dans votre pays, vous devriez garder ce champ toujours actif." + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,company_id:0 +msgid "Company" +msgstr "Société" + +#. module: account_banking_sepa_direct_debit +#: model:ir.model,name:account_banking_sepa_direct_debit.model_banking_export_sdd_wizard +msgid "Export SEPA Direct Debit File" +msgstr "Export du fichier de prélèvement SEPA" + +#. module: account_banking_sepa_direct_debit +#: help:banking.export.sdd,batch_booking:0 +#: help:banking.export.sdd.wizard,batch_booking:0 +msgid "" +"If true, the bank statement will display only one credit line for all the " +"direct debits of the SEPA file ; if false, the bank statement will display " +"one credit line per direct debit of the SEPA file." +msgstr "" +"Si activé, le relevé de compte ne fera apparaître qu'une ligne de crédit " +"pour tous les prélèvements du fichier SEPA ; si désactivé, le relevé de " +"banque fera apparaître une ligne de crédit pour chaque prélèvement du " +"fichier SEPA." + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:225 +#, python-format +msgid "" +"Cannot validate the mandate '%s' because it is not attached to a bank " +"account." +msgstr "" +"Impossible de valider le mandat '%s' car il n'est pas rattaché à un compte " +"bancaire." + +#. module: account_banking_sepa_direct_debit +#: selection:banking.export.sdd,state:0 +#: view:sdd.mandate:0 +#: selection:sdd.mandate,state:0 +msgid "Draft" +msgstr "Brouillon" + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:290 +#, python-format +msgid "Mandate update" +msgstr "Mise-à-jour du mandat" + +#. module: account_banking_sepa_direct_debit +#: selection:banking.export.sdd,charge_bearer:0 +#: selection:banking.export.sdd.wizard,charge_bearer:0 +msgid "Shared" +msgstr "Partagée" + +#. module: account_banking_sepa_direct_debit +#: field:banking.export.sdd,batch_booking:0 +#: field:banking.export.sdd.wizard,batch_booking:0 +msgid "Batch Booking" +msgstr "Crédit groupé" + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,sepa_migrated:0 +msgid "Migrated to SEPA" +msgstr "Migré à SEPA" + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,state:0 +msgid "Status" +msgstr "Statut" + +#. module: account_banking_sepa_direct_debit +#: field:banking.export.sdd,total_amount:0 +#: field:banking.export.sdd.wizard,total_amount:0 +msgid "Total Amount" +msgstr "Montant total" + +#. module: account_banking_sepa_direct_debit +#: model:ir.actions.act_window,name:account_banking_sepa_direct_debit.action_account_banking_sdd +#: model:ir.ui.menu,name:account_banking_sepa_direct_debit.menu_account_banking_sdd +msgid "SEPA Direct Debit Files" +msgstr "Fichiers de prélèvement SEPA" + +#. module: account_banking_sepa_direct_debit +#: selection:banking.export.sdd,charge_bearer:0 +#: selection:banking.export.sdd.wizard,charge_bearer:0 +msgid "Following Service Level" +msgstr "Suivant le niveau de service" + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:233 +#, python-format +msgid "" +"The mandate '%s' can't have a date of last debit before the date of " +"signature." +msgstr "" +"Le mandat '%s' ne peut pas avoir une date de dernier débit antérieure à la " +"date de signature." + +#. module: account_banking_sepa_direct_debit +#: model:mail.message.subtype,description:account_banking_sepa_direct_debit.recurrent_sequence_type_final +#: model:mail.message.subtype,name:account_banking_sepa_direct_debit.recurrent_sequence_type_final +msgid "Sequence Type set to Final" +msgstr "Type de Séquence mis à Final" + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,message_is_follower:0 +msgid "Is a Follower" +msgstr "Is a Follower" + +#. module: account_banking_sepa_direct_debit +#: help:sdd.mandate,original_mandate_identification:0 +msgid "" +"When the field 'Migrated to SEPA' is not active, this field will be used as " +"the Original Mandate Identification in the Direct Debit file." +msgstr "" +"Quand le champ 'Migré à SEPA' n'est pas activé, ce champ sera le 'Original " +"Mandate Identification' dans le fichier de prélèvement." + +#. module: account_banking_sepa_direct_debit +#: view:payment.order:0 +msgid "SDD Mandate" +msgstr "Mandat de prélèvement" + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,original_mandate_identification:0 +msgid "Original Mandate Identification" +msgstr "Ancien Identifiant du Mandat" + +#. module: account_banking_sepa_direct_debit +#: model:ir.model,name:account_banking_sepa_direct_debit.model_res_company +msgid "Companies" +msgstr "Sociétés" + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,message_summary:0 +msgid "Summary" +msgstr "Résumé" + +#. module: account_banking_sepa_direct_debit +#: model:res.groups,name:account_banking_sepa_direct_debit.group_original_mandate_required +msgid "Original Mandate Required (SEPA)" +msgstr "Ancien mandat requis (SEPA)" + +#. module: account_banking_sepa_direct_debit +#: field:account.invoice,sdd_mandate_id:0 +#: model:ir.model,name:account_banking_sepa_direct_debit.model_sdd_mandate +#: field:payment.line,sdd_mandate_id:0 +#: view:sdd.mandate:0 +msgid "SEPA Direct Debit Mandate" +msgstr "Mandat de prélèvement SEPA" + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/wizard/export_sdd.py:193 +#, python-format +msgid "" +"Missing SEPA Direct Debit mandate on the payment line with partner '%s' and " +"Invoice ref '%s'." +msgstr "" +"Mandat de prélèvement SEPA manquant sur la ligne de paiement ayant pour " +"partenaire '%s' et pour référence de facture '%s'." + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/wizard/export_sdd.py:210 +#, python-format +msgid "" +"The mandate with reference '%s' for partner '%s' has type set to 'One-Off' " +"and it has a last debit date set to '%s', so we can't use it." +msgstr "" +"Le mandat portant la référence '%s' pour le partenaire '%s' est de type 'One-" +"Off' et il a une date de dernier débit au '%s', donc il n'est pas utilisable." + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,scan:0 +msgid "Scan of the Mandate" +msgstr "Scan du mandat" + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,last_debit_date:0 +msgid "Date of the Last Debit" +msgstr "Date du dernier prélèvement" + +#. module: account_banking_sepa_direct_debit +#: model:mail.message.subtype,name:account_banking_sepa_direct_debit.mandate_expired +msgid "Mandate Expired" +msgstr "Mandat expiré" + +#. module: account_banking_sepa_direct_debit +#: constraint:res.company:0 +msgid "Invalid SEPA Creditor Identifier." +msgstr "Identifiant créancier SEPA invalide." + +#. module: account_banking_sepa_direct_debit +#: model:ir.model,name:account_banking_sepa_direct_debit.model_res_partner_bank +msgid "Bank Accounts" +msgstr "Comptes bancaires" + +#. module: account_banking_sepa_direct_debit +#: model:ir.actions.act_window,help:account_banking_sepa_direct_debit.sdd_mandate_action +msgid "" +"

\n" +" Click to create a new SEPA Direct Debit Mandate.\n" +"

\n" +" A SEPA Direct Debit Mandate is a document signed by your customer " +"that gives you the autorization to do one or several direct debits on his " +"bank account.\n" +"

\n" +" " +msgstr "" +"

\n" +" Cliquez pour créer un mandat de prélèvement SEPA.\n" +"

\n" +" Un mandat de prélèvement SEPA est un document signé par votre client " +"qui vous donne l'autorisation de réaliser un ou plusieurs prélèvements sur " +"son compte bancaire.\n" +"

\n" +" " + +#. module: account_banking_sepa_direct_debit +#: view:banking.export.sdd:0 +msgid "General Information" +msgstr "Informations générales" + +#. module: account_banking_sepa_direct_debit +#: view:sdd.mandate:0 +#: selection:sdd.mandate,state:0 +msgid "Valid" +msgstr "Valide" + +#. module: account_banking_sepa_direct_debit +#: model:ir.model,name:account_banking_sepa_direct_debit.model_account_invoice +msgid "Invoice" +msgstr "Facture" + +#. module: account_banking_sepa_direct_debit +#: view:banking.export.sdd.wizard:0 +#: view:sdd.mandate:0 +msgid "Cancel" +msgstr "Annuler" + +#. module: account_banking_sepa_direct_debit +#: view:sdd.mandate:0 +#: field:sdd.mandate,payment_line_ids:0 +msgid "Related Payment Lines" +msgstr "Lignes de paiement associées" + +#. module: account_banking_sepa_direct_debit +#: view:sdd.mandate:0 +#: selection:sdd.mandate,type:0 +msgid "Recurrent" +msgstr "Récurrent" + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,type:0 +msgid "Type of Mandate" +msgstr "Type de mandat" + +#. module: account_banking_sepa_direct_debit +#: model:mail.message.subtype,name:account_banking_sepa_direct_debit.mandate_valid +msgid "Mandate Validated" +msgstr "Mandat validé" + +#. module: account_banking_sepa_direct_debit +#: field:banking.export.sdd,file:0 +msgid "SEPA File" +msgstr "Fichier SEPA" + +#. module: account_banking_sepa_direct_debit +#: field:res.company,sepa_creditor_identifier:0 +msgid "SEPA Creditor Identifier" +msgstr "Identifiant créancier SEPA" + +#. module: account_banking_sepa_direct_debit +#: model:ir.model,name:account_banking_sepa_direct_debit.model_banking_export_sdd +msgid "SEPA Direct Debit export" +msgstr "Export de prélèvement SEPA" + +#. module: account_banking_sepa_direct_debit +#: view:sdd.mandate:0 +#: selection:sdd.mandate,state:0 +msgid "Expired" +msgstr "Expiré" + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,partner_bank_id:0 +msgid "Bank Account" +msgstr "Compte bancaire" + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:254 +#, python-format +msgid "" +"You must set the 'Original Mandate Identification' on the recurrent mandate " +"'%s' which is not marked as 'Migrated to SEPA'." +msgstr "" +"Vous devez renseigner le champ 'Ancien identifiant du mandat' sur le mandat " +"récurrent '%s' qui n'est pas marqué comme étant 'Migré à SEPA'." + +#. module: account_banking_sepa_direct_debit +#: model:mail.message.subtype,description:account_banking_sepa_direct_debit.recurrent_sequence_type_first +#: model:mail.message.subtype,name:account_banking_sepa_direct_debit.recurrent_sequence_type_first +msgid "Sequence Type set to First" +msgstr "Type de Séquence mis à First" + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:291 +#, python-format +msgid "" +"As you changed the bank account attached to this mandate, the 'Sequence " +"Type' has been set back to 'First'." +msgstr "" +"Etant donné que vous avez changé le compte bancaire associé à ce mandat, le " +"'Type de séquence' a été remis à 'First'." + +#. module: account_banking_sepa_direct_debit +#: help:sdd.mandate,message_ids:0 +msgid "Messages and communication history" +msgstr "Messages and communication history" + +#. module: account_banking_sepa_direct_debit +#: view:sdd.mandate:0 +msgid "Search SEPA Direct Debit Mandates" +msgstr "Recherche dans les mandats de prélèvement SEPA" + +#. module: account_banking_sepa_direct_debit +#: field:banking.export.sdd.wizard,file:0 +msgid "File" +msgstr "Fichier" diff --git a/account_banking_sepa_direct_debit/i18n/nl.po b/account_banking_sepa_direct_debit/i18n/nl.po new file mode 100644 index 000000000..2c2ccc12f --- /dev/null +++ b/account_banking_sepa_direct_debit/i18n/nl.po @@ -0,0 +1,754 @@ +# Dutch translation for banking-addons +# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 +# This file is distributed under the same license as the banking-addons package. +# FIRST AUTHOR , 2014. +# +msgid "" +msgstr "" +"Project-Id-Version: banking-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2013-12-23 22:24+0000\n" +"PO-Revision-Date: 2014-04-24 10:38+0000\n" +"Last-Translator: Erwin van der Ploeg (BAS Solutions) \n" +"Language-Team: Dutch \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2014-05-31 06:02+0000\n" +"X-Generator: Launchpad (build 17031)\n" + +#. module: account_banking_sepa_direct_debit +#: model:mail.message.subtype,description:account_banking_sepa_direct_debit.mandate_valid +msgid "SEPA Direct Debit Mandate Validated" +msgstr "SEPA incasso machtiging bevestigd." + +#. module: account_banking_sepa_direct_debit +#: field:banking.export.sdd,filename:0 +#: field:banking.export.sdd.wizard,filename:0 +msgid "Filename" +msgstr "Bestandsnaam" + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/wizard/export_sdd.py:200 +#, python-format +msgid "" +"The SEPA Direct Debit mandate with reference '%s' for partner '%s' has " +"expired." +msgstr "" +"De SEPA incasso machtiging met referentie '%s' voor relatie '%s' is verlopen." + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:219 +#, python-format +msgid "Cannot validate the mandate '%s' without a date of signature." +msgstr "" +"Het is niet mogelijk de machtiging '%s' te bevestigen zonder een datum van " +"ondertekenen." + +#. module: account_banking_sepa_direct_debit +#: selection:sdd.mandate,recurrent_sequence_type:0 +msgid "Final" +msgstr "Definitief" + +#. module: account_banking_sepa_direct_debit +#: selection:banking.export.sdd.wizard,state:0 +msgid "Finish" +msgstr "Gereed" + +#. module: account_banking_sepa_direct_debit +#: view:res.partner:0 +#: view:res.partner.bank:0 +msgid "SDD Mandates" +msgstr "SDD machteging" + +#. module: account_banking_sepa_direct_debit +#: constraint:payment.line:0 +#: constraint:sdd.mandate:0 +msgid "Error msg in raise" +msgstr "Fout bericht" + +#. module: account_banking_sepa_direct_debit +#: selection:banking.export.sdd,state:0 +msgid "Reconciled" +msgstr "Afgeletterd" + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,recurrent_sequence_type:0 +msgid "Sequence Type for Next Debit" +msgstr "Reeks soort voor volgende incasso" + +#. module: account_banking_sepa_direct_debit +#: selection:banking.export.sdd,charge_bearer:0 +#: selection:banking.export.sdd.wizard,charge_bearer:0 +msgid "Borne by Creditor" +msgstr "Op rekening van schuldeiser" + +#. module: account_banking_sepa_direct_debit +#: model:ir.actions.act_window,name:account_banking_sepa_direct_debit.sdd_mandate_action +#: model:ir.ui.menu,name:account_banking_sepa_direct_debit.sdd_mandate_menu +#: view:res.partner.bank:0 +#: field:res.partner.bank,sdd_mandate_ids:0 +msgid "SEPA Direct Debit Mandates" +msgstr "SEPA incasso machtegingen" + +#. module: account_banking_sepa_direct_debit +#: view:banking.export.sdd.wizard:0 +#: view:sdd.mandate:0 +msgid "Validate" +msgstr "Bevestigen" + +#. module: account_banking_sepa_direct_debit +#: model:mail.message.subtype,description:account_banking_sepa_direct_debit.recurrent_sequence_type_recurring +#: model:mail.message.subtype,name:account_banking_sepa_direct_debit.recurrent_sequence_type_recurring +msgid "Sequence Type set to Recurring" +msgstr "Reeks soort ingesteld op herhalend" + +#. module: account_banking_sepa_direct_debit +#: view:banking.export.sdd.wizard:0 +msgid "Generate" +msgstr "Genereer" + +#. module: account_banking_sepa_direct_debit +#: model:mail.message.subtype,description:account_banking_sepa_direct_debit.mandate_cancel +msgid "SEPA Direct Debit Mandate Cancelled" +msgstr "SEPA incasso machtegingen geannuleerd" + +#. module: account_banking_sepa_direct_debit +#: selection:banking.export.sdd,charge_bearer:0 +#: selection:banking.export.sdd.wizard,charge_bearer:0 +msgid "Borne by Debtor" +msgstr "Rekening van schuldenaar" + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:212 +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:218 +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:224 +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:232 +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:239 +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:245 +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:253 +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:395 +#: code:addons/account_banking_sepa_direct_debit/wizard/export_sdd.py:140 +#: code:addons/account_banking_sepa_direct_debit/wizard/export_sdd.py:192 +#: code:addons/account_banking_sepa_direct_debit/wizard/export_sdd.py:199 +#: code:addons/account_banking_sepa_direct_debit/wizard/export_sdd.py:209 +#, python-format +msgid "Error:" +msgstr "Fout:" + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,message_ids:0 +msgid "Messages" +msgstr "Berichten" + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,unique_mandate_reference:0 +msgid "Unique Mandate Reference" +msgstr "Unieke machtiging referentie" + +#. module: account_banking_sepa_direct_debit +#: view:sdd.mandate:0 +#: selection:sdd.mandate,state:0 +msgid "Cancelled" +msgstr "Geannuleerd" + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/wizard/export_sdd.py:141 +#, python-format +msgid "" +"Payment Type Code '%s' is not supported. The only Payment Type Code " +"supported for SEPA Direct Debit are 'pain.008.001.02', 'pain.008.001.03' and " +"'pain.008.001.04'." +msgstr "" +"Betaal soort code '%s' wordt niet ondersteund. De enige betaalsoort code " +"ondersteund voor SEPA incasso's zijn 'pain.008.001.02', 'pain.008.001.03' en " +"'pain.008.001.04'." + +#. module: account_banking_sepa_direct_debit +#: help:sdd.mandate,message_unread:0 +msgid "If checked new messages require your attention." +msgstr "Indien aangevinkt zullen nieuwe berichten uw aandacht vragen." + +#. module: account_banking_sepa_direct_debit +#: field:banking.export.sdd.wizard,file_id:0 +msgid "SDD File" +msgstr "SDD bestand" + +#. module: account_banking_sepa_direct_debit +#: model:mail.message.subtype,description:account_banking_sepa_direct_debit.mandate_expired +msgid "SEPA Direct Debit Mandate has Expired" +msgstr "SEPA Direct incasso machtiging is verlopen" + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:246 +#, python-format +msgid "" +"The recurrent mandate '%s' which is not marked as 'Migrated to SEPA' must " +"have its recurrent sequence type set to 'First'." +msgstr "" +"Bij de herhalende machtiging '%s' welke niet is gemarkeerd als 'gemigreerd " +"naar SEPA' dient de reeks soort te worden ingesteld op 'Eerste'." + +#. module: account_banking_sepa_direct_debit +#: help:banking.export.sdd,charge_bearer:0 +#: help:banking.export.sdd.wizard,charge_bearer:0 +msgid "" +"Following service level : transaction charges are to be applied following " +"the rules agreed in the service level and/or scheme (SEPA Core messages must " +"use this). Shared : transaction charges on the creditor side are to be borne " +"by the creditor, transaction charges on the debtor side are to be borne by " +"the debtor. Borne by creditor : all transaction charges are to be borne by " +"the creditor. Borne by debtor : all transaction charges are to be borne by " +"the debtor." +msgstr "" +"Volg service level: Transactie kosten worden toegepast volgens de " +"afgesproken regels in het service level en/of schema (Voor SEPA berichten " +"deze gebruiken). Gedeeld : De transactiekosten aan de crediteur zijde zijn " +"voor de schuldenaar, transactiekosten aan de debiteur kant zijn voor de " +"schuldeiser. Op rekening van de schuldenaar: Alle transactie kosten zijn " +"voor rekening van de schuldenaar. Op rekening van de schuldeiser: Alle " +"transactie kosten zijn voor rekening van de schuldeiser." + +#. module: account_banking_sepa_direct_debit +#: view:sdd.mandate:0 +msgid "Reference" +msgstr "Referentie" + +#. module: account_banking_sepa_direct_debit +#: view:banking.export.sdd:0 +msgid "SEPA Direct Debit" +msgstr "SEPA Incasso (Direct Debit)" + +#. module: account_banking_sepa_direct_debit +#: view:banking.export.sdd.wizard:0 +msgid "SEPA Direct Debit XML file generation" +msgstr "SEPA Incasso XML bestand aanmaken" + +#. module: account_banking_sepa_direct_debit +#: help:sdd.mandate,message_summary:0 +msgid "" +"Holds the Chatter summary (number of messages, ...). This summary is " +"directly in html format in order to be inserted in kanban views." +msgstr "" +"Bevat de samenvatting van de chatter (aantal berichten,...). Deze " +"samenvatting is direct in html formaat om zo in de kanban weergave te worden " +"ingevoegd." + +#. module: account_banking_sepa_direct_debit +#: model:ir.model,name:account_banking_sepa_direct_debit.model_payment_line +msgid "Payment Line" +msgstr "Betaalregel" + +#. module: account_banking_sepa_direct_debit +#: field:banking.export.sdd,create_date:0 +msgid "Generation Date" +msgstr "Aangemaakt op" + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:396 +#, python-format +msgid "" +"The payment line with reference '%s' has the bank account '%s' which is not " +"attached to the mandate '%s' (this mandate is attached to the bank account " +"'%s')." +msgstr "" +"De betaalregel met referentie '%s' heeft het bankrekeningnummer '%s' welke " +"niet is gekoppeld aan de machtiging '%s' (deze machtiging is gekoppeld aan " +"bankrekening '%s')." + +#. module: account_banking_sepa_direct_debit +#: selection:banking.export.sdd.wizard,state:0 +msgid "Create" +msgstr "Aanmaken" + +#. module: account_banking_sepa_direct_debit +#: field:banking.export.sdd,nb_transactions:0 +#: field:banking.export.sdd.wizard,nb_transactions:0 +msgid "Number of Transactions" +msgstr "Aantal transacties" + +#. module: account_banking_sepa_direct_debit +#: view:sdd.mandate:0 +#: selection:sdd.mandate,type:0 +msgid "One-Off" +msgstr "Eenmalig" + +#. module: account_banking_sepa_direct_debit +#: field:banking.export.sdd,state:0 +#: field:banking.export.sdd.wizard,state:0 +msgid "State" +msgstr "Status" + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:240 +#, python-format +msgid "The recurrent mandate '%s' must have a sequence type." +msgstr "De herhalende machtiging '%s' dient een reeks soort te hebben." + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,message_follower_ids:0 +msgid "Followers" +msgstr "Volgers" + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,message_unread:0 +msgid "Unread Messages" +msgstr "Ongelezen berichten" + +#. module: account_banking_sepa_direct_debit +#: view:banking.export.sdd:0 +#: field:banking.export.sdd,payment_order_ids:0 +#: field:banking.export.sdd.wizard,payment_order_ids:0 +msgid "Payment Orders" +msgstr "Betaalopdrachten" + +#. module: account_banking_sepa_direct_debit +#: view:sdd.mandate:0 +msgid "Type" +msgstr "Soort" + +#. module: account_banking_sepa_direct_debit +#: selection:banking.export.sdd,state:0 +msgid "Sent" +msgstr "Verstuurd" + +#. module: account_banking_sepa_direct_debit +#: field:res.company,original_creditor_identifier:0 +msgid "Original Creditor Identifier" +msgstr "Originele Incassant-ID" + +#. module: account_banking_sepa_direct_debit +#: selection:sdd.mandate,recurrent_sequence_type:0 +msgid "Recurring" +msgstr "Terugkerend" + +#. module: account_banking_sepa_direct_debit +#: help:res.company,sepa_creditor_identifier:0 +msgid "" +"Enter the Creditor Identifier that has been attributed to your company to " +"make SEPA Direct Debits. This identifier is composed of :\n" +"- your country ISO code (2 letters)\n" +"- a 2-digits checkum\n" +"- a 3-letters business code\n" +"- a country-specific identifier" +msgstr "" +"Geef de Incassant-ID in, welke is toegewezen aan uw bedrijf om incasso's uit " +"te voeren. De Incassant-ID is samengesteld uit:\n" +"- uw ISO landcode (2 letters)\n" +"- een 2 cijferig controlegetal\n" +"- een 3 cijferig business code\n" +"- een landspecifieke identifier" + +#. module: account_banking_sepa_direct_debit +#: sql_constraint:sdd.mandate:0 +msgid "A Mandate with the same reference already exists for this company !" +msgstr "Een machtiging met dezelfde referentie bestaat al vooR dit bedrijf!" + +#. module: account_banking_sepa_direct_debit +#: help:sdd.mandate,state:0 +msgid "" +"Only valid mandates can be used in a payment line. A cancelled mandate is a " +"mandate that has been cancelled by the customer. A one-off mandate expires " +"after its first use. A recurrent mandate expires after it's final use or if " +"it hasn't been used for 36 months." +msgstr "" +"Alleen geldige machtigingen kunnen worden gebruikt op betaalregels. Een " +"geannuleerde machtiging is een machtiging welke is geannuleerd door de " +"klant. Een eenmalige machtiging verloopt na eenmalig gebruik. Een herhalende " +"machtiging verloopt na zijn laatste gebruik of als deze niet is gebruikt " +"voor 36 maanden." + +#. module: account_banking_sepa_direct_debit +#: help:sdd.mandate,recurrent_sequence_type:0 +msgid "" +"This field is only used for Recurrent mandates, not for One-Off mandates." +msgstr "" +"Dit veld wordt alleen gebruikt voor herhalende machtigingen, niet voor een " +"eenmalige machtiging." + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:213 +#, python-format +msgid "The date of signature of mandate '%s' is in the future !" +msgstr "" +"De datum van de handtekening van de machtiging '%s' is in de toekomst!" + +#. module: account_banking_sepa_direct_debit +#: view:sdd.mandate:0 +msgid "Signature Date" +msgstr "Handtekening datum" + +#. module: account_banking_sepa_direct_debit +#: field:banking.export.sdd,charge_bearer:0 +#: field:banking.export.sdd.wizard,charge_bearer:0 +msgid "Charge Bearer" +msgstr "Kostenverdeling" + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,partner_id:0 +msgid "Partner" +msgstr "Relatie" + +#. module: account_banking_sepa_direct_debit +#: selection:sdd.mandate,recurrent_sequence_type:0 +msgid "First" +msgstr "Eerste" + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,signature_date:0 +msgid "Date of Signature of the Mandate" +msgstr "Datum avn de handtekening van de machtiging" + +#. module: account_banking_sepa_direct_debit +#: model:mail.message.subtype,name:account_banking_sepa_direct_debit.mandate_cancel +msgid "Mandate Cancelled" +msgstr "Machtiging geannuleerd" + +#. module: account_banking_sepa_direct_debit +#: model:ir.actions.act_window,name:account_banking_sepa_direct_debit.act_banking_export_sdd_payment_order +msgid "Generated SEPA Direct Debit Files" +msgstr "Genereerde SEPA incasso bestanden" + +#. module: account_banking_sepa_direct_debit +#: help:sdd.mandate,sepa_migrated:0 +msgid "" +"If this field is not active, the mandate section of the next direct debit " +"file that include this mandate will contain the 'Original Mandate " +"Identification' and the 'Original Creditor Scheme Identification'. This is " +"required in a few countries (Belgium for instance), but not in all " +"countries. If this is not required in your country, you should keep this " +"field always active." +msgstr "" +"Indien niet aangevinkt, zal het machtiging gedeelte van het volgende incasso " +"bestand, dat deze machtiging bevat, de 'Originele machtiging identificatie' " +"en de 'Origineel schuldeiser identificatie' bevatten. Dit is verplicht in " +"een aantal landen (zoals bijvoorbeeld België), maar niet in alle landen. " +"Indien dit niet verplicht is in uw land, dient u dit veld altijd aangevinkt " +"te houden." + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,company_id:0 +msgid "Company" +msgstr "Bedijf" + +#. module: account_banking_sepa_direct_debit +#: model:ir.model,name:account_banking_sepa_direct_debit.model_banking_export_sdd_wizard +msgid "Export SEPA Direct Debit File" +msgstr "Exporteer SEPA incasso bestand" + +#. module: account_banking_sepa_direct_debit +#: help:banking.export.sdd,batch_booking:0 +#: help:banking.export.sdd.wizard,batch_booking:0 +msgid "" +"If true, the bank statement will display only one credit line for all the " +"direct debits of the SEPA file ; if false, the bank statement will display " +"one credit line per direct debit of the SEPA file." +msgstr "" +"Indien aangevinkt, zal het bankafschrift maar één credit regel weergeven " +"voor alle incasso's van het SEPA bestand. Indien niet aangevinkt wordt voor " +"iedere incasso een credit regel weergegeven op het bankafschrift." + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:225 +#, python-format +msgid "" +"Cannot validate the mandate '%s' because it is not attached to a bank " +"account." +msgstr "" +"Kan de machtiging '%s' niet bevestigen omdat deze niet is gekoppeld aan een " +"bankrekening." + +#. module: account_banking_sepa_direct_debit +#: selection:banking.export.sdd,state:0 +#: view:sdd.mandate:0 +#: selection:sdd.mandate,state:0 +msgid "Draft" +msgstr "Concept" + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:290 +#, python-format +msgid "Mandate update" +msgstr "Machtiging bijwerken" + +#. module: account_banking_sepa_direct_debit +#: selection:banking.export.sdd,charge_bearer:0 +#: selection:banking.export.sdd.wizard,charge_bearer:0 +msgid "Shared" +msgstr "Gedeeld" + +#. module: account_banking_sepa_direct_debit +#: field:banking.export.sdd,batch_booking:0 +#: field:banking.export.sdd.wizard,batch_booking:0 +msgid "Batch Booking" +msgstr "Bach verwerking" + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,sepa_migrated:0 +msgid "Migrated to SEPA" +msgstr "Gemigreerd naar SEPa" + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,state:0 +msgid "Status" +msgstr "Status" + +#. module: account_banking_sepa_direct_debit +#: field:banking.export.sdd,total_amount:0 +#: field:banking.export.sdd.wizard,total_amount:0 +msgid "Total Amount" +msgstr "Totaalbedrag" + +#. module: account_banking_sepa_direct_debit +#: model:ir.actions.act_window,name:account_banking_sepa_direct_debit.action_account_banking_sdd +#: model:ir.ui.menu,name:account_banking_sepa_direct_debit.menu_account_banking_sdd +msgid "SEPA Direct Debit Files" +msgstr "SEPA incasso bestanden" + +#. module: account_banking_sepa_direct_debit +#: selection:banking.export.sdd,charge_bearer:0 +#: selection:banking.export.sdd.wizard,charge_bearer:0 +msgid "Following Service Level" +msgstr "Volg service level" + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:233 +#, python-format +msgid "" +"The mandate '%s' can't have a date of last debit before the date of " +"signature." +msgstr "" +"De machtiging '%s' kan geen datum van laatste incasso hebben die eerder is " +"dan de datum van ondertekening." + +#. module: account_banking_sepa_direct_debit +#: model:mail.message.subtype,description:account_banking_sepa_direct_debit.recurrent_sequence_type_final +#: model:mail.message.subtype,name:account_banking_sepa_direct_debit.recurrent_sequence_type_final +msgid "Sequence Type set to Final" +msgstr "Reeks soort ingesteld op definitief" + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,message_is_follower:0 +msgid "Is a Follower" +msgstr "Is een volger" + +#. module: account_banking_sepa_direct_debit +#: help:sdd.mandate,original_mandate_identification:0 +msgid "" +"When the field 'Migrated to SEPA' is not active, this field will be used as " +"the Original Mandate Identification in the Direct Debit file." +msgstr "" +"Wanneer het veld 'gemigreerd naar SEPA' niet actief is, zal dit veld worden " +"gebruikt als de originele machtiging identificatie in het incasso bestand." + +#. module: account_banking_sepa_direct_debit +#: view:payment.order:0 +msgid "SDD Mandate" +msgstr "SDD machtiging" + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,original_mandate_identification:0 +msgid "Original Mandate Identification" +msgstr "Originele machtiging indificatie" + +#. module: account_banking_sepa_direct_debit +#: model:ir.model,name:account_banking_sepa_direct_debit.model_res_company +msgid "Companies" +msgstr "Bedrijven" + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,message_summary:0 +msgid "Summary" +msgstr "Samenvatting" + +#. module: account_banking_sepa_direct_debit +#: model:res.groups,name:account_banking_sepa_direct_debit.group_original_mandate_required +msgid "Original Mandate Required (SEPA)" +msgstr "Originele machtiging benodigd (SEPA)" + +#. module: account_banking_sepa_direct_debit +#: field:account.invoice,sdd_mandate_id:0 +#: model:ir.model,name:account_banking_sepa_direct_debit.model_sdd_mandate +#: field:payment.line,sdd_mandate_id:0 +#: view:sdd.mandate:0 +msgid "SEPA Direct Debit Mandate" +msgstr "SEPA incasso machtiging" + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/wizard/export_sdd.py:193 +#, python-format +msgid "" +"Missing SEPA Direct Debit mandate on the payment line with partner '%s' and " +"Invoice ref '%s'." +msgstr "" +"Ontbrekende SEPA incasso machtiging op de betaalregel met relatie '%s' en " +"factuur referentie '%s'." + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/wizard/export_sdd.py:210 +#, python-format +msgid "" +"The mandate with reference '%s' for partner '%s' has type set to 'One-Off' " +"and it has a last debit date set to '%s', so we can't use it." +msgstr "" +"De machtiging referentie '%s' voor relatie %s' is ingesteld op 'eenmalig' en " +"de laatste incasso datum is ingesteld op '%s'. Zodoende kunnen we deze niet " +"gebruiken." + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,scan:0 +msgid "Scan of the Mandate" +msgstr "Scan van de machteging" + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,last_debit_date:0 +msgid "Date of the Last Debit" +msgstr "Datum van laatste incasso" + +#. module: account_banking_sepa_direct_debit +#: model:mail.message.subtype,name:account_banking_sepa_direct_debit.mandate_expired +msgid "Mandate Expired" +msgstr "Machtiging verlopen" + +#. module: account_banking_sepa_direct_debit +#: constraint:res.company:0 +msgid "Invalid SEPA Creditor Identifier." +msgstr "Ongeldige SEPA Incassant-ID." + +#. module: account_banking_sepa_direct_debit +#: model:ir.model,name:account_banking_sepa_direct_debit.model_res_partner_bank +msgid "Bank Accounts" +msgstr "Bankrekeningen" + +#. module: account_banking_sepa_direct_debit +#: model:ir.actions.act_window,help:account_banking_sepa_direct_debit.sdd_mandate_action +msgid "" +"

\n" +" Click to create a new SEPA Direct Debit Mandate.\n" +"

\n" +" A SEPA Direct Debit Mandate is a document signed by your customer " +"that gives you the autorization to do one or several direct debits on his " +"bank account.\n" +"

\n" +" " +msgstr "" +"

\n" +" Klik voor het maken van een nieuwe SEPA incasso machtiging.\n" +"

\n" +" Een SEPA incasso machtiging is een document ondertekend door uw " +"klant, welke u toestemming geeft om incasso's uit te voeren op zijn " +"bankrekening.\n" +"

\n" +" " + +#. module: account_banking_sepa_direct_debit +#: view:banking.export.sdd:0 +msgid "General Information" +msgstr "Algemene informatie" + +#. module: account_banking_sepa_direct_debit +#: view:sdd.mandate:0 +#: selection:sdd.mandate,state:0 +msgid "Valid" +msgstr "Geldig" + +#. module: account_banking_sepa_direct_debit +#: model:ir.model,name:account_banking_sepa_direct_debit.model_account_invoice +msgid "Invoice" +msgstr "Factuur" + +#. module: account_banking_sepa_direct_debit +#: view:banking.export.sdd.wizard:0 +#: view:sdd.mandate:0 +msgid "Cancel" +msgstr "Annuleer" + +#. module: account_banking_sepa_direct_debit +#: view:sdd.mandate:0 +#: field:sdd.mandate,payment_line_ids:0 +msgid "Related Payment Lines" +msgstr "Gerelateerde betaalregels" + +#. module: account_banking_sepa_direct_debit +#: view:sdd.mandate:0 +#: selection:sdd.mandate,type:0 +msgid "Recurrent" +msgstr "Terugkerend" + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,type:0 +msgid "Type of Mandate" +msgstr "Soort machtiging" + +#. module: account_banking_sepa_direct_debit +#: model:mail.message.subtype,name:account_banking_sepa_direct_debit.mandate_valid +msgid "Mandate Validated" +msgstr "Machtiging bevestigd" + +#. module: account_banking_sepa_direct_debit +#: field:banking.export.sdd,file:0 +msgid "SEPA File" +msgstr "SEPA bestand" + +#. module: account_banking_sepa_direct_debit +#: field:res.company,sepa_creditor_identifier:0 +msgid "SEPA Creditor Identifier" +msgstr "SEPA Incassant-ID" + +#. module: account_banking_sepa_direct_debit +#: model:ir.model,name:account_banking_sepa_direct_debit.model_banking_export_sdd +msgid "SEPA Direct Debit export" +msgstr "SEPA incasso export" + +#. module: account_banking_sepa_direct_debit +#: view:sdd.mandate:0 +#: selection:sdd.mandate,state:0 +msgid "Expired" +msgstr "Verlopen" + +#. module: account_banking_sepa_direct_debit +#: field:sdd.mandate,partner_bank_id:0 +msgid "Bank Account" +msgstr "Bankrekening" + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:254 +#, python-format +msgid "" +"You must set the 'Original Mandate Identification' on the recurrent mandate " +"'%s' which is not marked as 'Migrated to SEPA'." +msgstr "" +"U dient de 'Originele machtiging identificatie' in te stellen op de " +"herhalende machtiging '%s' welke niet is gemarkeerd als 'Gemigreerd naar " +"SEPA'" + +#. module: account_banking_sepa_direct_debit +#: model:mail.message.subtype,description:account_banking_sepa_direct_debit.recurrent_sequence_type_first +#: model:mail.message.subtype,name:account_banking_sepa_direct_debit.recurrent_sequence_type_first +msgid "Sequence Type set to First" +msgstr "Reeks ingesteld op eerste" + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:291 +#, python-format +msgid "" +"As you changed the bank account attached to this mandate, the 'Sequence " +"Type' has been set back to 'First'." +msgstr "" +"Omdat u de gekoppelde bankrekening heeft gewijzigd is de reeks terug gezet " +"naar 'Eerste'." + +#. module: account_banking_sepa_direct_debit +#: help:sdd.mandate,message_ids:0 +msgid "Messages and communication history" +msgstr "Berichten en communicatie historie" + +#. module: account_banking_sepa_direct_debit +#: view:sdd.mandate:0 +msgid "Search SEPA Direct Debit Mandates" +msgstr "Zoek SEPA incasso machtigingen" + +#. module: account_banking_sepa_direct_debit +#: field:banking.export.sdd.wizard,file:0 +msgid "File" +msgstr "Bestand" diff --git a/account_banking_sepa_direct_debit/mandate_expire_cron.xml b/account_banking_sepa_direct_debit/mandate_expire_cron.xml new file mode 100644 index 000000000..4cb0693d2 --- /dev/null +++ b/account_banking_sepa_direct_debit/mandate_expire_cron.xml @@ -0,0 +1,26 @@ + + + + + + + + + Set SEPA Direct Debit Mandates to Expired + + + 1 + days + -1 + + + + + + + + diff --git a/account_banking_sepa_direct_debit/res_partner_bank_view.xml b/account_banking_sepa_direct_debit/res_partner_bank_view.xml new file mode 100644 index 000000000..0b32e9f1c --- /dev/null +++ b/account_banking_sepa_direct_debit/res_partner_bank_view.xml @@ -0,0 +1,48 @@ + + + + + + + sdd.mandate.res.partner.bank.form + res.partner.bank + + + + + + + + + + + + sdd.mandate.res.partner.bank.tree + res.partner.bank + + + + + + + + + + + sdd.mandate.partner.form + res.partner + + + + + + + + + + diff --git a/account_banking_sepa_direct_debit/sdd_mandate_view.xml b/account_banking_sepa_direct_debit/sdd_mandate_view.xml new file mode 100644 index 000000000..bd1dd6e79 --- /dev/null +++ b/account_banking_sepa_direct_debit/sdd_mandate_view.xml @@ -0,0 +1,152 @@ + + + + + + + sdd.mandate.form + sdd.mandate + +
+
+
+ +
+

+ +

+
+ + + + + + + + + + + + + + + +
+
+ + +
+
+
+
+ + + sdd.mandate.tree + sdd.mandate + + + + + + + + + + + + + + + sdd.mandate.search + sdd.mandate + + + + + + + + + + + + + + + SEPA Direct Debit Mandates + sdd.mandate + form + tree,form + +

+ Click to create a new SEPA Direct Debit Mandate. +

+ A SEPA Direct Debit Mandate is a document signed by your customer that gives you the autorization to do one or several direct debits on his bank account. +

+
+
+ + + + + + Mandate Validated + sdd.mandate + + SEPA Direct Debit Mandate Validated + + + + Mandate Expired + sdd.mandate + + SEPA Direct Debit Mandate has Expired + + + + Mandate Cancelled + sdd.mandate + + SEPA Direct Debit Mandate Cancelled + + + + Sequence Type set to First + sdd.mandate + + Sequence Type set to First + + + + Sequence Type set to Recurring + sdd.mandate + + Sequence Type set to Recurring + + + + Sequence Type set to Final + sdd.mandate + + Sequence Type set to Final + + +
+
diff --git a/account_banking_sepa_direct_debit/security/ir.model.access.csv b/account_banking_sepa_direct_debit/security/ir.model.access.csv new file mode 100644 index 000000000..cf78ffb59 --- /dev/null +++ b/account_banking_sepa_direct_debit/security/ir.model.access.csv @@ -0,0 +1,4 @@ +"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" +"access_banking_export_sdd","Full access on banking.export.sdd","model_banking_export_sdd","account_payment.group_account_payment",1,1,1,1 +"access_sdd_mandate","Full access on sdd.mandate","model_sdd_mandate","account_payment.group_account_payment",1,1,1,1 +"access_sdd_mandate_read","Read access on sdd.mandate","model_sdd_mandate","base.group_user",1,0,0,0 diff --git a/account_banking_sepa_direct_debit/security/original_mandate_required_security.xml b/account_banking_sepa_direct_debit/security/original_mandate_required_security.xml new file mode 100644 index 000000000..e6a8570cf --- /dev/null +++ b/account_banking_sepa_direct_debit/security/original_mandate_required_security.xml @@ -0,0 +1,17 @@ + + + + + + + + Original Mandate Required (SEPA) + + + + + diff --git a/account_banking_sepa_direct_debit/sepa_direct_debit_demo.xml b/account_banking_sepa_direct_debit/sepa_direct_debit_demo.xml new file mode 100644 index 000000000..220261088 --- /dev/null +++ b/account_banking_sepa_direct_debit/sepa_direct_debit_demo.xml @@ -0,0 +1,27 @@ + + + + + + + SEPA Direct Debit La Banque Postale + + + + + + + + FR78ZZZ424242 + + + + + recurrent + first + 2014-02-01 + valid + + + + diff --git a/account_banking_sepa_direct_debit/static/src/img/icon.png b/account_banking_sepa_direct_debit/static/src/img/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..6d1d923b6506b33ca0825af17ed0ae36c9bd0dc6 GIT binary patch literal 6892 zcmVPx#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2i*$` z7B3e|!Eq@702*vbL_t(|+RdAHcwFVR?tgpFo<5^8Ga8M0v1A#^k}b=Yja)D`;hH!h zp@cw^OL9)Yq+CcN<6E5%AqMj|;G$)Txm zv~I!^I(n+U|IaV%J#*-PEC8EIvy(P$%HNgdO88Wo)4Jx^$zJiqnE@oNL}_sbt5#-` zn{6jC!MNykqR|+A0~0j24O4rvo6#{JPP>^cm3fMya-x68^T%U{J0Cw#*ERV+0)Xw? z^PE*Hm)%;JXZu1R7){^3zgZMD8a}eEn2qa~A&T!EDNduL$l2G| z?|I^Ib>}0m9&R7`rvY&Lm$vLGD@wn^;}2!--hWoi&vSCawd=523?E3mswy0=Zs#vA zoun|&&brdfuKK2dAOG~%haUe>0oZjz#fp-mjE6JR61P43w|dd#O5!uut;cB4@?ovo zQ$0NQ{Bb_Au|UyC!v5;ou3Mk^+v&3(H~?R}sp@l8Yx3{!=oxn%sq5p*|9S~&uEY<; z=<3=oDl2klUdLhz&puy6PtO=1-C8(wx_RhpKY8?x=ibRRHSgrhKe+w!`!|&5-t)J8 zO$jE8iLc(g^#gPF`Bo?##g=Sl+#MhkiefhDDJ#h!H^;$m|5#(WxIF8s%JMAJKMuF= zdtU*ls6e{y3s*c@R+N6rZ(lg6`Q*peu(_)6JsINC$> zNhT&HgP;mn%z8%0{G_=O*>rIsFYKuov(u8Qwr?!RaR*!X3=X2a=MdPs73ou#eexMs ziuLN>zgRDR`R1)SY?gOqY+y`e0MUY=F=MeNqS0tTRZ&$1k7p7^_M^o7sPY7A z%#FnmMHJ)L@cF~+ef=z18A+^NoilUoqcxpuSerNV`oEt!g59jeYSI7cg#$0%aNq#) zdjjCc-`(+KNs;TuXZ}_%e&yy%m+bP9D8z(xM13|%wroUEL`4NuR7IKon;8I9Rh@pR z#NPw_zA?gqZgj#3MtzKl$sk&-hSv5GBGDL?YjO!rg)y7-^z^yO&a?sWm)&((w4f^L z2#y}Y&K93A-N&ee=ehSBM@H+}zGm)-xa za=>@Ly7l^XtFrFfeV|2i-L;k2lFS#}@Kn@}*>NdJjv^$jVLGPO_yIn>dVBi_27_2E z=U-1<;P1GHXfzTAlbyCsFDWSw%=$1Ula8J~H^=L`iOMp|3sNx|bcDk)k%-Ki)j7O= zq+KXpmQq=iXKy-G)7`ja57>1>#fplOjGxvu4oaJ<3Q0{#Sk!PiCJ>d%NX^}e+2WXo zz^L^0_HpRYVVav;@cDf2$|EF6OHxWX<5Rf=L-7bU8?@Mx%=Gk45Q`}cjd+>#1OfQp z*KgopZMRf*QTl^7UbSlZk^v~aDC=QaQJoQ0q~xNE#f?`abV=JtNn0}~iw6P$nwy(B z@cJ8^ZEhhH3Zbeh$;rv@=>*BiDZ&?7hR%@4%Hj-s{s?uadpTCyg(Qh6(@rFc0-wIR zlDej$^tG#V9$r!ieCNxT?pj-xdFz`ed&TRnUdLi5Q&iSrw0#6?Vg{ht1qR|*5V_pC@ZYZRobyQqkoPNjFisiFnR675~=CXpXI_;Lsu0fxepPRCv z@rnZarnWu>U9ir4EU5{b~()`rL9o%7qI`kM zNfN56@Vlq~fXCxy-)n#2uP^Qa;MLdu!6jR&`0Qt{QhlQIW@n4;oLanAmJf|bXA^(0MA&0KTMm3;Xt-=wiIUei=U3aaCS0QF(oH@4m@s#B4U9 zo|hB;_=l%BR$as1egELb&wq(MFFnVmEjxJW#b-%OOh8o>+S)qs`vW}rn}=|vrlP6} zimLGYXJ6okPhZ8vq=(*qHxZ=(gE)#t6zCtEM3!TetVl_Vs0p-u~@s;UrEVmRzJ1Odjz-8k%abUF?F{R6}TC(%kWvaFDn znutz!E+NXY!ttXmihDBfz#aF!@@)|y$zrH-dx9)4T=?#)8Ykui*OG|JeD0r=lz=2j z7m&PE#>Xe-yl*rZiALpFNmo%6L{WpmU?4Lijo!X~Iy!qm5Qzzn>0?ryVTI?|q=-4e zAX=^ZDgbePSw^PQVJQnm6mhX)M`tNmGE;NA-E-rA3G8opWCWkji`P4wDx1wF91a`V zS(!wmQ2-JX6H%1dIoGzB(CM@Yf`A}7h{fVQ6pBRW<{h05m)*L$;-VavSW%X}Ex~Hg znHDi#RRt`G1xq$QcHYL`y0bQ$eZk)}Hl1b16;~6Q3Zo)$@utgXeV&+@fJP(Y_4+Ux zjWeM#JTe+5N$p*PLlNYtJZ+$fsA8PqERo3U{n%|*bUKY;?Hbo*qSIwv24FE87CHJ7 z(dtY~0$_aHJ*OtnXf)XE^Ls!z9A?j+S1B)F6|WFgm1BqZ&Kp+2;1r38Rzl%0$;nCN z=48bUmNZCO39artQC6@{eZg~GT}Q+ZU+pnWAtON)Q^JnnBYnJ}4*^LjvW@kP|0sAJ3KDxz|XhBJ*6m#m<^p^>XTu@j@w z$jQ3XJo?B3yuAB4{_^}&05qIwV$;UT8RG$JYU;?%%{rF?G$IjMo#`LUsb>TMK@v@( zMkAW^+6#1agr&6)CfxJI|NP-|*=1Y#Kev99y1IHcZ>~Zk3Y=+dV&@f?Q(Iey#bV** zSN5@b)k?m4+qb!5=XLBqaEMd&4eYpl8@GM^4t8GoS@yiLm!6(JoT(|?e9P?&3=E%_ z2Q-X~`Z#r_pA+@H3=VtFM*xi=ScJ##xn?js%jR@tITs}OCg-)7ttlvqf*>$26AXt# z?B9QYxHqY&N?gb&E?z;JEA=g2x1cIKF)>LX5I`e|bai$!G(1Yhnle;HrLplW7Zn%L z($b2-U?3|q9Tk-mC+b;KUdqVG810>1tgkGmq2VkA%W}{g^mLwmjc{m+43Ac~dv;9M2ET#m{S8V1d0`d~#e{@cfq^b%|r*lc(qtok%#bQLGG8&Br zqap6zo!vc@l*ARJNJK``NV8a7ykiu?F#Y|g97B>M!r=&G6Fzct?C5k7MuV1&v_u95 zJu{+4OjZ42OjUz#v8DxifE;{R>@P7f5lLEF_?V1FT&`5)XcRdXBQO=B`uGWa=dr>- zAb`aZ&qu-F6lQb$sEdRn#N-%tb!S+XpM@kzOiXxiIV>z+<|KW(cPR)0k%&C4O(?`< zB`AXG7J-S$z{1Cy?0Z+|zs+V_GJj}nYUavMT#q1%$k7-sr-RCMYi8v0uC5+_^1vgQ zEoP!o8L!um)oNkqm7gUXj*^j)77t1Ftv!c$d+Ff|L@*e&(_n@`z%5QqMSCPkWNIq1 zu>L1|7Tvth=O+{j&7r?``@#T(!(oPoMsT|)h(@CvJb0Lm8#kaTDxuI68clqoxjET1 zx3+Qc&7%|*6{68-$j;8d7x3e-+t~f$(*%M+%oZ~#4m*AQgK_Yabol%cqSGWO7E>7- z@sOPv=OmGktONql9w`u(I{>1Qh2uOD7+4g5(b183>+8Ho5;YoZHe0;Bov+d9@gd7m zt@N73>ET3g#GDK4V6whoueNq%lNu~>|; zF*hx(?L76{=XmgEchhv%PitEz*)Ek8g{jokbz`?#@OXn1U77kTL6$7t{9WYwxt5)!Ta?&&}9 zgCE|@8wU?_#g31#e0d=a4NWvOH1YfkyUEVVL?cOjao0CUNKD|FXJ4SRtB1S(<337? zizqC}Lm*D4FJ6~VYKoP0<+)^}B~5FIqgYH@dWR?5#QM_%`#rv?NN6g$;87q5Dt=Gf zyq^W9rsj?R#nNg|PcH_8o}d5xF>b!;3%FdVtSl);r_=GXpZ$`?re-3M2(RrufZ1%~ zc+Cmyb{luy^=(c!G!YI**t_?2%2$`NEI)@!w{GOlJHEl)Km2a|R0w*J!ya_g%JAC< zv%;Y;et#r%;^fGF@y(OH14CoJx>UQ7p5F0=!@xg301c-b=I!hIyuKNg=k2*65{c)V z*4B0k3zyN*(8#)VYlz7TjZMw`_4%i1s6WE-WBUO(c<3nk`MG!|y%ZMYV>IfiJJrCl z{9FbGhdEwTM_z6=k#GdPPDfg*NKs)b&XoBnd}u1n@VKw8wyAqa1PJ(|hjm(sfdTiz zWH2^Dz&mta40||steVNm`KQ&Q(I}_t>*s*r_4?3HQ`n6gH}D_d{}GK%&8%Bjfuh8? z>XSRU=DN?bvg~4d`}zTRzgwq zOec)so(wWN<|7oEEr^Vb`w>-D@dQGLW;DT1?I_vw`RglRZ||94%Oxe^d>x@lPmobh zB8J3rCMG5cO$CY5LiIdN@O-uxXM&QXA;n?GY&K&uo3PuH85!tQ0pBo**$Cx{XYSN&d~BYBs;{(&?ibfX24bo{j5rcV?$2rFZmB3iAy;b##w2;U2~pG=Lz1 zsv=1ef+!G+#fZfeWla-l)q>am0q99^4 z>abYM)4V~QAuZ?k2Hz4pe11RO-MtJBk5E{UKl44UR?E~>5Tn?M$sjU1?x($T42Rt^ zlM7T8T3Y(?`9jqXJod&9X7vSn`zHTfkmFc8*fIjE=k^AQi(J#{kV;Cp1|_)^>P1x+eb1VKdRx)W>2sM4dW~XQGpT*7EuNjEsz(OSq9K#8@w)2#1cf zQ(M;qz~Jz?1byIOGt2YrN_UU@H^+{(dFO49AFJ(ncx2qyQ&yC!?EOdM!U~ZH;fdD? z`iB200C*<7jE%dei#i!Oa1xh8k03yDk_oGIw!j+*Mi?EQBovmrUOCqEiv{NcUOw11 zcB*mk?xX|*UXPz~_re8|MvUSgc@^JzN8^XRVsZpI*ojdW!erK?s*viil46gK@vU4D zpKf_^PaPMp$x==>^xb{rNS}Mr5t*Mn_Qn$}9bmo*#f(sQcNbQ}C`rZvtY(S!u2Gs=hDmW)>Fsy3EH5RV z11tvofiO?~{!OmfvOIF6rfb))eqViX$p8QxuIWCrJlB!1wk&Hyd*`U&3r5LIPriUR zOc4pRpxbi^z^$Q{r7ubxqZ?7UMSvVP1`Fe37I8T6*((v>bix2Vc(+R zaIPN+TG59_>0@&IEJ6PWp`edwBt$4Iqc<35866A;3HU|{1%?QC+nMq-U=({WXnklU z6`w!M;p%o|S)sHzgA}_3lSxP4z+@Z%qmD7RpNAja&-EWGRl55op8x9`FWuDDwfMyN zk{+0-s6hJEWmo)a^~#JJ51;532gick@-JIvRM~gB6h*}!lu=bNt|TckMuRwKvg_@u z{!Blq&IHUR9o>CyN{Z6(`9fH&25L|Bu;-OieE#YRrLk@3iC2!i{N)QxiZ96n00sw9 z_P*Kn*P>+(8XJpR<1!iu7_clE%8APDGn8Vq_7y-q-{*UStuEh@c_`N_|9 z%!HH0tVfbWo_h8O1HGeMvtwoC#F>Hn?!5o+U%$|ue@6hkwf=FqeP3!yLQ7tzZPUeT zvdvFDS1q)(k5F2iu_OcD>vFpTq&O^SG$IzWp1RY0JowAKtS`$@iVITv57l&k>7GaS zKm1Ovsd=ZHIC`S{j80;Y$)qp3d~;!*2GRyK(-j~PZ7FsC|%XG73jE5iF zk9*9^jaQc|V-tZ_4;TO1sk|iP-%{+B+@mMD#Y45-tXZAI z&dWJSP9G?v0 z4@L=vqR5JZ$*9AqldxEHWTqyNnU&-T=)lS5-hmHtfBzqpiy;_LBaChU0000 +# +# 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 . import export_sdd diff --git a/account_banking_sepa_direct_debit/wizard/export_sdd.py b/account_banking_sepa_direct_debit/wizard/export_sdd.py new file mode 100644 index 000000000..19520d318 --- /dev/null +++ b/account_banking_sepa_direct_debit/wizard/export_sdd.py @@ -0,0 +1,451 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# SEPA Direct Debit module for OpenERP +# Copyright (C) 2013 Akretion (http://www.akretion.com) +# @author: Alexis de Lattre +# +# 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 openerp.osv import orm, fields +from openerp.tools.translate import _ +from openerp import netsvc +from datetime import datetime +from lxml import etree + + +class banking_export_sdd_wizard(orm.TransientModel): + _name = 'banking.export.sdd.wizard' + _inherit = ['banking.export.pain'] + _description = 'Export SEPA Direct Debit File' + _columns = { + 'state': fields.selection([ + ('create', 'Create'), + ('finish', 'Finish'), + ], 'State', readonly=True), + 'batch_booking': fields.boolean( + 'Batch Booking', + help="If true, the bank statement will display only one credit " + "line for all the direct debits of the SEPA file ; if false, " + "the bank statement will display one credit line per direct " + "debit of the SEPA file."), + 'charge_bearer': fields.selection([ + ('SLEV', 'Following Service Level'), + ('SHAR', 'Shared'), + ('CRED', 'Borne by Creditor'), + ('DEBT', 'Borne by Debtor'), + ], 'Charge Bearer', required=True, + help="Following service level : transaction charges are to be " + "applied following the rules agreed in the service level and/or " + "scheme (SEPA Core messages must use this). Shared : transaction " + "charges on the creditor side are to be borne by the creditor, " + "transaction charges on the debtor side are to be borne by the " + "debtor. Borne by creditor : all transaction charges are to be " + "borne by the creditor. Borne by debtor : all transaction " + "charges are to be borne by the debtor."), + 'nb_transactions': fields.related( + 'file_id', 'nb_transactions', type='integer', + string='Number of Transactions', readonly=True), + 'total_amount': fields.related( + 'file_id', 'total_amount', type='float', string='Total Amount', + readonly=True), + 'file_id': fields.many2one( + 'banking.export.sdd', 'SDD File', readonly=True), + 'file': fields.related( + 'file_id', 'file', string="File", type='binary', readonly=True), + 'filename': fields.related( + 'file_id', 'filename', string="Filename", type='char', size=256, + readonly=True), + 'payment_order_ids': fields.many2many( + 'payment.order', 'wiz_sdd_payorders_rel', 'wizard_id', + 'payment_order_id', 'Payment Orders', readonly=True), + } + + _defaults = { + 'charge_bearer': 'SLEV', + 'state': 'create', + } + + def create(self, cr, uid, vals, context=None): + payment_order_ids = context.get('active_ids', []) + vals.update({ + 'payment_order_ids': [[6, 0, payment_order_ids]], + }) + return super(banking_export_sdd_wizard, self).create( + cr, uid, vals, context=context) + + def _get_previous_bank(self, cr, uid, payline, context=None): + payline_obj = self.pool['payment.line'] + previous_bank = False + payline_ids = payline_obj.search( + cr, uid, [ + ('sdd_mandate_id', '=', payline.sdd_mandate_id.id), + ('bank_id', '!=', payline.bank_id.id), + ], + context=context) + if payline_ids: + older_lines = payline_obj.browse( + cr, uid, payline_ids, context=context) + previous_date = False + previous_payline_id = False + for older_line in older_lines: + older_line_date_sent = older_line.order_id.date_sent + if (older_line_date_sent + and older_line_date_sent > previous_date): + previous_date = older_line_date_sent + previous_payline_id = older_line.id + if previous_payline_id: + previous_payline = payline_obj.browse( + cr, uid, previous_payline_id, context=context) + previous_bank = previous_payline.bank_id + return previous_bank + + def create_sepa(self, cr, uid, ids, context=None): + ''' + Creates the SEPA Direct Debit file. That's the important code ! + ''' + sepa_export = self.browse(cr, uid, ids[0], context=context) + + pain_flavor = sepa_export.payment_order_ids[0].mode.type.code + convert_to_ascii = \ + sepa_export.payment_order_ids[0].mode.convert_to_ascii + if pain_flavor == 'pain.008.001.02': + bic_xml_tag = 'BIC' + name_maxsize = 70 + root_xml_tag = 'CstmrDrctDbtInitn' + elif pain_flavor == 'pain.008.001.03': + bic_xml_tag = 'BICFI' + name_maxsize = 140 + root_xml_tag = 'CstmrDrctDbtInitn' + elif pain_flavor == 'pain.008.001.04': + bic_xml_tag = 'BICFI' + name_maxsize = 140 + root_xml_tag = 'CstmrDrctDbtInitn' + else: + raise orm.except_orm( + _('Error:'), + _("Payment Type Code '%s' is not supported. The only " + "Payment Type Code supported for SEPA Direct Debit " + "are 'pain.008.001.02', 'pain.008.001.03' and " + "'pain.008.001.04'.") % pain_flavor) + + gen_args = { + 'bic_xml_tag': bic_xml_tag, + 'name_maxsize': name_maxsize, + 'convert_to_ascii': convert_to_ascii, + 'payment_method': 'DD', + 'pain_flavor': pain_flavor, + 'sepa_export': sepa_export, + 'file_obj': self.pool['banking.export.sdd'], + 'pain_xsd_file': + 'account_banking_sepa_direct_debit/data/%s.xsd' % pain_flavor, + } + + pain_ns = { + 'xsi': 'http://www.w3.org/2001/XMLSchema-instance', + None: 'urn:iso:std:iso:20022:tech:xsd:%s' % pain_flavor, + } + + xml_root = etree.Element('Document', nsmap=pain_ns) + pain_root = etree.SubElement(xml_root, root_xml_tag) + + # A. Group header + group_header_1_0, nb_of_transactions_1_6, control_sum_1_7 = \ + self.generate_group_header_block( + cr, uid, pain_root, gen_args, context=context) + + transactions_count_1_6 = 0 + total_amount = 0.0 + amount_control_sum_1_7 = 0.0 + lines_per_group = {} + # key = (requested_date, priority, sequence type) + # value = list of lines as objects + # Iterate on payment orders + today = fields.date.context_today(self, cr, uid, context=context) + for payment_order in sepa_export.payment_order_ids: + total_amount = total_amount + payment_order.total + # Iterate each payment lines + for line in payment_order.line_ids: + transactions_count_1_6 += 1 + priority = line.priority + if payment_order.date_prefered == 'due': + requested_date = line.ml_maturity_date or today + elif payment_order.date_prefered == 'fixed': + requested_date = payment_order.date_scheduled or today + else: + requested_date = today + if not line.sdd_mandate_id: + raise orm.except_orm( + _('Error:'), + _("Missing SEPA Direct Debit mandate on the payment " + "line with partner '%s' and Invoice ref '%s'.") + % (line.partner_id.name, + line.ml_inv_ref.number)) + if line.sdd_mandate_id.state != 'valid': + raise orm.except_orm( + _('Error:'), + _("The SEPA Direct Debit mandate with reference '%s' " + "for partner '%s' has expired.") + % (line.sdd_mandate_id.unique_mandate_reference, + line.sdd_mandate_id.partner_id.name)) + if line.sdd_mandate_id.type == 'oneoff': + if not line.sdd_mandate_id.last_debit_date: + seq_type = 'OOFF' + else: + raise orm.except_orm( + _('Error:'), + _("The mandate with reference '%s' for partner " + "'%s' has type set to 'One-Off' and it has a " + "last debit date set to '%s', so we can't use " + "it.") + % (line.sdd_mandate_id.unique_mandate_reference, + line.sdd_mandate_id.partner_id.name, + line.sdd_mandate_id.last_debit_date)) + elif line.sdd_mandate_id.type == 'recurrent': + seq_type_map = { + 'recurring': 'RCUR', + 'first': 'FRST', + 'final': 'FNAL', + } + seq_type_label = \ + line.sdd_mandate_id.recurrent_sequence_type + assert seq_type_label is not False + seq_type = seq_type_map[seq_type_label] + + key = (requested_date, priority, seq_type) + if key in lines_per_group: + lines_per_group[key].append(line) + else: + lines_per_group[key] = [line] + # Write requested_exec_date on 'Payment date' of the pay line + if requested_date != line.date: + self.pool['payment.line'].write( + cr, uid, line.id, + {'date': requested_date}, context=context) + + for (requested_date, priority, sequence_type), lines in \ + lines_per_group.items(): + # B. Payment info + payment_info_2_0, nb_of_transactions_2_4, control_sum_2_5 = \ + self.generate_start_payment_info_block( + cr, uid, pain_root, + "sepa_export.payment_order_ids[0].reference + '-' + " + "sequence_type + '-' + requested_date.replace('-', '') " + "+ '-' + priority", + priority, 'CORE', sequence_type, requested_date, { + 'sepa_export': sepa_export, + 'sequence_type': sequence_type, + 'priority': priority, + 'requested_date': requested_date, + }, gen_args, context=context) + + self.generate_party_block( + cr, uid, payment_info_2_0, 'Cdtr', 'B', + 'sepa_export.payment_order_ids[0].mode.bank_id.partner_id.' + 'name', + 'sepa_export.payment_order_ids[0].mode.bank_id.acc_number', + 'sepa_export.payment_order_ids[0].mode.bank_id.bank.bic', + {'sepa_export': sepa_export}, + gen_args, context=context) + + charge_bearer_2_24 = etree.SubElement(payment_info_2_0, 'ChrgBr') + charge_bearer_2_24.text = sepa_export.charge_bearer + + creditor_scheme_identification_2_27 = etree.SubElement( + payment_info_2_0, 'CdtrSchmeId') + self.generate_creditor_scheme_identification( + cr, uid, creditor_scheme_identification_2_27, + 'sepa_export.payment_order_ids[0].company_id.' + 'sepa_creditor_identifier', + 'SEPA Creditor Identifier', {'sepa_export': sepa_export}, + 'SEPA', gen_args, context=context) + + transactions_count_2_4 = 0 + amount_control_sum_2_5 = 0.0 + for line in lines: + transactions_count_2_4 += 1 + # C. Direct Debit Transaction Info + dd_transaction_info_2_28 = etree.SubElement( + payment_info_2_0, 'DrctDbtTxInf') + payment_identification_2_29 = etree.SubElement( + dd_transaction_info_2_28, 'PmtId') + end2end_identification_2_31 = etree.SubElement( + payment_identification_2_29, 'EndToEndId') + end2end_identification_2_31.text = self._prepare_field( + cr, uid, 'End to End Identification', 'line.name', + {'line': line}, 35, + gen_args=gen_args, context=context) + currency_name = self._prepare_field( + cr, uid, 'Currency Code', 'line.currency.name', + {'line': line}, 3, gen_args=gen_args, + context=context) + instructed_amount_2_44 = etree.SubElement( + dd_transaction_info_2_28, 'InstdAmt', Ccy=currency_name) + instructed_amount_2_44.text = '%.2f' % line.amount_currency + amount_control_sum_1_7 += line.amount_currency + amount_control_sum_2_5 += line.amount_currency + dd_transaction_2_46 = etree.SubElement( + dd_transaction_info_2_28, 'DrctDbtTx') + mandate_related_info_2_47 = etree.SubElement( + dd_transaction_2_46, 'MndtRltdInf') + mandate_identification_2_48 = etree.SubElement( + mandate_related_info_2_47, 'MndtId') + mandate_identification_2_48.text = self._prepare_field( + cr, uid, 'Unique Mandate Reference', + 'line.sdd_mandate_id.unique_mandate_reference', + {'line': line}, 35, + gen_args=gen_args, context=context) + mandate_signature_date_2_49 = etree.SubElement( + mandate_related_info_2_47, 'DtOfSgntr') + mandate_signature_date_2_49.text = self._prepare_field( + cr, uid, 'Mandate Signature Date', + 'line.sdd_mandate_id.signature_date', + {'line': line}, 10, + gen_args=gen_args, context=context) + if sequence_type == 'FRST' and ( + line.sdd_mandate_id.last_debit_date or + not line.sdd_mandate_id.sepa_migrated): + previous_bank = self._get_previous_bank( + cr, uid, line, context=context) + if previous_bank or not line.sdd_mandate_id.sepa_migrated: + amendment_indicator_2_50 = etree.SubElement( + mandate_related_info_2_47, 'AmdmntInd') + amendment_indicator_2_50.text = 'true' + amendment_info_details_2_51 = etree.SubElement( + mandate_related_info_2_47, 'AmdmntInfDtls') + if previous_bank: + if previous_bank.bank.bic == line.bank_id.bank.bic: + ori_debtor_account_2_57 = etree.SubElement( + amendment_info_details_2_51, 'OrgnlDbtrAcct') + ori_debtor_account_id = etree.SubElement( + ori_debtor_account_2_57, 'Id') + ori_debtor_account_iban = etree.SubElement( + ori_debtor_account_id, 'IBAN') + ori_debtor_account_iban.text = self._validate_iban( + cr, uid, self._prepare_field( + cr, uid, 'Original Debtor Account', + 'previous_bank.acc_number', + {'previous_bank': previous_bank}, + gen_args=gen_args, + context=context), + context=context) + else: + ori_debtor_agent_2_58 = etree.SubElement( + amendment_info_details_2_51, 'OrgnlDbtrAgt') + ori_debtor_agent_institution = etree.SubElement( + ori_debtor_agent_2_58, 'FinInstnId') + ori_debtor_agent_bic = etree.SubElement( + ori_debtor_agent_institution, bic_xml_tag) + ori_debtor_agent_bic.text = self._prepare_field( + cr, uid, 'Original Debtor Agent', + 'previous_bank.bank.bic', + {'previous_bank': previous_bank}, + gen_args=gen_args, + context=context) + ori_debtor_agent_other = etree.SubElement( + ori_debtor_agent_institution, 'Othr') + ori_debtor_agent_other_id = etree.SubElement( + ori_debtor_agent_other, 'Id') + ori_debtor_agent_other_id.text = 'SMNDA' + # SMNDA = Same Mandate New Debtor Agent + elif not line.sdd_mandate_id.sepa_migrated: + ori_mandate_identification_2_52 = etree.SubElement( + amendment_info_details_2_51, 'OrgnlMndtId') + ori_mandate_identification_2_52.text = \ + self._prepare_field( + cr, uid, 'Original Mandate Identification', + 'line.sdd_mandate_id.' + 'original_mandate_identification', + {'line': line}, + gen_args=gen_args, + context=context) + ori_creditor_scheme_id_2_53 = etree.SubElement( + amendment_info_details_2_51, 'OrgnlCdtrSchmeId') + self.generate_creditor_scheme_identification( + cr, uid, ori_creditor_scheme_id_2_53, + 'sepa_export.payment_order_ids[0].company_id.' + 'original_creditor_identifier', + 'Original Creditor Identifier', + {'sepa_export': sepa_export}, + 'SEPA', gen_args, context=context) + + self.generate_party_block( + cr, uid, dd_transaction_info_2_28, 'Dbtr', 'C', + 'line.partner_id.name', + 'line.bank_id.acc_number', + 'line.bank_id.bank.bic', + {'line': line}, gen_args, context=context) + + self.generate_remittance_info_block( + cr, uid, dd_transaction_info_2_28, + line, gen_args, context=context) + + nb_of_transactions_2_4.text = str(transactions_count_2_4) + control_sum_2_5.text = '%.2f' % amount_control_sum_2_5 + nb_of_transactions_1_6.text = str(transactions_count_1_6) + control_sum_1_7.text = '%.2f' % amount_control_sum_1_7 + + return self.finalize_sepa_file_creation( + cr, uid, ids, xml_root, total_amount, transactions_count_1_6, + gen_args, context=context) + + def cancel_sepa(self, cr, uid, ids, context=None): + ''' + Cancel the SEPA file: just drop the file + ''' + sepa_export = self.browse(cr, uid, ids[0], context=context) + self.pool.get('banking.export.sdd').unlink( + cr, uid, sepa_export.file_id.id, context=context) + return {'type': 'ir.actions.act_window_close'} + + def save_sepa(self, cr, uid, ids, context=None): + ''' + Save the SEPA Direct Debit file: mark all payments in the file + as 'sent'. Write 'last debit date' on mandate and set oneoff + mandate to expired + ''' + sepa_export = self.browse(cr, uid, ids[0], context=context) + self.pool.get('banking.export.sdd').write( + cr, uid, sepa_export.file_id.id, {'state': 'sent'}, + context=context) + wf_service = netsvc.LocalService('workflow') + for order in sepa_export.payment_order_ids: + wf_service.trg_validate(uid, 'payment.order', order.id, 'done', cr) + mandate_ids = [line.sdd_mandate_id.id for line in order.line_ids] + self.pool['sdd.mandate'].write( + cr, uid, mandate_ids, + {'last_debit_date': datetime.today().strftime('%Y-%m-%d')}, + context=context) + to_expire_ids = [] + first_mandate_ids = [] + for line in order.line_ids: + if line.sdd_mandate_id.type == 'oneoff': + to_expire_ids.append(line.sdd_mandate_id.id) + elif line.sdd_mandate_id.type == 'recurrent': + seq_type = line.sdd_mandate_id.recurrent_sequence_type + if seq_type == 'final': + to_expire_ids.append(line.sdd_mandate_id.id) + elif seq_type == 'first': + first_mandate_ids.append(line.sdd_mandate_id.id) + self.pool['sdd.mandate'].write( + cr, uid, to_expire_ids, {'state': 'expired'}, context=context) + self.pool['sdd.mandate'].write( + cr, uid, first_mandate_ids, { + 'recurrent_sequence_type': 'recurring', + 'sepa_migrated': True, + }, context=context) + return {'type': 'ir.actions.act_window_close'} diff --git a/account_banking_sepa_direct_debit/wizard/export_sdd_view.xml b/account_banking_sepa_direct_debit/wizard/export_sdd_view.xml new file mode 100644 index 000000000..3699de91c --- /dev/null +++ b/account_banking_sepa_direct_debit/wizard/export_sdd_view.xml @@ -0,0 +1,37 @@ + + + + + + + banking.export.sdd.wizard.view + banking.export.sdd.wizard + +
+ + + + + + + + + + + +
+
+ +
+
+ +
+
From 8626b6d41d7be0ebd7c804110ae7d0ff9067b0f9 Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Fri, 25 Jul 2014 16:26:01 +0200 Subject: [PATCH 3/7] [IMP] adapt views to 6.1 --- account_banking_pain_base/company_view.xml | 5 +- .../view/bank_payment_manual.xml | 9 +-- .../view/payment_mode_type.xml | 5 +- .../account_banking_sdd_view.xml | 8 +- .../account_payment_view.xml | 2 +- .../company_view.xml | 1 + .../sdd_mandate_view.xml | 75 ++++--------------- .../wizard/export_sdd_view.xml | 14 ++-- 8 files changed, 38 insertions(+), 81 deletions(-) diff --git a/account_banking_pain_base/company_view.xml b/account_banking_pain_base/company_view.xml index a98d9b641..6a2dc2c85 100644 --- a/account_banking_pain_base/company_view.xml +++ b/account_banking_pain_base/company_view.xml @@ -10,13 +10,14 @@ pain.group.on.res.company.form res.company + form - + - + diff --git a/account_banking_payment_export/view/bank_payment_manual.xml b/account_banking_payment_export/view/bank_payment_manual.xml index e350c9b6f..572de1d4b 100644 --- a/account_banking_payment_export/view/bank_payment_manual.xml +++ b/account_banking_payment_export/view/bank_payment_manual.xml @@ -5,12 +5,11 @@ Form for manual payment wizard payment.manual -
+