Merge lp:~akretion-team/banking-addons/61-sepa-direct-debit into lp:banking-addons/6.1

Proposed by Alexis de Lattre
Status: Work in progress
Proposed branch: lp:~akretion-team/banking-addons/61-sepa-direct-debit
Merge into: lp:banking-addons/6.1
Diff against target: 9652 lines (+8331/-602) (has conflicts)
50 files modified
account_banking/account_banking.py (+10/-1)
account_banking/wizard/account_payment_order.py (+3/-3)
account_banking_pain_base/__init__.py (+26/-0)
account_banking_pain_base/__openerp__.py (+50/-0)
account_banking_pain_base/banking_export_pain.py (+409/-0)
account_banking_pain_base/company.py (+78/-0)
account_banking_pain_base/company_view.xml (+24/-0)
account_banking_pain_base/i18n/account_banking_pain_base.pot (+146/-0)
account_banking_pain_base/i18n/fr.po (+146/-0)
account_banking_pain_base/payment_line.py (+52/-0)
account_banking_pain_base/payment_line_view.xml (+43/-0)
account_banking_pain_base/payment_mode.py (+39/-0)
account_banking_pain_base/payment_mode_view.xml (+22/-0)
account_banking_sepa_credit_transfer/__init__.py (+2/-3)
account_banking_sepa_credit_transfer/__openerp__.py (+8/-6)
account_banking_sepa_credit_transfer/account_banking_sepa.py (+44/-34)
account_banking_sepa_credit_transfer/account_banking_sepa_view.xml (+7/-10)
account_banking_sepa_credit_transfer/data/pain.001.001.05.xsd (+931/-0)
account_banking_sepa_credit_transfer/data/payment_type_sepa_sct.xml (+13/-8)
account_banking_sepa_credit_transfer/i18n/account_banking_sepa_credit_transfer.pot (+80/-124)
account_banking_sepa_credit_transfer/i18n/fr.po (+88/-132)
account_banking_sepa_credit_transfer/i18n/nl.po (+405/-0)
account_banking_sepa_credit_transfer/wizard/__init__.py (+1/-1)
account_banking_sepa_credit_transfer/wizard/export_sepa.py (+205/-253)
account_banking_sepa_credit_transfer/wizard/export_sepa_view.xml (+9/-21)
account_banking_sepa_direct_debit/__init__.py (+25/-0)
account_banking_sepa_direct_debit/__openerp__.py (+61/-0)
account_banking_sepa_direct_debit/account_banking_sdd.py (+396/-0)
account_banking_sepa_direct_debit/account_banking_sdd_view.xml (+82/-0)
account_banking_sepa_direct_debit/account_invoice_view.xml (+22/-0)
account_banking_sepa_direct_debit/account_payment_view.xml (+26/-0)
account_banking_sepa_direct_debit/company.py (+89/-0)
account_banking_sepa_direct_debit/company_view.xml (+23/-0)
account_banking_sepa_direct_debit/data/mandate_reference_sequence.xml (+21/-0)
account_banking_sepa_direct_debit/data/pain.008.001.02.xsd (+879/-0)
account_banking_sepa_direct_debit/data/pain.008.001.03.xsd (+925/-0)
account_banking_sepa_direct_debit/data/pain.008.001.04.xsd (+892/-0)
account_banking_sepa_direct_debit/data/payment_type_sdd.xml (+37/-0)
account_banking_sepa_direct_debit/i18n/account_banking_sepa_direct_debit.pot (+633/-0)
account_banking_sepa_direct_debit/i18n/fr.po (+642/-0)
account_banking_sepa_direct_debit/mandate_expire_cron.xml (+26/-0)
account_banking_sepa_direct_debit/res_partner_bank_view.xml (+53/-0)
account_banking_sepa_direct_debit/sdd_mandate_view.xml (+92/-0)
account_banking_sepa_direct_debit/security/ir.model.access.csv (+4/-0)
account_banking_sepa_direct_debit/security/original_mandate_required_security.xml (+17/-0)
account_banking_sepa_direct_debit/wizard/__init__.py (+23/-0)
account_banking_sepa_direct_debit/wizard/export_sdd.py (+450/-0)
account_banking_sepa_direct_debit/wizard/export_sdd_view.xml (+36/-0)
account_direct_debit/model/account_payment.py (+3/-1)
account_direct_debit/view/account_payment.xml (+33/-5)
Text conflict in account_banking/account_banking.py
To merge this branch: bzr merge lp:~akretion-team/banking-addons/61-sepa-direct-debit
Reviewer Review Type Date Requested Status
Stefan Rijnhart (Opener) Needs Fixing
Guewen Baconnier @ Camptocamp Approve
Review via email: mp+200020@code.launchpad.net

Description of the change

This is the 6.1 equivalent of my merge on the 7.0 branch.

This branch contains :
- support for SEPA direct debit
- the work I carried out with Luc de Meyer (Noviat) during a code sprint on November 21st to get the additionnal features that were present in Luc's module account_pain for SEPA credit transfer (including the "Initiating Party Issuer", which is required by a few countries including Belgium and structured remittance info)
- the module account_banking_pain_base : this module allows to share as much code as possible between the module for credit transfers and the module for direct debits

P.S. : 38 days left before SEPA migration deadline !

To post a comment you must log in.
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Hi Alexis,

Is the 7.0 branch this one? https://code.launchpad.net/~akretion-team/banking-addons/70-sepa-direct-debit/+merge/195139
Is the 6.1 branch "work in progress" like the 7.0 one?

Neat piece of work! LGTM so far

Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :
review: Approve
191. By Alexis de Lattre

FIX to avoid a crash when adding payment lines via "Select invoices to collect" with date_preferred == fixed
This was caused by a wrong field name : payment.date_planned -> payment.date_scheduled

Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

It seems this still needs updating with the results from the review of the 7.0 branch https://code.launchpad.net/~akretion-team/banking-addons/70-sepa-trf-dd-updates/+merge/200019. Otherwise, looks good obviously.

There are some seemingly unrelated changes in account_banking/account_banking.py, but they all look like improvements to me. The changes to exception handling in this file are probably trying to fix the same issue that this branch addresses: https://code.launchpad.net/~therp-nl/banking-addons/6.1-no_unnecessary_raise/+merge/205647.

review: Needs Fixing
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

A month without activity, I set this as WIP

192. By Alexis de Lattre

Add storno field in payment line views.
Add menu entry for payment lines.
Remove readonly=True for storno field, because we may want to set it by hand if we don't have automatic import of bank statements.

Unmerged revisions

192. By Alexis de Lattre

Add storno field in payment line views.
Add menu entry for payment lines.
Remove readonly=True for storno field, because we may want to set it by hand if we don't have automatic import of bank statements.

191. By Alexis de Lattre

FIX to avoid a crash when adding payment lines via "Select invoices to collect" with date_preferred == fixed
This was caused by a wrong field name : payment.date_planned -> payment.date_scheduled

190. By Alexis de Lattre

Backport all SEPA-related modules from current lp:~akretion-team/banking-addons/70-sepa-trf-dd-updates (7.0) to 6.1
Avoid bloacking error message when there is no transfer journal/account on payment mode.

189. By Alexis de Lattre

Add account_banking_sepa_direct_debit, backported to OpenERP 6.1.

188. By Alexis de Lattre

[FIX] Allow offline usage
payment_order_type on payment.order is readonly when not in draft state.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_banking/account_banking.py'
2--- account_banking/account_banking.py 2014-02-10 20:13:22 +0000
3+++ account_banking/account_banking.py 2014-03-19 00:47:00 +0000
4@@ -1057,6 +1057,7 @@
5 'payment_order_type': fields.selection(
6 [('payment', 'Payment'),('debit', 'Direct debit')],
7 'Payment order type', required=True,
8+ readonly=True, states={'draft': [('readonly', False)]},
9 ),
10 'date_sent': fields.date('Send date', readonly=True),
11 }
12@@ -1510,8 +1511,13 @@
13 _('The account number appears to be invalid for '
14 '%(country)s')
15 % {'country': country.name}
16+<<<<<<< TREE
17 ))
18 if info is False:
19+=======
20+ ))
21+ except:
22+>>>>>>> MERGE-SOURCE
23 if country.code in sepa.IBAN.countries:
24 acc_number_fmt = sepa.BBAN(acc_number, country.code)
25 if acc_number_fmt.valid:
26@@ -1576,7 +1582,10 @@
27 if not bic:
28 return {}
29
30- info, address = sepa.online.bank_info(bic)
31+ try:
32+ info, address = sepa.online.bank_info(bic)
33+ except:
34+ return {}
35 if not info:
36 return {}
37
38
39=== modified file 'account_banking/wizard/account_payment_order.py'
40--- account_banking/wizard/account_payment_order.py 2013-06-04 21:10:24 +0000
41+++ account_banking/wizard/account_payment_order.py 2014-03-19 00:47:00 +0000
42@@ -76,9 +76,9 @@
43 elif payment.date_prefered == 'fixed':
44 ### account_banking
45 # date_to_pay = payment.date_planned
46- date_to_pay = payment.date_planned and \
47- str2date(payment.date_planned) > _today\
48- and payment.date_planned or False
49+ date_to_pay = payment.date_scheduled and \
50+ str2date(payment.date_scheduled) > _today\
51+ and payment.date_scheduled or False
52 ### end account banking
53
54 ### account_banking
55
56=== added directory 'account_banking_pain_base'
57=== added file 'account_banking_pain_base/__init__.py'
58--- account_banking_pain_base/__init__.py 1970-01-01 00:00:00 +0000
59+++ account_banking_pain_base/__init__.py 2014-03-19 00:47:00 +0000
60@@ -0,0 +1,26 @@
61+# -*- encoding: utf-8 -*-
62+##############################################################################
63+#
64+# PAIN Base module for OpenERP
65+# Copyright (C) 2013 Akretion (http://www.akretion.com)
66+# @author: Alexis de Lattre <alexis.delattre@akretion.com>
67+#
68+# This program is free software: you can redistribute it and/or modify
69+# it under the terms of the GNU Affero General Public License as
70+# published by the Free Software Foundation, either version 3 of the
71+# License, or (at your option) any later version.
72+#
73+# This program is distributed in the hope that it will be useful,
74+# but WITHOUT ANY WARRANTY; without even the implied warranty of
75+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
76+# GNU Affero General Public License for more details.
77+#
78+# You should have received a copy of the GNU Affero General Public License
79+# along with this program. If not, see <http://www.gnu.org/licenses/>.
80+#
81+##############################################################################
82+
83+from . import payment_line
84+from . import payment_mode
85+from . import company
86+from . import banking_export_pain
87
88=== added file 'account_banking_pain_base/__openerp__.py'
89--- account_banking_pain_base/__openerp__.py 1970-01-01 00:00:00 +0000
90+++ account_banking_pain_base/__openerp__.py 2014-03-19 00:47:00 +0000
91@@ -0,0 +1,50 @@
92+##############################################################################
93+#
94+# PAIN base module for OpenERP
95+# Copyright (C) 2013 Akretion (http://www.akretion.com)
96+# @author: Alexis de Lattre <alexis.delattre@akretion.com>
97+#
98+# This program is free software: you can redistribute it and/or modify
99+# it under the terms of the GNU Affero General Public License as
100+# published by the Free Software Foundation, either version 3 of the
101+# License, or (at your option) any later version.
102+#
103+# This program is distributed in the hope that it will be useful,
104+# but WITHOUT ANY WARRANTY; without even the implied warranty of
105+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
106+# GNU Affero General Public License for more details.
107+#
108+# You should have received a copy of the GNU Affero General Public License
109+# along with this program. If not, see <http://www.gnu.org/licenses/>.
110+#
111+##############################################################################
112+{
113+ 'name': 'Account Banking PAIN Base Module',
114+ 'summary': 'Base module for PAIN file generation',
115+ 'version': '0.1',
116+ 'license': 'AGPL-3',
117+ 'author': 'Akretion, Noviat',
118+ 'website': 'http://openerp-community-association.org/',
119+ 'category': 'Hidden',
120+ 'depends': ['account_banking'],
121+ 'external_dependencies': {
122+ 'python': ['unidecode', 'lxml'],
123+ },
124+ 'data': [
125+ 'payment_line_view.xml',
126+ 'payment_mode_view.xml',
127+ 'company_view.xml',
128+ ],
129+ 'description': '''
130+Base module for PAIN file generation
131+====================================
132+
133+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.
134+
135+This module is part of the banking addons: https://launchpad.net/banking-addons
136+
137+This module was started during the Akretion-Noviat code sprint of November 21st 2013 in Epiais les Louvres (France).
138+ ''',
139+ 'active': False,
140+ 'installable': True,
141+}
142
143=== added file 'account_banking_pain_base/banking_export_pain.py'
144--- account_banking_pain_base/banking_export_pain.py 1970-01-01 00:00:00 +0000
145+++ account_banking_pain_base/banking_export_pain.py 2014-03-19 00:47:00 +0000
146@@ -0,0 +1,409 @@
147+# -*- encoding: utf-8 -*-
148+##############################################################################
149+#
150+# PAIN Base module for OpenERP
151+# Copyright (C) 2013 Akretion (http://www.akretion.com)
152+# @author: Alexis de Lattre <alexis.delattre@akretion.com>
153+#
154+# This program is free software: you can redistribute it and/or modify
155+# it under the terms of the GNU Affero General Public License as
156+# published by the Free Software Foundation, either version 3 of the
157+# License, or (at your option) any later version.
158+#
159+# This program is distributed in the hope that it will be useful,
160+# but WITHOUT ANY WARRANTY; without even the implied warranty of
161+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
162+# GNU Affero General Public License for more details.
163+#
164+# You should have received a copy of the GNU Affero General Public License
165+# along with this program. If not, see <http://www.gnu.org/licenses/>.
166+#
167+##############################################################################
168+
169+from openerp.osv import orm
170+from openerp.tools.translate import _
171+from openerp.tools.safe_eval import safe_eval
172+from datetime import datetime
173+from unidecode import unidecode
174+from lxml import etree
175+from openerp import tools
176+import logging
177+import base64
178+
179+logger = logging.getLogger(__name__)
180+
181+
182+class banking_export_pain(orm.AbstractModel):
183+ _name = 'banking.export.pain'
184+
185+ def _validate_iban(self, cr, uid, iban, context=None):
186+ '''if IBAN is valid, returns IBAN
187+ if IBAN is NOT valid, raises an error message'''
188+ partner_bank_obj = self.pool.get('res.partner.bank')
189+ if partner_bank_obj.is_iban_valid(cr, uid, iban, context=context):
190+ return iban.replace(' ', '')
191+ else:
192+ raise orm.except_orm(
193+ _('Error:'), _("This IBAN is not valid : %s") % iban)
194+
195+ def _prepare_field(
196+ self, cr, uid, field_name, field_value, eval_ctx, max_size=0,
197+ gen_args=None, context=None):
198+ '''This function is designed to be inherited !'''
199+ if gen_args is None:
200+ gen_args = {}
201+ assert isinstance(eval_ctx, dict), 'eval_ctx must contain a dict'
202+ try:
203+ value = safe_eval(field_value, eval_ctx)
204+ # SEPA uses XML ; XML = UTF-8 ; UTF-8 = support for all characters
205+ # But we are dealing with banks...
206+ # and many banks don't want non-ASCCI characters !
207+ # cf section 1.4 "Character set" of the SEPA Credit Transfer
208+ # Scheme Customer-to-bank guidelines
209+ if gen_args.get('convert_to_ascii'):
210+ value = unidecode(value)
211+ unallowed_ascii_chars = [
212+ '"', '#', '$', '%', '&', '*', ';', '<', '>', '=', '@',
213+ '[', ']', '^', '_', '`', '{', '}', '|', '~', '\\', '!']
214+ for unallowed_ascii_char in unallowed_ascii_chars:
215+ value = value.replace(unallowed_ascii_char, '-')
216+ except:
217+ line = eval_ctx.get('line')
218+ if line:
219+ raise orm.except_orm(
220+ _('Error:'),
221+ _("Cannot compute the '%s' of the Payment Line with "
222+ "reference '%s'.")
223+ % (field_name, line.name))
224+ else:
225+ raise orm.except_orm(
226+ _('Error:'),
227+ _("Cannot compute the '%s'.") % field_name)
228+ if not isinstance(value, (str, unicode)):
229+ raise orm.except_orm(
230+ _('Field type error:'),
231+ _("The type of the field '%s' is %s. It should be a string "
232+ "or unicode.")
233+ % (field_name, type(value)))
234+ if not value:
235+ raise orm.except_orm(
236+ _('Error:'),
237+ _("The '%s' is empty or 0. It should have a non-null value.")
238+ % field_name)
239+ if max_size and len(value) > max_size:
240+ value = value[0:max_size]
241+ return value
242+
243+ def _prepare_export_sepa(
244+ self, cr, uid, total_amount, transactions_count, xml_string,
245+ gen_args, context=None):
246+ return {
247+ 'batch_booking': gen_args['sepa_export'].batch_booking,
248+ 'charge_bearer': gen_args['sepa_export'].charge_bearer,
249+ 'total_amount': total_amount,
250+ 'nb_transactions': transactions_count,
251+ 'file': base64.encodestring(xml_string),
252+ 'payment_order_ids': [(
253+ 6, 0, [x.id for x in gen_args['sepa_export'].payment_order_ids]
254+ )],
255+ }
256+
257+ def _validate_xml(self, cr, uid, xml_string, gen_args, context=None):
258+ xsd_etree_obj = etree.parse(
259+ tools.file_open(gen_args['pain_xsd_file']))
260+ official_pain_schema = etree.XMLSchema(xsd_etree_obj)
261+
262+ try:
263+ root_to_validate = etree.fromstring(xml_string)
264+ official_pain_schema.assertValid(root_to_validate)
265+ except Exception, e:
266+ logger.warning(
267+ "The XML file is invalid against the XML Schema Definition")
268+ logger.warning(xml_string)
269+ logger.warning(e)
270+ raise orm.except_orm(
271+ _('Error:'),
272+ _("The generated XML file is not valid against the official "
273+ "XML Schema Definition. The generated XML file and the "
274+ "full error have been written in the server logs. Here "
275+ "is the error, which may give you an idea on the cause "
276+ "of the problem : %s")
277+ % str(e))
278+ return True
279+
280+ def finalize_sepa_file_creation(
281+ self, cr, uid, ids, xml_root, total_amount, transactions_count,
282+ gen_args, context=None):
283+ xml_string = etree.tostring(
284+ xml_root, pretty_print=True, encoding='UTF-8',
285+ xml_declaration=True)
286+ logger.debug(
287+ "Generated SEPA XML file in format %s below"
288+ % gen_args['pain_flavor'])
289+ logger.debug(xml_string)
290+ self._validate_xml(cr, uid, xml_string, gen_args, context=context)
291+
292+ file_id = gen_args['file_obj'].create(
293+ cr, uid, self._prepare_export_sepa(
294+ cr, uid, total_amount, transactions_count,
295+ xml_string, gen_args, context=context),
296+ context=context)
297+
298+ self.write(
299+ cr, uid, ids, {
300+ 'file_id': file_id,
301+ 'state': 'finish',
302+ }, context=context)
303+
304+ action = {
305+ 'name': 'SEPA File',
306+ 'type': 'ir.actions.act_window',
307+ 'view_type': 'form',
308+ 'view_mode': 'form,tree',
309+ 'res_model': self._name,
310+ 'res_id': ids[0],
311+ 'target': 'new',
312+ }
313+ return action
314+
315+ def generate_group_header_block(
316+ self, cr, uid, parent_node, gen_args, context=None):
317+ group_header_1_0 = etree.SubElement(parent_node, 'GrpHdr')
318+ message_identification_1_1 = etree.SubElement(
319+ group_header_1_0, 'MsgId')
320+ message_identification_1_1.text = self._prepare_field(
321+ cr, uid, 'Message Identification',
322+ 'sepa_export.payment_order_ids[0].reference',
323+ {'sepa_export': gen_args['sepa_export']}, 35,
324+ gen_args=gen_args, context=context)
325+ creation_date_time_1_2 = etree.SubElement(group_header_1_0, 'CreDtTm')
326+ creation_date_time_1_2.text = datetime.strftime(
327+ datetime.today(), '%Y-%m-%dT%H:%M:%S')
328+ if gen_args.get('pain_flavor') == 'pain.001.001.02':
329+ # batch_booking is in "Group header" with pain.001.001.02
330+ # and in "Payment info" in pain.001.001.03/04
331+ batch_booking = etree.SubElement(group_header_1_0, 'BtchBookg')
332+ batch_booking.text = \
333+ str(gen_args['sepa_export'].batch_booking).lower()
334+ nb_of_transactions_1_6 = etree.SubElement(
335+ group_header_1_0, 'NbOfTxs')
336+ control_sum_1_7 = etree.SubElement(group_header_1_0, 'CtrlSum')
337+ # Grpg removed in pain.001.001.03
338+ if gen_args.get('pain_flavor') == 'pain.001.001.02':
339+ grouping = etree.SubElement(group_header_1_0, 'Grpg')
340+ grouping.text = 'GRPD'
341+ self.generate_initiating_party_block(
342+ cr, uid, group_header_1_0, gen_args,
343+ context=context)
344+ return group_header_1_0, nb_of_transactions_1_6, control_sum_1_7
345+
346+ def generate_start_payment_info_block(
347+ self, cr, uid, parent_node, payment_info_ident,
348+ priority, local_instrument, sequence_type, requested_date,
349+ eval_ctx, gen_args, context=None):
350+ payment_info_2_0 = etree.SubElement(parent_node, 'PmtInf')
351+ payment_info_identification_2_1 = etree.SubElement(
352+ payment_info_2_0, 'PmtInfId')
353+ payment_info_identification_2_1.text = self._prepare_field(
354+ cr, uid, 'Payment Information Identification',
355+ payment_info_ident, eval_ctx, 35,
356+ gen_args=gen_args, context=context)
357+ payment_method_2_2 = etree.SubElement(payment_info_2_0, 'PmtMtd')
358+ if gen_args.get('pain_flavor').startswith('pain.008.'):
359+ payment_method_2_2.text = 'DD'
360+ request_date_tag = 'ReqdColltnDt'
361+ else:
362+ payment_method_2_2.text = 'TRF'
363+ request_date_tag = 'ReqdExctnDt'
364+ if gen_args.get('pain_flavor') != 'pain.001.001.02':
365+ batch_booking_2_3 = etree.SubElement(payment_info_2_0, 'BtchBookg')
366+ batch_booking_2_3.text = \
367+ str(gen_args['sepa_export'].batch_booking).lower()
368+ # The "SEPA Customer-to-bank
369+ # Implementation guidelines" for SCT and SDD says that control sum
370+ # and nb_of_transactions should be present
371+ # at both "group header" level and "payment info" level
372+ nb_of_transactions_2_4 = etree.SubElement(
373+ payment_info_2_0, 'NbOfTxs')
374+ control_sum_2_5 = etree.SubElement(payment_info_2_0, 'CtrlSum')
375+ payment_type_info_2_6 = etree.SubElement(
376+ payment_info_2_0, 'PmtTpInf')
377+ if priority:
378+ instruction_priority_2_7 = etree.SubElement(
379+ payment_type_info_2_6, 'InstrPrty')
380+ instruction_priority_2_7.text = priority
381+ service_level_2_8 = etree.SubElement(
382+ payment_type_info_2_6, 'SvcLvl')
383+ service_level_code_2_9 = etree.SubElement(service_level_2_8, 'Cd')
384+ service_level_code_2_9.text = 'SEPA'
385+ if local_instrument:
386+ local_instrument_2_11 = etree.SubElement(
387+ payment_type_info_2_6, 'LclInstrm')
388+ local_instr_code_2_12 = etree.SubElement(
389+ local_instrument_2_11, 'Cd')
390+ local_instr_code_2_12.text = local_instrument
391+ if sequence_type:
392+ sequence_type_2_14 = etree.SubElement(
393+ payment_type_info_2_6, 'SeqTp')
394+ sequence_type_2_14.text = sequence_type
395+
396+ requested_date_2_17 = etree.SubElement(
397+ payment_info_2_0, request_date_tag)
398+ requested_date_2_17.text = requested_date
399+ return payment_info_2_0, nb_of_transactions_2_4, control_sum_2_5
400+
401+ def generate_initiating_party_block(
402+ self, cr, uid, parent_node, gen_args, context=None):
403+ my_company_name = self._prepare_field(
404+ cr, uid, 'Company Name',
405+ 'sepa_export.payment_order_ids[0].mode.bank_id.partner_id.name',
406+ {'sepa_export': gen_args['sepa_export']},
407+ gen_args.get('name_maxsize'), gen_args=gen_args, context=context)
408+ initiating_party_1_8 = etree.SubElement(parent_node, 'InitgPty')
409+ initiating_party_name = etree.SubElement(initiating_party_1_8, 'Nm')
410+ initiating_party_name.text = my_company_name
411+ initiating_party_identifier = self.pool['res.company'].\
412+ _get_initiating_party_identifier(
413+ cr, uid,
414+ gen_args['sepa_export'].payment_order_ids[0].company_id.id,
415+ context=context)
416+ initiating_party_issuer = gen_args['sepa_export'].\
417+ payment_order_ids[0].company_id.initiating_party_issuer
418+ if initiating_party_identifier and initiating_party_issuer:
419+ iniparty_id = etree.SubElement(initiating_party_1_8, 'Id')
420+ iniparty_org_id = etree.SubElement(iniparty_id, 'OrgId')
421+ iniparty_org_other = etree.SubElement(iniparty_org_id, 'Othr')
422+ iniparty_org_other_id = etree.SubElement(iniparty_org_other, 'Id')
423+ iniparty_org_other_id.text = initiating_party_identifier
424+ iniparty_org_other_issuer = etree.SubElement(
425+ iniparty_org_other, 'Issr')
426+ iniparty_org_other_issuer.text = initiating_party_issuer
427+ return True
428+
429+ def generate_party_bic(
430+ self, cr, uid, parent_node, party_type, party_type_label, bic,
431+ eval_ctx, gen_args, context=None):
432+ '''Generate the piece of the XML file corresponding to BIC
433+ This code is mutualized between TRF and DD'''
434+ party_agent = etree.SubElement(parent_node, '%sAgt' % party_type)
435+ party_agent_institution = etree.SubElement(
436+ party_agent, 'FinInstnId')
437+ party_agent_bic = etree.SubElement(
438+ party_agent_institution, gen_args.get('bic_xml_tag'))
439+ party_agent_bic.text = self._prepare_field(
440+ cr, uid, '%s BIC' % party_type_label, bic, eval_ctx,
441+ gen_args=gen_args, context=context)
442+ return True
443+
444+ def generate_party_block(
445+ self, cr, uid, parent_node, party_type, order, name, iban, bic,
446+ eval_ctx, gen_args, context=None):
447+ '''Generate the piece of the XML file corresponding to Name+IBAN+BIC
448+ This code is mutualized between TRF and DD'''
449+ assert order in ('B', 'C'), "Order can be 'B' or 'C'"
450+ if party_type == 'Cdtr':
451+ party_type_label = 'Creditor'
452+ elif party_type == 'Dbtr':
453+ party_type_label = 'Debtor'
454+ # At C level, the order is : BIC, Name, IBAN
455+ # At B level, the order is : Name, IBAN, BIC
456+ if order == 'C':
457+ self.generate_party_bic(
458+ cr, uid, parent_node, party_type, party_type_label, bic,
459+ eval_ctx, gen_args, context=context)
460+ party = etree.SubElement(parent_node, party_type)
461+ party_name = etree.SubElement(party, 'Nm')
462+ party_name.text = self._prepare_field(
463+ cr, uid, '%s Name' % party_type_label, name, eval_ctx,
464+ gen_args.get('name_maxsize'),
465+ gen_args=gen_args, context=context)
466+ party_account = etree.SubElement(
467+ parent_node, '%sAcct' % party_type)
468+ party_account_id = etree.SubElement(party_account, 'Id')
469+ party_account_iban = etree.SubElement(
470+ party_account_id, 'IBAN')
471+ piban = self._prepare_field(
472+ cr, uid, '%s IBAN' % party_type_label, iban, eval_ctx,
473+ gen_args=gen_args,
474+ context=context)
475+ viban = self._validate_iban(cr, uid, piban, context=context)
476+ party_account_iban.text = viban
477+ if order == 'B':
478+ self.generate_party_bic(
479+ cr, uid, parent_node, party_type, party_type_label, bic,
480+ eval_ctx, gen_args, context=context)
481+ return True
482+
483+ def generate_remittance_info_block(
484+ self, cr, uid, parent_node, line, gen_args, context=None):
485+
486+ remittance_info_2_91 = etree.SubElement(
487+ parent_node, 'RmtInf')
488+ if line.state == 'normal':
489+ remittance_info_unstructured_2_99 = etree.SubElement(
490+ remittance_info_2_91, 'Ustrd')
491+ remittance_info_unstructured_2_99.text = \
492+ self._prepare_field(
493+ cr, uid, 'Remittance Unstructured Information',
494+ 'line.communication', {'line': line}, 140,
495+ gen_args=gen_args,
496+ context=context)
497+ else:
498+ if not line.struct_communication_type:
499+ raise orm.except_orm(
500+ _('Error:'),
501+ _("Missing 'Structured Communication Type' on payment "
502+ "line with reference '%s'.")
503+ % (line.name))
504+ remittance_info_unstructured_2_100 = etree.SubElement(
505+ remittance_info_2_91, 'Strd')
506+ creditor_ref_information_2_120 = etree.SubElement(
507+ remittance_info_unstructured_2_100, 'CdtrRefInf')
508+ if gen_args.get('pain_flavor') == 'pain.001.001.02':
509+ creditor_ref_info_type_2_121 = etree.SubElement(
510+ creditor_ref_information_2_120, 'CdtrRefTp')
511+ creditor_ref_info_type_code_2_123 = etree.SubElement(
512+ creditor_ref_info_type_2_121, 'Cd')
513+ creditor_ref_info_type_issuer_2_125 = etree.SubElement(
514+ creditor_ref_info_type_2_121, 'Issr')
515+ creditor_reference_2_126 = etree.SubElement(
516+ creditor_ref_information_2_120, 'CdtrRef')
517+ else:
518+ creditor_ref_info_type_2_121 = etree.SubElement(
519+ creditor_ref_information_2_120, 'Tp')
520+ creditor_ref_info_type_or_2_122 = etree.SubElement(
521+ creditor_ref_info_type_2_121, 'CdOrPrtry')
522+ creditor_ref_info_type_code_2_123 = etree.SubElement(
523+ creditor_ref_info_type_or_2_122, 'Cd')
524+ creditor_ref_info_type_issuer_2_125 = etree.SubElement(
525+ creditor_ref_info_type_2_121, 'Issr')
526+ creditor_reference_2_126 = etree.SubElement(
527+ creditor_ref_information_2_120, 'Ref')
528+
529+ creditor_ref_info_type_code_2_123.text = 'SCOR'
530+ creditor_ref_info_type_issuer_2_125.text = \
531+ line.struct_communication_type
532+ creditor_reference_2_126.text = \
533+ self._prepare_field(
534+ cr, uid, 'Creditor Structured Reference',
535+ 'line.communication', {'line': line}, 35,
536+ gen_args=gen_args,
537+ context=context)
538+ return True
539+
540+ def generate_creditor_scheme_identification(
541+ self, cr, uid, parent_node, identification, identification_label,
542+ eval_ctx, scheme_name_proprietary, gen_args, context=None):
543+ csi_id = etree.SubElement(
544+ parent_node, 'Id')
545+ csi_privateid = csi_id = etree.SubElement(csi_id, 'PrvtId')
546+ csi_other = etree.SubElement(csi_privateid, 'Othr')
547+ csi_other_id = etree.SubElement(csi_other, 'Id')
548+ csi_other_id.text = self._prepare_field(
549+ cr, uid, identification_label, identification, eval_ctx,
550+ gen_args=gen_args, context=context)
551+ csi_scheme_name = etree.SubElement(csi_other, 'SchmeNm')
552+ csi_scheme_name_proprietary = etree.SubElement(
553+ csi_scheme_name, 'Prtry')
554+ csi_scheme_name_proprietary.text = scheme_name_proprietary
555+ return True
556
557=== added file 'account_banking_pain_base/company.py'
558--- account_banking_pain_base/company.py 1970-01-01 00:00:00 +0000
559+++ account_banking_pain_base/company.py 2014-03-19 00:47:00 +0000
560@@ -0,0 +1,78 @@
561+# -*- encoding: utf-8 -*-
562+##############################################################################
563+#
564+# PAIN Base module for OpenERP
565+# Copyright (C) 2013 Akretion (http://www.akretion.com)
566+# Copyright (C) 2013 Noviat (http://www.noviat.com)
567+# @author: Alexis de Lattre <alexis.delattre@akretion.com>
568+# @author: Luc de Meyer (Noviat)
569+#
570+# This program is free software: you can redistribute it and/or modify
571+# it under the terms of the GNU Affero General Public License as
572+# published by the Free Software Foundation, either version 3 of the
573+# License, or (at your option) any later version.
574+#
575+# This program is distributed in the hope that it will be useful,
576+# but WITHOUT ANY WARRANTY; without even the implied warranty of
577+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
578+# GNU Affero General Public License for more details.
579+#
580+# You should have received a copy of the GNU Affero General Public License
581+# along with this program. If not, see <http://www.gnu.org/licenses/>.
582+#
583+##############################################################################
584+
585+from openerp.osv import orm, fields
586+
587+
588+class res_company(orm.Model):
589+ _inherit = 'res.company'
590+
591+ _columns = {
592+ 'initiating_party_issuer': fields.char(
593+ 'Initiating Party Issuer', size=35,
594+ help="This will be used as the 'Initiating Party Issuer' in the "
595+ "PAIN files generated by OpenERP."),
596+ }
597+
598+ def _get_initiating_party_identifier(
599+ self, cr, uid, company_id, context=None):
600+ '''The code here may be different from one country to another.
601+ If you need to add support for an additionnal country, you can
602+ contribute your code here or inherit this function in the
603+ localization modules for your country'''
604+ assert isinstance(company_id, int), 'Only one company ID'
605+ company = self.browse(cr, uid, company_id, context=context)
606+ company_vat = company.vat
607+ party_identifier = False
608+ if company_vat and company_vat[0:2].upper() in ['BE']:
609+ party_identifier = company_vat[2:].replace(' ', '')
610+ return party_identifier
611+
612+ def _initiating_party_issuer_default(self, cr, uid, context=None):
613+ '''If you need to add support for an additionnal country, you can
614+ add an entry in the dict "party_issuer_per_country" here
615+ or inherit this function in the localization modules for
616+ your country'''
617+ initiating_party_issuer = ''
618+ # If your country require the 'Initiating Party Issuer', you should
619+ # contribute the entry for your country in the dict below
620+ party_issuer_per_country = {
621+ 'BE': 'KBO-BCE', # KBO-BCE = the registry of companies in Belgium
622+ }
623+ company_id = self._company_default_get(
624+ cr, uid, 'res.company', context=context)
625+ if company_id:
626+ company = self.browse(cr, uid, company_id, context=context)
627+ country_code = company.country_id.code
628+ initiating_party_issuer = party_issuer_per_country.get(
629+ country_code, '')
630+ return initiating_party_issuer
631+
632+ def _initiating_party_issuer_def(self, cr, uid, context=None):
633+ return self._initiating_party_issuer_default(
634+ cr, uid, context=context)
635+
636+ _defaults = {
637+ 'initiating_party_issuer': _initiating_party_issuer_def,
638+ }
639
640=== added file 'account_banking_pain_base/company_view.xml'
641--- account_banking_pain_base/company_view.xml 1970-01-01 00:00:00 +0000
642+++ account_banking_pain_base/company_view.xml 2014-03-19 00:47:00 +0000
643@@ -0,0 +1,24 @@
644+<?xml version="1.0" encoding="utf-8"?>
645+<!--
646+ Copyright (C) 2013 Akretion (http://www.akretion.com)
647+ @author: Alexis de Lattre <alexis.delattre@akretion.com>
648+ The licence is in the file __openerp__.py
649+-->
650+<openerp>
651+<data>
652+
653+<record id="view_company_form" model="ir.ui.view">
654+ <field name="name">pain.group.on.res.company.form</field>
655+ <field name="model">res.company</field>
656+ <field name="inherit_id" ref="base.view_company_form"/>
657+ <field name="arch" type="xml">
658+ <field name="currency_id" position="after">
659+ <group name="pain" string="Payment Initiation" colspan="2" col="2">
660+ <field name="initiating_party_issuer"/>
661+ </group>
662+ </field>
663+ </field>
664+</record>
665+
666+</data>
667+</openerp>
668
669=== added directory 'account_banking_pain_base/i18n'
670=== added file 'account_banking_pain_base/i18n/account_banking_pain_base.pot'
671--- account_banking_pain_base/i18n/account_banking_pain_base.pot 1970-01-01 00:00:00 +0000
672+++ account_banking_pain_base/i18n/account_banking_pain_base.pot 2014-03-19 00:47:00 +0000
673@@ -0,0 +1,146 @@
674+# Translation of OpenERP Server.
675+# This file contains the translation of the following modules:
676+# * account_banking_pain_base
677+#
678+msgid ""
679+msgstr ""
680+"Project-Id-Version: OpenERP Server 7.0\n"
681+"Report-Msgid-Bugs-To: \n"
682+"POT-Creation-Date: 2013-12-23 21:26+0000\n"
683+"PO-Revision-Date: 2013-12-23 21:26+0000\n"
684+"Last-Translator: <>\n"
685+"Language-Team: \n"
686+"MIME-Version: 1.0\n"
687+"Content-Type: text/plain; charset=UTF-8\n"
688+"Content-Transfer-Encoding: \n"
689+"Plural-Forms: \n"
690+
691+#. module: account_banking_pain_base
692+#: field:res.company,initiating_party_issuer:0
693+msgid "Initiating Party Issuer"
694+msgstr ""
695+
696+#. module: account_banking_pain_base
697+#: code:addons/account_banking_pain_base/banking_export_pain.py:122
698+#, python-format
699+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"
700+msgstr ""
701+
702+#. module: account_banking_pain_base
703+#: field:payment.line,priority:0
704+msgid "Priority"
705+msgstr ""
706+
707+#. module: account_banking_pain_base
708+#: model:ir.model,name:account_banking_pain_base.model_payment_line
709+msgid "Payment Line"
710+msgstr ""
711+
712+#. module: account_banking_pain_base
713+#: model:ir.model,name:account_banking_pain_base.model_payment_mode
714+msgid "Payment Mode"
715+msgstr ""
716+
717+#. module: account_banking_pain_base
718+#: help:res.company,initiating_party_issuer:0
719+msgid "This will be used as the 'Initiating Party Issuer' in the PAIN files generated by OpenERP."
720+msgstr ""
721+
722+#. module: account_banking_pain_base
723+#: code:addons/account_banking_pain_base/banking_export_pain.py:351
724+#, python-format
725+msgid "Missing 'Structured Communication Type' on payment line with reference '%s'."
726+msgstr ""
727+
728+#. module: account_banking_pain_base
729+#: selection:payment.line,priority:0
730+msgid "Normal"
731+msgstr ""
732+
733+#. module: account_banking_pain_base
734+#: code:addons/account_banking_pain_base/banking_export_pain.py:70
735+#, python-format
736+msgid "Cannot compute the '%s' of the Payment Line with reference '%s'."
737+msgstr ""
738+
739+#. module: account_banking_pain_base
740+#: code:addons/account_banking_pain_base/banking_export_pain.py:77
741+#, python-format
742+msgid "Cannot compute the '%s'."
743+msgstr ""
744+
745+#. module: account_banking_pain_base
746+#: code:addons/account_banking_pain_base/banking_export_pain.py:81
747+#, python-format
748+msgid "The type of the field '%s' is %s. It should be a string or unicode."
749+msgstr ""
750+
751+#. module: account_banking_pain_base
752+#: code:addons/account_banking_pain_base/banking_export_pain.py:47
753+#: code:addons/account_banking_pain_base/banking_export_pain.py:69
754+#: code:addons/account_banking_pain_base/banking_export_pain.py:76
755+#: code:addons/account_banking_pain_base/banking_export_pain.py:86
756+#: code:addons/account_banking_pain_base/banking_export_pain.py:121
757+#: code:addons/account_banking_pain_base/banking_export_pain.py:350
758+#, python-format
759+msgid "Error:"
760+msgstr ""
761+
762+#. module: account_banking_pain_base
763+#: model:ir.model,name:account_banking_pain_base.model_res_company
764+msgid "Companies"
765+msgstr ""
766+
767+#. module: account_banking_pain_base
768+#: code:addons/account_banking_pain_base/banking_export_pain.py:47
769+#, python-format
770+msgid "This IBAN is not valid : %s"
771+msgstr ""
772+
773+#. module: account_banking_pain_base
774+#: code:addons/account_banking_pain_base/banking_export_pain.py:80
775+#, python-format
776+msgid "Field type error:"
777+msgstr ""
778+
779+#. module: account_banking_pain_base
780+#: field:payment.line,struct_communication_type:0
781+msgid "Structured Communication Type"
782+msgstr ""
783+
784+#. module: account_banking_pain_base
785+#: code:addons/account_banking_pain_base/banking_export_pain.py:87
786+#, python-format
787+msgid "The '%s' is empty or 0. It should have a non-null value."
788+msgstr ""
789+
790+#. module: account_banking_pain_base
791+#: model:ir.model,name:account_banking_pain_base.model_banking_export_pain
792+msgid "banking.export.pain"
793+msgstr ""
794+
795+#. module: account_banking_pain_base
796+#: help:payment.mode,convert_to_ascii:0
797+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."
798+msgstr ""
799+
800+#. module: account_banking_pain_base
801+#: help:payment.line,priority:0
802+msgid "This field will be used as the 'Instruction Priority' in the generated PAIN file."
803+msgstr ""
804+
805+#. module: account_banking_pain_base
806+#: view:res.company:0
807+msgid "Payment Initiation"
808+msgstr ""
809+
810+#. module: account_banking_pain_base
811+#: selection:payment.line,priority:0
812+msgid "High"
813+msgstr ""
814+
815+#. module: account_banking_pain_base
816+#: field:payment.mode,convert_to_ascii:0
817+msgid "Convert to ASCII"
818+msgstr ""
819+
820
821=== added file 'account_banking_pain_base/i18n/fr.po'
822--- account_banking_pain_base/i18n/fr.po 1970-01-01 00:00:00 +0000
823+++ account_banking_pain_base/i18n/fr.po 2014-03-19 00:47:00 +0000
824@@ -0,0 +1,146 @@
825+# Translation of OpenERP Server.
826+# This file contains the translation of the following modules:
827+# * account_banking_pain_base
828+#
829+msgid ""
830+msgstr ""
831+"Project-Id-Version: OpenERP Server 7.0\n"
832+"Report-Msgid-Bugs-To: \n"
833+"POT-Creation-Date: 2013-12-23 21:27+0000\n"
834+"PO-Revision-Date: 2013-12-23 21:27+0000\n"
835+"Last-Translator: <>\n"
836+"Language-Team: \n"
837+"MIME-Version: 1.0\n"
838+"Content-Type: text/plain; charset=UTF-8\n"
839+"Content-Transfer-Encoding: \n"
840+"Plural-Forms: \n"
841+
842+#. module: account_banking_pain_base
843+#: field:res.company,initiating_party_issuer:0
844+msgid "Initiating Party Issuer"
845+msgstr "Initiating Party Issuer"
846+
847+#. module: account_banking_pain_base
848+#: code:addons/account_banking_pain_base/banking_export_pain.py:122
849+#, python-format
850+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"
851+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"
852+
853+#. module: account_banking_pain_base
854+#: field:payment.line,priority:0
855+msgid "Priority"
856+msgstr "Priorité"
857+
858+#. module: account_banking_pain_base
859+#: model:ir.model,name:account_banking_pain_base.model_payment_line
860+msgid "Payment Line"
861+msgstr "Ligne de paiement"
862+
863+#. module: account_banking_pain_base
864+#: model:ir.model,name:account_banking_pain_base.model_payment_mode
865+msgid "Payment Mode"
866+msgstr "Mode de paiement"
867+
868+#. module: account_banking_pain_base
869+#: help:res.company,initiating_party_issuer:0
870+msgid "This will be used as the 'Initiating Party Issuer' in the PAIN files generated by OpenERP."
871+msgstr "Ce champ sera le 'Initiating Party Issuer' dans les fichiers PAIN générés par OpenERP."
872+
873+#. module: account_banking_pain_base
874+#: code:addons/account_banking_pain_base/banking_export_pain.py:351
875+#, python-format
876+msgid "Missing 'Structured Communication Type' on payment line with reference '%s'."
877+msgstr "Le 'Type de communication structuré' n'est pas renseigné sur la ligne de paiement ayant la référence '%s'."
878+
879+#. module: account_banking_pain_base
880+#: selection:payment.line,priority:0
881+msgid "Normal"
882+msgstr "Normal"
883+
884+#. module: account_banking_pain_base
885+#: code:addons/account_banking_pain_base/banking_export_pain.py:70
886+#, python-format
887+msgid "Cannot compute the '%s' of the Payment Line with reference '%s'."
888+msgstr "Impossible de calculer le '%s' de la ligne de paiement ayant la référence '%s'."
889+
890+#. module: account_banking_pain_base
891+#: code:addons/account_banking_pain_base/banking_export_pain.py:77
892+#, python-format
893+msgid "Cannot compute the '%s'."
894+msgstr "Impossible de calculer le '%s'."
895+
896+#. module: account_banking_pain_base
897+#: code:addons/account_banking_pain_base/banking_export_pain.py:81
898+#, python-format
899+msgid "The type of the field '%s' is %s. It should be a string or unicode."
900+msgstr "Le type du champ '%s' est %s. Il devrait être de type string ou unicode."
901+
902+#. module: account_banking_pain_base
903+#: code:addons/account_banking_pain_base/banking_export_pain.py:47
904+#: code:addons/account_banking_pain_base/banking_export_pain.py:69
905+#: code:addons/account_banking_pain_base/banking_export_pain.py:76
906+#: code:addons/account_banking_pain_base/banking_export_pain.py:86
907+#: code:addons/account_banking_pain_base/banking_export_pain.py:121
908+#: code:addons/account_banking_pain_base/banking_export_pain.py:350
909+#, python-format
910+msgid "Error:"
911+msgstr "Erreur :"
912+
913+#. module: account_banking_pain_base
914+#: model:ir.model,name:account_banking_pain_base.model_res_company
915+msgid "Companies"
916+msgstr "Sociétés"
917+
918+#. module: account_banking_pain_base
919+#: code:addons/account_banking_pain_base/banking_export_pain.py:47
920+#, python-format
921+msgid "This IBAN is not valid : %s"
922+msgstr "Cet IBAN n'est pas valide : %s"
923+
924+#. module: account_banking_pain_base
925+#: code:addons/account_banking_pain_base/banking_export_pain.py:80
926+#, python-format
927+msgid "Field type error:"
928+msgstr "Erreur dans le type de champ :"
929+
930+#. module: account_banking_pain_base
931+#: field:payment.line,struct_communication_type:0
932+msgid "Structured Communication Type"
933+msgstr "Type de communication structurée"
934+
935+#. module: account_banking_pain_base
936+#: code:addons/account_banking_pain_base/banking_export_pain.py:87
937+#, python-format
938+msgid "The '%s' is empty or 0. It should have a non-null value."
939+msgstr "Le '%s' est vide ou égal à 0. Il devrait avoir une valeur non-nulle."
940+
941+#. module: account_banking_pain_base
942+#: model:ir.model,name:account_banking_pain_base.model_banking_export_pain
943+msgid "banking.export.pain"
944+msgstr "banking.export.pain"
945+
946+#. module: account_banking_pain_base
947+#: help:payment.mode,convert_to_ascii:0
948+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."
949+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é."
950+
951+#. module: account_banking_pain_base
952+#: help:payment.line,priority:0
953+msgid "This field will be used as the 'Instruction Priority' in the generated PAIN file."
954+msgstr "Ce champ sera le 'Instruction Priority' dans le fichier PAIN généré."
955+
956+#. module: account_banking_pain_base
957+#: view:res.company:0
958+msgid "Payment Initiation"
959+msgstr "Payment Initiation"
960+
961+#. module: account_banking_pain_base
962+#: selection:payment.line,priority:0
963+msgid "High"
964+msgstr "Élevé"
965+
966+#. module: account_banking_pain_base
967+#: field:payment.mode,convert_to_ascii:0
968+msgid "Convert to ASCII"
969+msgstr "Convertir en ASCII"
970+
971
972=== added file 'account_banking_pain_base/payment_line.py'
973--- account_banking_pain_base/payment_line.py 1970-01-01 00:00:00 +0000
974+++ account_banking_pain_base/payment_line.py 2014-03-19 00:47:00 +0000
975@@ -0,0 +1,52 @@
976+# -*- encoding: utf-8 -*-
977+##############################################################################
978+#
979+# PAIN Base module for OpenERP
980+# Copyright (C) 2013 Akretion (http://www.akretion.com)
981+# @author: Alexis de Lattre <alexis.delattre@akretion.com>
982+#
983+# This program is free software: you can redistribute it and/or modify
984+# it under the terms of the GNU Affero General Public License as
985+# published by the Free Software Foundation, either version 3 of the
986+# License, or (at your option) any later version.
987+#
988+# This program is distributed in the hope that it will be useful,
989+# but WITHOUT ANY WARRANTY; without even the implied warranty of
990+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
991+# GNU Affero General Public License for more details.
992+#
993+# You should have received a copy of the GNU Affero General Public License
994+# along with this program. If not, see <http://www.gnu.org/licenses/>.
995+#
996+##############################################################################
997+
998+from openerp.osv import orm, fields
999+
1000+
1001+class payment_line(orm.Model):
1002+ _inherit = 'payment.line'
1003+
1004+ def _get_struct_communication_types(self, cr, uid, context=None):
1005+ return [('ISO', 'ISO')]
1006+
1007+ _columns = {
1008+ 'priority': fields.selection([
1009+ ('NORM', 'Normal'),
1010+ ('HIGH', 'High'),
1011+ ], 'Priority',
1012+ help="This field will be used as the 'Instruction Priority' in "
1013+ "the generated PAIN file."),
1014+ # Update size from 64 to 140, because PAIN allows 140 caracters
1015+ 'communication': fields.char(
1016+ 'Communication', size=140, required=True,
1017+ help="Used as the message between ordering customer and current "
1018+ "company. Depicts 'What do you want to say to the recipient "
1019+ "about this order ?'"),
1020+ 'struct_communication_type': fields.selection(
1021+ _get_struct_communication_types, 'Structured Communication Type'),
1022+ }
1023+
1024+ _defaults = {
1025+ 'priority': 'NORM',
1026+ 'struct_communication_type': 'ISO',
1027+ }
1028
1029=== added file 'account_banking_pain_base/payment_line_view.xml'
1030--- account_banking_pain_base/payment_line_view.xml 1970-01-01 00:00:00 +0000
1031+++ account_banking_pain_base/payment_line_view.xml 2014-03-19 00:47:00 +0000
1032@@ -0,0 +1,43 @@
1033+<?xml version="1.0" encoding="utf-8"?>
1034+<!--
1035+ Copyright (C) 2013 Akretion (http://www.akretion.com)
1036+ @author: Alexis de Lattre <alexis.delattre@akretion.com>
1037+ The licence is in the file __openerp__.py
1038+-->
1039+<openerp>
1040+<data>
1041+
1042+<record id="view_payment_line_form" model="ir.ui.view">
1043+ <field name="name">pain.base.payment.line.form</field>
1044+ <field name="model">payment.line</field>
1045+ <field name="inherit_id" ref="account_payment.view_payment_line_form"/>
1046+ <field name="arch" type="xml">
1047+ <field name="bank_id" position="after">
1048+ <field name="priority"/>
1049+ <newline />
1050+ </field>
1051+ <field name="communication2" position="replace"/>
1052+ <field name="state" position="after">
1053+ <field name="struct_communication_type" attrs="{'invisible': [('state', '!=', 'structured')], 'required': [('state', '=', 'structured')]}"/>
1054+ </field>
1055+ </field>
1056+</record>
1057+
1058+<record id="view_payment_order_form" model="ir.ui.view">
1059+ <field name="name">pain.base.payment.line.inside.order.form</field>
1060+ <field name="model">payment.order</field>
1061+ <field name="inherit_id" ref="account_payment.view_payment_order_form"/>
1062+ <field name="arch" type="xml">
1063+ <xpath expr="//field[@name='line_ids']/form//field[@name='bank_id']" position="after">
1064+ <field name="priority"/>
1065+ <newline />
1066+ </xpath>
1067+ <xpath expr="//field[@name='line_ids']/form//field[@name='communication2']" position="replace"/>
1068+ <xpath expr="//field[@name='line_ids']/form//field[@name='state']" position="after">
1069+ <field name="struct_communication_type" attrs="{'invisible': [('state', '!=', 'structured')], 'required': [('state', '=', 'structured')]}"/>
1070+ </xpath>
1071+ </field>
1072+</record>
1073+
1074+</data>
1075+</openerp>
1076
1077=== added file 'account_banking_pain_base/payment_mode.py'
1078--- account_banking_pain_base/payment_mode.py 1970-01-01 00:00:00 +0000
1079+++ account_banking_pain_base/payment_mode.py 2014-03-19 00:47:00 +0000
1080@@ -0,0 +1,39 @@
1081+# -*- encoding: utf-8 -*-
1082+##############################################################################
1083+#
1084+# PAIN Base module for OpenERP
1085+# Copyright (C) 2013 Akretion (http://www.akretion.com)
1086+# @author: Alexis de Lattre <alexis.delattre@akretion.com>
1087+#
1088+# This program is free software: you can redistribute it and/or modify
1089+# it under the terms of the GNU Affero General Public License as
1090+# published by the Free Software Foundation, either version 3 of the
1091+# License, or (at your option) any later version.
1092+#
1093+# This program is distributed in the hope that it will be useful,
1094+# but WITHOUT ANY WARRANTY; without even the implied warranty of
1095+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1096+# GNU Affero General Public License for more details.
1097+#
1098+# You should have received a copy of the GNU Affero General Public License
1099+# along with this program. If not, see <http://www.gnu.org/licenses/>.
1100+#
1101+##############################################################################
1102+
1103+from openerp.osv import orm, fields
1104+
1105+
1106+class payment_mode(orm.Model):
1107+ _inherit = 'payment.mode'
1108+
1109+ _columns = {
1110+ 'convert_to_ascii': fields.boolean(
1111+ 'Convert to ASCII',
1112+ help="If active, OpenERP will convert each accented caracter to "
1113+ "the corresponding unaccented caracter, so that only ASCII "
1114+ "caracters are used in the generated PAIN file."),
1115+ }
1116+
1117+ _defaults = {
1118+ 'convert_to_ascii': True,
1119+ }
1120
1121=== added file 'account_banking_pain_base/payment_mode_view.xml'
1122--- account_banking_pain_base/payment_mode_view.xml 1970-01-01 00:00:00 +0000
1123+++ account_banking_pain_base/payment_mode_view.xml 2014-03-19 00:47:00 +0000
1124@@ -0,0 +1,22 @@
1125+<?xml version="1.0" encoding="utf-8"?>
1126+<!--
1127+ Copyright (C) 2013 Akretion (http://www.akretion.com)
1128+ @author: Alexis de Lattre <alexis.delattre@akretion.com>
1129+ The licence is in the file __openerp__.py
1130+-->
1131+<openerp>
1132+<data>
1133+
1134+<record id="view_payment_mode_form_inherit" model="ir.ui.view">
1135+ <field name="name">add.convert_to_ascii.in.payment.mode.form</field>
1136+ <field name="model">payment.mode</field>
1137+ <field name="inherit_id" ref="account_banking.view_payment_mode_form_inherit"/>
1138+ <field name="arch" type="xml">
1139+ <field name="type" position="after">
1140+ <field name="convert_to_ascii"/>
1141+ </field>
1142+ </field>
1143+</record>
1144+
1145+</data>
1146+</openerp>
1147
1148=== modified file 'account_banking_sepa_credit_transfer/__init__.py'
1149--- account_banking_sepa_credit_transfer/__init__.py 2013-05-15 20:09:21 +0000
1150+++ account_banking_sepa_credit_transfer/__init__.py 2014-03-19 00:47:00 +0000
1151@@ -20,6 +20,5 @@
1152 #
1153 ##############################################################################
1154
1155-import wizard
1156-import account_banking_sepa
1157-
1158+from . import wizard
1159+from . import account_banking_sepa
1160
1161=== modified file 'account_banking_sepa_credit_transfer/__openerp__.py'
1162--- account_banking_sepa_credit_transfer/__openerp__.py 2013-09-22 19:51:06 +0000
1163+++ account_banking_sepa_credit_transfer/__openerp__.py 2014-03-19 00:47:00 +0000
1164@@ -21,24 +21,25 @@
1165 {
1166 'name': 'Account Banking SEPA Credit Transfer',
1167 'summary': 'Create SEPA XML files for Credit Transfers',
1168- 'version': '0.1',
1169+ 'version': '0.2',
1170 'license': 'AGPL-3',
1171 'author': 'Akretion',
1172 'website': 'http://www.akretion.com',
1173 'category': 'Banking addons',
1174- 'depends': ['account_banking'],
1175- 'init_xml': [],
1176- 'update_xml': [
1177+ 'depends': ['account_banking_pain_base'],
1178+ 'external_dependencies': {
1179+ 'python': ['unidecode', 'lxml'],
1180+ },
1181+ 'data': [
1182 'account_banking_sepa_view.xml',
1183 'wizard/export_sepa_view.xml',
1184 'data/payment_type_sepa_sct.xml',
1185 'security/ir.model.access.csv',
1186 ],
1187- 'demo_xml': [],
1188 'description': '''
1189 Module to export payment orders in SEPA XML file format.
1190
1191-SEPA PAIN (PAyment INitiation) is the new european standard for Customer-to-Bank payment instructions. This module implements SEPA Credit Transfer (SCT), more specifically PAIN versions 001.001.02, 001.001.03 and 001.001.04. It is part of the ISO 20022 standard, available on http://www.iso20022.org.
1192+SEPA PAIN (PAyment INitiation) is the new european standard for Customer-to-Bank payment instructions. This module implements SEPA Credit Transfer (SCT), more specifically PAIN versions 001.001.02, 001.001.03, 001.001.04 and 001.001.05. It is part of the ISO 20022 standard, available on http://www.iso20022.org.
1193
1194 The Implementation Guidelines for SEPA Credit Transfer published by the European Payments Council (http://http://www.europeanpaymentscouncil.eu) use PAIN version 001.001.03, so it's probably the version of PAIN that you should try first.
1195
1196@@ -48,4 +49,5 @@
1197 ''',
1198 'active': False,
1199 'installable': True,
1200+ 'application': True,
1201 }
1202
1203=== modified file 'account_banking_sepa_credit_transfer/account_banking_sepa.py'
1204--- account_banking_sepa_credit_transfer/account_banking_sepa.py 2013-05-22 21:07:52 +0000
1205+++ account_banking_sepa_credit_transfer/account_banking_sepa.py 2014-03-19 00:47:00 +0000
1206@@ -19,22 +19,26 @@
1207 #
1208 ##############################################################################
1209
1210-from osv import osv, fields
1211-import time
1212-from tools.translate import _
1213+from openerp.osv import orm, fields
1214 import decimal_precision as dp
1215-
1216-
1217-class banking_export_sepa(osv.osv):
1218+from unidecode import unidecode
1219+
1220+
1221+class banking_export_sepa(orm.Model):
1222 '''SEPA export'''
1223 _name = 'banking.export.sepa'
1224 _description = __doc__
1225- _rec_name = 'msg_identification'
1226+ _rec_name = 'filename'
1227
1228 def _generate_filename(self, cr, uid, ids, name, arg, context=None):
1229 res = {}
1230 for sepa_file in self.browse(cr, uid, ids, context=context):
1231- res[sepa_file.id] = 'sepa_' + (sepa_file.msg_identification or '') + '.xml'
1232+ ref = sepa_file.payment_order_ids[0].reference
1233+ if ref:
1234+ label = unidecode(ref.replace('/', '-'))
1235+ else:
1236+ label = 'error'
1237+ res[sepa_file.id] = 'sct_%s.xml' % label
1238 return res
1239
1240 _columns = {
1241@@ -42,39 +46,45 @@
1242 'payment.order',
1243 'account_payment_order_sepa_rel',
1244 'banking_export_sepa_id', 'account_order_id',
1245- 'Payment orders',
1246- readonly=True),
1247- 'prefered_exec_date': fields.date('Prefered execution date', readonly=True),
1248- 'nb_transactions': fields.integer('Number of transactions', readonly=True),
1249- 'total_amount': fields.float('Total amount',
1250- digits_compute=dp.get_precision('Account'), readonly=True),
1251- 'msg_identification': fields.char('Message identification', size=35,
1252- readonly=True),
1253- 'batch_booking': fields.boolean('Batch booking', readonly=True,
1254- help="If true, the bank statement will display only one debit line for all the wire transfers of the SEPA XML file ; if false, the bank statement will display one debit line per wire transfer of the SEPA XML file."),
1255+ 'Payment Orders',
1256+ readonly=True),
1257+ 'nb_transactions': fields.integer(
1258+ 'Number of Transactions', readonly=True),
1259+ 'total_amount': fields.float(
1260+ 'Total Amount', digits_compute=dp.get_precision('Account'),
1261+ readonly=True),
1262+ 'batch_booking': fields.boolean(
1263+ 'Batch Booking', readonly=True,
1264+ help="If true, the bank statement will display only one debit "
1265+ "line for all the wire transfers of the SEPA XML file ; "
1266+ "if false, the bank statement will display one debit line "
1267+ "per wire transfer of the SEPA XML file."),
1268 'charge_bearer': fields.selection([
1269+ ('SLEV', 'Following Service Level'),
1270 ('SHAR', 'Shared'),
1271- ('CRED', 'Borne by creditor'),
1272- ('DEBT', 'Borne by debtor'),
1273- ('SLEV', 'Following service level'),
1274- ], 'Charge bearer', readonly=True,
1275- help='Shared : transaction charges on the sender side are to be borne by the debtor, transaction charges on the receiver side are to be borne by the creditor (most transfers use this). 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. Following service level : transaction charges are to be applied following the rules agreed in the service level and/or scheme.'),
1276- 'generation_date': fields.datetime('Generation date',
1277+ ('CRED', 'Borne by Creditor'),
1278+ ('DEBT', 'Borne by Debtor'),
1279+ ], 'Charge Bearer', readonly=True,
1280+ help="Following service level : transaction charges are to be "
1281+ "applied following the rules agreed in the service level and/or "
1282+ "scheme (SEPA Core messages must use this). Shared : "
1283+ "transaction charges on the creditor side are to be borne by "
1284+ "the creditor, transaction charges on the debtor side are to "
1285+ "be borne by the debtor. Borne by creditor : all transaction "
1286+ "charges are to be borne by the creditor. Borne by debtor : "
1287+ "all transaction charges are to be borne by the debtor."),
1288+ 'create_date': fields.datetime('Generation Date', readonly=True),
1289+ 'file': fields.binary('SEPA XML File', readonly=True),
1290+ 'filename': fields.function(
1291+ _generate_filename, type='char', size=256, string='Filename',
1292 readonly=True),
1293- 'file': fields.binary('SEPA XML file', readonly=True),
1294- 'filename': fields.function(_generate_filename, type='char', size=256,
1295- method=True, string='Filename', readonly=True),
1296 'state': fields.selection([
1297- ('draft', 'Draft'),
1298- ('sent', 'Sent'),
1299- ('done', 'Reconciled'),
1300+ ('draft', 'Draft'),
1301+ ('sent', 'Sent'),
1302+ ('done', 'Reconciled'),
1303 ], 'State', readonly=True),
1304 }
1305
1306 _defaults = {
1307- 'generation_date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
1308 'state': 'draft',
1309 }
1310-
1311-banking_export_sepa()
1312-
1313
1314=== modified file 'account_banking_sepa_credit_transfer/account_banking_sepa_view.xml'
1315--- account_banking_sepa_credit_transfer/account_banking_sepa_view.xml 2013-09-22 19:51:06 +0000
1316+++ account_banking_sepa_credit_transfer/account_banking_sepa_view.xml 2014-03-19 00:47:00 +0000
1317@@ -15,20 +15,18 @@
1318 <form string="SEPA Credit Transfer">
1319 <notebook>
1320 <page string="General Information">
1321- <field name="msg_identification" select="1" />
1322 <field name="total_amount" />
1323 <field name="nb_transactions" />
1324- <field name="prefered_exec_date" />
1325 <field name="batch_booking" />
1326 <field name="charge_bearer"/>
1327- <field name="generation_date" />
1328+ <field name="create_date" />
1329 <newline />
1330 <field name="file" filename="filename"/>
1331 <field name="filename" invisible="True"/>
1332 </page>
1333 <page string="Payment Orders">
1334 <field name="payment_order_ids" colspan="4" nolabel="1">
1335- <tree colors="blue:state in ('draft');gray:state in ('cancel','done');black:state in ('open')" string="Payment order">
1336+ <tree colors="blue:state in ('draft');gray:state in ('cancel','done');black:state in ('open')" string="Payment Orders">
1337 <field name="reference"/>
1338 <field name="date_created"/>
1339 <field name="date_done"/>
1340@@ -49,9 +47,8 @@
1341 <field name="type">tree</field>
1342 <field name="arch" type="xml">
1343 <tree string="SEPA Credit Transfer">
1344- <field name="msg_identification"/>
1345- <field name="prefered_exec_date"/>
1346- <field name="generation_date"/>
1347+ <field name="filename"/>
1348+ <field name="create_date"/>
1349 <field name="nb_transactions"/>
1350 </tree>
1351 </field>
1352@@ -59,7 +56,7 @@
1353
1354
1355 <record id="action_account_banking_sepa" model="ir.actions.act_window">
1356- <field name="name">Generated SEPA Credit Transfer XML files</field>
1357+ <field name="name">SEPA Credit Transfer Files</field>
1358 <field name="res_model">banking.export.sepa</field>
1359 <field name="view_type">form</field>
1360 <field name="view_mode">tree,form</field>
1361@@ -67,13 +64,13 @@
1362
1363
1364 <menuitem id="menu_account_banking_sepa"
1365- parent="account_banking.menu_finance_banking_actions"
1366+ parent="account_payment.menu_main_payment"
1367 action="action_account_banking_sepa"
1368 sequence="15"
1369 />
1370
1371 <act_window id="act_banking_export_sepa_payment_order"
1372- name="Generated SEPA Credit Transfer files"
1373+ name="SEPA Credit Transfer Files"
1374 domain="[('payment_order_ids', '=', active_id)]"
1375 res_model="banking.export.sepa"
1376 src_model="payment.order"
1377
1378=== added file 'account_banking_sepa_credit_transfer/data/pain.001.001.05.xsd'
1379--- account_banking_sepa_credit_transfer/data/pain.001.001.05.xsd 1970-01-01 00:00:00 +0000
1380+++ account_banking_sepa_credit_transfer/data/pain.001.001.05.xsd 2014-03-19 00:47:00 +0000
1381@@ -0,0 +1,931 @@
1382+<?xml version="1.0" encoding="UTF-8"?>
1383+<!--Generated by Standards Editor (build:R1.0.41.3) on 2013 Mar 05 13:39:40, ISO 20022 version : 2013-->
1384+<xs:schema xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.05" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="urn:iso:std:iso:20022:tech:xsd:pain.001.001.05">
1385+ <xs:element name="Document" type="Document"/>
1386+ <xs:complexType name="AccountIdentification4Choice">
1387+ <xs:choice>
1388+ <xs:element name="IBAN" type="IBAN2007Identifier"/>
1389+ <xs:element name="Othr" type="GenericAccountIdentification1"/>
1390+ </xs:choice>
1391+ </xs:complexType>
1392+ <xs:complexType name="AccountSchemeName1Choice">
1393+ <xs:choice>
1394+ <xs:element name="Cd" type="ExternalAccountIdentification1Code"/>
1395+ <xs:element name="Prtry" type="Max35Text"/>
1396+ </xs:choice>
1397+ </xs:complexType>
1398+ <xs:simpleType name="ActiveOrHistoricCurrencyAndAmount_SimpleType">
1399+ <xs:restriction base="xs:decimal">
1400+ <xs:fractionDigits value="5"/>
1401+ <xs:totalDigits value="18"/>
1402+ <xs:minInclusive value="0"/>
1403+ </xs:restriction>
1404+ </xs:simpleType>
1405+ <xs:complexType name="ActiveOrHistoricCurrencyAndAmount">
1406+ <xs:simpleContent>
1407+ <xs:extension base="ActiveOrHistoricCurrencyAndAmount_SimpleType">
1408+ <xs:attribute name="Ccy" type="ActiveOrHistoricCurrencyCode" use="required"/>
1409+ </xs:extension>
1410+ </xs:simpleContent>
1411+ </xs:complexType>
1412+ <xs:simpleType name="ActiveOrHistoricCurrencyCode">
1413+ <xs:restriction base="xs:string">
1414+ <xs:pattern value="[A-Z]{3,3}"/>
1415+ </xs:restriction>
1416+ </xs:simpleType>
1417+ <xs:simpleType name="AddressType2Code">
1418+ <xs:restriction base="xs:string">
1419+ <xs:enumeration value="ADDR"/>
1420+ <xs:enumeration value="PBOX"/>
1421+ <xs:enumeration value="HOME"/>
1422+ <xs:enumeration value="BIZZ"/>
1423+ <xs:enumeration value="MLTO"/>
1424+ <xs:enumeration value="DLVY"/>
1425+ </xs:restriction>
1426+ </xs:simpleType>
1427+ <xs:complexType name="AmountType3Choice">
1428+ <xs:choice>
1429+ <xs:element name="InstdAmt" type="ActiveOrHistoricCurrencyAndAmount"/>
1430+ <xs:element name="EqvtAmt" type="EquivalentAmount2"/>
1431+ </xs:choice>
1432+ </xs:complexType>
1433+ <xs:simpleType name="AnyBICIdentifier">
1434+ <xs:restriction base="xs:string">
1435+ <xs:pattern value="[A-Z]{6,6}[A-Z2-9][A-NP-Z0-9]([A-Z0-9]{3,3}){0,1}"/>
1436+ </xs:restriction>
1437+ </xs:simpleType>
1438+ <xs:complexType name="Authorisation1Choice">
1439+ <xs:choice>
1440+ <xs:element name="Cd" type="Authorisation1Code"/>
1441+ <xs:element name="Prtry" type="Max128Text"/>
1442+ </xs:choice>
1443+ </xs:complexType>
1444+ <xs:simpleType name="Authorisation1Code">
1445+ <xs:restriction base="xs:string">
1446+ <xs:enumeration value="AUTH"/>
1447+ <xs:enumeration value="FDET"/>
1448+ <xs:enumeration value="FSUM"/>
1449+ <xs:enumeration value="ILEV"/>
1450+ </xs:restriction>
1451+ </xs:simpleType>
1452+ <xs:simpleType name="BICFIIdentifier">
1453+ <xs:restriction base="xs:string">
1454+ <xs:pattern value="[A-Z]{6,6}[A-Z2-9][A-NP-Z0-9]([A-Z0-9]{3,3}){0,1}"/>
1455+ </xs:restriction>
1456+ </xs:simpleType>
1457+ <xs:simpleType name="BaseOneRate">
1458+ <xs:restriction base="xs:decimal">
1459+ <xs:fractionDigits value="10"/>
1460+ <xs:totalDigits value="11"/>
1461+ </xs:restriction>
1462+ </xs:simpleType>
1463+ <xs:simpleType name="BatchBookingIndicator">
1464+ <xs:restriction base="xs:boolean"/>
1465+ </xs:simpleType>
1466+ <xs:complexType name="BranchAndFinancialInstitutionIdentification5">
1467+ <xs:sequence>
1468+ <xs:element name="FinInstnId" type="FinancialInstitutionIdentification8"/>
1469+ <xs:element maxOccurs="1" minOccurs="0" name="BrnchId" type="BranchData2"/>
1470+ </xs:sequence>
1471+ </xs:complexType>
1472+ <xs:complexType name="BranchData2">
1473+ <xs:sequence>
1474+ <xs:element maxOccurs="1" minOccurs="0" name="Id" type="Max35Text"/>
1475+ <xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/>
1476+ <xs:element maxOccurs="1" minOccurs="0" name="PstlAdr" type="PostalAddress6"/>
1477+ </xs:sequence>
1478+ </xs:complexType>
1479+ <xs:complexType name="CashAccount24">
1480+ <xs:sequence>
1481+ <xs:element name="Id" type="AccountIdentification4Choice"/>
1482+ <xs:element maxOccurs="1" minOccurs="0" name="Tp" type="CashAccountType2Choice"/>
1483+ <xs:element maxOccurs="1" minOccurs="0" name="Ccy" type="ActiveOrHistoricCurrencyCode"/>
1484+ <xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max70Text"/>
1485+ </xs:sequence>
1486+ </xs:complexType>
1487+ <xs:complexType name="CashAccountType2Choice">
1488+ <xs:choice>
1489+ <xs:element name="Cd" type="ExternalCashAccountType1Code"/>
1490+ <xs:element name="Prtry" type="Max35Text"/>
1491+ </xs:choice>
1492+ </xs:complexType>
1493+ <xs:complexType name="CategoryPurpose1Choice">
1494+ <xs:choice>
1495+ <xs:element name="Cd" type="ExternalCategoryPurpose1Code"/>
1496+ <xs:element name="Prtry" type="Max35Text"/>
1497+ </xs:choice>
1498+ </xs:complexType>
1499+ <xs:simpleType name="ChargeBearerType1Code">
1500+ <xs:restriction base="xs:string">
1501+ <xs:enumeration value="DEBT"/>
1502+ <xs:enumeration value="CRED"/>
1503+ <xs:enumeration value="SHAR"/>
1504+ <xs:enumeration value="SLEV"/>
1505+ </xs:restriction>
1506+ </xs:simpleType>
1507+ <xs:complexType name="Cheque7">
1508+ <xs:sequence>
1509+ <xs:element maxOccurs="1" minOccurs="0" name="ChqTp" type="ChequeType2Code"/>
1510+ <xs:element maxOccurs="1" minOccurs="0" name="ChqNb" type="Max35Text"/>
1511+ <xs:element maxOccurs="1" minOccurs="0" name="ChqFr" type="NameAndAddress10"/>
1512+ <xs:element maxOccurs="1" minOccurs="0" name="DlvryMtd" type="ChequeDeliveryMethod1Choice"/>
1513+ <xs:element maxOccurs="1" minOccurs="0" name="DlvrTo" type="NameAndAddress10"/>
1514+ <xs:element maxOccurs="1" minOccurs="0" name="InstrPrty" type="Priority2Code"/>
1515+ <xs:element maxOccurs="1" minOccurs="0" name="ChqMtrtyDt" type="ISODate"/>
1516+ <xs:element maxOccurs="1" minOccurs="0" name="FrmsCd" type="Max35Text"/>
1517+ <xs:element maxOccurs="2" minOccurs="0" name="MemoFld" type="Max35Text"/>
1518+ <xs:element maxOccurs="1" minOccurs="0" name="RgnlClrZone" type="Max35Text"/>
1519+ <xs:element maxOccurs="1" minOccurs="0" name="PrtLctn" type="Max35Text"/>
1520+ <xs:element maxOccurs="5" minOccurs="0" name="Sgntr" type="Max70Text"/>
1521+ </xs:sequence>
1522+ </xs:complexType>
1523+ <xs:simpleType name="ChequeDelivery1Code">
1524+ <xs:restriction base="xs:string">
1525+ <xs:enumeration value="MLDB"/>
1526+ <xs:enumeration value="MLCD"/>
1527+ <xs:enumeration value="MLFA"/>
1528+ <xs:enumeration value="CRDB"/>
1529+ <xs:enumeration value="CRCD"/>
1530+ <xs:enumeration value="CRFA"/>
1531+ <xs:enumeration value="PUDB"/>
1532+ <xs:enumeration value="PUCD"/>
1533+ <xs:enumeration value="PUFA"/>
1534+ <xs:enumeration value="RGDB"/>
1535+ <xs:enumeration value="RGCD"/>
1536+ <xs:enumeration value="RGFA"/>
1537+ </xs:restriction>
1538+ </xs:simpleType>
1539+ <xs:complexType name="ChequeDeliveryMethod1Choice">
1540+ <xs:choice>
1541+ <xs:element name="Cd" type="ChequeDelivery1Code"/>
1542+ <xs:element name="Prtry" type="Max35Text"/>
1543+ </xs:choice>
1544+ </xs:complexType>
1545+ <xs:simpleType name="ChequeType2Code">
1546+ <xs:restriction base="xs:string">
1547+ <xs:enumeration value="CCHQ"/>
1548+ <xs:enumeration value="CCCH"/>
1549+ <xs:enumeration value="BCHQ"/>
1550+ <xs:enumeration value="DRFT"/>
1551+ <xs:enumeration value="ELDR"/>
1552+ </xs:restriction>
1553+ </xs:simpleType>
1554+ <xs:complexType name="ClearingSystemIdentification2Choice">
1555+ <xs:choice>
1556+ <xs:element name="Cd" type="ExternalClearingSystemIdentification1Code"/>
1557+ <xs:element name="Prtry" type="Max35Text"/>
1558+ </xs:choice>
1559+ </xs:complexType>
1560+ <xs:complexType name="ClearingSystemMemberIdentification2">
1561+ <xs:sequence>
1562+ <xs:element maxOccurs="1" minOccurs="0" name="ClrSysId" type="ClearingSystemIdentification2Choice"/>
1563+ <xs:element name="MmbId" type="Max35Text"/>
1564+ </xs:sequence>
1565+ </xs:complexType>
1566+ <xs:complexType name="ContactDetails2">
1567+ <xs:sequence>
1568+ <xs:element maxOccurs="1" minOccurs="0" name="NmPrfx" type="NamePrefix1Code"/>
1569+ <xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/>
1570+ <xs:element maxOccurs="1" minOccurs="0" name="PhneNb" type="PhoneNumber"/>
1571+ <xs:element maxOccurs="1" minOccurs="0" name="MobNb" type="PhoneNumber"/>
1572+ <xs:element maxOccurs="1" minOccurs="0" name="FaxNb" type="PhoneNumber"/>
1573+ <xs:element maxOccurs="1" minOccurs="0" name="EmailAdr" type="Max2048Text"/>
1574+ <xs:element maxOccurs="1" minOccurs="0" name="Othr" type="Max35Text"/>
1575+ </xs:sequence>
1576+ </xs:complexType>
1577+ <xs:simpleType name="CountryCode">
1578+ <xs:restriction base="xs:string">
1579+ <xs:pattern value="[A-Z]{2,2}"/>
1580+ </xs:restriction>
1581+ </xs:simpleType>
1582+ <xs:simpleType name="CreditDebitCode">
1583+ <xs:restriction base="xs:string">
1584+ <xs:enumeration value="CRDT"/>
1585+ <xs:enumeration value="DBIT"/>
1586+ </xs:restriction>
1587+ </xs:simpleType>
1588+ <xs:complexType name="CreditTransferTransaction6">
1589+ <xs:sequence>
1590+ <xs:element name="PmtId" type="PaymentIdentification1"/>
1591+ <xs:element maxOccurs="1" minOccurs="0" name="PmtTpInf" type="PaymentTypeInformation19"/>
1592+ <xs:element name="Amt" type="AmountType3Choice"/>
1593+ <xs:element maxOccurs="1" minOccurs="0" name="XchgRateInf" type="ExchangeRate1"/>
1594+ <xs:element maxOccurs="1" minOccurs="0" name="ChrgBr" type="ChargeBearerType1Code"/>
1595+ <xs:element maxOccurs="1" minOccurs="0" name="ChqInstr" type="Cheque7"/>
1596+ <xs:element maxOccurs="1" minOccurs="0" name="UltmtDbtr" type="PartyIdentification43"/>
1597+ <xs:element maxOccurs="1" minOccurs="0" name="IntrmyAgt1" type="BranchAndFinancialInstitutionIdentification5"/>
1598+ <xs:element maxOccurs="1" minOccurs="0" name="IntrmyAgt1Acct" type="CashAccount24"/>
1599+ <xs:element maxOccurs="1" minOccurs="0" name="IntrmyAgt2" type="BranchAndFinancialInstitutionIdentification5"/>
1600+ <xs:element maxOccurs="1" minOccurs="0" name="IntrmyAgt2Acct" type="CashAccount24"/>
1601+ <xs:element maxOccurs="1" minOccurs="0" name="IntrmyAgt3" type="BranchAndFinancialInstitutionIdentification5"/>
1602+ <xs:element maxOccurs="1" minOccurs="0" name="IntrmyAgt3Acct" type="CashAccount24"/>
1603+ <xs:element maxOccurs="1" minOccurs="0" name="CdtrAgt" type="BranchAndFinancialInstitutionIdentification5"/>
1604+ <xs:element maxOccurs="1" minOccurs="0" name="CdtrAgtAcct" type="CashAccount24"/>
1605+ <xs:element maxOccurs="1" minOccurs="0" name="Cdtr" type="PartyIdentification43"/>
1606+ <xs:element maxOccurs="1" minOccurs="0" name="CdtrAcct" type="CashAccount24"/>
1607+ <xs:element maxOccurs="1" minOccurs="0" name="UltmtCdtr" type="PartyIdentification43"/>
1608+ <xs:element maxOccurs="unbounded" minOccurs="0" name="InstrForCdtrAgt" type="InstructionForCreditorAgent1"/>
1609+ <xs:element maxOccurs="1" minOccurs="0" name="InstrForDbtrAgt" type="Max140Text"/>
1610+ <xs:element maxOccurs="1" minOccurs="0" name="Purp" type="Purpose2Choice"/>
1611+ <xs:element maxOccurs="10" minOccurs="0" name="RgltryRptg" type="RegulatoryReporting3"/>
1612+ <xs:element maxOccurs="1" minOccurs="0" name="Tax" type="TaxInformation3"/>
1613+ <xs:element maxOccurs="10" minOccurs="0" name="RltdRmtInf" type="RemittanceLocation2"/>
1614+ <xs:element maxOccurs="1" minOccurs="0" name="RmtInf" type="RemittanceInformation7"/>
1615+ <xs:element maxOccurs="unbounded" minOccurs="0" name="SplmtryData" type="SupplementaryData1"/>
1616+ </xs:sequence>
1617+ </xs:complexType>
1618+ <xs:complexType name="CreditorReferenceInformation2">
1619+ <xs:sequence>
1620+ <xs:element maxOccurs="1" minOccurs="0" name="Tp" type="CreditorReferenceType2"/>
1621+ <xs:element maxOccurs="1" minOccurs="0" name="Ref" type="Max35Text"/>
1622+ </xs:sequence>
1623+ </xs:complexType>
1624+ <xs:complexType name="CreditorReferenceType1Choice">
1625+ <xs:choice>
1626+ <xs:element name="Cd" type="DocumentType3Code"/>
1627+ <xs:element name="Prtry" type="Max35Text"/>
1628+ </xs:choice>
1629+ </xs:complexType>
1630+ <xs:complexType name="CreditorReferenceType2">
1631+ <xs:sequence>
1632+ <xs:element name="CdOrPrtry" type="CreditorReferenceType1Choice"/>
1633+ <xs:element maxOccurs="1" minOccurs="0" name="Issr" type="Max35Text"/>
1634+ </xs:sequence>
1635+ </xs:complexType>
1636+ <xs:complexType name="CustomerCreditTransferInitiationV05">
1637+ <xs:sequence>
1638+ <xs:element name="GrpHdr" type="GroupHeader48"/>
1639+ <xs:element maxOccurs="unbounded" minOccurs="1" name="PmtInf" type="PaymentInstruction9"/>
1640+ <xs:element maxOccurs="unbounded" minOccurs="0" name="SplmtryData" type="SupplementaryData1"/>
1641+ </xs:sequence>
1642+ </xs:complexType>
1643+ <xs:complexType name="DateAndPlaceOfBirth">
1644+ <xs:sequence>
1645+ <xs:element name="BirthDt" type="ISODate"/>
1646+ <xs:element maxOccurs="1" minOccurs="0" name="PrvcOfBirth" type="Max35Text"/>
1647+ <xs:element name="CityOfBirth" type="Max35Text"/>
1648+ <xs:element name="CtryOfBirth" type="CountryCode"/>
1649+ </xs:sequence>
1650+ </xs:complexType>
1651+ <xs:complexType name="DatePeriodDetails">
1652+ <xs:sequence>
1653+ <xs:element name="FrDt" type="ISODate"/>
1654+ <xs:element name="ToDt" type="ISODate"/>
1655+ </xs:sequence>
1656+ </xs:complexType>
1657+ <xs:simpleType name="DecimalNumber">
1658+ <xs:restriction base="xs:decimal">
1659+ <xs:fractionDigits value="17"/>
1660+ <xs:totalDigits value="18"/>
1661+ </xs:restriction>
1662+ </xs:simpleType>
1663+ <xs:complexType name="DiscountAmountAndType1">
1664+ <xs:sequence>
1665+ <xs:element maxOccurs="1" minOccurs="0" name="Tp" type="DiscountAmountType1Choice"/>
1666+ <xs:element name="Amt" type="ActiveOrHistoricCurrencyAndAmount"/>
1667+ </xs:sequence>
1668+ </xs:complexType>
1669+ <xs:complexType name="DiscountAmountType1Choice">
1670+ <xs:choice>
1671+ <xs:element name="Cd" type="ExternalDiscountAmountType1Code"/>
1672+ <xs:element name="Prtry" type="Max35Text"/>
1673+ </xs:choice>
1674+ </xs:complexType>
1675+ <xs:complexType name="Document">
1676+ <xs:sequence>
1677+ <xs:element name="CstmrCdtTrfInitn" type="CustomerCreditTransferInitiationV05"/>
1678+ </xs:sequence>
1679+ </xs:complexType>
1680+ <xs:complexType name="DocumentAdjustment1">
1681+ <xs:sequence>
1682+ <xs:element name="Amt" type="ActiveOrHistoricCurrencyAndAmount"/>
1683+ <xs:element maxOccurs="1" minOccurs="0" name="CdtDbtInd" type="CreditDebitCode"/>
1684+ <xs:element maxOccurs="1" minOccurs="0" name="Rsn" type="Max4Text"/>
1685+ <xs:element maxOccurs="1" minOccurs="0" name="AddtlInf" type="Max140Text"/>
1686+ </xs:sequence>
1687+ </xs:complexType>
1688+ <xs:simpleType name="DocumentType3Code">
1689+ <xs:restriction base="xs:string">
1690+ <xs:enumeration value="RADM"/>
1691+ <xs:enumeration value="RPIN"/>
1692+ <xs:enumeration value="FXDR"/>
1693+ <xs:enumeration value="DISP"/>
1694+ <xs:enumeration value="PUOR"/>
1695+ <xs:enumeration value="SCOR"/>
1696+ </xs:restriction>
1697+ </xs:simpleType>
1698+ <xs:simpleType name="DocumentType5Code">
1699+ <xs:restriction base="xs:string">
1700+ <xs:enumeration value="MSIN"/>
1701+ <xs:enumeration value="CNFA"/>
1702+ <xs:enumeration value="DNFA"/>
1703+ <xs:enumeration value="CINV"/>
1704+ <xs:enumeration value="CREN"/>
1705+ <xs:enumeration value="DEBN"/>
1706+ <xs:enumeration value="HIRI"/>
1707+ <xs:enumeration value="SBIN"/>
1708+ <xs:enumeration value="CMCN"/>
1709+ <xs:enumeration value="SOAC"/>
1710+ <xs:enumeration value="DISP"/>
1711+ <xs:enumeration value="BOLD"/>
1712+ <xs:enumeration value="VCHR"/>
1713+ <xs:enumeration value="AROI"/>
1714+ <xs:enumeration value="TSUT"/>
1715+ </xs:restriction>
1716+ </xs:simpleType>
1717+ <xs:complexType name="EquivalentAmount2">
1718+ <xs:sequence>
1719+ <xs:element name="Amt" type="ActiveOrHistoricCurrencyAndAmount"/>
1720+ <xs:element name="CcyOfTrf" type="ActiveOrHistoricCurrencyCode"/>
1721+ </xs:sequence>
1722+ </xs:complexType>
1723+ <xs:complexType name="ExchangeRate1">
1724+ <xs:sequence>
1725+ <xs:element maxOccurs="1" minOccurs="0" name="UnitCcy" type="ActiveOrHistoricCurrencyCode"/>
1726+ <xs:element maxOccurs="1" minOccurs="0" name="XchgRate" type="BaseOneRate"/>
1727+ <xs:element maxOccurs="1" minOccurs="0" name="RateTp" type="ExchangeRateType1Code"/>
1728+ <xs:element maxOccurs="1" minOccurs="0" name="CtrctId" type="Max35Text"/>
1729+ </xs:sequence>
1730+ </xs:complexType>
1731+ <xs:simpleType name="ExchangeRateType1Code">
1732+ <xs:restriction base="xs:string">
1733+ <xs:enumeration value="SPOT"/>
1734+ <xs:enumeration value="SALE"/>
1735+ <xs:enumeration value="AGRD"/>
1736+ </xs:restriction>
1737+ </xs:simpleType>
1738+ <xs:simpleType name="ExternalAccountIdentification1Code">
1739+ <xs:restriction base="xs:string">
1740+ <xs:minLength value="1"/>
1741+ <xs:maxLength value="4"/>
1742+ </xs:restriction>
1743+ </xs:simpleType>
1744+ <xs:simpleType name="ExternalCashAccountType1Code">
1745+ <xs:restriction base="xs:string">
1746+ <xs:minLength value="1"/>
1747+ <xs:maxLength value="4"/>
1748+ </xs:restriction>
1749+ </xs:simpleType>
1750+ <xs:simpleType name="ExternalCategoryPurpose1Code">
1751+ <xs:restriction base="xs:string">
1752+ <xs:minLength value="1"/>
1753+ <xs:maxLength value="4"/>
1754+ </xs:restriction>
1755+ </xs:simpleType>
1756+ <xs:simpleType name="ExternalClearingSystemIdentification1Code">
1757+ <xs:restriction base="xs:string">
1758+ <xs:minLength value="1"/>
1759+ <xs:maxLength value="5"/>
1760+ </xs:restriction>
1761+ </xs:simpleType>
1762+ <xs:simpleType name="ExternalDiscountAmountType1Code">
1763+ <xs:restriction base="xs:string">
1764+ <xs:minLength value="1"/>
1765+ <xs:maxLength value="4"/>
1766+ </xs:restriction>
1767+ </xs:simpleType>
1768+ <xs:simpleType name="ExternalFinancialInstitutionIdentification1Code">
1769+ <xs:restriction base="xs:string">
1770+ <xs:minLength value="1"/>
1771+ <xs:maxLength value="4"/>
1772+ </xs:restriction>
1773+ </xs:simpleType>
1774+ <xs:simpleType name="ExternalLocalInstrument1Code">
1775+ <xs:restriction base="xs:string">
1776+ <xs:minLength value="1"/>
1777+ <xs:maxLength value="35"/>
1778+ </xs:restriction>
1779+ </xs:simpleType>
1780+ <xs:simpleType name="ExternalOrganisationIdentification1Code">
1781+ <xs:restriction base="xs:string">
1782+ <xs:minLength value="1"/>
1783+ <xs:maxLength value="4"/>
1784+ </xs:restriction>
1785+ </xs:simpleType>
1786+ <xs:simpleType name="ExternalPersonIdentification1Code">
1787+ <xs:restriction base="xs:string">
1788+ <xs:minLength value="1"/>
1789+ <xs:maxLength value="4"/>
1790+ </xs:restriction>
1791+ </xs:simpleType>
1792+ <xs:simpleType name="ExternalPurpose1Code">
1793+ <xs:restriction base="xs:string">
1794+ <xs:minLength value="1"/>
1795+ <xs:maxLength value="4"/>
1796+ </xs:restriction>
1797+ </xs:simpleType>
1798+ <xs:simpleType name="ExternalServiceLevel1Code">
1799+ <xs:restriction base="xs:string">
1800+ <xs:minLength value="1"/>
1801+ <xs:maxLength value="4"/>
1802+ </xs:restriction>
1803+ </xs:simpleType>
1804+ <xs:simpleType name="ExternalTaxAmountType1Code">
1805+ <xs:restriction base="xs:string">
1806+ <xs:minLength value="1"/>
1807+ <xs:maxLength value="4"/>
1808+ </xs:restriction>
1809+ </xs:simpleType>
1810+ <xs:complexType name="FinancialIdentificationSchemeName1Choice">
1811+ <xs:choice>
1812+ <xs:element name="Cd" type="ExternalFinancialInstitutionIdentification1Code"/>
1813+ <xs:element name="Prtry" type="Max35Text"/>
1814+ </xs:choice>
1815+ </xs:complexType>
1816+ <xs:complexType name="FinancialInstitutionIdentification8">
1817+ <xs:sequence>
1818+ <xs:element maxOccurs="1" minOccurs="0" name="BICFI" type="BICFIIdentifier"/>
1819+ <xs:element maxOccurs="1" minOccurs="0" name="ClrSysMmbId" type="ClearingSystemMemberIdentification2"/>
1820+ <xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/>
1821+ <xs:element maxOccurs="1" minOccurs="0" name="PstlAdr" type="PostalAddress6"/>
1822+ <xs:element maxOccurs="1" minOccurs="0" name="Othr" type="GenericFinancialIdentification1"/>
1823+ </xs:sequence>
1824+ </xs:complexType>
1825+ <xs:complexType name="GenericAccountIdentification1">
1826+ <xs:sequence>
1827+ <xs:element name="Id" type="Max34Text"/>
1828+ <xs:element maxOccurs="1" minOccurs="0" name="SchmeNm" type="AccountSchemeName1Choice"/>
1829+ <xs:element maxOccurs="1" minOccurs="0" name="Issr" type="Max35Text"/>
1830+ </xs:sequence>
1831+ </xs:complexType>
1832+ <xs:complexType name="GenericFinancialIdentification1">
1833+ <xs:sequence>
1834+ <xs:element name="Id" type="Max35Text"/>
1835+ <xs:element maxOccurs="1" minOccurs="0" name="SchmeNm" type="FinancialIdentificationSchemeName1Choice"/>
1836+ <xs:element maxOccurs="1" minOccurs="0" name="Issr" type="Max35Text"/>
1837+ </xs:sequence>
1838+ </xs:complexType>
1839+ <xs:complexType name="GenericOrganisationIdentification1">
1840+ <xs:sequence>
1841+ <xs:element name="Id" type="Max35Text"/>
1842+ <xs:element maxOccurs="1" minOccurs="0" name="SchmeNm" type="OrganisationIdentificationSchemeName1Choice"/>
1843+ <xs:element maxOccurs="1" minOccurs="0" name="Issr" type="Max35Text"/>
1844+ </xs:sequence>
1845+ </xs:complexType>
1846+ <xs:complexType name="GenericPersonIdentification1">
1847+ <xs:sequence>
1848+ <xs:element name="Id" type="Max35Text"/>
1849+ <xs:element maxOccurs="1" minOccurs="0" name="SchmeNm" type="PersonIdentificationSchemeName1Choice"/>
1850+ <xs:element maxOccurs="1" minOccurs="0" name="Issr" type="Max35Text"/>
1851+ </xs:sequence>
1852+ </xs:complexType>
1853+ <xs:complexType name="GroupHeader48">
1854+ <xs:sequence>
1855+ <xs:element name="MsgId" type="Max35Text"/>
1856+ <xs:element name="CreDtTm" type="ISODateTime"/>
1857+ <xs:element maxOccurs="2" minOccurs="0" name="Authstn" type="Authorisation1Choice"/>
1858+ <xs:element name="NbOfTxs" type="Max15NumericText"/>
1859+ <xs:element maxOccurs="1" minOccurs="0" name="CtrlSum" type="DecimalNumber"/>
1860+ <xs:element name="InitgPty" type="PartyIdentification43"/>
1861+ <xs:element maxOccurs="1" minOccurs="0" name="FwdgAgt" type="BranchAndFinancialInstitutionIdentification5"/>
1862+ </xs:sequence>
1863+ </xs:complexType>
1864+ <xs:simpleType name="IBAN2007Identifier">
1865+ <xs:restriction base="xs:string">
1866+ <xs:pattern value="[A-Z]{2,2}[0-9]{2,2}[a-zA-Z0-9]{1,30}"/>
1867+ </xs:restriction>
1868+ </xs:simpleType>
1869+ <xs:simpleType name="ISODate">
1870+ <xs:restriction base="xs:date"/>
1871+ </xs:simpleType>
1872+ <xs:simpleType name="ISODateTime">
1873+ <xs:restriction base="xs:dateTime"/>
1874+ </xs:simpleType>
1875+ <xs:simpleType name="Instruction3Code">
1876+ <xs:restriction base="xs:string">
1877+ <xs:enumeration value="CHQB"/>
1878+ <xs:enumeration value="HOLD"/>
1879+ <xs:enumeration value="PHOB"/>
1880+ <xs:enumeration value="TELB"/>
1881+ </xs:restriction>
1882+ </xs:simpleType>
1883+ <xs:complexType name="InstructionForCreditorAgent1">
1884+ <xs:sequence>
1885+ <xs:element maxOccurs="1" minOccurs="0" name="Cd" type="Instruction3Code"/>
1886+ <xs:element maxOccurs="1" minOccurs="0" name="InstrInf" type="Max140Text"/>
1887+ </xs:sequence>
1888+ </xs:complexType>
1889+ <xs:complexType name="LocalInstrument2Choice">
1890+ <xs:choice>
1891+ <xs:element name="Cd" type="ExternalLocalInstrument1Code"/>
1892+ <xs:element name="Prtry" type="Max35Text"/>
1893+ </xs:choice>
1894+ </xs:complexType>
1895+ <xs:simpleType name="Max10Text">
1896+ <xs:restriction base="xs:string">
1897+ <xs:minLength value="1"/>
1898+ <xs:maxLength value="10"/>
1899+ </xs:restriction>
1900+ </xs:simpleType>
1901+ <xs:simpleType name="Max128Text">
1902+ <xs:restriction base="xs:string">
1903+ <xs:minLength value="1"/>
1904+ <xs:maxLength value="128"/>
1905+ </xs:restriction>
1906+ </xs:simpleType>
1907+ <xs:simpleType name="Max140Text">
1908+ <xs:restriction base="xs:string">
1909+ <xs:minLength value="1"/>
1910+ <xs:maxLength value="140"/>
1911+ </xs:restriction>
1912+ </xs:simpleType>
1913+ <xs:simpleType name="Max15NumericText">
1914+ <xs:restriction base="xs:string">
1915+ <xs:pattern value="[0-9]{1,15}"/>
1916+ </xs:restriction>
1917+ </xs:simpleType>
1918+ <xs:simpleType name="Max16Text">
1919+ <xs:restriction base="xs:string">
1920+ <xs:minLength value="1"/>
1921+ <xs:maxLength value="16"/>
1922+ </xs:restriction>
1923+ </xs:simpleType>
1924+ <xs:simpleType name="Max2048Text">
1925+ <xs:restriction base="xs:string">
1926+ <xs:minLength value="1"/>
1927+ <xs:maxLength value="2048"/>
1928+ </xs:restriction>
1929+ </xs:simpleType>
1930+ <xs:simpleType name="Max34Text">
1931+ <xs:restriction base="xs:string">
1932+ <xs:minLength value="1"/>
1933+ <xs:maxLength value="34"/>
1934+ </xs:restriction>
1935+ </xs:simpleType>
1936+ <xs:simpleType name="Max350Text">
1937+ <xs:restriction base="xs:string">
1938+ <xs:minLength value="1"/>
1939+ <xs:maxLength value="350"/>
1940+ </xs:restriction>
1941+ </xs:simpleType>
1942+ <xs:simpleType name="Max35Text">
1943+ <xs:restriction base="xs:string">
1944+ <xs:minLength value="1"/>
1945+ <xs:maxLength value="35"/>
1946+ </xs:restriction>
1947+ </xs:simpleType>
1948+ <xs:simpleType name="Max4Text">
1949+ <xs:restriction base="xs:string">
1950+ <xs:minLength value="1"/>
1951+ <xs:maxLength value="4"/>
1952+ </xs:restriction>
1953+ </xs:simpleType>
1954+ <xs:simpleType name="Max70Text">
1955+ <xs:restriction base="xs:string">
1956+ <xs:minLength value="1"/>
1957+ <xs:maxLength value="70"/>
1958+ </xs:restriction>
1959+ </xs:simpleType>
1960+ <xs:complexType name="NameAndAddress10">
1961+ <xs:sequence>
1962+ <xs:element name="Nm" type="Max140Text"/>
1963+ <xs:element name="Adr" type="PostalAddress6"/>
1964+ </xs:sequence>
1965+ </xs:complexType>
1966+ <xs:simpleType name="NamePrefix1Code">
1967+ <xs:restriction base="xs:string">
1968+ <xs:enumeration value="DOCT"/>
1969+ <xs:enumeration value="MIST"/>
1970+ <xs:enumeration value="MISS"/>
1971+ <xs:enumeration value="MADM"/>
1972+ </xs:restriction>
1973+ </xs:simpleType>
1974+ <xs:simpleType name="Number">
1975+ <xs:restriction base="xs:decimal">
1976+ <xs:fractionDigits value="0"/>
1977+ <xs:totalDigits value="18"/>
1978+ </xs:restriction>
1979+ </xs:simpleType>
1980+ <xs:complexType name="OrganisationIdentification8">
1981+ <xs:sequence>
1982+ <xs:element maxOccurs="1" minOccurs="0" name="AnyBIC" type="AnyBICIdentifier"/>
1983+ <xs:element maxOccurs="unbounded" minOccurs="0" name="Othr" type="GenericOrganisationIdentification1"/>
1984+ </xs:sequence>
1985+ </xs:complexType>
1986+ <xs:complexType name="OrganisationIdentificationSchemeName1Choice">
1987+ <xs:choice>
1988+ <xs:element name="Cd" type="ExternalOrganisationIdentification1Code"/>
1989+ <xs:element name="Prtry" type="Max35Text"/>
1990+ </xs:choice>
1991+ </xs:complexType>
1992+ <xs:complexType name="Party11Choice">
1993+ <xs:choice>
1994+ <xs:element name="OrgId" type="OrganisationIdentification8"/>
1995+ <xs:element name="PrvtId" type="PersonIdentification5"/>
1996+ </xs:choice>
1997+ </xs:complexType>
1998+ <xs:complexType name="PartyIdentification43">
1999+ <xs:sequence>
2000+ <xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/>
2001+ <xs:element maxOccurs="1" minOccurs="0" name="PstlAdr" type="PostalAddress6"/>
2002+ <xs:element maxOccurs="1" minOccurs="0" name="Id" type="Party11Choice"/>
2003+ <xs:element maxOccurs="1" minOccurs="0" name="CtryOfRes" type="CountryCode"/>
2004+ <xs:element maxOccurs="1" minOccurs="0" name="CtctDtls" type="ContactDetails2"/>
2005+ </xs:sequence>
2006+ </xs:complexType>
2007+ <xs:complexType name="PaymentIdentification1">
2008+ <xs:sequence>
2009+ <xs:element maxOccurs="1" minOccurs="0" name="InstrId" type="Max35Text"/>
2010+ <xs:element name="EndToEndId" type="Max35Text"/>
2011+ </xs:sequence>
2012+ </xs:complexType>
2013+ <xs:complexType name="PaymentInstruction9">
2014+ <xs:sequence>
2015+ <xs:element name="PmtInfId" type="Max35Text"/>
2016+ <xs:element name="PmtMtd" type="PaymentMethod3Code"/>
2017+ <xs:element maxOccurs="1" minOccurs="0" name="BtchBookg" type="BatchBookingIndicator"/>
2018+ <xs:element maxOccurs="1" minOccurs="0" name="NbOfTxs" type="Max15NumericText"/>
2019+ <xs:element maxOccurs="1" minOccurs="0" name="CtrlSum" type="DecimalNumber"/>
2020+ <xs:element maxOccurs="1" minOccurs="0" name="PmtTpInf" type="PaymentTypeInformation19"/>
2021+ <xs:element name="ReqdExctnDt" type="ISODate"/>
2022+ <xs:element maxOccurs="1" minOccurs="0" name="PoolgAdjstmntDt" type="ISODate"/>
2023+ <xs:element name="Dbtr" type="PartyIdentification43"/>
2024+ <xs:element name="DbtrAcct" type="CashAccount24"/>
2025+ <xs:element name="DbtrAgt" type="BranchAndFinancialInstitutionIdentification5"/>
2026+ <xs:element maxOccurs="1" minOccurs="0" name="DbtrAgtAcct" type="CashAccount24"/>
2027+ <xs:element maxOccurs="1" minOccurs="0" name="InstrForDbtrAgt" type="Max140Text"/>
2028+ <xs:element maxOccurs="1" minOccurs="0" name="UltmtDbtr" type="PartyIdentification43"/>
2029+ <xs:element maxOccurs="1" minOccurs="0" name="ChrgBr" type="ChargeBearerType1Code"/>
2030+ <xs:element maxOccurs="1" minOccurs="0" name="ChrgsAcct" type="CashAccount24"/>
2031+ <xs:element maxOccurs="1" minOccurs="0" name="ChrgsAcctAgt" type="BranchAndFinancialInstitutionIdentification5"/>
2032+ <xs:element maxOccurs="unbounded" minOccurs="1" name="CdtTrfTxInf" type="CreditTransferTransaction6"/>
2033+ </xs:sequence>
2034+ </xs:complexType>
2035+ <xs:simpleType name="PaymentMethod3Code">
2036+ <xs:restriction base="xs:string">
2037+ <xs:enumeration value="CHK"/>
2038+ <xs:enumeration value="TRF"/>
2039+ <xs:enumeration value="TRA"/>
2040+ </xs:restriction>
2041+ </xs:simpleType>
2042+ <xs:complexType name="PaymentTypeInformation19">
2043+ <xs:sequence>
2044+ <xs:element maxOccurs="1" minOccurs="0" name="InstrPrty" type="Priority2Code"/>
2045+ <xs:element maxOccurs="1" minOccurs="0" name="SvcLvl" type="ServiceLevel8Choice"/>
2046+ <xs:element maxOccurs="1" minOccurs="0" name="LclInstrm" type="LocalInstrument2Choice"/>
2047+ <xs:element maxOccurs="1" minOccurs="0" name="CtgyPurp" type="CategoryPurpose1Choice"/>
2048+ </xs:sequence>
2049+ </xs:complexType>
2050+ <xs:simpleType name="PercentageRate">
2051+ <xs:restriction base="xs:decimal">
2052+ <xs:fractionDigits value="10"/>
2053+ <xs:totalDigits value="11"/>
2054+ </xs:restriction>
2055+ </xs:simpleType>
2056+ <xs:complexType name="PersonIdentification5">
2057+ <xs:sequence>
2058+ <xs:element maxOccurs="1" minOccurs="0" name="DtAndPlcOfBirth" type="DateAndPlaceOfBirth"/>
2059+ <xs:element maxOccurs="unbounded" minOccurs="0" name="Othr" type="GenericPersonIdentification1"/>
2060+ </xs:sequence>
2061+ </xs:complexType>
2062+ <xs:complexType name="PersonIdentificationSchemeName1Choice">
2063+ <xs:choice>
2064+ <xs:element name="Cd" type="ExternalPersonIdentification1Code"/>
2065+ <xs:element name="Prtry" type="Max35Text"/>
2066+ </xs:choice>
2067+ </xs:complexType>
2068+ <xs:simpleType name="PhoneNumber">
2069+ <xs:restriction base="xs:string">
2070+ <xs:pattern value="\+[0-9]{1,3}-[0-9()+\-]{1,30}"/>
2071+ </xs:restriction>
2072+ </xs:simpleType>
2073+ <xs:complexType name="PostalAddress6">
2074+ <xs:sequence>
2075+ <xs:element maxOccurs="1" minOccurs="0" name="AdrTp" type="AddressType2Code"/>
2076+ <xs:element maxOccurs="1" minOccurs="0" name="Dept" type="Max70Text"/>
2077+ <xs:element maxOccurs="1" minOccurs="0" name="SubDept" type="Max70Text"/>
2078+ <xs:element maxOccurs="1" minOccurs="0" name="StrtNm" type="Max70Text"/>
2079+ <xs:element maxOccurs="1" minOccurs="0" name="BldgNb" type="Max16Text"/>
2080+ <xs:element maxOccurs="1" minOccurs="0" name="PstCd" type="Max16Text"/>
2081+ <xs:element maxOccurs="1" minOccurs="0" name="TwnNm" type="Max35Text"/>
2082+ <xs:element maxOccurs="1" minOccurs="0" name="CtrySubDvsn" type="Max35Text"/>
2083+ <xs:element maxOccurs="1" minOccurs="0" name="Ctry" type="CountryCode"/>
2084+ <xs:element maxOccurs="7" minOccurs="0" name="AdrLine" type="Max70Text"/>
2085+ </xs:sequence>
2086+ </xs:complexType>
2087+ <xs:simpleType name="Priority2Code">
2088+ <xs:restriction base="xs:string">
2089+ <xs:enumeration value="HIGH"/>
2090+ <xs:enumeration value="NORM"/>
2091+ </xs:restriction>
2092+ </xs:simpleType>
2093+ <xs:complexType name="Purpose2Choice">
2094+ <xs:choice>
2095+ <xs:element name="Cd" type="ExternalPurpose1Code"/>
2096+ <xs:element name="Prtry" type="Max35Text"/>
2097+ </xs:choice>
2098+ </xs:complexType>
2099+ <xs:complexType name="ReferredDocumentInformation3">
2100+ <xs:sequence>
2101+ <xs:element maxOccurs="1" minOccurs="0" name="Tp" type="ReferredDocumentType2"/>
2102+ <xs:element maxOccurs="1" minOccurs="0" name="Nb" type="Max35Text"/>
2103+ <xs:element maxOccurs="1" minOccurs="0" name="RltdDt" type="ISODate"/>
2104+ </xs:sequence>
2105+ </xs:complexType>
2106+ <xs:complexType name="ReferredDocumentType1Choice">
2107+ <xs:choice>
2108+ <xs:element name="Cd" type="DocumentType5Code"/>
2109+ <xs:element name="Prtry" type="Max35Text"/>
2110+ </xs:choice>
2111+ </xs:complexType>
2112+ <xs:complexType name="ReferredDocumentType2">
2113+ <xs:sequence>
2114+ <xs:element name="CdOrPrtry" type="ReferredDocumentType1Choice"/>
2115+ <xs:element maxOccurs="1" minOccurs="0" name="Issr" type="Max35Text"/>
2116+ </xs:sequence>
2117+ </xs:complexType>
2118+ <xs:complexType name="RegulatoryAuthority2">
2119+ <xs:sequence>
2120+ <xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/>
2121+ <xs:element maxOccurs="1" minOccurs="0" name="Ctry" type="CountryCode"/>
2122+ </xs:sequence>
2123+ </xs:complexType>
2124+ <xs:complexType name="RegulatoryReporting3">
2125+ <xs:sequence>
2126+ <xs:element maxOccurs="1" minOccurs="0" name="DbtCdtRptgInd" type="RegulatoryReportingType1Code"/>
2127+ <xs:element maxOccurs="1" minOccurs="0" name="Authrty" type="RegulatoryAuthority2"/>
2128+ <xs:element maxOccurs="unbounded" minOccurs="0" name="Dtls" type="StructuredRegulatoryReporting3"/>
2129+ </xs:sequence>
2130+ </xs:complexType>
2131+ <xs:simpleType name="RegulatoryReportingType1Code">
2132+ <xs:restriction base="xs:string">
2133+ <xs:enumeration value="CRED"/>
2134+ <xs:enumeration value="DEBT"/>
2135+ <xs:enumeration value="BOTH"/>
2136+ </xs:restriction>
2137+ </xs:simpleType>
2138+ <xs:complexType name="RemittanceAmount2">
2139+ <xs:sequence>
2140+ <xs:element maxOccurs="1" minOccurs="0" name="DuePyblAmt" type="ActiveOrHistoricCurrencyAndAmount"/>
2141+ <xs:element maxOccurs="unbounded" minOccurs="0" name="DscntApldAmt" type="DiscountAmountAndType1"/>
2142+ <xs:element maxOccurs="1" minOccurs="0" name="CdtNoteAmt" type="ActiveOrHistoricCurrencyAndAmount"/>
2143+ <xs:element maxOccurs="unbounded" minOccurs="0" name="TaxAmt" type="TaxAmountAndType1"/>
2144+ <xs:element maxOccurs="unbounded" minOccurs="0" name="AdjstmntAmtAndRsn" type="DocumentAdjustment1"/>
2145+ <xs:element maxOccurs="1" minOccurs="0" name="RmtdAmt" type="ActiveOrHistoricCurrencyAndAmount"/>
2146+ </xs:sequence>
2147+ </xs:complexType>
2148+ <xs:complexType name="RemittanceInformation7">
2149+ <xs:sequence>
2150+ <xs:element maxOccurs="unbounded" minOccurs="0" name="Ustrd" type="Max140Text"/>
2151+ <xs:element maxOccurs="unbounded" minOccurs="0" name="Strd" type="StructuredRemittanceInformation9"/>
2152+ </xs:sequence>
2153+ </xs:complexType>
2154+ <xs:complexType name="RemittanceLocation2">
2155+ <xs:sequence>
2156+ <xs:element maxOccurs="1" minOccurs="0" name="RmtId" type="Max35Text"/>
2157+ <xs:element maxOccurs="1" minOccurs="0" name="RmtLctnMtd" type="RemittanceLocationMethod2Code"/>
2158+ <xs:element maxOccurs="1" minOccurs="0" name="RmtLctnElctrncAdr" type="Max2048Text"/>
2159+ <xs:element maxOccurs="1" minOccurs="0" name="RmtLctnPstlAdr" type="NameAndAddress10"/>
2160+ </xs:sequence>
2161+ </xs:complexType>
2162+ <xs:simpleType name="RemittanceLocationMethod2Code">
2163+ <xs:restriction base="xs:string">
2164+ <xs:enumeration value="FAXI"/>
2165+ <xs:enumeration value="EDIC"/>
2166+ <xs:enumeration value="URID"/>
2167+ <xs:enumeration value="EMAL"/>
2168+ <xs:enumeration value="POST"/>
2169+ <xs:enumeration value="SMSM"/>
2170+ </xs:restriction>
2171+ </xs:simpleType>
2172+ <xs:complexType name="ServiceLevel8Choice">
2173+ <xs:choice>
2174+ <xs:element name="Cd" type="ExternalServiceLevel1Code"/>
2175+ <xs:element name="Prtry" type="Max35Text"/>
2176+ </xs:choice>
2177+ </xs:complexType>
2178+ <xs:complexType name="StructuredRegulatoryReporting3">
2179+ <xs:sequence>
2180+ <xs:element maxOccurs="1" minOccurs="0" name="Tp" type="Max35Text"/>
2181+ <xs:element maxOccurs="1" minOccurs="0" name="Dt" type="ISODate"/>
2182+ <xs:element maxOccurs="1" minOccurs="0" name="Ctry" type="CountryCode"/>
2183+ <xs:element maxOccurs="1" minOccurs="0" name="Cd" type="Max10Text"/>
2184+ <xs:element maxOccurs="1" minOccurs="0" name="Amt" type="ActiveOrHistoricCurrencyAndAmount"/>
2185+ <xs:element maxOccurs="unbounded" minOccurs="0" name="Inf" type="Max35Text"/>
2186+ </xs:sequence>
2187+ </xs:complexType>
2188+ <xs:complexType name="StructuredRemittanceInformation9">
2189+ <xs:sequence>
2190+ <xs:element maxOccurs="unbounded" minOccurs="0" name="RfrdDocInf" type="ReferredDocumentInformation3"/>
2191+ <xs:element maxOccurs="1" minOccurs="0" name="RfrdDocAmt" type="RemittanceAmount2"/>
2192+ <xs:element maxOccurs="1" minOccurs="0" name="CdtrRefInf" type="CreditorReferenceInformation2"/>
2193+ <xs:element maxOccurs="1" minOccurs="0" name="Invcr" type="PartyIdentification43"/>
2194+ <xs:element maxOccurs="1" minOccurs="0" name="Invcee" type="PartyIdentification43"/>
2195+ <xs:element maxOccurs="3" minOccurs="0" name="AddtlRmtInf" type="Max140Text"/>
2196+ </xs:sequence>
2197+ </xs:complexType>
2198+ <xs:complexType name="SupplementaryData1">
2199+ <xs:sequence>
2200+ <xs:element maxOccurs="1" minOccurs="0" name="PlcAndNm" type="Max350Text"/>
2201+ <xs:element name="Envlp" type="SupplementaryDataEnvelope1"/>
2202+ </xs:sequence>
2203+ </xs:complexType>
2204+ <xs:complexType name="SupplementaryDataEnvelope1">
2205+ <xs:sequence>
2206+ <xs:any namespace="##any" processContents="lax"/>
2207+ </xs:sequence>
2208+ </xs:complexType>
2209+ <xs:complexType name="TaxAmount1">
2210+ <xs:sequence>
2211+ <xs:element maxOccurs="1" minOccurs="0" name="Rate" type="PercentageRate"/>
2212+ <xs:element maxOccurs="1" minOccurs="0" name="TaxblBaseAmt" type="ActiveOrHistoricCurrencyAndAmount"/>
2213+ <xs:element maxOccurs="1" minOccurs="0" name="TtlAmt" type="ActiveOrHistoricCurrencyAndAmount"/>
2214+ <xs:element maxOccurs="unbounded" minOccurs="0" name="Dtls" type="TaxRecordDetails1"/>
2215+ </xs:sequence>
2216+ </xs:complexType>
2217+ <xs:complexType name="TaxAmountAndType1">
2218+ <xs:sequence>
2219+ <xs:element maxOccurs="1" minOccurs="0" name="Tp" type="TaxAmountType1Choice"/>
2220+ <xs:element name="Amt" type="ActiveOrHistoricCurrencyAndAmount"/>
2221+ </xs:sequence>
2222+ </xs:complexType>
2223+ <xs:complexType name="TaxAmountType1Choice">
2224+ <xs:choice>
2225+ <xs:element name="Cd" type="ExternalTaxAmountType1Code"/>
2226+ <xs:element name="Prtry" type="Max35Text"/>
2227+ </xs:choice>
2228+ </xs:complexType>
2229+ <xs:complexType name="TaxAuthorisation1">
2230+ <xs:sequence>
2231+ <xs:element maxOccurs="1" minOccurs="0" name="Titl" type="Max35Text"/>
2232+ <xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/>
2233+ </xs:sequence>
2234+ </xs:complexType>
2235+ <xs:complexType name="TaxInformation3">
2236+ <xs:sequence>
2237+ <xs:element maxOccurs="1" minOccurs="0" name="Cdtr" type="TaxParty1"/>
2238+ <xs:element maxOccurs="1" minOccurs="0" name="Dbtr" type="TaxParty2"/>
2239+ <xs:element maxOccurs="1" minOccurs="0" name="AdmstnZn" type="Max35Text"/>
2240+ <xs:element maxOccurs="1" minOccurs="0" name="RefNb" type="Max140Text"/>
2241+ <xs:element maxOccurs="1" minOccurs="0" name="Mtd" type="Max35Text"/>
2242+ <xs:element maxOccurs="1" minOccurs="0" name="TtlTaxblBaseAmt" type="ActiveOrHistoricCurrencyAndAmount"/>
2243+ <xs:element maxOccurs="1" minOccurs="0" name="TtlTaxAmt" type="ActiveOrHistoricCurrencyAndAmount"/>
2244+ <xs:element maxOccurs="1" minOccurs="0" name="Dt" type="ISODate"/>
2245+ <xs:element maxOccurs="1" minOccurs="0" name="SeqNb" type="Number"/>
2246+ <xs:element maxOccurs="unbounded" minOccurs="0" name="Rcrd" type="TaxRecord1"/>
2247+ </xs:sequence>
2248+ </xs:complexType>
2249+ <xs:complexType name="TaxParty1">
2250+ <xs:sequence>
2251+ <xs:element maxOccurs="1" minOccurs="0" name="TaxId" type="Max35Text"/>
2252+ <xs:element maxOccurs="1" minOccurs="0" name="RegnId" type="Max35Text"/>
2253+ <xs:element maxOccurs="1" minOccurs="0" name="TaxTp" type="Max35Text"/>
2254+ </xs:sequence>
2255+ </xs:complexType>
2256+ <xs:complexType name="TaxParty2">
2257+ <xs:sequence>
2258+ <xs:element maxOccurs="1" minOccurs="0" name="TaxId" type="Max35Text"/>
2259+ <xs:element maxOccurs="1" minOccurs="0" name="RegnId" type="Max35Text"/>
2260+ <xs:element maxOccurs="1" minOccurs="0" name="TaxTp" type="Max35Text"/>
2261+ <xs:element maxOccurs="1" minOccurs="0" name="Authstn" type="TaxAuthorisation1"/>
2262+ </xs:sequence>
2263+ </xs:complexType>
2264+ <xs:complexType name="TaxPeriod1">
2265+ <xs:sequence>
2266+ <xs:element maxOccurs="1" minOccurs="0" name="Yr" type="ISODate"/>
2267+ <xs:element maxOccurs="1" minOccurs="0" name="Tp" type="TaxRecordPeriod1Code"/>
2268+ <xs:element maxOccurs="1" minOccurs="0" name="FrToDt" type="DatePeriodDetails"/>
2269+ </xs:sequence>
2270+ </xs:complexType>
2271+ <xs:complexType name="TaxRecord1">
2272+ <xs:sequence>
2273+ <xs:element maxOccurs="1" minOccurs="0" name="Tp" type="Max35Text"/>
2274+ <xs:element maxOccurs="1" minOccurs="0" name="Ctgy" type="Max35Text"/>
2275+ <xs:element maxOccurs="1" minOccurs="0" name="CtgyDtls" type="Max35Text"/>
2276+ <xs:element maxOccurs="1" minOccurs="0" name="DbtrSts" type="Max35Text"/>
2277+ <xs:element maxOccurs="1" minOccurs="0" name="CertId" type="Max35Text"/>
2278+ <xs:element maxOccurs="1" minOccurs="0" name="FrmsCd" type="Max35Text"/>
2279+ <xs:element maxOccurs="1" minOccurs="0" name="Prd" type="TaxPeriod1"/>
2280+ <xs:element maxOccurs="1" minOccurs="0" name="TaxAmt" type="TaxAmount1"/>
2281+ <xs:element maxOccurs="1" minOccurs="0" name="AddtlInf" type="Max140Text"/>
2282+ </xs:sequence>
2283+ </xs:complexType>
2284+ <xs:complexType name="TaxRecordDetails1">
2285+ <xs:sequence>
2286+ <xs:element maxOccurs="1" minOccurs="0" name="Prd" type="TaxPeriod1"/>
2287+ <xs:element name="Amt" type="ActiveOrHistoricCurrencyAndAmount"/>
2288+ </xs:sequence>
2289+ </xs:complexType>
2290+ <xs:simpleType name="TaxRecordPeriod1Code">
2291+ <xs:restriction base="xs:string">
2292+ <xs:enumeration value="MM01"/>
2293+ <xs:enumeration value="MM02"/>
2294+ <xs:enumeration value="MM03"/>
2295+ <xs:enumeration value="MM04"/>
2296+ <xs:enumeration value="MM05"/>
2297+ <xs:enumeration value="MM06"/>
2298+ <xs:enumeration value="MM07"/>
2299+ <xs:enumeration value="MM08"/>
2300+ <xs:enumeration value="MM09"/>
2301+ <xs:enumeration value="MM10"/>
2302+ <xs:enumeration value="MM11"/>
2303+ <xs:enumeration value="MM12"/>
2304+ <xs:enumeration value="QTR1"/>
2305+ <xs:enumeration value="QTR2"/>
2306+ <xs:enumeration value="QTR3"/>
2307+ <xs:enumeration value="QTR4"/>
2308+ <xs:enumeration value="HLF1"/>
2309+ <xs:enumeration value="HLF2"/>
2310+ </xs:restriction>
2311+ </xs:simpleType>
2312+</xs:schema>
2313
2314=== modified file 'account_banking_sepa_credit_transfer/data/payment_type_sepa_sct.xml'
2315--- account_banking_sepa_credit_transfer/data/payment_type_sepa_sct.xml 2013-09-23 13:38:15 +0000
2316+++ account_banking_sepa_credit_transfer/data/payment_type_sepa_sct.xml 2014-03-19 00:47:00 +0000
2317@@ -1,34 +1,39 @@
2318 <?xml version="1.0" encoding="utf-8"?>
2319 <openerp>
2320-<data noupdate="1">
2321+<data noupdate="0">
2322
2323
2324 <!-- TODO In the suitable_bank_types field, we should restrict to IBAN type and Rib+IBAN of l10n_fr_rib ? -->
2325+<record id="export_sepa_sct_001_001_05" model="payment.mode.type">
2326+ <field name="name">SEPA Credit Transfer v05</field>
2327+ <field name="code">pain.001.001.05</field>
2328+ <field name="suitable_bank_types"
2329+ eval="[(6,0,[ref('base_iban.bank_iban')])]" />
2330+ <field name="ir_model_id" ref="model_banking_export_sepa_wizard"/>
2331+</record>
2332+
2333 <record id="export_sepa_sct_001_001_04" model="payment.mode.type">
2334 <field name="name">SEPA Credit Transfer v04</field>
2335 <field name="code">pain.001.001.04</field>
2336 <field name="suitable_bank_types"
2337- eval="[(6,0,[ref('base_iban.bank_iban')])]" />
2338+ eval="[(6,0,[ref('base_iban.bank_iban')])]" />
2339 <field name="ir_model_id" ref="model_banking_export_sepa_wizard"/>
2340- <field name="payment_order_type">payment</field>
2341 </record>
2342
2343 <record id="export_sepa_sct_001_001_03" model="payment.mode.type">
2344- <field name="name">SEPA Credit Transfer v03</field>
2345+ <field name="name">SEPA Credit Transfer v03 (recommended)</field>
2346 <field name="code">pain.001.001.03</field>
2347 <field name="suitable_bank_types"
2348- eval="[(6,0,[ref('base_iban.bank_iban')])]" />
2349+ eval="[(6,0,[ref('base_iban.bank_iban')])]" />
2350 <field name="ir_model_id" ref="model_banking_export_sepa_wizard"/>
2351- <field name="payment_order_type">payment</field>
2352 </record>
2353
2354 <record id="export_sepa_sct_001_001_02" model="payment.mode.type">
2355 <field name="name">SEPA Credit Transfer v02</field>
2356 <field name="code">pain.001.001.02</field>
2357 <field name="suitable_bank_types"
2358- eval="[(6,0,[ref('base_iban.bank_iban')])]" />
2359+ eval="[(6,0,[ref('base_iban.bank_iban')])]" />
2360 <field name="ir_model_id" ref="model_banking_export_sepa_wizard"/>
2361- <field name="payment_order_type">payment</field>
2362 </record>
2363
2364
2365
2366=== modified file 'account_banking_sepa_credit_transfer/i18n/account_banking_sepa_credit_transfer.pot'
2367--- account_banking_sepa_credit_transfer/i18n/account_banking_sepa_credit_transfer.pot 2013-06-06 08:04:29 +0000
2368+++ account_banking_sepa_credit_transfer/i18n/account_banking_sepa_credit_transfer.pot 2014-03-19 00:47:00 +0000
2369@@ -4,10 +4,10 @@
2370 #
2371 msgid ""
2372 msgstr ""
2373-"Project-Id-Version: OpenERP Server 6.1\n"
2374+"Project-Id-Version: OpenERP Server 7.0\n"
2375 "Report-Msgid-Bugs-To: \n"
2376-"POT-Creation-Date: 2013-06-06 08:01+0000\n"
2377-"PO-Revision-Date: 2013-06-06 08:01+0000\n"
2378+"POT-Creation-Date: 2013-12-23 22:49+0000\n"
2379+"PO-Revision-Date: 2013-12-23 22:49+0000\n"
2380 "Last-Translator: <>\n"
2381 "Language-Team: \n"
2382 "MIME-Version: 1.0\n"
2383@@ -16,24 +16,14 @@
2384 "Plural-Forms: \n"
2385
2386 #. module: account_banking_sepa_credit_transfer
2387-#: field:banking.export.sepa,file:0
2388-#: field:banking.export.sepa.wizard,file_id:0
2389-msgid "SEPA XML file"
2390-msgstr ""
2391-
2392-#. module: account_banking_sepa_credit_transfer
2393-#: view:banking.export.sepa:0
2394-msgid "Payment order"
2395-msgstr ""
2396-
2397-#. module: account_banking_sepa_credit_transfer
2398 #: selection:banking.export.sepa.wizard,state:0
2399 msgid "Create"
2400 msgstr ""
2401
2402 #. module: account_banking_sepa_credit_transfer
2403-#: help:banking.export.sepa.wizard,msg_identification:0
2404-msgid "This is the message identification of the entire SEPA XML file. 35 characters max."
2405+#: field:banking.export.sepa,nb_transactions:0
2406+#: field:banking.export.sepa.wizard,nb_transactions:0
2407+msgid "Number of Transactions"
2408 msgstr ""
2409
2410 #. module: account_banking_sepa_credit_transfer
2411@@ -43,11 +33,6 @@
2412 msgstr ""
2413
2414 #. module: account_banking_sepa_credit_transfer
2415-#: view:banking.export.sepa:0
2416-msgid "General information"
2417-msgstr ""
2418-
2419-#. module: account_banking_sepa_credit_transfer
2420 #: field:banking.export.sepa,state:0
2421 #: field:banking.export.sepa.wizard,state:0
2422 msgid "State"
2423@@ -59,9 +44,8 @@
2424 msgstr ""
2425
2426 #. module: account_banking_sepa_credit_transfer
2427-#: field:banking.export.sepa,prefered_exec_date:0
2428-#: field:banking.export.sepa.wizard,prefered_exec_date:0
2429-msgid "Prefered execution date"
2430+#: help:banking.export.sepa.wizard,charge_bearer:0
2431+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 debtor side are to be borne by the debtor, transaction charges on the creditor side are to be borne by the creditor. 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."
2432 msgstr ""
2433
2434 #. module: account_banking_sepa_credit_transfer
2435@@ -71,13 +55,19 @@
2436 msgstr ""
2437
2438 #. module: account_banking_sepa_credit_transfer
2439-#: field:banking.export.sepa,generation_date:0
2440-msgid "Generation date"
2441+#: field:banking.export.sepa,batch_booking:0
2442+#: field:banking.export.sepa.wizard,batch_booking:0
2443+msgid "Batch Booking"
2444+msgstr ""
2445+
2446+#. module: account_banking_sepa_credit_transfer
2447+#: selection:banking.export.sepa,state:0
2448+msgid "Sent"
2449 msgstr ""
2450
2451 #. module: account_banking_sepa_credit_transfer
2452 #: model:ir.model,name:account_banking_sepa_credit_transfer.model_banking_export_sepa_wizard
2453-msgid "Export SEPA Credit Transfer XML file"
2454+msgid "Export SEPA Credit Transfer File"
2455 msgstr ""
2456
2457 #. module: account_banking_sepa_credit_transfer
2458@@ -96,19 +86,15 @@
2459 msgstr ""
2460
2461 #. module: account_banking_sepa_credit_transfer
2462-#: model:ir.actions.act_window,name:account_banking_sepa_credit_transfer.act_banking_export_sepa_payment_order
2463-msgid "Generated SEPA files"
2464-msgstr ""
2465-
2466-#. module: account_banking_sepa_credit_transfer
2467-#: model:ir.actions.act_window,name:account_banking_sepa_credit_transfer.action_account_banking_sepa
2468-#: model:ir.ui.menu,name:account_banking_sepa_credit_transfer.menu_account_banking_sepa
2469-msgid "Generated SEPA XML files"
2470-msgstr ""
2471-
2472-#. module: account_banking_sepa_credit_transfer
2473-#: selection:banking.export.sepa,state:0
2474-msgid "Sent"
2475+#: selection:banking.export.sepa,charge_bearer:0
2476+#: selection:banking.export.sepa.wizard,charge_bearer:0
2477+msgid "Following Service Level"
2478+msgstr ""
2479+
2480+#. module: account_banking_sepa_credit_transfer
2481+#: selection:banking.export.sepa,charge_bearer:0
2482+#: selection:banking.export.sepa.wizard,charge_bearer:0
2483+msgid "Borne by Creditor"
2484 msgstr ""
2485
2486 #. module: account_banking_sepa_credit_transfer
2487@@ -122,90 +108,80 @@
2488 msgstr ""
2489
2490 #. module: account_banking_sepa_credit_transfer
2491-#: field:banking.export.sepa,msg_identification:0
2492-#: field:banking.export.sepa.wizard,msg_identification:0
2493-msgid "Message identification"
2494+#: selection:banking.export.sepa,charge_bearer:0
2495+#: selection:banking.export.sepa.wizard,charge_bearer:0
2496+msgid "Borne by Debtor"
2497 msgstr ""
2498
2499 #. module: account_banking_sepa_credit_transfer
2500-#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:284
2501+#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:128
2502+#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:245
2503 #, python-format
2504-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"
2505+msgid "Error:"
2506 msgstr ""
2507
2508 #. module: account_banking_sepa_credit_transfer
2509 #: field:banking.export.sepa,total_amount:0
2510 #: field:banking.export.sepa.wizard,total_amount:0
2511-msgid "Total amount"
2512+msgid "Total Amount"
2513+msgstr ""
2514+
2515+#. module: account_banking_sepa_credit_transfer
2516+#: field:banking.export.sepa,charge_bearer:0
2517+#: field:banking.export.sepa.wizard,charge_bearer:0
2518+msgid "Charge Bearer"
2519+msgstr ""
2520+
2521+#. module: account_banking_sepa_credit_transfer
2522+#: view:banking.export.sepa.wizard:0
2523+msgid "SEPA File Generation"
2524+msgstr ""
2525+
2526+#. module: account_banking_sepa_credit_transfer
2527+#: model:ir.model,name:account_banking_sepa_credit_transfer.model_banking_export_sepa
2528+msgid "SEPA export"
2529+msgstr ""
2530+
2531+#. module: account_banking_sepa_credit_transfer
2532+#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:246
2533+#, python-format
2534+msgid "Missing Bank Account on invoice '%s' (payment order line reference '%s')."
2535+msgstr ""
2536+
2537+#. module: account_banking_sepa_credit_transfer
2538+#: field:banking.export.sepa,file:0
2539+#: field:banking.export.sepa.wizard,file_id:0
2540+msgid "SEPA XML File"
2541 msgstr ""
2542
2543 #. module: account_banking_sepa_credit_transfer
2544 #: help:banking.export.sepa,charge_bearer:0
2545-#: help:banking.export.sepa.wizard,charge_bearer:0
2546-msgid "Shared : transaction charges on the sender side are to be borne by the debtor, transaction charges on the receiver side are to be borne by the creditor (most transfers use this). 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. Following service level : transaction charges are to be applied following the rules agreed in the service level and/or scheme."
2547+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."
2548 msgstr ""
2549
2550 #. module: account_banking_sepa_credit_transfer
2551-#: selection:banking.export.sepa,charge_bearer:0
2552-#: selection:banking.export.sepa.wizard,charge_bearer:0
2553-msgid "Borne by creditor"
2554+#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:129
2555+#, python-format
2556+msgid "Payment Type Code '%s' is not supported. The only Payment Type Codes supported for SEPA Credit Transfers are 'pain.001.001.02', 'pain.001.001.03', 'pain.001.001.04' and 'pain.001.001.05'."
2557 msgstr ""
2558
2559 #. module: account_banking_sepa_credit_transfer
2560 #: view:banking.export.sepa:0
2561 #: field:banking.export.sepa,payment_order_ids:0
2562 #: field:banking.export.sepa.wizard,payment_order_ids:0
2563-msgid "Payment orders"
2564-msgstr ""
2565-
2566-#. module: account_banking_sepa_credit_transfer
2567-#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:90
2568-#, python-format
2569-msgid "This IBAN is not valid : %s"
2570-msgstr ""
2571-
2572-#. module: account_banking_sepa_credit_transfer
2573-#: view:banking.export.sepa.wizard:0
2574-msgid "SEPA XML file generation"
2575-msgstr ""
2576-
2577-#. module: account_banking_sepa_credit_transfer
2578-#: view:banking.export.sepa.wizard:0
2579-msgid "Reference for further communication"
2580-msgstr ""
2581-
2582-#. module: account_banking_sepa_credit_transfer
2583-#: view:banking.export.sepa.wizard:0
2584-msgid "Processing details"
2585-msgstr ""
2586-
2587-#. module: account_banking_sepa_credit_transfer
2588-#: model:ir.model,name:account_banking_sepa_credit_transfer.model_banking_export_sepa
2589-msgid "SEPA export"
2590-msgstr ""
2591-
2592-#. module: account_banking_sepa_credit_transfer
2593-#: selection:banking.export.sepa,charge_bearer:0
2594-#: selection:banking.export.sepa.wizard,charge_bearer:0
2595-msgid "Borne by debtor"
2596-msgstr ""
2597-
2598-#. module: account_banking_sepa_credit_transfer
2599-#: field:banking.export.sepa,nb_transactions:0
2600-#: field:banking.export.sepa.wizard,nb_transactions:0
2601-msgid "Number of transactions"
2602-msgstr ""
2603-
2604-#. module: account_banking_sepa_credit_transfer
2605-#: selection:banking.export.sepa,charge_bearer:0
2606-#: selection:banking.export.sepa.wizard,charge_bearer:0
2607-msgid "Following service level"
2608-msgstr ""
2609-
2610-#. module: account_banking_sepa_credit_transfer
2611-#: field:banking.export.sepa,charge_bearer:0
2612-#: field:banking.export.sepa.wizard,charge_bearer:0
2613-msgid "Charge bearer"
2614+msgid "Payment Orders"
2615+msgstr ""
2616+
2617+#. module: account_banking_sepa_credit_transfer
2618+#: view:banking.export.sepa:0
2619+msgid "General Information"
2620+msgstr ""
2621+
2622+#. module: account_banking_sepa_credit_transfer
2623+#: model:ir.actions.act_window,name:account_banking_sepa_credit_transfer.act_banking_export_sepa_payment_order
2624+#: model:ir.actions.act_window,name:account_banking_sepa_credit_transfer.action_account_banking_sepa
2625+#: model:ir.ui.menu,name:account_banking_sepa_credit_transfer.menu_account_banking_sepa
2626+msgid "SEPA Credit Transfer Files"
2627 msgstr ""
2628
2629 #. module: account_banking_sepa_credit_transfer
2630@@ -215,11 +191,6 @@
2631 msgstr ""
2632
2633 #. module: account_banking_sepa_credit_transfer
2634-#: help:banking.export.sepa.wizard,prefered_exec_date:0
2635-msgid "This is the date on which the file should be processed by the bank. Please keep in mind that banks only execute on working days and typically use a delay of two days between execution date and effective transfer date."
2636-msgstr ""
2637-
2638-#. module: account_banking_sepa_credit_transfer
2639 #: field:banking.export.sepa.wizard,file:0
2640 msgid "File"
2641 msgstr ""
2642@@ -230,22 +201,7 @@
2643 msgstr ""
2644
2645 #. module: account_banking_sepa_credit_transfer
2646-#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:135
2647-#, python-format
2648-msgid "Payment Type Code '%s' is not supported. The only Payment Type Codes supported for SEPA Credit Transfers are 'pain.001.001.02', 'pain.001.001.03' and 'pain.001.001.04'."
2649-msgstr ""
2650-
2651-#. module: account_banking_sepa_credit_transfer
2652-#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:90
2653-#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:135
2654-#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:284
2655-#, python-format
2656-msgid "Error :"
2657-msgstr ""
2658-
2659-#. module: account_banking_sepa_credit_transfer
2660-#: field:banking.export.sepa,batch_booking:0
2661-#: field:banking.export.sepa.wizard,batch_booking:0
2662-msgid "Batch booking"
2663+#: field:banking.export.sepa,create_date:0
2664+msgid "Generation Date"
2665 msgstr ""
2666
2667
2668=== modified file 'account_banking_sepa_credit_transfer/i18n/fr.po'
2669--- account_banking_sepa_credit_transfer/i18n/fr.po 2013-06-06 08:04:29 +0000
2670+++ account_banking_sepa_credit_transfer/i18n/fr.po 2014-03-19 00:47:00 +0000
2671@@ -4,10 +4,10 @@
2672 #
2673 msgid ""
2674 msgstr ""
2675-"Project-Id-Version: OpenERP Server 6.1\n"
2676+"Project-Id-Version: OpenERP Server 7.0\n"
2677 "Report-Msgid-Bugs-To: \n"
2678-"POT-Creation-Date: 2013-06-06 08:01+0000\n"
2679-"PO-Revision-Date: 2013-06-06 08:01+0000\n"
2680+"POT-Creation-Date: 2013-12-23 22:52+0000\n"
2681+"PO-Revision-Date: 2013-12-23 22:52+0000\n"
2682 "Last-Translator: <>\n"
2683 "Language-Team: \n"
2684 "MIME-Version: 1.0\n"
2685@@ -16,25 +16,15 @@
2686 "Plural-Forms: \n"
2687
2688 #. module: account_banking_sepa_credit_transfer
2689-#: field:banking.export.sepa,file:0
2690-#: field:banking.export.sepa.wizard,file_id:0
2691-msgid "SEPA XML file"
2692-msgstr "Fichier SEPA XML"
2693-
2694-#. module: account_banking_sepa_credit_transfer
2695-#: view:banking.export.sepa:0
2696-msgid "Payment order"
2697-msgstr "Ordre de paiement"
2698-
2699-#. module: account_banking_sepa_credit_transfer
2700 #: selection:banking.export.sepa.wizard,state:0
2701 msgid "Create"
2702 msgstr "Créer"
2703
2704 #. module: account_banking_sepa_credit_transfer
2705-#: help:banking.export.sepa.wizard,msg_identification:0
2706-msgid "This is the message identification of the entire SEPA XML file. 35 characters max."
2707-msgstr "Ceci est le libellé d'identification du fichier SEPA XML. 35 caractères maximum."
2708+#: field:banking.export.sepa,nb_transactions:0
2709+#: field:banking.export.sepa.wizard,nb_transactions:0
2710+msgid "Number of Transactions"
2711+msgstr "Nombre de transactions"
2712
2713 #. module: account_banking_sepa_credit_transfer
2714 #: field:banking.export.sepa,filename:0
2715@@ -43,11 +33,6 @@
2716 msgstr "Nom du fichier"
2717
2718 #. module: account_banking_sepa_credit_transfer
2719-#: view:banking.export.sepa:0
2720-msgid "General information"
2721-msgstr "Informations générales"
2722-
2723-#. module: account_banking_sepa_credit_transfer
2724 #: field:banking.export.sepa,state:0
2725 #: field:banking.export.sepa.wizard,state:0
2726 msgid "State"
2727@@ -59,10 +44,9 @@
2728 msgstr "Brouillon"
2729
2730 #. module: account_banking_sepa_credit_transfer
2731-#: field:banking.export.sepa,prefered_exec_date:0
2732-#: field:banking.export.sepa.wizard,prefered_exec_date:0
2733-msgid "Prefered execution date"
2734-msgstr "Date d'exécution demandée"
2735+#: help:banking.export.sepa.wizard,charge_bearer:0
2736+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 debtor side are to be borne by the debtor, transaction charges on the creditor side are to be borne by the creditor. 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."
2737+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."
2738
2739 #. module: account_banking_sepa_credit_transfer
2740 #: selection:banking.export.sepa,charge_bearer:0
2741@@ -71,14 +55,20 @@
2742 msgstr "Partagé"
2743
2744 #. module: account_banking_sepa_credit_transfer
2745-#: field:banking.export.sepa,generation_date:0
2746-msgid "Generation date"
2747-msgstr "Date de génération"
2748+#: field:banking.export.sepa,batch_booking:0
2749+#: field:banking.export.sepa.wizard,batch_booking:0
2750+msgid "Batch Booking"
2751+msgstr "Débit groupé"
2752+
2753+#. module: account_banking_sepa_credit_transfer
2754+#: selection:banking.export.sepa,state:0
2755+msgid "Sent"
2756+msgstr "Envoyé"
2757
2758 #. module: account_banking_sepa_credit_transfer
2759 #: model:ir.model,name:account_banking_sepa_credit_transfer.model_banking_export_sepa_wizard
2760-msgid "Export SEPA Credit Transfer XML file"
2761-msgstr "Exporte the fichier de virement SEPA XML"
2762+msgid "Export SEPA Credit Transfer File"
2763+msgstr "Exporte le fichier de virement SEPA"
2764
2765 #. module: account_banking_sepa_credit_transfer
2766 #: view:banking.export.sepa:0
2767@@ -96,20 +86,16 @@
2768 msgstr "Réconcilié"
2769
2770 #. module: account_banking_sepa_credit_transfer
2771-#: model:ir.actions.act_window,name:account_banking_sepa_credit_transfer.act_banking_export_sepa_payment_order
2772-msgid "Generated SEPA files"
2773-msgstr "Fichiers SEPA générés"
2774-
2775-#. module: account_banking_sepa_credit_transfer
2776-#: model:ir.actions.act_window,name:account_banking_sepa_credit_transfer.action_account_banking_sepa
2777-#: model:ir.ui.menu,name:account_banking_sepa_credit_transfer.menu_account_banking_sepa
2778-msgid "Generated SEPA XML files"
2779-msgstr "Fichiers SEPA XML générés"
2780-
2781-#. module: account_banking_sepa_credit_transfer
2782-#: selection:banking.export.sepa,state:0
2783-msgid "Sent"
2784-msgstr "Envoyé"
2785+#: selection:banking.export.sepa,charge_bearer:0
2786+#: selection:banking.export.sepa.wizard,charge_bearer:0
2787+msgid "Following Service Level"
2788+msgstr "Suivant le niveau de service"
2789+
2790+#. module: account_banking_sepa_credit_transfer
2791+#: selection:banking.export.sepa,charge_bearer:0
2792+#: selection:banking.export.sepa.wizard,charge_bearer:0
2793+msgid "Borne by Creditor"
2794+msgstr "Supportés par le destinataire"
2795
2796 #. module: account_banking_sepa_credit_transfer
2797 #: view:banking.export.sepa.wizard:0
2798@@ -122,91 +108,81 @@
2799 msgstr "Générer"
2800
2801 #. module: account_banking_sepa_credit_transfer
2802-#: field:banking.export.sepa,msg_identification:0
2803-#: field:banking.export.sepa.wizard,msg_identification:0
2804-msgid "Message identification"
2805-msgstr "Libellé d'identification"
2806+#: selection:banking.export.sepa,charge_bearer:0
2807+#: selection:banking.export.sepa.wizard,charge_bearer:0
2808+msgid "Borne by Debtor"
2809+msgstr "Supportés par l'émetteur"
2810
2811 #. module: account_banking_sepa_credit_transfer
2812-#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:284
2813+#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:128
2814+#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:245
2815 #, python-format
2816-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"
2817-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"
2818+msgid "Error:"
2819+msgstr "Erreur :"
2820
2821 #. module: account_banking_sepa_credit_transfer
2822 #: field:banking.export.sepa,total_amount:0
2823 #: field:banking.export.sepa.wizard,total_amount:0
2824-msgid "Total amount"
2825+msgid "Total Amount"
2826 msgstr "Montant total"
2827
2828 #. module: account_banking_sepa_credit_transfer
2829+#: field:banking.export.sepa,charge_bearer:0
2830+#: field:banking.export.sepa.wizard,charge_bearer:0
2831+msgid "Charge Bearer"
2832+msgstr "Répartition des frais"
2833+
2834+#. module: account_banking_sepa_credit_transfer
2835+#: view:banking.export.sepa.wizard:0
2836+msgid "SEPA File Generation"
2837+msgstr "Génération du fichier SEPA"
2838+
2839+#. module: account_banking_sepa_credit_transfer
2840+#: model:ir.model,name:account_banking_sepa_credit_transfer.model_banking_export_sepa
2841+msgid "SEPA export"
2842+msgstr "Export SEPA"
2843+
2844+#. module: account_banking_sepa_credit_transfer
2845+#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:246
2846+#, python-format
2847+msgid "Missing Bank Account on invoice '%s' (payment order line reference '%s')."
2848+msgstr "Compte bancaire manquant sur la facture '%s' (référence de la ligne de paiement : '%s')."
2849+
2850+#. module: account_banking_sepa_credit_transfer
2851+#: field:banking.export.sepa,file:0
2852+#: field:banking.export.sepa.wizard,file_id:0
2853+msgid "SEPA XML File"
2854+msgstr "Fichier SEPA XML"
2855+
2856+#. module: account_banking_sepa_credit_transfer
2857 #: help:banking.export.sepa,charge_bearer:0
2858-#: help:banking.export.sepa.wizard,charge_bearer:0
2859-msgid "Shared : transaction charges on the sender side are to be borne by the debtor, transaction charges on the receiver side are to be borne by the creditor (most transfers use this). 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. Following service level : transaction charges are to be applied following the rules agreed in the service level and/or scheme."
2860-msgstr "Partagés : les frais bancaires côté émetteur sont à la charge de l'émetteur et les frais bancaires côté destinataire sont à la charge du destinataire (la plupart des virements utilisent cette répartition). Supportés par le destinataire : tous les frais bancaires sont à la charge du destinataire. Supportés par l'émetteur : tous les frais bancaires sont à la charge de l'émetteur. Suivant le niveau de service : la répartition des frais bancaires suit les règles pré-établies dans le contrat avec la banque."
2861+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."
2862+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."
2863
2864 #. module: account_banking_sepa_credit_transfer
2865-#: selection:banking.export.sepa,charge_bearer:0
2866-#: selection:banking.export.sepa.wizard,charge_bearer:0
2867-msgid "Borne by creditor"
2868-msgstr "Supportés par le destinataire"
2869+#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:129
2870+#, python-format
2871+msgid "Payment Type Code '%s' is not supported. The only Payment Type Codes supported for SEPA Credit Transfers are 'pain.001.001.02', 'pain.001.001.03', 'pain.001.001.04' and 'pain.001.001.05'."
2872+msgstr "Le code du Type de paiement '%s' n'est pas supporté. Les seuls codes de Type de paiement supportés pour les virements SEPA sont 'pain.001.001.02', 'pain.001.001.03', 'pain.001.001.04' et 'pain.001.001.05'."
2873
2874 #. module: account_banking_sepa_credit_transfer
2875 #: view:banking.export.sepa:0
2876 #: field:banking.export.sepa,payment_order_ids:0
2877 #: field:banking.export.sepa.wizard,payment_order_ids:0
2878-msgid "Payment orders"
2879+msgid "Payment Orders"
2880 msgstr "Ordres de paiement"
2881
2882 #. module: account_banking_sepa_credit_transfer
2883-#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:90
2884-#, python-format
2885-msgid "This IBAN is not valid : %s"
2886-msgstr "Cet IBAN n'est pas valide : %s"
2887-
2888-#. module: account_banking_sepa_credit_transfer
2889-#: view:banking.export.sepa.wizard:0
2890-msgid "SEPA XML file generation"
2891-msgstr "Génération du fichier SEPA XML"
2892-
2893-#. module: account_banking_sepa_credit_transfer
2894-#: view:banking.export.sepa.wizard:0
2895-msgid "Reference for further communication"
2896-msgstr "Référence pour communication ultérieure"
2897-
2898-#. module: account_banking_sepa_credit_transfer
2899-#: view:banking.export.sepa.wizard:0
2900-msgid "Processing details"
2901-msgstr "Paramètres"
2902-
2903-#. module: account_banking_sepa_credit_transfer
2904-#: model:ir.model,name:account_banking_sepa_credit_transfer.model_banking_export_sepa
2905-msgid "SEPA export"
2906-msgstr "Export SEPA"
2907-
2908-#. module: account_banking_sepa_credit_transfer
2909-#: selection:banking.export.sepa,charge_bearer:0
2910-#: selection:banking.export.sepa.wizard,charge_bearer:0
2911-msgid "Borne by debtor"
2912-msgstr "Supportés par l'émetteur"
2913-
2914-#. module: account_banking_sepa_credit_transfer
2915-#: field:banking.export.sepa,nb_transactions:0
2916-#: field:banking.export.sepa.wizard,nb_transactions:0
2917-msgid "Number of transactions"
2918-msgstr "Nombre de transactions"
2919-
2920-#. module: account_banking_sepa_credit_transfer
2921-#: selection:banking.export.sepa,charge_bearer:0
2922-#: selection:banking.export.sepa.wizard,charge_bearer:0
2923-msgid "Following service level"
2924-msgstr "Suivant le niveau de service"
2925-
2926-#. module: account_banking_sepa_credit_transfer
2927-#: field:banking.export.sepa,charge_bearer:0
2928-#: field:banking.export.sepa.wizard,charge_bearer:0
2929-msgid "Charge bearer"
2930-msgstr "Répartition des frais"
2931+#: view:banking.export.sepa:0
2932+msgid "General Information"
2933+msgstr "Informations générales"
2934+
2935+#. module: account_banking_sepa_credit_transfer
2936+#: model:ir.actions.act_window,name:account_banking_sepa_credit_transfer.act_banking_export_sepa_payment_order
2937+#: model:ir.actions.act_window,name:account_banking_sepa_credit_transfer.action_account_banking_sepa
2938+#: model:ir.ui.menu,name:account_banking_sepa_credit_transfer.menu_account_banking_sepa
2939+msgid "SEPA Credit Transfer Files"
2940+msgstr "Fichiers de virement SEPA"
2941
2942 #. module: account_banking_sepa_credit_transfer
2943 #: help:banking.export.sepa,batch_booking:0
2944@@ -215,11 +191,6 @@
2945 msgstr "Si coché, le relevé de compte ne comportera qu'une ligne de débit pour tous les virements du fichier SEPA XML ; si non coché, le relevé de compte comportera une ligne de débit pour chaque virement du fichier SEPA XML."
2946
2947 #. module: account_banking_sepa_credit_transfer
2948-#: help:banking.export.sepa.wizard,prefered_exec_date:0
2949-msgid "This is the date on which the file should be processed by the bank. Please keep in mind that banks only execute on working days and typically use a delay of two days between execution date and effective transfer date."
2950-msgstr "C'est la date à laquelle le fichier doit être traité par la banque. Gardez en tête que les banques réalisent des traitements seulement les jours ouvrés et ont habituellement un délai de 2 jours entre la date de traitement et la date du transfert effectif."
2951-
2952-#. module: account_banking_sepa_credit_transfer
2953 #: field:banking.export.sepa.wizard,file:0
2954 msgid "File"
2955 msgstr "Fichier"
2956@@ -230,22 +201,7 @@
2957 msgstr "Annuler"
2958
2959 #. module: account_banking_sepa_credit_transfer
2960-#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:135
2961-#, python-format
2962-msgid "Payment Type Code '%s' is not supported. The only Payment Type Codes supported for SEPA Credit Transfers are 'pain.001.001.02', 'pain.001.001.03' and 'pain.001.001.04'."
2963-msgstr "Le code '%s' pour le Type de Paiment n'est pas supporté. Les seuls codes de Types de Paiement supportés pour les virements SEPA sont 'pain.001.001.02', 'pain.001.001.03' et 'pain.001.001.04'."
2964-
2965-#. module: account_banking_sepa_credit_transfer
2966-#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:90
2967-#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:135
2968-#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:284
2969-#, python-format
2970-msgid "Error :"
2971-msgstr "Erreur :"
2972-
2973-#. module: account_banking_sepa_credit_transfer
2974-#: field:banking.export.sepa,batch_booking:0
2975-#: field:banking.export.sepa.wizard,batch_booking:0
2976-msgid "Batch booking"
2977-msgstr "Débit groupé"
2978+#: field:banking.export.sepa,create_date:0
2979+msgid "Generation Date"
2980+msgstr "Date de génération"
2981
2982
2983=== added file 'account_banking_sepa_credit_transfer/i18n/nl.po'
2984--- account_banking_sepa_credit_transfer/i18n/nl.po 1970-01-01 00:00:00 +0000
2985+++ account_banking_sepa_credit_transfer/i18n/nl.po 2014-03-19 00:47:00 +0000
2986@@ -0,0 +1,405 @@
2987+# Translation of OpenERP Server.
2988+# This file contains the translation of the following modules:
2989+# * account_banking_sepa_credit_transfer
2990+#
2991+msgid ""
2992+msgstr ""
2993+"Project-Id-Version: OpenERP Server 7.0\n"
2994+"Report-Msgid-Bugs-To: \n"
2995+"POT-Creation-Date: 2013-11-13 09:13+0000\n"
2996+"PO-Revision-Date: 2013-12-03 11:49+0000\n"
2997+"Last-Translator: Jan Jurkus (GCE CAD-Service) <ict@gcecad-service.nl>\n"
2998+"Language-Team: \n"
2999+"MIME-Version: 1.0\n"
3000+"Content-Type: text/plain; charset=UTF-8\n"
3001+"Content-Transfer-Encoding: 8bit\n"
3002+"X-Launchpad-Export-Date: 2013-12-04 05:59+0000\n"
3003+"X-Generator: Launchpad (build 16861)\n"
3004+
3005+#. module: account_banking_sepa_credit_transfer
3006+#: field:banking.export.sepa,prefered_exec_date:0
3007+#: field:banking.export.sepa.wizard,prefered_exec_date:0
3008+msgid "Prefered Execution Date"
3009+msgstr "Voorkeurs uitvoerdatum"
3010+
3011+#. module: account_banking_sepa_credit_transfer
3012+#: selection:banking.export.sepa.wizard,state:0
3013+msgid "Create"
3014+msgstr "Aanmaken"
3015+
3016+#. module: account_banking_sepa_credit_transfer
3017+#: field:banking.export.sepa,nb_transactions:0
3018+#: field:banking.export.sepa.wizard,nb_transactions:0
3019+msgid "Number of Transactions"
3020+msgstr "Aantal transacties"
3021+
3022+#. module: account_banking_sepa_credit_transfer
3023+#: field:banking.export.sepa,filename:0
3024+#: field:banking.export.sepa.wizard,filename:0
3025+msgid "Filename"
3026+msgstr "Bestandsnaam"
3027+
3028+#. module: account_banking_sepa_credit_transfer
3029+#: field:banking.export.sepa,state:0
3030+#: field:banking.export.sepa.wizard,state:0
3031+msgid "State"
3032+msgstr "Status"
3033+
3034+#. module: account_banking_sepa_credit_transfer
3035+#: selection:banking.export.sepa,state:0
3036+msgid "Draft"
3037+msgstr "Concept"
3038+
3039+#. module: account_banking_sepa_credit_transfer
3040+#: help:banking.export.sepa.wizard,charge_bearer:0
3041+msgid ""
3042+"Following service level : transaction charges are to be applied following "
3043+"the rules agreed in the service level and/or scheme (SEPA Core messages must "
3044+"use this). Shared : transaction charges on the debtor side are to be borne "
3045+"by the debtor, transaction charges on the creditor side are to be borne by "
3046+"the creditor. Borne by creditor : all transaction charges are to be borne by "
3047+"the creditor. Borne by debtor : all transaction charges are to be borne by "
3048+"the debtor."
3049+msgstr ""
3050+"Volg service level: Transactie kosten worden toegepast volgens de "
3051+"afgesproken regels in het service level en/of schema (Voor SEPA berichten "
3052+"deze gebruiken). Gedeeld : De transactiekosten aan de debiteur zijde zijn "
3053+"voor de schuldeiser, transactiekosten aan de crediteur kant zijn voor de "
3054+"schuldenaar. Rekening van de schuldenaar: Alle transactie kosten zijn voor "
3055+"rekening van de schuldenaar. Rekening van de schuldeiser: Alle transactie "
3056+"kosten zijn voor rekening van de schuldeiser."
3057+
3058+#. module: account_banking_sepa_credit_transfer
3059+#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:117
3060+#, python-format
3061+msgid ""
3062+"Cannot compute the '%s' of the Payment Line with Invoice Reference '%s'."
3063+msgstr ""
3064+"Niet mogelijk de '%s' van de betaalregel te berekenen met factuurreferentie "
3065+"'%s'."
3066+
3067+#. module: account_banking_sepa_credit_transfer
3068+#: selection:banking.export.sepa,charge_bearer:0
3069+#: selection:banking.export.sepa.wizard,charge_bearer:0
3070+msgid "Shared"
3071+msgstr "Gedeeld"
3072+
3073+#. module: account_banking_sepa_credit_transfer
3074+#: field:banking.export.sepa,batch_booking:0
3075+#: field:banking.export.sepa.wizard,batch_booking:0
3076+msgid "Batch Booking"
3077+msgstr "Bach verwerking"
3078+
3079+#. module: account_banking_sepa_credit_transfer
3080+#: model:ir.model,name:account_banking_sepa_credit_transfer.model_banking_export_sepa_wizard
3081+msgid "Export SEPA Credit Transfer XML file"
3082+msgstr "Exporteer SEPA XML overschrijvingsbestand"
3083+
3084+#. module: account_banking_sepa_credit_transfer
3085+#: view:banking.export.sepa:0
3086+msgid "SEPA Credit Transfer"
3087+msgstr "SEPA overschrijving"
3088+
3089+#. module: account_banking_sepa_credit_transfer
3090+#: selection:banking.export.sepa.wizard,state:0
3091+msgid "Finish"
3092+msgstr "Gereed"
3093+
3094+#. module: account_banking_sepa_credit_transfer
3095+#: selection:banking.export.sepa,state:0
3096+msgid "Reconciled"
3097+msgstr "Afgeletterd"
3098+
3099+#. module: account_banking_sepa_credit_transfer
3100+#: selection:banking.export.sepa,charge_bearer:0
3101+#: selection:banking.export.sepa.wizard,charge_bearer:0
3102+msgid "Following Service Level"
3103+msgstr "Volg service level"
3104+
3105+#. module: account_banking_sepa_credit_transfer
3106+#: selection:banking.export.sepa,charge_bearer:0
3107+#: selection:banking.export.sepa.wizard,charge_bearer:0
3108+msgid "Borne by Creditor"
3109+msgstr "Rekening van schuldeiser"
3110+
3111+#. module: account_banking_sepa_credit_transfer
3112+#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:122
3113+#, python-format
3114+msgid "Cannot compute the '%s'."
3115+msgstr "Niet mogelijk de '%s' te berekenen."
3116+
3117+#. module: account_banking_sepa_credit_transfer
3118+#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:126
3119+#, python-format
3120+msgid "The type of the field '%s' is %s. It should be a string or unicode."
3121+msgstr ""
3122+"Het veldsoort van het veld '%s' is %s. Het moet een string of unicode soort "
3123+"zijn."
3124+
3125+#. module: account_banking_sepa_credit_transfer
3126+#: selection:banking.export.sepa,state:0
3127+msgid "Sent"
3128+msgstr "Verzonden"
3129+
3130+#. module: account_banking_sepa_credit_transfer
3131+#: view:banking.export.sepa.wizard:0
3132+msgid "Validate"
3133+msgstr "Bevestig"
3134+
3135+#. module: account_banking_sepa_credit_transfer
3136+#: view:banking.export.sepa.wizard:0
3137+msgid "Generate"
3138+msgstr "Genereer"
3139+
3140+#. module: account_banking_sepa_credit_transfer
3141+#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:169
3142+#, python-format
3143+msgid ""
3144+"The generated XML file is not valid against the official XML Schema "
3145+"Definition. The generated XML file and the full error have been written in "
3146+"the server logs. Here is the error, which may give you an idea on the cause "
3147+"of the problem : %s"
3148+msgstr ""
3149+"Het gegenereerde XML bestand is niet geldig volgens de officiële XML schema "
3150+"definities. Het gegenereerde XML bestand en de volledige fout zijn "
3151+"weggeschreven in de server log bestanden. Hier is de fout, wat u een idee "
3152+"kunt geven over de oorzaak van het probleem: %s\""
3153+
3154+#. module: account_banking_sepa_credit_transfer
3155+#: selection:banking.export.sepa,charge_bearer:0
3156+#: selection:banking.export.sepa.wizard,charge_bearer:0
3157+msgid "Borne by Debtor"
3158+msgstr "Rekening van schuldenaar"
3159+
3160+#. module: account_banking_sepa_credit_transfer
3161+#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:90
3162+#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:116
3163+#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:121
3164+#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:130
3165+#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:168
3166+#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:206
3167+#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:350
3168+#, python-format
3169+msgid "Error:"
3170+msgstr "Fout:"
3171+
3172+#. module: account_banking_sepa_credit_transfer
3173+#: field:banking.export.sepa,total_amount:0
3174+#: field:banking.export.sepa.wizard,total_amount:0
3175+msgid "Total Amount"
3176+msgstr "Totaalbedrag"
3177+
3178+#. module: account_banking_sepa_credit_transfer
3179+#: field:banking.export.sepa,charge_bearer:0
3180+#: field:banking.export.sepa.wizard,charge_bearer:0
3181+msgid "Charge Bearer"
3182+msgstr "Kostenverdeling"
3183+
3184+#. module: account_banking_sepa_credit_transfer
3185+#: view:banking.export.sepa.wizard:0
3186+msgid "SEPA File Generation"
3187+msgstr "SEPA bestand genereren"
3188+
3189+#. module: account_banking_sepa_credit_transfer
3190+#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:125
3191+#, python-format
3192+msgid "Field type error:"
3193+msgstr "Veldsoort fout:"
3194+
3195+#. module: account_banking_sepa_credit_transfer
3196+#: model:ir.model,name:account_banking_sepa_credit_transfer.model_banking_export_sepa
3197+msgid "SEPA export"
3198+msgstr "SEPA export"
3199+
3200+#. module: account_banking_sepa_credit_transfer
3201+#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:351
3202+#, python-format
3203+msgid ""
3204+"Missing Bank Account on invoice '%s' (payment order line reference '%s')."
3205+msgstr ""
3206+"Ontbrekende bankrekening op factuur '%s' (betaalregel referentie '%s')"
3207+
3208+#. module: account_banking_sepa_credit_transfer
3209+#: field:banking.export.sepa,file:0
3210+#: field:banking.export.sepa.wizard,file_id:0
3211+msgid "SEPA XML File"
3212+msgstr "SEPA XML bestand"
3213+
3214+#. module: account_banking_sepa_credit_transfer
3215+#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:131
3216+#, python-format
3217+msgid "The '%s' is empty or 0. It should have a non-null value."
3218+msgstr "De '%s' is leeg of 0. Het mag geen lege of nul waarde hebben."
3219+
3220+#. module: account_banking_sepa_credit_transfer
3221+#: help:banking.export.sepa,charge_bearer:0
3222+msgid ""
3223+"Following service level : transaction charges are to be applied following "
3224+"the rules agreed in the service level and/or scheme (SEPA Core messages must "
3225+"use this). Shared : transaction charges on the creditor side are to be borne "
3226+"by the creditor, transaction charges on the debtor side are to be borne by "
3227+"the debtor. Borne by creditor : all transaction charges are to be borne by "
3228+"the creditor. Borne by debtor : all transaction charges are to be borne by "
3229+"the debtor."
3230+msgstr ""
3231+"Volg service level: Transactie kosten worden toegepast volgens de "
3232+"afgesproken regels in het service level en/of schema (Voor SEPA berichten "
3233+"deze gebruiken). Gedeeld : De transactiekosten aan de crediteur zijde zijn "
3234+"voor de schuldenaar, transactiekosten aan de debiteur kant zijn voor de "
3235+"schuldeiser. Rekening van de schuldenaar: Alle transactie kosten zijn voor "
3236+"rekening van de schuldenaar. Rekening van de schuldeiser: Alle transactie "
3237+"kosten zijn voor rekening van de schuldeiser."
3238+
3239+#. module: account_banking_sepa_credit_transfer
3240+#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:207
3241+#, python-format
3242+msgid ""
3243+"Payment Type Code '%s' is not supported. The only Payment Type Codes "
3244+"supported for SEPA Credit Transfers are 'pain.001.001.02', "
3245+"'pain.001.001.03', 'pain.001.001.04' and 'pain.001.001.05'."
3246+msgstr ""
3247+"Betaal type code '%s' wordt niet ondersteund. De enige betaal type codes "
3248+"voor SEPA credit boekingen zijn 'pain.001.001.02', 'pain.001.001.03' en "
3249+"'pain.001.001.04'."
3250+
3251+#. module: account_banking_sepa_credit_transfer
3252+#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:90
3253+#, python-format
3254+msgid "This IBAN is not valid : %s"
3255+msgstr "Deze IBAN is niet geldig : %s"
3256+
3257+#. module: account_banking_sepa_credit_transfer
3258+#: view:banking.export.sepa:0
3259+#: field:banking.export.sepa,payment_order_ids:0
3260+#: field:banking.export.sepa.wizard,payment_order_ids:0
3261+msgid "Payment Orders"
3262+msgstr "Betaalopdrachten"
3263+
3264+#. module: account_banking_sepa_credit_transfer
3265+#: view:banking.export.sepa:0
3266+msgid "General Information"
3267+msgstr "Algemene informatie"
3268+
3269+#. module: account_banking_sepa_credit_transfer
3270+#: model:ir.actions.act_window,name:account_banking_sepa_credit_transfer.act_banking_export_sepa_payment_order
3271+#: model:ir.actions.act_window,name:account_banking_sepa_credit_transfer.action_account_banking_sepa
3272+#: model:ir.ui.menu,name:account_banking_sepa_credit_transfer.menu_account_banking_sepa
3273+msgid "SEPA Credit Transfer Files"
3274+msgstr "SEPA Credit Transfer bestanden"
3275+
3276+#. module: account_banking_sepa_credit_transfer
3277+#: help:banking.export.sepa,batch_booking:0
3278+#: help:banking.export.sepa.wizard,batch_booking:0
3279+msgid ""
3280+"If true, the bank statement will display only one debit line for all the "
3281+"wire transfers of the SEPA XML file ; if false, the bank statement will "
3282+"display one debit line per wire transfer of the SEPA XML file."
3283+msgstr ""
3284+"Indien aangevinkt zal het bankafschrift maar één debet regel weergeven voor "
3285+"alle overschrijvingen van het SEPA XML bestand. Indien uitgevinkt, zal het "
3286+"bankafschrift een debet regel weergeven per SEPA XML bestand."
3287+
3288+#. module: account_banking_sepa_credit_transfer
3289+#: help:banking.export.sepa.wizard,prefered_exec_date:0
3290+msgid ""
3291+"This is the date on which the file should be processed by the bank. Please "
3292+"keep in mind that banks only execute on working days and typically use a "
3293+"delay of two days between execution date and effective transfer date."
3294+msgstr ""
3295+"Dit is de datum waarop het bestand zou moeten worden verwerkt door de bank. "
3296+"Houdt u er rekening mee dat banken alleen op werkdagen de bestanden "
3297+"verwerken en veelal een vertraging hebben van twee dagen tussen de "
3298+"verwerkingsdatum en de effectieve overschrijfdatum."
3299+
3300+#. module: account_banking_sepa_credit_transfer
3301+#: field:banking.export.sepa.wizard,file:0
3302+msgid "File"
3303+msgstr "Bestand"
3304+
3305+#. module: account_banking_sepa_credit_transfer
3306+#: view:banking.export.sepa.wizard:0
3307+msgid "Cancel"
3308+msgstr "Annuleren"
3309+
3310+#. module: account_banking_sepa_credit_transfer
3311+#: field:banking.export.sepa,create_date:0
3312+msgid "Generation Date"
3313+msgstr "Aangemaakt op"
3314+
3315+#~ msgid "SEPA XML file"
3316+#~ msgstr "SEPA XML bestand"
3317+
3318+#~ msgid "Number of transactions"
3319+#~ msgstr "Aantal transacties"
3320+
3321+#~ msgid ""
3322+#~ "This is the message identification of the entire SEPA XML file. 35 "
3323+#~ "characters max."
3324+#~ msgstr ""
3325+#~ "Dit is een bericht identificatie van het gehele SEPA XML bestand. Maximaal "
3326+#~ "35 karakters."
3327+
3328+#~ msgid "Prefered execution date"
3329+#~ msgstr "Voorkeurs uitvoerdatum"
3330+
3331+#~ msgid "Generation date"
3332+#~ msgstr "Aanmaakdatum"
3333+
3334+#~ msgid "Message identification"
3335+#~ msgstr "Bericht identificatie"
3336+
3337+#~ msgid "Total amount"
3338+#~ msgstr "Totaal bedrag"
3339+
3340+#~ msgid "Borne by creditor"
3341+#~ msgstr "Rekening van schuldeiser"
3342+
3343+#~ msgid "Payment orders"
3344+#~ msgstr "Betaalopdrachten"
3345+
3346+#~ msgid "Generated SEPA Credit Transfer files"
3347+#~ msgstr "Gegenereerde SEPA overschrijfbestanden"
3348+
3349+#~ msgid "SEPA XML file generation"
3350+#~ msgstr "SEPA XML bestand generatie"
3351+
3352+#~ msgid "Reference for further communication"
3353+#~ msgstr "Referentie voor verdere communicatie"
3354+
3355+#~ msgid "Processing details"
3356+#~ msgstr "Verwerkings details"
3357+
3358+#~ msgid "Borne by debtor"
3359+#~ msgstr "Rekening van schuldenaar"
3360+
3361+#~ msgid "Payment order"
3362+#~ msgstr "Betaalopdracht"
3363+
3364+#~ msgid "Following service level"
3365+#~ msgstr "Volg service level"
3366+
3367+#~ msgid "Charge bearer"
3368+#~ msgstr "Kostenverdeling"
3369+
3370+#~ msgid ""
3371+#~ "Shared : transaction charges on the sender side are to be borne by the "
3372+#~ "debtor, transaction charges on the receiver side are to be borne by the "
3373+#~ "creditor (most transfers use this). Borne by creditor : all transaction "
3374+#~ "charges are to be borne by the creditor. Borne by debtor : all transaction "
3375+#~ "charges are to be borne by the debtor. Following service level : transaction "
3376+#~ "charges are to be applied following the rules agreed in the service level "
3377+#~ "and/or scheme."
3378+#~ msgstr ""
3379+#~ "Gedeeld : De transactiekosten aan de verzender kant zijn voor de "
3380+#~ "schuldeiser, transactiekosten aan de ontvanger kant zijn voor de schuldenaar "
3381+#~ "(deze keuze wordt het meest gebruikt). Rekening van de schuldenaar: Alle "
3382+#~ "transactie kosten zijn voor rekening van de schuldenaar. Rekening van de "
3383+#~ "schuldeiser: Alle transactie kosten zijn voor rekening van de schuldeiser. "
3384+#~ "Volg service level: Transactie kosten worden toegepast volgens de "
3385+#~ "afgesporken regels in het service level en/of schema."
3386+
3387+#~ msgid "Batch booking"
3388+#~ msgstr "Batch boeking"
3389+
3390+#~ msgid "Generated SEPA Credit Transfer XML files"
3391+#~ msgstr "Gengenereerde SEPA XML overschrijf bestanden"
3392
3393=== added directory 'account_banking_sepa_credit_transfer/static'
3394=== added directory 'account_banking_sepa_credit_transfer/static/src'
3395=== added directory 'account_banking_sepa_credit_transfer/static/src/img'
3396=== added file 'account_banking_sepa_credit_transfer/static/src/img/icon.png'
3397Binary files account_banking_sepa_credit_transfer/static/src/img/icon.png 1970-01-01 00:00:00 +0000 and account_banking_sepa_credit_transfer/static/src/img/icon.png 2014-03-19 00:47:00 +0000 differ
3398=== modified file 'account_banking_sepa_credit_transfer/wizard/__init__.py'
3399--- account_banking_sepa_credit_transfer/wizard/__init__.py 2013-05-15 20:09:21 +0000
3400+++ account_banking_sepa_credit_transfer/wizard/__init__.py 2014-03-19 00:47:00 +0000
3401@@ -20,4 +20,4 @@
3402 #
3403 ##############################################################################
3404
3405-import export_sepa
3406+from . import export_sepa
3407
3408=== modified file 'account_banking_sepa_credit_transfer/wizard/export_sepa.py'
3409--- account_banking_sepa_credit_transfer/wizard/export_sepa.py 2013-10-14 14:43:35 +0000
3410+++ account_banking_sepa_credit_transfer/wizard/export_sepa.py 2014-03-19 00:47:00 +0000
3411@@ -21,51 +21,58 @@
3412 ##############################################################################
3413
3414
3415-from osv import osv, fields
3416-import base64
3417-from datetime import datetime, timedelta
3418-from tools.translate import _
3419-import tools
3420+from openerp.osv import orm, fields
3421+from openerp.tools.translate import _
3422+from openerp import netsvc
3423 from lxml import etree
3424-import logging
3425-import netsvc
3426-
3427-_logger = logging.getLogger(__name__)
3428-
3429-
3430-class banking_export_sepa_wizard(osv.osv_memory):
3431+
3432+
3433+class banking_export_sepa_wizard(orm.TransientModel):
3434 _name = 'banking.export.sepa.wizard'
3435- _description = 'Export SEPA Credit Transfer XML file'
3436+ _inherit = ['banking.export.pain']
3437+ _description = 'Export SEPA Credit Transfer File'
3438+
3439 _columns = {
3440- 'state': fields.selection([('create', 'Create'), ('finish', 'Finish')],
3441- 'State', readonly=True),
3442- 'msg_identification': fields.char('Message identification', size=35,
3443- # Can't set required=True on the field because it blocks
3444- # the launch of the wizard -> I set it as required in the view
3445- help='This is the message identification of the entire SEPA XML file. 35 characters max.'),
3446- 'batch_booking': fields.boolean('Batch booking',
3447- help="If true, the bank statement will display only one debit line for all the wire transfers of the SEPA XML file ; if false, the bank statement will display one debit line per wire transfer of the SEPA XML file."),
3448- 'prefered_exec_date': fields.date('Prefered execution date',
3449- help='This is the date on which the file should be processed by the bank. Please keep in mind that banks only execute on working days and typically use a delay of two days between execution date and effective transfer date.'),
3450+ 'state': fields.selection([
3451+ ('create', 'Create'),
3452+ ('finish', 'Finish'),
3453+ ], 'State', readonly=True),
3454+ 'batch_booking': fields.boolean(
3455+ 'Batch Booking',
3456+ help="If true, the bank statement will display only one debit "
3457+ "line for all the wire transfers of the SEPA XML file ; if "
3458+ "false, the bank statement will display one debit line per wire "
3459+ "transfer of the SEPA XML file."),
3460 'charge_bearer': fields.selection([
3461+ ('SLEV', 'Following Service Level'),
3462 ('SHAR', 'Shared'),
3463- ('CRED', 'Borne by creditor'),
3464- ('DEBT', 'Borne by debtor'),
3465- ('SLEV', 'Following service level'),
3466- ], 'Charge bearer', required=True,
3467- help='Shared : transaction charges on the sender side are to be borne by the debtor, transaction charges on the receiver side are to be borne by the creditor (most transfers use this). 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. Following service level : transaction charges are to be applied following the rules agreed in the service level and/or scheme.'),
3468- 'nb_transactions': fields.related('file_id', 'nb_transactions',
3469- type='integer', string='Number of transactions', readonly=True),
3470- 'total_amount': fields.related('file_id', 'total_amount', type='float',
3471- string='Total amount', readonly=True),
3472- 'file_id': fields.many2one('banking.export.sepa', 'SEPA XML file', readonly=True),
3473- 'file': fields.related('file_id', 'file', string="File", type='binary',
3474+ ('CRED', 'Borne by Creditor'),
3475+ ('DEBT', 'Borne by Debtor'),
3476+ ], 'Charge Bearer', required=True,
3477+ help="Following service level : transaction charges are to be "
3478+ "applied following the rules agreed in the service level and/or "
3479+ "scheme (SEPA Core messages must use this). Shared : transaction "
3480+ "charges on the debtor side are to be borne by the debtor, "
3481+ "transaction charges on the creditor side are to be borne by "
3482+ "the creditor. Borne by creditor : all transaction charges are "
3483+ "to be borne by the creditor. Borne by debtor : all transaction "
3484+ "charges are to be borne by the debtor."),
3485+ 'nb_transactions': fields.related(
3486+ 'file_id', 'nb_transactions', type='integer',
3487+ string='Number of Transactions', readonly=True),
3488+ 'total_amount': fields.related(
3489+ 'file_id', 'total_amount', type='float', string='Total Amount',
3490 readonly=True),
3491- 'filename': fields.related('file_id', 'filename', string="Filename",
3492- type='char', size=256, readonly=True),
3493- 'payment_order_ids': fields.many2many('payment.order',
3494- 'wiz_sepa_payorders_rel', 'wizard_id', 'payment_order_id',
3495- 'Payment orders', readonly=True),
3496+ 'file_id': fields.many2one(
3497+ 'banking.export.sepa', 'SEPA XML File', readonly=True),
3498+ 'file': fields.related(
3499+ 'file_id', 'file', string="File", type='binary', readonly=True),
3500+ 'filename': fields.related(
3501+ 'file_id', 'filename', string="Filename", type='char',
3502+ size=256, readonly=True),
3503+ 'payment_order_ids': fields.many2many(
3504+ 'payment.order', 'wiz_sepa_payorders_rel', 'wizard_id',
3505+ 'payment_order_id', 'Payment Orders', readonly=True),
3506 }
3507
3508 _defaults = {
3509@@ -73,46 +80,24 @@
3510 'state': 'create',
3511 }
3512
3513-
3514- def _limit_size(self, cr, uid, field, max_size, context=None):
3515- '''Limit size of strings to respect the PAIN standard'''
3516- max_size = int(max_size)
3517- return field[0:max_size]
3518-
3519-
3520- def _validate_iban(self, cr, uid, iban, context=None):
3521- '''if IBAN is valid, returns IBAN
3522- if IBAN is NOT valid, raises an error message'''
3523- partner_bank_obj = self.pool.get('res.partner.bank')
3524- if partner_bank_obj.is_iban_valid(cr, uid, iban, context=context):
3525- return iban.replace(' ', '')
3526- else:
3527- raise osv.except_osv(_('Error :'), _("This IBAN is not valid : %s") % iban)
3528-
3529 def create(self, cr, uid, vals, context=None):
3530 payment_order_ids = context.get('active_ids', [])
3531 vals.update({
3532 'payment_order_ids': [[6, 0, payment_order_ids]],
3533 })
3534- return super(banking_export_sepa_wizard, self).create(cr, uid,
3535- vals, context=context)
3536-
3537+ return super(banking_export_sepa_wizard, self).create(
3538+ cr, uid, vals, context=context)
3539
3540 def create_sepa(self, cr, uid, ids, context=None):
3541 '''
3542 Creates the SEPA Credit Transfer file. That's the important code !
3543 '''
3544- payment_order_obj = self.pool.get('payment.order')
3545-
3546+ if context is None:
3547+ context = {}
3548 sepa_export = self.browse(cr, uid, ids[0], context=context)
3549-
3550- my_company_name = sepa_export.payment_order_ids[0].mode.bank_id.partner_id.name
3551- my_company_iban = self._validate_iban(cr, uid, sepa_export.payment_order_ids[0].mode.bank_id.acc_number, context=context)
3552- my_company_bic = sepa_export.payment_order_ids[0].mode.bank_id.bank.bic
3553- #my_company_country_code = sepa_export.payment_order_ids[0].mode.bank_id.partner_id.address[0].country_id.code
3554- #my_company_city = sepa_export.payment_order_ids[0].mode.bank_id.partner_id.address[0].city
3555- #my_company_street1 = sepa_export.payment_order_ids[0].mode.bank_id.partner_id.address[0].street
3556 pain_flavor = sepa_export.payment_order_ids[0].mode.type.code
3557+ convert_to_ascii = \
3558+ sepa_export.payment_order_ids[0].mode.convert_to_ascii
3559 if pain_flavor == 'pain.001.001.02':
3560 bic_xml_tag = 'BIC'
3561 name_maxsize = 70
3562@@ -121,226 +106,193 @@
3563 bic_xml_tag = 'BIC'
3564 # size 70 -> 140 for <Nm> with pain.001.001.03
3565 # BUT the European Payment Council, in the document
3566- # "SEPA Credit Transfer Scheme Customer-to-bank Implementation guidelines" v6.0
3567- # available on http://www.europeanpaymentscouncil.eu/knowledge_bank.cfm
3568+ # "SEPA Credit Transfer Scheme Customer-to-bank
3569+ # Implementation guidelines" v6.0 available on
3570+ # http://www.europeanpaymentscouncil.eu/knowledge_bank.cfm
3571 # says that 'Nm' should be limited to 70
3572- # so we follow the "European Payment Council" and we put 70 and not 140
3573+ # so we follow the "European Payment Council"
3574+ # and we put 70 and not 140
3575 name_maxsize = 70
3576 root_xml_tag = 'CstmrCdtTrfInitn'
3577 elif pain_flavor == 'pain.001.001.04':
3578 bic_xml_tag = 'BICFI'
3579 name_maxsize = 140
3580 root_xml_tag = 'CstmrCdtTrfInitn'
3581- else:
3582- raise osv.except_osv(_('Error :'), _("Payment Type Code '%s' is not supported. The only Payment Type Codes supported for SEPA Credit Transfers are 'pain.001.001.02', 'pain.001.001.03' and 'pain.001.001.04'.") % pain_flavor)
3583- if sepa_export.batch_booking:
3584- my_batch_booking = 'true'
3585- else:
3586- my_batch_booking = 'false'
3587- my_msg_identification = sepa_export.msg_identification
3588- if sepa_export.prefered_exec_date:
3589- my_requested_exec_date = sepa_export.prefered_exec_date
3590- else:
3591- my_requested_exec_date = datetime.strftime(datetime.today() + timedelta(days=1), '%Y-%m-%d')
3592+ elif pain_flavor == 'pain.001.001.05':
3593+ bic_xml_tag = 'BICFI'
3594+ name_maxsize = 140
3595+ root_xml_tag = 'CstmrCdtTrfInitn'
3596+
3597+ else:
3598+ raise orm.except_orm(
3599+ _('Error:'),
3600+ _("Payment Type Code '%s' is not supported. The only "
3601+ "Payment Type Codes supported for SEPA Credit Transfers "
3602+ "are 'pain.001.001.02', 'pain.001.001.03', "
3603+ "'pain.001.001.04' and 'pain.001.001.05'.")
3604+ % pain_flavor)
3605+
3606+ gen_args = {
3607+ 'bic_xml_tag': bic_xml_tag,
3608+ 'name_maxsize': name_maxsize,
3609+ 'convert_to_ascii': convert_to_ascii,
3610+ 'pain_flavor': pain_flavor,
3611+ 'sepa_export': sepa_export,
3612+ 'file_obj': self.pool['banking.export.sepa'],
3613+ 'pain_xsd_file':
3614+ 'account_banking_sepa_credit_transfer/data/%s.xsd'
3615+ % pain_flavor,
3616+ }
3617
3618 pain_ns = {
3619 'xsi': 'http://www.w3.org/2001/XMLSchema-instance',
3620 None: 'urn:iso:std:iso:20022:tech:xsd:%s' % pain_flavor,
3621 }
3622
3623- root = etree.Element('Document', nsmap=pain_ns)
3624- pain_root = etree.SubElement(root, root_xml_tag)
3625+ xml_root = etree.Element('Document', nsmap=pain_ns)
3626+ pain_root = etree.SubElement(xml_root, root_xml_tag)
3627+ pain_03_to_05 = \
3628+ ['pain.001.001.03', 'pain.001.001.04', 'pain.001.001.05']
3629+
3630 # A. Group header
3631- group_header = etree.SubElement(pain_root, 'GrpHdr')
3632- message_identification = etree.SubElement(group_header, 'MsgId')
3633- message_identification.text = self._limit_size(cr, uid, my_msg_identification, 35, context=context)
3634- creation_date_time = etree.SubElement(group_header, 'CreDtTm')
3635- creation_date_time.text = datetime.strftime(datetime.today(), '%Y-%m-%dT%H:%M:%S')
3636- if pain_flavor == 'pain.001.001.02':
3637- # batch_booking is in "Group header" with pain.001.001.02
3638- # and in "Payment info" in pain.001.001.03/04
3639- batch_booking = etree.SubElement(group_header, 'BtchBookg')
3640- batch_booking.text = my_batch_booking
3641- nb_of_transactions_grphdr = etree.SubElement(group_header, 'NbOfTxs')
3642- control_sum_grphdr = etree.SubElement(group_header, 'CtrlSum')
3643- # Grpg removed in pain.001.001.03
3644- if pain_flavor == 'pain.001.001.02':
3645- grouping = etree.SubElement(group_header, 'Grpg')
3646- grouping.text = 'GRPD'
3647- initiating_party = etree.SubElement(group_header, 'InitgPty')
3648- initiating_party_name = etree.SubElement(initiating_party, 'Nm')
3649- initiating_party_name.text = self._limit_size(cr, uid, my_company_name, name_maxsize, context=context)
3650- # B. Payment info
3651- payment_info = etree.SubElement(pain_root, 'PmtInf')
3652- payment_info_identification = etree.SubElement(payment_info, 'PmtInfId')
3653- payment_info_identification.text = self._limit_size(cr, uid, my_msg_identification, 35, context=context)
3654- payment_method = etree.SubElement(payment_info, 'PmtMtd')
3655- payment_method.text = 'TRF'
3656- if pain_flavor in ['pain.001.001.03', 'pain.001.001.04']:
3657- # batch_booking is in "Group header" with pain.001.001.02
3658- # and in "Payment info" in pain.001.001.03/04
3659- batch_booking = etree.SubElement(payment_info, 'BtchBookg')
3660- batch_booking.text = my_batch_booking
3661- # It may seem surprising, but the
3662- # "SEPA Credit Transfer Scheme Customer-to-bank Implementation guidelines"
3663- # v6.0 says that control sum and nb_of_transactions should be present
3664- # at both "group header" level and "payment info" level
3665- # This seems to be confirmed by the tests carried out at
3666- # BNP Paribas in PAIN v001.001.03
3667- if pain_flavor in ['pain.001.001.03', 'pain.001.001.04']:
3668- nb_of_transactions_pmtinf = etree.SubElement(payment_info, 'NbOfTxs')
3669- control_sum_pmtinf = etree.SubElement(payment_info, 'CtrlSum')
3670- payment_type_info = etree.SubElement(payment_info, 'PmtTpInf')
3671- service_level = etree.SubElement(payment_type_info, 'SvcLvl')
3672- service_level_code = etree.SubElement(service_level, 'Cd')
3673- service_level_code.text = 'SEPA'
3674- requested_exec_date = etree.SubElement(payment_info, 'ReqdExctnDt')
3675- requested_exec_date.text = my_requested_exec_date
3676- debtor = etree.SubElement(payment_info, 'Dbtr')
3677- debtor_name = etree.SubElement(debtor, 'Nm')
3678- debtor_name.text = self._limit_size(cr, uid, my_company_name, name_maxsize, context=context)
3679-# debtor_address = etree.SubElement(debtor, 'PstlAdr')
3680-# debtor_street = etree.SubElement(debtor_address, 'AdrLine')
3681-# debtor_street.text = my_company_street1
3682-# debtor_city = etree.SubElement(debtor_address, 'AdrLine')
3683-# debtor_city.text = my_company_city
3684-# debtor_country = etree.SubElement(debtor_address, 'Ctry')
3685-# debtor_country.text = my_company_country_code
3686- debtor_account = etree.SubElement(payment_info, 'DbtrAcct')
3687- debtor_account_id = etree.SubElement(debtor_account, 'Id')
3688- debtor_account_iban = etree.SubElement(debtor_account_id, 'IBAN')
3689- debtor_account_iban.text = my_company_iban
3690- debtor_agent = etree.SubElement(payment_info, 'DbtrAgt')
3691- debtor_agent_institution = etree.SubElement(debtor_agent, 'FinInstnId')
3692- if my_company_bic:
3693- debtor_agent_bic = etree.SubElement(debtor_agent_institution, bic_xml_tag)
3694- debtor_agent_bic.text = my_company_bic
3695- charge_bearer = etree.SubElement(payment_info, 'ChrgBr')
3696- charge_bearer.text = sepa_export.charge_bearer
3697+ group_header_1_0, nb_of_transactions_1_6, control_sum_1_7 = \
3698+ self.generate_group_header_block(
3699+ cr, uid, pain_root, gen_args, context=context)
3700
3701- transactions_count = 0
3702+ transactions_count_1_6 = 0
3703 total_amount = 0.0
3704- amount_control_sum = 0.0
3705- # Iterate on payment orders
3706+ amount_control_sum_1_7 = 0.0
3707+ lines_per_group = {}
3708+ # key = (requested_date, priority)
3709+ # values = list of lines as object
3710+ today = fields.date.context_today(self, cr, uid, context=context)
3711 for payment_order in sepa_export.payment_order_ids:
3712 total_amount = total_amount + payment_order.total
3713- # Iterate each payment lines
3714 for line in payment_order.line_ids:
3715- transactions_count += 1
3716+ priority = line.priority
3717+ if payment_order.date_prefered == 'due':
3718+ requested_date = line.ml_maturity_date or today
3719+ elif payment_order.date_prefered == 'fixed':
3720+ requested_date = payment_order.date_scheduled or today
3721+ else:
3722+ requested_date = today
3723+ key = (requested_date, priority)
3724+ if key in lines_per_group:
3725+ lines_per_group[key].append(line)
3726+ else:
3727+ lines_per_group[key] = [line]
3728+ # Write requested_date on 'Payment date' of the pay line
3729+ if requested_date != line.date:
3730+ self.pool['payment.line'].write(
3731+ cr, uid, line.id,
3732+ {'date': requested_date}, context=context)
3733+
3734+ for (requested_date, priority), lines in lines_per_group.items():
3735+ # B. Payment info
3736+ payment_info_2_0, nb_of_transactions_2_4, control_sum_2_5 = \
3737+ self.generate_start_payment_info_block(
3738+ cr, uid, pain_root,
3739+ "sepa_export.payment_order_ids[0].reference + '-' "
3740+ "+ requested_date.replace('-', '') + '-' + priority",
3741+ priority, False, False, requested_date, {
3742+ 'sepa_export': sepa_export,
3743+ 'priority': priority,
3744+ 'requested_date': requested_date,
3745+ }, gen_args, context=context)
3746+
3747+ self.generate_party_block(
3748+ cr, uid, payment_info_2_0, 'Dbtr', 'B',
3749+ 'sepa_export.payment_order_ids[0].mode.bank_id.partner_id.'
3750+ 'name',
3751+ 'sepa_export.payment_order_ids[0].mode.bank_id.acc_number',
3752+ 'sepa_export.payment_order_ids[0].mode.bank_id.bank.bic',
3753+ {'sepa_export': sepa_export},
3754+ gen_args, context=context)
3755+
3756+ charge_bearer_2_24 = etree.SubElement(payment_info_2_0, 'ChrgBr')
3757+ charge_bearer_2_24.text = sepa_export.charge_bearer
3758+
3759+ transactions_count_2_4 = 0
3760+ amount_control_sum_2_5 = 0.0
3761+ for line in lines:
3762+ transactions_count_1_6 += 1
3763+ transactions_count_2_4 += 1
3764 # C. Credit Transfer Transaction Info
3765- credit_transfer_transaction_info = etree.SubElement(payment_info, 'CdtTrfTxInf')
3766- payment_identification = etree.SubElement(credit_transfer_transaction_info, 'PmtId')
3767- instruction_identification = etree.SubElement(payment_identification, 'InstrId')
3768- instruction_identification.text = self._limit_size(cr, uid, line.communication, 35, context=context) #otherwise, we can reach the invoice fields via ml_inv_ref
3769- end2end_identification = etree.SubElement(payment_identification, 'EndToEndId')
3770- end2end_identification.text = self._limit_size(cr, uid, line.communication, 35, context=context)
3771- amount = etree.SubElement(credit_transfer_transaction_info, 'Amt')
3772- instructed_amount = etree.SubElement(amount, 'InstdAmt', Ccy=line.currency.name)
3773- instructed_amount.text = '%.2f' % line.amount_currency
3774- amount_control_sum += line.amount_currency
3775- creditor_agent = etree.SubElement(credit_transfer_transaction_info, 'CdtrAgt')
3776- creditor_agent_institution = etree.SubElement(creditor_agent, 'FinInstnId')
3777+ credit_transfer_transaction_info_2_27 = etree.SubElement(
3778+ payment_info_2_0, 'CdtTrfTxInf')
3779+ payment_identification_2_28 = etree.SubElement(
3780+ credit_transfer_transaction_info_2_27, 'PmtId')
3781+ end2end_identification_2_30 = etree.SubElement(
3782+ payment_identification_2_28, 'EndToEndId')
3783+ end2end_identification_2_30.text = self._prepare_field(
3784+ cr, uid, 'End to End Identification', 'line.name',
3785+ {'line': line}, 35, gen_args=gen_args,
3786+ context=context)
3787+ currency_name = self._prepare_field(
3788+ cr, uid, 'Currency Code', 'line.currency.name',
3789+ {'line': line}, 3, gen_args=gen_args,
3790+ context=context)
3791+ amount_2_42 = etree.SubElement(
3792+ credit_transfer_transaction_info_2_27, 'Amt')
3793+ instructed_amount_2_43 = etree.SubElement(
3794+ amount_2_42, 'InstdAmt', Ccy=currency_name)
3795+ instructed_amount_2_43.text = '%.2f' % line.amount_currency
3796+ amount_control_sum_1_7 += line.amount_currency
3797+ amount_control_sum_2_5 += line.amount_currency
3798+
3799 if not line.bank_id:
3800- raise osv.except_osv(_('Error :'), _("Missing Bank Account on invoice '%s' (payment order line reference '%s').") %(line.ml_inv_ref.number, line.name))
3801- if line.bank_id.bank.bic:
3802- creditor_agent_bic = etree.SubElement(creditor_agent_institution, bic_xml_tag)
3803- creditor_agent_bic.text = line.bank_id.bank.bic
3804- creditor = etree.SubElement(credit_transfer_transaction_info, 'Cdtr')
3805- creditor_name = etree.SubElement(creditor, 'Nm')
3806- creditor_name.text = self._limit_size(cr, uid, line.partner_id.name, name_maxsize, context=context)
3807-# I don't think they want it
3808-# If they want it, we need to implement full spec p26 appendix
3809-# creditor_address = etree.SubElement(creditor, 'PstlAdr')
3810-# creditor_street = etree.SubElement(creditor_address, 'AdrLine')
3811-# creditor_street.text = line.partner_id.address[0].street
3812-# creditor_city = etree.SubElement(creditor_address, 'AdrLine')
3813-# creditor_city.text = line.partner_id.address[0].city
3814-# creditor_country = etree.SubElement(creditor_address, 'Ctry')
3815-# creditor_country.text = line.partner_id.address[0].country_id.code
3816- creditor_account = etree.SubElement(credit_transfer_transaction_info, 'CdtrAcct')
3817- creditor_account_id = etree.SubElement(creditor_account, 'Id')
3818- creditor_account_iban = etree.SubElement(creditor_account_id, 'IBAN')
3819- creditor_account_iban.text = self._validate_iban(cr, uid, line.bank_id.acc_number, context=context)
3820- remittance_info = etree.SubElement(credit_transfer_transaction_info, 'RmtInf')
3821- # switch to Structured (Strdr) ? If we do it, beware that the format is not the same between pain 02 and pain 03
3822- remittance_info_unstructured = etree.SubElement(remittance_info, 'Ustrd')
3823- remittance_info_unstructured.text = self._limit_size(cr, uid, line.communication, 140, context=context)
3824-
3825- if pain_flavor in ['pain.001.001.03', 'pain.001.001.04']:
3826- nb_of_transactions_grphdr.text = nb_of_transactions_pmtinf.text = str(transactions_count)
3827- control_sum_grphdr.text = control_sum_pmtinf.text = '%.2f' % amount_control_sum
3828+ raise orm.except_orm(
3829+ _('Error:'),
3830+ _("Missing Bank Account on invoice '%s' (payment "
3831+ "order line reference '%s').")
3832+ % (line.ml_inv_ref.number, line.name))
3833+ self.generate_party_block(
3834+ cr, uid, credit_transfer_transaction_info_2_27, 'Cdtr',
3835+ 'C', 'line.partner_id.name', 'line.bank_id.acc_number',
3836+ 'line.bank_id.bank.bic', {'line': line}, gen_args,
3837+ context=context)
3838+
3839+ self.generate_remittance_info_block(
3840+ cr, uid, credit_transfer_transaction_info_2_27,
3841+ line, gen_args, context=context)
3842+
3843+ if pain_flavor in pain_03_to_05:
3844+ nb_of_transactions_2_4.text = str(transactions_count_2_4)
3845+ control_sum_2_5.text = '%.2f' % amount_control_sum_2_5
3846+
3847+ if pain_flavor in pain_03_to_05:
3848+ nb_of_transactions_1_6.text = str(transactions_count_1_6)
3849+ control_sum_1_7.text = '%.2f' % amount_control_sum_1_7
3850 else:
3851- nb_of_transactions_grphdr.text = str(transactions_count)
3852- control_sum_grphdr.text = '%.2f' % amount_control_sum
3853-
3854-
3855- xml_string = etree.tostring(root, pretty_print=True, encoding='UTF-8', xml_declaration=True)
3856- _logger.debug("Generated SEPA XML file below")
3857- _logger.debug(xml_string)
3858- official_pain_schema = etree.XMLSchema(etree.parse(tools.file_open('account_banking_sepa_credit_transfer/data/%s.xsd' % pain_flavor)))
3859-
3860- try:
3861- root_to_validate = etree.fromstring(xml_string)
3862- official_pain_schema.assertValid(root_to_validate)
3863- except Exception, e:
3864- _logger.warning("The XML file is invalid against the XML Schema Definition")
3865- _logger.warning(xml_string)
3866- _logger.warning(e)
3867- raise osv.except_osv(_('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))
3868-
3869- # CREATE the banking.export.sepa record
3870- file_id = self.pool.get('banking.export.sepa').create(cr, uid,
3871- {
3872- 'msg_identification': my_msg_identification,
3873- 'batch_booking': sepa_export.batch_booking,
3874- 'charge_bearer': sepa_export.charge_bearer,
3875- 'prefered_exec_date': sepa_export.prefered_exec_date,
3876- 'total_amount': total_amount,
3877- 'nb_transactions': transactions_count,
3878- 'file': base64.encodestring(xml_string),
3879- 'payment_order_ids': [
3880- (6, 0, [x.id for x in sepa_export.payment_order_ids])
3881- ],
3882- }, context=context)
3883-
3884- self.write(cr, uid, ids, {
3885- 'file_id': file_id,
3886- 'state': 'finish',
3887- }, context=context)
3888-
3889- action = {
3890- 'name': 'SEPA XML',
3891- 'type': 'ir.actions.act_window',
3892- 'view_type': 'form',
3893- 'view_mode': 'form,tree',
3894- 'res_model': self._name,
3895- 'res_id': ids[0],
3896- 'target': 'new',
3897- }
3898- return action
3899-
3900+ nb_of_transactions_1_6.text = str(transactions_count_1_6)
3901+ control_sum_1_7.text = '%.2f' % amount_control_sum_1_7
3902+
3903+ return self.finalize_sepa_file_creation(
3904+ cr, uid, ids, xml_root, total_amount, transactions_count_1_6,
3905+ gen_args, context=context)
3906
3907 def cancel_sepa(self, cr, uid, ids, context=None):
3908 '''
3909- Cancel the SEPA PAIN: just drop the file
3910+ Cancel the SEPA file: just drop the file
3911 '''
3912 sepa_export = self.browse(cr, uid, ids[0], context=context)
3913- self.pool.get('banking.export.sepa').unlink(cr, uid, sepa_export.file_id.id, context=context)
3914+ self.pool.get('banking.export.sepa').unlink(
3915+ cr, uid, sepa_export.file_id.id, context=context)
3916 return {'type': 'ir.actions.act_window_close'}
3917
3918-
3919 def save_sepa(self, cr, uid, ids, context=None):
3920 '''
3921- Save the SEPA PAIN: mark all payments in the file as 'sent'.
3922+ Save the SEPA file: send the done signal to all payment
3923+ orders in the file. With the default workflow, they will
3924+ transition to 'done', while with the advanced workflow in
3925+ account_banking_payment they will transition to 'sent' waiting
3926+ reconciliation.
3927 '''
3928 sepa_export = self.browse(cr, uid, ids[0], context=context)
3929- sepa_file = self.pool.get('banking.export.sepa').write(cr, uid,
3930- sepa_export.file_id.id, {'state': 'sent'}, context=context)
3931+ self.pool.get('banking.export.sepa').write(
3932+ cr, uid, sepa_export.file_id.id, {'state': 'sent'},
3933+ context=context)
3934 wf_service = netsvc.LocalService('workflow')
3935 for order in sepa_export.payment_order_ids:
3936 wf_service.trg_validate(uid, 'payment.order', order.id, 'sent', cr)
3937 return {'type': 'ir.actions.act_window_close'}
3938-
3939-
3940-banking_export_sepa_wizard()
3941-
3942
3943=== modified file 'account_banking_sepa_credit_transfer/wizard/export_sepa_view.xml'
3944--- account_banking_sepa_credit_transfer/wizard/export_sepa_view.xml 2013-05-23 13:11:42 +0000
3945+++ account_banking_sepa_credit_transfer/wizard/export_sepa_view.xml 2014-03-19 00:47:00 +0000
3946@@ -1,6 +1,6 @@
3947 <?xml version="1.0" encoding="utf-8"?>
3948 <!--
3949- Copyright (C) 2010-2012 Akretion (http://www.akretion.com)
3950+ Copyright (C) 2010-2013 Akretion (http://www.akretion.com)
3951 @author: Alexis de Lattre <alexis.delattre@akretion.com>
3952 The licence is in the file __openerp__.py
3953 -->
3954@@ -12,33 +12,21 @@
3955 <field name="model">banking.export.sepa.wizard</field>
3956 <field name="type">form</field>
3957 <field name="arch" type="xml">
3958- <form string="SEPA XML file generation">
3959+ <form string="SEPA File Generation">
3960 <field name="state" invisible="True"/>
3961- <group states="create">
3962- <separator colspan="4" string="Processing details" />
3963+ <group states="create" col="2" colspan="2">
3964 <field name="batch_booking" />
3965- <field name="prefered_exec_date" />
3966 <field name="charge_bearer" />
3967- <separator colspan="4" string="Reference for further communication" />
3968- <field name="msg_identification" required="True" />
3969- <newline />
3970- <button icon="gtk-close" special="cancel" string="Cancel" colspan="2"/>
3971- <button icon="gtk-ok" string="Generate" name="create_sepa" type="object" colspan="2"/>
3972+ <button icon="gtk-close" string="Cancel" special="cancel"/>
3973+ <button icon="gtk-ok" string="Generate" name="create_sepa" type="object"/>
3974 </group>
3975- <group states="finish">
3976+ <group states="finish" col="2" colspan="2">
3977 <field name="total_amount" />
3978- <!-- Don't display this field, to avoid this bug :
3979- https://bugs.launchpad.net/openobject-client-web/+bug/718989
3980- Bug desc : in the Gtk client, you have to clic twice on the
3981- "Create" button.
3982- <field name="nb_transactions" /> -->
3983- <newline />
3984- <field name="file_id" />
3985+ <field name="nb_transactions" />
3986 <field name="file" filename="filename" />
3987 <field name="filename" invisible="True"/>
3988- <newline />
3989- <button icon="gtk-cancel" string="Cancel" name="cancel_sepa" type="object" colspan="2"/>
3990- <button icon="gtk-ok" string="Validate" name="save_sepa" type="object" colspan="2"/>
3991+ <button icon="gtk-cancel" string="Cancel" name="cancel_sepa" type="object"/>
3992+ <button icon="gtk-ok" string="Validate" name="save_sepa" type="object"/>
3993 </group>
3994 </form>
3995 </field>
3996
3997=== added directory 'account_banking_sepa_direct_debit'
3998=== added file 'account_banking_sepa_direct_debit/__init__.py'
3999--- account_banking_sepa_direct_debit/__init__.py 1970-01-01 00:00:00 +0000
4000+++ account_banking_sepa_direct_debit/__init__.py 2014-03-19 00:47:00 +0000
4001@@ -0,0 +1,25 @@
4002+# -*- encoding: utf-8 -*-
4003+##############################################################################
4004+#
4005+# SEPA Direct Debit module for OpenERP
4006+# Copyright (C) 2013 Akretion (http://www.akretion.com)
4007+# @author: Alexis de Lattre <alexis.delattre@akretion.com>
4008+#
4009+# This program is free software: you can redistribute it and/or modify
4010+# it under the terms of the GNU Affero General Public License as
4011+# published by the Free Software Foundation, either version 3 of the
4012+# License, or (at your option) any later version.
4013+#
4014+# This program is distributed in the hope that it will be useful,
4015+# but WITHOUT ANY WARRANTY; without even the implied warranty of
4016+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4017+# GNU Affero General Public License for more details.
4018+#
4019+# You should have received a copy of the GNU Affero General Public License
4020+# along with this program. If not, see <http://www.gnu.org/licenses/>.
4021+#
4022+##############################################################################
4023+
4024+from . import company
4025+from . import wizard
4026+from . import account_banking_sdd
4027
4028=== added file 'account_banking_sepa_direct_debit/__openerp__.py'
4029--- account_banking_sepa_direct_debit/__openerp__.py 1970-01-01 00:00:00 +0000
4030+++ account_banking_sepa_direct_debit/__openerp__.py 2014-03-19 00:47:00 +0000
4031@@ -0,0 +1,61 @@
4032+##############################################################################
4033+#
4034+# SEPA Direct Debit module for OpenERP
4035+# Copyright (C) 2013 Akretion (http://www.akretion.com)
4036+# @author: Alexis de Lattre <alexis.delattre@akretion.com>
4037+#
4038+# This program is free software: you can redistribute it and/or modify
4039+# it under the terms of the GNU Affero General Public License as
4040+# published by the Free Software Foundation, either version 3 of the
4041+# License, or (at your option) any later version.
4042+#
4043+# This program is distributed in the hope that it will be useful,
4044+# but WITHOUT ANY WARRANTY; without even the implied warranty of
4045+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4046+# GNU Affero General Public License for more details.
4047+#
4048+# You should have received a copy of the GNU Affero General Public License
4049+# along with this program. If not, see <http://www.gnu.org/licenses/>.
4050+#
4051+##############################################################################
4052+{
4053+ 'name': 'Account Banking SEPA Direct Debit',
4054+ 'summary': 'Create SEPA files for Direct Debit',
4055+ 'version': '0.1',
4056+ 'license': 'AGPL-3',
4057+ 'author': 'Akretion',
4058+ 'website': 'http://www.akretion.com',
4059+ 'category': 'Banking addons',
4060+ 'depends': ['account_direct_debit', 'account_banking_pain_base'],
4061+ 'external_dependencies': {
4062+ 'python': ['unidecode', 'lxml'],
4063+ },
4064+ 'data': [
4065+ 'security/original_mandate_required_security.xml',
4066+ 'account_banking_sdd_view.xml',
4067+ 'sdd_mandate_view.xml',
4068+ 'res_partner_bank_view.xml',
4069+ 'account_payment_view.xml',
4070+ 'company_view.xml',
4071+ 'mandate_expire_cron.xml',
4072+ 'account_invoice_view.xml',
4073+ 'wizard/export_sdd_view.xml',
4074+ 'data/payment_type_sdd.xml',
4075+ 'data/mandate_reference_sequence.xml',
4076+ 'security/ir.model.access.csv',
4077+ ],
4078+ 'description': '''
4079+Module to export direct debit payment orders in SEPA XML file format.
4080+
4081+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.
4082+
4083+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.
4084+
4085+This module uses the framework provided by the banking addons, cf https://launchpad.net/banking-addons
4086+
4087+Please contact Alexis de Lattre from Akretion <alexis.delattre@akretion.com> for any help or question about this module.
4088+ ''',
4089+ 'active': False,
4090+ 'installable': True,
4091+ 'application': True,
4092+}
4093
4094=== added file 'account_banking_sepa_direct_debit/account_banking_sdd.py'
4095--- account_banking_sepa_direct_debit/account_banking_sdd.py 1970-01-01 00:00:00 +0000
4096+++ account_banking_sepa_direct_debit/account_banking_sdd.py 2014-03-19 00:47:00 +0000
4097@@ -0,0 +1,396 @@
4098+##############################################################################
4099+#
4100+# SEPA Direct Debit module for OpenERP
4101+# Copyright (C) 2013 Akretion (http://www.akretion.com)
4102+# @author: Alexis de Lattre <alexis.delattre@akretion.com>
4103+#
4104+# This program is free software: you can redistribute it and/or modify
4105+# it under the terms of the GNU Affero General Public License as
4106+# published by the Free Software Foundation, either version 3 of the
4107+# License, or (at your option) any later version.
4108+#
4109+# This program is distributed in the hope that it will be useful,
4110+# but WITHOUT ANY WARRANTY; without even the implied warranty of
4111+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4112+# GNU Affero General Public License for more details.
4113+#
4114+# You should have received a copy of the GNU Affero General Public License
4115+# along with this program. If not, see <http://www.gnu.org/licenses/>.
4116+#
4117+##############################################################################
4118+
4119+from openerp.osv import orm, fields
4120+from openerp.tools.translate import _
4121+import decimal_precision as dp
4122+from unidecode import unidecode
4123+from datetime import datetime
4124+from dateutil.relativedelta import relativedelta
4125+import logging
4126+
4127+NUMBER_OF_UNUSED_MONTHS_BEFORE_EXPIRY = 36
4128+
4129+logger = logging.getLogger(__name__)
4130+
4131+
4132+class banking_export_sdd(orm.Model):
4133+ '''SEPA Direct Debit export'''
4134+ _name = 'banking.export.sdd'
4135+ _description = __doc__
4136+ _rec_name = 'filename'
4137+
4138+ def _generate_filename(self, cr, uid, ids, name, arg, context=None):
4139+ res = {}
4140+ for sepa_file in self.browse(cr, uid, ids, context=context):
4141+ ref = sepa_file.payment_order_ids[0].reference
4142+ if ref:
4143+ label = unidecode(ref.replace('/', '-'))
4144+ else:
4145+ label = 'error'
4146+ res[sepa_file.id] = 'sdd_%s.xml' % label
4147+ return res
4148+
4149+ _columns = {
4150+ 'payment_order_ids': fields.many2many(
4151+ 'payment.order',
4152+ 'account_payment_order_sdd_rel',
4153+ 'banking_export_sepa_id', 'account_order_id',
4154+ 'Payment Orders',
4155+ readonly=True),
4156+ 'nb_transactions': fields.integer(
4157+ 'Number of Transactions', readonly=True),
4158+ 'total_amount': fields.float(
4159+ 'Total Amount', digits_compute=dp.get_precision('Account'),
4160+ readonly=True),
4161+ 'batch_booking': fields.boolean(
4162+ 'Batch Booking', readonly=True,
4163+ help="If true, the bank statement will display only one credit "
4164+ "line for all the direct debits of the SEPA file ; if false, "
4165+ "the bank statement will display one credit line per direct "
4166+ "debit of the SEPA file."),
4167+ 'charge_bearer': fields.selection([
4168+ ('SLEV', 'Following Service Level'),
4169+ ('SHAR', 'Shared'),
4170+ ('CRED', 'Borne by Creditor'),
4171+ ('DEBT', 'Borne by Debtor'),
4172+ ], 'Charge Bearer', readonly=True,
4173+ help="Following service level : transaction charges are to be "
4174+ "applied following the rules agreed in the service level and/or "
4175+ "scheme (SEPA Core messages must use this). Shared : "
4176+ "transaction charges on the creditor side are to be borne by "
4177+ "the creditor, transaction charges on the debtor side are to be "
4178+ "borne by the debtor. Borne by creditor : all transaction "
4179+ "charges are to be borne by the creditor. Borne by debtor : "
4180+ "all transaction charges are to be borne by the debtor."),
4181+ 'create_date': fields.datetime('Generation Date', readonly=True),
4182+ 'file': fields.binary('SEPA File', readonly=True),
4183+ 'filename': fields.function(
4184+ _generate_filename, type='char', size=256,
4185+ string='Filename', readonly=True, store=True),
4186+ 'state': fields.selection([
4187+ ('draft', 'Draft'),
4188+ ('sent', 'Sent'),
4189+ ('done', 'Reconciled'),
4190+ ], 'State', readonly=True),
4191+ }
4192+
4193+ _defaults = {
4194+ 'state': 'draft',
4195+ }
4196+
4197+
4198+class sdd_mandate(orm.Model):
4199+ '''SEPA Direct Debit Mandate'''
4200+ _name = 'sdd.mandate'
4201+ _description = __doc__
4202+ _rec_name = 'unique_mandate_reference'
4203+ _order = 'signature_date desc'
4204+
4205+ _columns = {
4206+ 'partner_bank_id': fields.many2one(
4207+ 'res.partner.bank', 'Bank Account'),
4208+ 'partner_id': fields.related(
4209+ 'partner_bank_id', 'partner_id', type='many2one',
4210+ relation='res.partner', string='Partner', readonly=True),
4211+ 'company_id': fields.many2one('res.company', 'Company', required=True),
4212+ 'unique_mandate_reference': fields.char(
4213+ 'Unique Mandate Reference', size=35, readonly=True),
4214+ 'type': fields.selection([
4215+ ('recurrent', 'Recurrent'),
4216+ ('oneoff', 'One-Off'),
4217+ ], 'Type of Mandate', required=True),
4218+ 'recurrent_sequence_type': fields.selection([
4219+ ('first', 'First'),
4220+ ('recurring', 'Recurring'),
4221+ ('final', 'Final'),
4222+ ], 'Sequence Type for Next Debit',
4223+ help="This field is only used for Recurrent mandates, not for "
4224+ "One-Off mandates."),
4225+ 'signature_date': fields.date(
4226+ 'Date of Signature of the Mandate'),
4227+ 'scan': fields.binary('Scan of the Mandate'),
4228+ 'last_debit_date': fields.date(
4229+ 'Date of the Last Debit', readonly=True),
4230+ 'state': fields.selection([
4231+ ('draft', 'Draft'),
4232+ ('valid', 'Valid'),
4233+ ('expired', 'Expired'),
4234+ ('cancel', 'Cancelled'),
4235+ ], 'Status',
4236+ help="Only valid mandates can be used in a payment line. A "
4237+ "cancelled mandate is a mandate that has been cancelled by "
4238+ "the customer. A one-off mandate expires after its first use. "
4239+ "A recurrent mandate expires after it's final use or if it "
4240+ "hasn't been used for 36 months."),
4241+ 'payment_line_ids': fields.one2many(
4242+ 'payment.line', 'sdd_mandate_id', "Related Payment Lines"),
4243+ 'sepa_migrated': fields.boolean(
4244+ 'Migrated to SEPA',
4245+ help="If this field is not active, the mandate section of the "
4246+ "next direct debit file that include this mandate will contain "
4247+ "the 'Original Mandate Identification' and the 'Original "
4248+ "Creditor Scheme Identification'. This is required in a few "
4249+ "countries (Belgium for instance), but not in all countries. "
4250+ "If this is not required in your country, you should keep this "
4251+ "field always active."),
4252+ 'original_mandate_identification': fields.char(
4253+ 'Original Mandate Identification', size=35,
4254+ help="When the field 'Migrated to SEPA' is not active, this "
4255+ "field will be used as the Original Mandate Identification in "
4256+ "the Direct Debit file."),
4257+ }
4258+
4259+ _defaults = {
4260+ 'company_id': lambda self, cr, uid, context:
4261+ self.pool['res.company']._company_default_get(
4262+ cr, uid, 'sdd.mandate', context=context),
4263+ 'unique_mandate_reference': lambda self, cr, uid, ctx:
4264+ self.pool['ir.sequence'].get(cr, uid, 'sdd.mandate.reference'),
4265+ 'state': 'draft',
4266+ 'sepa_migrated': True,
4267+ }
4268+
4269+ _sql_constraints = [(
4270+ 'mandate_ref_company_uniq',
4271+ 'unique(unique_mandate_reference, company_id)',
4272+ 'A Mandate with the same reference already exists for this company !'
4273+ )]
4274+
4275+ def _check_sdd_mandate(self, cr, uid, ids):
4276+ for mandate in self.browse(cr, uid, ids):
4277+ if (mandate.signature_date and
4278+ mandate.signature_date >
4279+ datetime.today().strftime('%Y-%m-%d')):
4280+ raise orm.except_orm(
4281+ _('Error:'),
4282+ _("The date of signature of mandate '%s' is in the "
4283+ "future !")
4284+ % mandate.unique_mandate_reference)
4285+ if mandate.state == 'valid' and not mandate.signature_date:
4286+ raise orm.except_orm(
4287+ _('Error:'),
4288+ _("Cannot validate the mandate '%s' without a date of "
4289+ "signature.")
4290+ % mandate.unique_mandate_reference)
4291+ if mandate.state == 'valid' and not mandate.partner_bank_id:
4292+ raise orm.except_orm(
4293+ _('Error:'),
4294+ _("Cannot validate the mandate '%s' because it is not "
4295+ "attached to a bank account.")
4296+ % mandate.unique_mandate_reference)
4297+
4298+ if (mandate.signature_date and mandate.last_debit_date and
4299+ mandate.signature_date > mandate.last_debit_date):
4300+ raise orm.except_orm(
4301+ _('Error:'),
4302+ _("The mandate '%s' can't have a date of last debit "
4303+ "before the date of signature.")
4304+ % mandate.unique_mandate_reference)
4305+ if (mandate.type == 'recurrent'
4306+ and not mandate.recurrent_sequence_type):
4307+ raise orm.except_orm(
4308+ _('Error:'),
4309+ _("The recurrent mandate '%s' must have a sequence type.")
4310+ % mandate.unique_mandate_reference)
4311+ if (mandate.type == 'recurrent' and not mandate.sepa_migrated
4312+ and mandate.recurrent_sequence_type != 'first'):
4313+ raise orm.except_orm(
4314+ _('Error:'),
4315+ _("The recurrent mandate '%s' which is not marked as "
4316+ "'Migrated to SEPA' must have its recurrent sequence "
4317+ "type set to 'First'.")
4318+ % mandate.unique_mandate_reference)
4319+ if (mandate.type == 'recurrent' and not mandate.sepa_migrated
4320+ and not mandate.original_mandate_identification):
4321+ raise orm.except_orm(
4322+ _('Error:'),
4323+ _("You must set the 'Original Mandate Identification' "
4324+ "on the recurrent mandate '%s' which is not marked "
4325+ "as 'Migrated to SEPA'.")
4326+ % mandate.unique_mandate_reference)
4327+ return True
4328+
4329+ _constraints = [
4330+ (_check_sdd_mandate, "Error msg in raise", [
4331+ 'last_debit_date', 'signature_date', 'state', 'partner_bank_id',
4332+ 'type', 'recurrent_sequence_type', 'sepa_migrated',
4333+ 'original_mandate_identification',
4334+ ]),
4335+ ]
4336+
4337+ def mandate_type_change(self, cr, uid, ids, type):
4338+ if type == 'recurrent':
4339+ recurrent_sequence_type = 'first'
4340+ else:
4341+ recurrent_sequence_type = False
4342+ res = {'value': {'recurrent_sequence_type': recurrent_sequence_type}}
4343+ return res
4344+
4345+ def mandate_partner_bank_change(
4346+ self, cr, uid, ids, partner_bank_id, type, recurrent_sequence_type,
4347+ last_debit_date, state):
4348+ res = {'value': {}}
4349+ if partner_bank_id:
4350+ partner_bank_read = self.pool['res.partner.bank'].read(
4351+ cr, uid, partner_bank_id, ['partner_id'])['partner_id']
4352+ if partner_bank_read:
4353+ res['value']['partner_id'] = partner_bank_read[0]
4354+ if (state == 'valid' and partner_bank_id
4355+ and type == 'recurrent'
4356+ and recurrent_sequence_type != 'first'):
4357+ res['value']['recurrent_sequence_type'] = 'first'
4358+ res['warning'] = {
4359+ 'title': _('Mandate update'),
4360+ 'message': _(
4361+ "As you changed the bank account attached to this "
4362+ "mandate, the 'Sequence Type' has been set back to "
4363+ "'First'."),
4364+ }
4365+ return res
4366+
4367+ def validate(self, cr, uid, ids, context=None):
4368+ to_validate_ids = []
4369+ for mandate in self.browse(cr, uid, ids, context=context):
4370+ assert mandate.state == 'draft', 'Mandate should be in draft state'
4371+ to_validate_ids.append(mandate.id)
4372+ self.write(
4373+ cr, uid, to_validate_ids, {'state': 'valid'}, context=context)
4374+ return True
4375+
4376+ def cancel(self, cr, uid, ids, context=None):
4377+ to_cancel_ids = []
4378+ for mandate in self.browse(cr, uid, ids, context=context):
4379+ assert mandate.state in ('draft', 'valid'),\
4380+ 'Mandate should be in draft or valid state'
4381+ to_cancel_ids.append(mandate.id)
4382+ self.write(
4383+ cr, uid, to_cancel_ids, {'state': 'cancel'}, context=context)
4384+ return True
4385+
4386+ def _sdd_mandate_set_state_to_expired(self, cr, uid, context=None):
4387+ logger.info('Searching for SDD Mandates that must be set to Expired')
4388+ expire_limit_date = datetime.today() + \
4389+ relativedelta(months=-NUMBER_OF_UNUSED_MONTHS_BEFORE_EXPIRY)
4390+ expire_limit_date_str = expire_limit_date.strftime('%Y-%m-%d')
4391+ expired_mandate_ids = self.search(cr, uid, [
4392+ '|',
4393+ ('last_debit_date', '=', False),
4394+ ('last_debit_date', '<=', expire_limit_date_str),
4395+ ('state', '=', 'valid'),
4396+ ('signature_date', '<=', expire_limit_date_str),
4397+ ], context=context)
4398+ if expired_mandate_ids:
4399+ self.write(
4400+ cr, uid, expired_mandate_ids, {'state': 'expired'},
4401+ context=context)
4402+ logger.info(
4403+ 'The following SDD Mandate IDs has been set to expired: %s'
4404+ % expired_mandate_ids)
4405+ else:
4406+ logger.info('0 SDD Mandates must be set to Expired')
4407+ return True
4408+
4409+
4410+class res_partner_bank(orm.Model):
4411+ _inherit = 'res.partner.bank'
4412+
4413+ _columns = {
4414+ 'sdd_mandate_ids': fields.one2many(
4415+ 'sdd.mandate', 'partner_bank_id', 'SEPA Direct Debit Mandates'),
4416+ }
4417+
4418+
4419+class payment_line(orm.Model):
4420+ _inherit = 'payment.line'
4421+
4422+ _columns = {
4423+ 'sdd_mandate_id': fields.many2one(
4424+ 'sdd.mandate', 'SEPA Direct Debit Mandate',
4425+ domain=[('state', '=', 'valid')]),
4426+ }
4427+
4428+ def create(self, cr, uid, vals, context=None):
4429+ '''If the customer invoice has a mandate, take it
4430+ otherwise, take the first valid mandate of the bank account'''
4431+ if context is None:
4432+ context = {}
4433+ if not vals:
4434+ vals = {}
4435+ partner_bank_id = vals.get('bank_id')
4436+ move_line_id = vals.get('move_line_id')
4437+ if (context.get('default_payment_order_type') == 'debit'
4438+ and 'sdd_mandate_id' not in vals):
4439+ if move_line_id:
4440+ line = self.pool['account.move.line'].browse(
4441+ cr, uid, move_line_id, context=context)
4442+ if (line.invoice and line.invoice.type == 'out_invoice'
4443+ and line.invoice.sdd_mandate_id):
4444+ vals.update({
4445+ 'sdd_mandate_id': line.invoice.sdd_mandate_id.id,
4446+ 'bank_id':
4447+ line.invoice.sdd_mandate_id.partner_bank_id.id,
4448+ })
4449+ if partner_bank_id and 'sdd_mandate_id' not in vals:
4450+ mandate_ids = self.pool['sdd.mandate'].search(cr, uid, [
4451+ ('partner_bank_id', '=', partner_bank_id),
4452+ ('state', '=', 'valid'),
4453+ ], context=context)
4454+ if mandate_ids:
4455+ vals['sdd_mandate_id'] = mandate_ids[0]
4456+ return super(payment_line, self).create(cr, uid, vals, context=context)
4457+
4458+ def _check_mandate_bank_link(self, cr, uid, ids):
4459+ for payline in self.browse(cr, uid, ids):
4460+ if (payline.sdd_mandate_id and payline.bank_id
4461+ and payline.sdd_mandate_id.partner_bank_id.id !=
4462+ payline.bank_id.id):
4463+ raise orm.except_orm(
4464+ _('Error:'),
4465+ _("The payment line with reference '%s' has the bank "
4466+ "account '%s' which is not attached to the mandate "
4467+ "'%s' (this mandate is attached to the bank account "
4468+ "'%s').") % (
4469+ payline.name,
4470+ self.pool['res.partner.bank'].name_get(
4471+ cr, uid, [payline.bank_id.id])[0][1],
4472+ payline.sdd_mandate_id.unique_mandate_reference,
4473+ self.pool['res.partner.bank'].name_get(
4474+ cr, uid,
4475+ [payline.sdd_mandate_id.partner_bank_id.id])[0][1],
4476+ ))
4477+ return True
4478+
4479+ _constraints = [
4480+ (_check_mandate_bank_link, 'Error msg in raise',
4481+ ['sdd_mandate_id', 'bank_id']),
4482+ ]
4483+
4484+
4485+class account_invoice(orm.Model):
4486+ _inherit = 'account.invoice'
4487+
4488+ _columns = {
4489+ 'sdd_mandate_id': fields.many2one(
4490+ 'sdd.mandate', 'SEPA Direct Debit Mandate',
4491+ domain=[('state', '=', 'valid')], readonly=True,
4492+ states={'draft': [('readonly', False)]})
4493+ }
4494
4495=== added file 'account_banking_sepa_direct_debit/account_banking_sdd_view.xml'
4496--- account_banking_sepa_direct_debit/account_banking_sdd_view.xml 1970-01-01 00:00:00 +0000
4497+++ account_banking_sepa_direct_debit/account_banking_sdd_view.xml 2014-03-19 00:47:00 +0000
4498@@ -0,0 +1,82 @@
4499+<?xml version="1.0" encoding="utf-8"?>
4500+<!--
4501+ Copyright (C) 2013 Akretion (http://www.akretion.com)
4502+ @author: Alexis de Lattre <alexis.delattre@akretion.com>
4503+ The licence is in the file __openerp__.py
4504+-->
4505+<openerp>
4506+<data>
4507+
4508+<record id="view_banking_export_sdd_form" model="ir.ui.view">
4509+ <field name="name">account.banking.export.sdd.form</field>
4510+ <field name="model">banking.export.sdd</field>
4511+ <field name="type">form</field>
4512+ <field name="arch" type="xml">
4513+ <form string="SEPA Direct Debit">
4514+ <notebook>
4515+ <page string="General Information">
4516+ <field name="total_amount" />
4517+ <field name="nb_transactions" />
4518+ <field name="batch_booking" />
4519+ <field name="charge_bearer"/>
4520+ <field name="create_date" />
4521+ <newline />
4522+ <field name="file" filename="filename"/>
4523+ <field name="filename" invisible="True"/>
4524+ </page>
4525+ <page string="Payment Orders">
4526+ <field name="payment_order_ids" colspan="4" nolabel="1">
4527+ <tree colors="blue:state in ('draft');gray:state in ('cancel','done');black:state in ('open')" string="Payment Orders">
4528+ <field name="reference"/>
4529+ <field name="date_created"/>
4530+ <field name="date_done"/>
4531+ <field name="total"/>
4532+ <field name="state"/>
4533+ </tree>
4534+ </field>
4535+ </page>
4536+ </notebook>
4537+ </form>
4538+ </field>
4539+</record>
4540+
4541+
4542+<record id="view_banking_export_sdd_tree" model="ir.ui.view">
4543+ <field name="name">account.banking.export.sdd.tree</field>
4544+ <field name="model">banking.export.sdd</field>
4545+ <field name="type">tree</field>
4546+ <field name="arch" type="xml">
4547+ <tree string="SEPA Direct Debit">
4548+ <field name="filename"/>
4549+ <field name="create_date"/>
4550+ <field name="nb_transactions"/>
4551+ </tree>
4552+ </field>
4553+</record>
4554+
4555+
4556+<record id="action_account_banking_sdd" model="ir.actions.act_window">
4557+ <field name="name">SEPA Direct Debit Files</field>
4558+ <field name="res_model">banking.export.sdd</field>
4559+ <field name="view_type">form</field>
4560+ <field name="view_mode">tree,form</field>
4561+</record>
4562+
4563+
4564+<menuitem id="menu_account_banking_sdd"
4565+ parent="account_payment.menu_main_payment"
4566+ action="action_account_banking_sdd"
4567+ sequence="20"
4568+ />
4569+
4570+<act_window id="act_banking_export_sdd_payment_order"
4571+ name="Generated SEPA Direct Debit Files"
4572+ domain="[('payment_order_ids', '=', active_id)]"
4573+ res_model="banking.export.sdd"
4574+ src_model="payment.order"
4575+ view_type="form"
4576+ view_mode="tree,form"
4577+/>
4578+
4579+</data>
4580+</openerp>
4581
4582=== added file 'account_banking_sepa_direct_debit/account_invoice_view.xml'
4583--- account_banking_sepa_direct_debit/account_invoice_view.xml 1970-01-01 00:00:00 +0000
4584+++ account_banking_sepa_direct_debit/account_invoice_view.xml 2014-03-19 00:47:00 +0000
4585@@ -0,0 +1,22 @@
4586+<?xml version="1.0" encoding="utf-8"?>
4587+<!--
4588+ Copyright (C) 2013 Akretion (http://www.akretion.com)
4589+ @author: Alexis de Lattre <alexis.delattre@akretion.com>
4590+ The licence is in the file __openerp__.py
4591+-->
4592+<openerp>
4593+<data>
4594+
4595+<record id="invoice_form" model="ir.ui.view">
4596+ <field name="name">add.sdd.mandate.on.customer.invoice.form</field>
4597+ <field name="model">account.invoice</field>
4598+ <field name="inherit_id" ref="account.invoice_form"/>
4599+ <field name="arch" type="xml">
4600+ <field name="partner_bank_id" position="after">
4601+ <field name="sdd_mandate_id" domain="[('partner_id', '=', partner_id), ('state', '=', 'valid')]" attrs="{'invisible': [('type', '=', 'out_refund')]}"/>
4602+ </field>
4603+ </field>
4604+</record>
4605+
4606+</data>
4607+</openerp>
4608
4609=== added file 'account_banking_sepa_direct_debit/account_payment_view.xml'
4610--- account_banking_sepa_direct_debit/account_payment_view.xml 1970-01-01 00:00:00 +0000
4611+++ account_banking_sepa_direct_debit/account_payment_view.xml 2014-03-19 00:47:00 +0000
4612@@ -0,0 +1,26 @@
4613+<?xml version="1.0" encoding="utf-8"?>
4614+<!--
4615+ Copyright (C) 2013 Akretion (http://www.akretion.com)
4616+ @author: Alexis de Lattre <alexis.delattre@akretion.com>
4617+ The licence is in the file __openerp__.py
4618+-->
4619+<openerp>
4620+<data>
4621+
4622+<record id="sdd_view_payment_order_form" model="ir.ui.view">
4623+ <field name="name">sdd.payment.order.form</field>
4624+ <field name="model">payment.order</field>
4625+ <field name="inherit_id" ref="account_payment.view_payment_order_form"/>
4626+ <field name="arch" type="xml">
4627+ <xpath expr="//field[@name='line_ids']/form/notebook/page/field[@name='bank_id']" position="after">
4628+ <field name="sdd_mandate_id" domain="[('partner_bank_id', '=', bank_id), ('state', '=', 'valid')]" invisible="context.get('default_payment_order_type')!='debit'" context="{'default_partner_bank_id': bank_id}"/>
4629+ <newline />
4630+ </xpath>
4631+ <xpath expr="//field[@name='line_ids']/tree/field[@name='bank_id']" position="after">
4632+ <field name="sdd_mandate_id" string="SDD Mandate" invisible="context.get('default_payment_order_type')!='debit'"/>
4633+ </xpath>
4634+ </field>
4635+</record>
4636+
4637+</data>
4638+</openerp>
4639
4640=== added file 'account_banking_sepa_direct_debit/company.py'
4641--- account_banking_sepa_direct_debit/company.py 1970-01-01 00:00:00 +0000
4642+++ account_banking_sepa_direct_debit/company.py 2014-03-19 00:47:00 +0000
4643@@ -0,0 +1,89 @@
4644+##############################################################################
4645+#
4646+# SEPA Direct Debit module for OpenERP
4647+# Copyright (C) 2013 Akretion (http://www.akretion.com)
4648+# @author: Alexis de Lattre <alexis.delattre@akretion.com>
4649+#
4650+# This program is free software: you can redistribute it and/or modify
4651+# it under the terms of the GNU Affero General Public License as
4652+# published by the Free Software Foundation, either version 3 of the
4653+# License, or (at your option) any later version.
4654+#
4655+# This program is distributed in the hope that it will be useful,
4656+# but WITHOUT ANY WARRANTY; without even the implied warranty of
4657+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4658+# GNU Affero General Public License for more details.
4659+#
4660+# You should have received a copy of the GNU Affero General Public License
4661+# along with this program. If not, see <http://www.gnu.org/licenses/>.
4662+#
4663+##############################################################################
4664+
4665+from openerp.osv import orm, fields
4666+import logging
4667+
4668+logger = logging.getLogger(__name__)
4669+
4670+
4671+class res_company(orm.Model):
4672+ _inherit = 'res.company'
4673+
4674+ _columns = {
4675+ 'sepa_creditor_identifier': fields.char(
4676+ 'SEPA Creditor Identifier', size=35,
4677+ help="Enter the Creditor Identifier that has been attributed "
4678+ "to your company to make SEPA Direct Debits. This identifier "
4679+ "is composed of :\n- your country ISO code (2 letters)\n- a "
4680+ "2-digits checkum\n- a 3-letters business code\n- a "
4681+ "country-specific identifier"),
4682+ 'original_creditor_identifier': fields.char(
4683+ 'Original Creditor Identifier', size=70),
4684+ }
4685+
4686+ def is_sepa_creditor_identifier_valid(
4687+ self, cr, uid, sepa_creditor_identifier, context=None):
4688+ """Check if SEPA Creditor Identifier is valid
4689+ @param sepa_creditor_identifier: SEPA Creditor Identifier as str
4690+ or unicode
4691+ @return: True if valid, False otherwise
4692+ """
4693+ if not isinstance(sepa_creditor_identifier, (str, unicode)):
4694+ return False
4695+ try:
4696+ sci_str = str(sepa_creditor_identifier)
4697+ except:
4698+ logger.warning(
4699+ "SEPA Creditor ID should contain only ASCII caracters.")
4700+ return False
4701+ sci = sci_str.lower()
4702+ if len(sci) < 9:
4703+ return False
4704+ before_replacement = sci[7:] + sci[0:2] + '00'
4705+ logger.debug(
4706+ "SEPA ID check before_replacement = %s" % before_replacement)
4707+ after_replacement = ''
4708+ for char in before_replacement:
4709+ if char.isalpha():
4710+ after_replacement += str(ord(char)-87)
4711+ else:
4712+ after_replacement += char
4713+ logger.debug(
4714+ "SEPA ID check after_replacement = %s" % after_replacement)
4715+ if int(sci[2:4]) == (98 - (int(after_replacement) % 97)):
4716+ return True
4717+ else:
4718+ return False
4719+
4720+ def _check_sepa_creditor_identifier(self, cr, uid, ids):
4721+ for company in self.browse(cr, uid, ids):
4722+ if company.sepa_creditor_identifier:
4723+ if not self.is_sepa_creditor_identifier_valid(
4724+ cr, uid, company.sepa_creditor_identifier):
4725+ return False
4726+ return True
4727+
4728+ _constraints = [
4729+ (_check_sepa_creditor_identifier,
4730+ "Invalid SEPA Creditor Identifier.",
4731+ ['sepa_creditor_identifier']),
4732+ ]
4733
4734=== added file 'account_banking_sepa_direct_debit/company_view.xml'
4735--- account_banking_sepa_direct_debit/company_view.xml 1970-01-01 00:00:00 +0000
4736+++ account_banking_sepa_direct_debit/company_view.xml 2014-03-19 00:47:00 +0000
4737@@ -0,0 +1,23 @@
4738+<?xml version="1.0" encoding="utf-8"?>
4739+<!--
4740+ Copyright (C) 2013 Akretion (http://www.akretion.com)
4741+ @author: Alexis de Lattre <alexis.delattre@akretion.com>
4742+ The licence is in the file __openerp__.py
4743+-->
4744+<openerp>
4745+<data>
4746+
4747+<record id="sdd_res_company_form" model="ir.ui.view">
4748+ <field name="name">sepa_direct_debit.res.company.form</field>
4749+ <field name="model">res.company</field>
4750+ <field name="inherit_id" ref="account_banking_pain_base.view_company_form"/>
4751+ <field name="arch" type="xml">
4752+ <group name="pain" position="inside">
4753+ <field name="sepa_creditor_identifier"/>
4754+ <field name="original_creditor_identifier" groups="account_banking_sepa_direct_debit.group_original_mandate_required"/>
4755+ </group>
4756+ </field>
4757+</record>
4758+
4759+</data>
4760+</openerp>
4761
4762=== added directory 'account_banking_sepa_direct_debit/data'
4763=== added file 'account_banking_sepa_direct_debit/data/mandate_reference_sequence.xml'
4764--- account_banking_sepa_direct_debit/data/mandate_reference_sequence.xml 1970-01-01 00:00:00 +0000
4765+++ account_banking_sepa_direct_debit/data/mandate_reference_sequence.xml 2014-03-19 00:47:00 +0000
4766@@ -0,0 +1,21 @@
4767+<?xml version="1.0" encoding="utf-8"?>
4768+<openerp>
4769+<data noupdate="1">
4770+
4771+
4772+<record id="sdd_mandate_seq_type" model="ir.sequence.type">
4773+ <field name="name">SDD Mandate Reference</field>
4774+ <field name="code">sdd.mandate.reference</field>
4775+</record>
4776+
4777+<record id="sdd_mandate_seq" model="ir.sequence">
4778+ <field name="name">SDD Mandate Reference</field>
4779+ <field name="code">sdd.mandate.reference</field>
4780+ <field name="prefix">RUM</field>
4781+ <field name="padding" eval="7"/>
4782+ <!-- remember that max size for the mandate ref is 35 -->
4783+</record>
4784+
4785+
4786+</data>
4787+</openerp>
4788
4789=== added file 'account_banking_sepa_direct_debit/data/pain.008.001.02.xsd'
4790--- account_banking_sepa_direct_debit/data/pain.008.001.02.xsd 1970-01-01 00:00:00 +0000
4791+++ account_banking_sepa_direct_debit/data/pain.008.001.02.xsd 2014-03-19 00:47:00 +0000
4792@@ -0,0 +1,879 @@
4793+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
4794+<!--Generated by SWIFTStandards Workstation (build:R6.1.0.2) on 2009 Jan 08 17:30:53-->
4795+<xs:schema xmlns="urn:iso:std:iso:20022:tech:xsd:pain.008.001.02" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="urn:iso:std:iso:20022:tech:xsd:pain.008.001.02">
4796+ <xs:element name="Document" type="Document"/>
4797+ <xs:complexType name="AccountIdentification4Choice">
4798+ <xs:sequence>
4799+ <xs:choice>
4800+ <xs:element name="IBAN" type="IBAN2007Identifier"/>
4801+ <xs:element name="Othr" type="GenericAccountIdentification1"/>
4802+ </xs:choice>
4803+ </xs:sequence>
4804+ </xs:complexType>
4805+ <xs:complexType name="AccountSchemeName1Choice">
4806+ <xs:sequence>
4807+ <xs:choice>
4808+ <xs:element name="Cd" type="ExternalAccountIdentification1Code"/>
4809+ <xs:element name="Prtry" type="Max35Text"/>
4810+ </xs:choice>
4811+ </xs:sequence>
4812+ </xs:complexType>
4813+ <xs:simpleType name="ActiveOrHistoricCurrencyAndAmount_SimpleType">
4814+ <xs:restriction base="xs:decimal">
4815+ <xs:minInclusive value="0"/>
4816+ <xs:fractionDigits value="5"/>
4817+ <xs:totalDigits value="18"/>
4818+ </xs:restriction>
4819+ </xs:simpleType>
4820+ <xs:complexType name="ActiveOrHistoricCurrencyAndAmount">
4821+ <xs:simpleContent>
4822+ <xs:extension base="ActiveOrHistoricCurrencyAndAmount_SimpleType">
4823+ <xs:attribute name="Ccy" type="ActiveOrHistoricCurrencyCode" use="required"/>
4824+ </xs:extension>
4825+ </xs:simpleContent>
4826+ </xs:complexType>
4827+ <xs:simpleType name="ActiveOrHistoricCurrencyCode">
4828+ <xs:restriction base="xs:string">
4829+ <xs:pattern value="[A-Z]{3,3}"/>
4830+ </xs:restriction>
4831+ </xs:simpleType>
4832+ <xs:simpleType name="AddressType2Code">
4833+ <xs:restriction base="xs:string">
4834+ <xs:enumeration value="ADDR"/>
4835+ <xs:enumeration value="PBOX"/>
4836+ <xs:enumeration value="HOME"/>
4837+ <xs:enumeration value="BIZZ"/>
4838+ <xs:enumeration value="MLTO"/>
4839+ <xs:enumeration value="DLVY"/>
4840+ </xs:restriction>
4841+ </xs:simpleType>
4842+ <xs:complexType name="AmendmentInformationDetails6">
4843+ <xs:sequence>
4844+ <xs:element maxOccurs="1" minOccurs="0" name="OrgnlMndtId" type="Max35Text"/>
4845+ <xs:element maxOccurs="1" minOccurs="0" name="OrgnlCdtrSchmeId" type="PartyIdentification32"/>
4846+ <xs:element maxOccurs="1" minOccurs="0" name="OrgnlCdtrAgt" type="BranchAndFinancialInstitutionIdentification4"/>
4847+ <xs:element maxOccurs="1" minOccurs="0" name="OrgnlCdtrAgtAcct" type="CashAccount16"/>
4848+ <xs:element maxOccurs="1" minOccurs="0" name="OrgnlDbtr" type="PartyIdentification32"/>
4849+ <xs:element maxOccurs="1" minOccurs="0" name="OrgnlDbtrAcct" type="CashAccount16"/>
4850+ <xs:element maxOccurs="1" minOccurs="0" name="OrgnlDbtrAgt" type="BranchAndFinancialInstitutionIdentification4"/>
4851+ <xs:element maxOccurs="1" minOccurs="0" name="OrgnlDbtrAgtAcct" type="CashAccount16"/>
4852+ <xs:element maxOccurs="1" minOccurs="0" name="OrgnlFnlColltnDt" type="ISODate"/>
4853+ <xs:element maxOccurs="1" minOccurs="0" name="OrgnlFrqcy" type="Frequency1Code"/>
4854+ </xs:sequence>
4855+ </xs:complexType>
4856+ <xs:simpleType name="AnyBICIdentifier">
4857+ <xs:restriction base="xs:string">
4858+ <xs:pattern value="[A-Z]{6,6}[A-Z2-9][A-NP-Z0-9]([A-Z0-9]{3,3}){0,1}"/>
4859+ </xs:restriction>
4860+ </xs:simpleType>
4861+ <xs:complexType name="Authorisation1Choice">
4862+ <xs:sequence>
4863+ <xs:choice>
4864+ <xs:element name="Cd" type="Authorisation1Code"/>
4865+ <xs:element name="Prtry" type="Max128Text"/>
4866+ </xs:choice>
4867+ </xs:sequence>
4868+ </xs:complexType>
4869+ <xs:simpleType name="Authorisation1Code">
4870+ <xs:restriction base="xs:string">
4871+ <xs:enumeration value="AUTH"/>
4872+ <xs:enumeration value="FDET"/>
4873+ <xs:enumeration value="FSUM"/>
4874+ <xs:enumeration value="ILEV"/>
4875+ </xs:restriction>
4876+ </xs:simpleType>
4877+ <xs:simpleType name="BICIdentifier">
4878+ <xs:restriction base="xs:string">
4879+ <xs:pattern value="[A-Z]{6,6}[A-Z2-9][A-NP-Z0-9]([A-Z0-9]{3,3}){0,1}"/>
4880+ </xs:restriction>
4881+ </xs:simpleType>
4882+ <xs:simpleType name="BatchBookingIndicator">
4883+ <xs:restriction base="xs:boolean"/>
4884+ </xs:simpleType>
4885+ <xs:complexType name="BranchAndFinancialInstitutionIdentification4">
4886+ <xs:sequence>
4887+ <xs:element name="FinInstnId" type="FinancialInstitutionIdentification7"/>
4888+ <xs:element maxOccurs="1" minOccurs="0" name="BrnchId" type="BranchData2"/>
4889+ </xs:sequence>
4890+ </xs:complexType>
4891+ <xs:complexType name="BranchData2">
4892+ <xs:sequence>
4893+ <xs:element maxOccurs="1" minOccurs="0" name="Id" type="Max35Text"/>
4894+ <xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/>
4895+ <xs:element maxOccurs="1" minOccurs="0" name="PstlAdr" type="PostalAddress6"/>
4896+ </xs:sequence>
4897+ </xs:complexType>
4898+ <xs:complexType name="CashAccount16">
4899+ <xs:sequence>
4900+ <xs:element name="Id" type="AccountIdentification4Choice"/>
4901+ <xs:element maxOccurs="1" minOccurs="0" name="Tp" type="CashAccountType2"/>
4902+ <xs:element maxOccurs="1" minOccurs="0" name="Ccy" type="ActiveOrHistoricCurrencyCode"/>
4903+ <xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max70Text"/>
4904+ </xs:sequence>
4905+ </xs:complexType>
4906+ <xs:complexType name="CashAccountType2">
4907+ <xs:sequence>
4908+ <xs:choice>
4909+ <xs:element name="Cd" type="CashAccountType4Code"/>
4910+ <xs:element name="Prtry" type="Max35Text"/>
4911+ </xs:choice>
4912+ </xs:sequence>
4913+ </xs:complexType>
4914+ <xs:simpleType name="CashAccountType4Code">
4915+ <xs:restriction base="xs:string">
4916+ <xs:enumeration value="CASH"/>
4917+ <xs:enumeration value="CHAR"/>
4918+ <xs:enumeration value="COMM"/>
4919+ <xs:enumeration value="TAXE"/>
4920+ <xs:enumeration value="CISH"/>
4921+ <xs:enumeration value="TRAS"/>
4922+ <xs:enumeration value="SACC"/>
4923+ <xs:enumeration value="CACC"/>
4924+ <xs:enumeration value="SVGS"/>
4925+ <xs:enumeration value="ONDP"/>
4926+ <xs:enumeration value="MGLD"/>
4927+ <xs:enumeration value="NREX"/>
4928+ <xs:enumeration value="MOMA"/>
4929+ <xs:enumeration value="LOAN"/>
4930+ <xs:enumeration value="SLRY"/>
4931+ <xs:enumeration value="ODFT"/>
4932+ </xs:restriction>
4933+ </xs:simpleType>
4934+ <xs:complexType name="CategoryPurpose1Choice">
4935+ <xs:sequence>
4936+ <xs:choice>
4937+ <xs:element name="Cd" type="ExternalCategoryPurpose1Code"/>
4938+ <xs:element name="Prtry" type="Max35Text"/>
4939+ </xs:choice>
4940+ </xs:sequence>
4941+ </xs:complexType>
4942+ <xs:simpleType name="ChargeBearerType1Code">
4943+ <xs:restriction base="xs:string">
4944+ <xs:enumeration value="DEBT"/>
4945+ <xs:enumeration value="CRED"/>
4946+ <xs:enumeration value="SHAR"/>
4947+ <xs:enumeration value="SLEV"/>
4948+ </xs:restriction>
4949+ </xs:simpleType>
4950+ <xs:complexType name="ClearingSystemIdentification2Choice">
4951+ <xs:sequence>
4952+ <xs:choice>
4953+ <xs:element name="Cd" type="ExternalClearingSystemIdentification1Code"/>
4954+ <xs:element name="Prtry" type="Max35Text"/>
4955+ </xs:choice>
4956+ </xs:sequence>
4957+ </xs:complexType>
4958+ <xs:complexType name="ClearingSystemMemberIdentification2">
4959+ <xs:sequence>
4960+ <xs:element maxOccurs="1" minOccurs="0" name="ClrSysId" type="ClearingSystemIdentification2Choice"/>
4961+ <xs:element name="MmbId" type="Max35Text"/>
4962+ </xs:sequence>
4963+ </xs:complexType>
4964+ <xs:complexType name="ContactDetails2">
4965+ <xs:sequence>
4966+ <xs:element maxOccurs="1" minOccurs="0" name="NmPrfx" type="NamePrefix1Code"/>
4967+ <xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/>
4968+ <xs:element maxOccurs="1" minOccurs="0" name="PhneNb" type="PhoneNumber"/>
4969+ <xs:element maxOccurs="1" minOccurs="0" name="MobNb" type="PhoneNumber"/>
4970+ <xs:element maxOccurs="1" minOccurs="0" name="FaxNb" type="PhoneNumber"/>
4971+ <xs:element maxOccurs="1" minOccurs="0" name="EmailAdr" type="Max2048Text"/>
4972+ <xs:element maxOccurs="1" minOccurs="0" name="Othr" type="Max35Text"/>
4973+ </xs:sequence>
4974+ </xs:complexType>
4975+ <xs:simpleType name="CountryCode">
4976+ <xs:restriction base="xs:string">
4977+ <xs:pattern value="[A-Z]{2,2}"/>
4978+ </xs:restriction>
4979+ </xs:simpleType>
4980+ <xs:simpleType name="CreditDebitCode">
4981+ <xs:restriction base="xs:string">
4982+ <xs:enumeration value="CRDT"/>
4983+ <xs:enumeration value="DBIT"/>
4984+ </xs:restriction>
4985+ </xs:simpleType>
4986+ <xs:complexType name="CreditorReferenceInformation2">
4987+ <xs:sequence>
4988+ <xs:element maxOccurs="1" minOccurs="0" name="Tp" type="CreditorReferenceType2"/>
4989+ <xs:element maxOccurs="1" minOccurs="0" name="Ref" type="Max35Text"/>
4990+ </xs:sequence>
4991+ </xs:complexType>
4992+ <xs:complexType name="CreditorReferenceType1Choice">
4993+ <xs:sequence>
4994+ <xs:choice>
4995+ <xs:element name="Cd" type="DocumentType3Code"/>
4996+ <xs:element name="Prtry" type="Max35Text"/>
4997+ </xs:choice>
4998+ </xs:sequence>
4999+ </xs:complexType>
5000+ <xs:complexType name="CreditorReferenceType2">
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches