Merge lp:~luc-demeyer/account-financial-tools/7.0-account_pain into lp:~account-core-editors/account-financial-tools/7.0
- 7.0-account_pain
- Merge into 7.0
Status: | Work in progress |
---|---|
Proposed branch: | lp:~luc-demeyer/account-financial-tools/7.0-account_pain |
Merge into: | lp:~account-core-editors/account-financial-tools/7.0 |
Diff against target: |
2229 lines (+2153/-0) 13 files modified
account_pain/README.txt (+3/-0) account_pain/__init__.py (+25/-0) account_pain/__openerp__.py (+65/-0) account_pain/account_move_line.py (+104/-0) account_pain/account_pain_wizard.xml (+36/-0) account_pain/account_payment.py (+233/-0) account_pain/account_payment_view.xml (+143/-0) account_pain/i18n/fr.po (+78/-0) account_pain/i18n/nl.po (+78/-0) account_pain/wizard/__init__.py (+24/-0) account_pain/wizard/pain_wizard.py (+303/-0) account_pain/wizard/payment_order_create.py (+140/-0) account_pain/xsd/pain.001.001.03.xsd (+921/-0) |
To merge this branch: | bzr merge lp:~luc-demeyer/account-financial-tools/7.0-account_pain |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Stefan Rijnhart (Opener) | Disapprove | ||
Raphaël Valyi - http://www.akretion.com | Needs Fixing | ||
Pedro Manuel Baeza | Needs Information | ||
Review via email: mp+192256@code.launchpad.net |
Commit message
Description of the change
add support for SEPA payments (ISO 20022)
Pedro Manuel Baeza (pedro.baeza) wrote : | # |
Alexis de Lattre (alexis-via) wrote : | # |
@Pedro
I think SEPA-related stuff belongs to the banking-addons https:/
By the way, there is already a module for SEPA Credit Transfer in the banking-addons (account_
Raphaël Valyi - http://www.akretion.com (rvalyi) wrote : | # |
Hello Luc,
cool to see Noviat joining the OCA effort. I won't comment functionally but certainly the remarks of Alexis and Pedro are valid.
Technically, there a few caveats that the watchdogs will remind you if I don't, so let's do it:
* please use orm.Model instead of osv.osv which is deprecated now
* also use orm.TransientModel instead of osv.memory
* also you use context={} in methods definitions at lines 309, 324, 327 and 458. You better use the ugly context=None + test against None plumbing instead. Indeed the mutable {} would eventually remain from a method call to another, see http://
Regards.
Stefan Rijnhart (Opener) (stefan-opener) wrote : | # |
Hi Luc,
I gladly welcome the initiative of Noviat of bringing their great modules under the umbrella of the community projects!
With regards to this particular module, I must agree with Alexis that his module overlaps greatly with this module. Now before Stéphane Bidoul made a great effort to decouple the banking addons export modules from the whole bank statement import and reconciliation bit, there would have been a legitimate place for a standalone module like this. But since Alexis' SEPA export module can now also be used with only a very thin boilerplate architecture (account_
Looking at what this module adds is as announced, heavily biased for Belgium. This is awkward in a module that has potential use in all of Europe, but it would be perfectly alright to refactor them out into a module on top of account_
I hope that my review is not discouraging you. Your input is much appreciated, but the point of the community repositories is also to combine focus and avoid double work.
Cheers,
Stefan.
Pedro Manuel Baeza (pedro.baeza) wrote : | # |
Hi, I told about account-payment repository because I see that this feature is developed following account-payment approach instead of banking-payment, the same as, for example, spanish bank formats export.
Maybe the two approaches can coexist?
Regards.
Raphaël Valyi - http://www.akretion.com (rvalyi) wrote : | # |
Hello Pedro,
just to mention: in Brazil we are also account-payment biased so far (we
were inspired by NaN module like 4 years ago now). And we still have to
develop SEPA like format but for Brazil (CNAB). So we have more or less the
same problem as you. I'm not sure yet what approach is the best, but we
should definitely keep convergence in mind with account-payment and
banking-payment. I also mention that it looks that NaN and Ziakzak recently
ported the account-payment approach to Tryton (so they stick we it).
Regards.
On Wed, Oct 23, 2013 at 6:25 AM, Pedro Manuel Baeza
<email address hidden>wrote:
> Hi, I told about account-payment repository because I see that this
> feature is developed following account-payment approach instead of
> banking-payment, the same as, for example, spanish bank formats export.
>
> Maybe the two approaches can coexist?
>
> Regards.
> --
>
> https:/
> You are reviewing the proposed merge of
> lp:~luc-demeyer/account-financial-tools/7.0-account_pain into
> lp:account-financial-tools.
>
- 124. By Luc De Meyer
-
technical update
Luc De Meyer (Noviat) (luc-demeyer) wrote : | # |
I updated the https:/
Luc
-----Original Message-----
From: <email address hidden> [mailto:<email address hidden>] On Behalf Of Raphaël Valyi - http://
Sent: woensdag 23 oktober 2013 6:05
To: <email address hidden>
Subject: Re: [Merge] lp:~luc-demeyer/account-financial-tools/7.0-account_pain into lp:account-financial-tools
Review: Needs Fixing
Hello Luc,
cool to see Noviat joining the OCA effort. I won't comment functionally but certainly the remarks of Alexis and Pedro are valid.
Technically, there a few caveats that the watchdogs will remind you if I don't, so let's do it:
* please use orm.Model instead of osv.osv which is deprecated now
* also use orm.TransientModel instead of osv.memory
* also you use context={} in methods definitions at lines 309, 324, 327 and 458. You better use the ugly context=None + test against None plumbing instead. Indeed the mutable {} would eventually remain from a method call to another, see http://
Regards.
--
https:/
You are the owner of lp:~luc-demeyer/account-financial-tools/7.0-account_pain.
Luc De Meyer (Noviat) (luc-demeyer) wrote : | # |
I am in favor of one SEPA community module in stead of multiple.
Hence the best approach would be to merge the functionality.
After a quick comparison module from Alexis I think it's no too hard to do.
We should merge the functionality which will require some changes to both the 'account_
Once this is done, we can migrate our 'account_pain' install base to the new module. We are also working on new functionalities and these would than become more widely available.
Alexis, Stefan,
What about a physical meeting where we run through the requirements and after this produce a new version that can be used as well as the basis for other country specific SEPA extensions.
We can host such a session in our Brussels offices (centrally located between France and Holland, I'll pay dinner, lunch, drinks, ... to compensate for your travel costs).
Regards,
Luc
-----Original Message-----
From: <email address hidden> [mailto:<email address hidden>] On Behalf Of Raphaël Valyi - http://
Sent: woensdag 23 oktober 2013 15:24
To: Pedro Manuel Baeza
Subject: Re: [Merge] lp:~luc-demeyer/account-financial-tools/7.0-account_pain into lp:account-financial-tools
Hello Pedro,
just to mention: in Brazil we are also account-payment biased so far (we were inspired by NaN module like 4 years ago now). And we still have to develop SEPA like format but for Brazil (CNAB). So we have more or less the same problem as you. I'm not sure yet what approach is the best, but we should definitely keep convergence in mind with account-payment and banking-payment. I also mention that it looks that NaN and Ziakzak recently ported the account-payment approach to Tryton (so they stick we it).
Regards.
On Wed, Oct 23, 2013 at 6:25 AM, Pedro Manuel Baeza
<email address hidden>wrote:
> Hi, I told about account-payment repository because I see that this
> feature is developed following account-payment approach instead of
> banking-payment, the same as, for example, spanish bank formats export.
>
> Maybe the two approaches can coexist?
>
> Regards.
> --
>
> https:/
> count_pain/
> lp:~luc-demeyer/account-financial-tools/7.0-account_pain into
> lp:account-financial-tools.
>
--
https:/
You are the owner of lp:~luc-demeyer/account-financial-tools/7.0-account_pain.
- 125. By Luc De Meyer
-
technical update
Alexis de Lattre (alexis-via) wrote : | # |
Here is result of the Akretion-Noviat code sprint on SEPA credit transfer to add the additionnal features of the module account_pain inside the module account_
https:/
But before I propose this branch for a merge on lp:banking-addons, I will need to have the following MP approved : https:/
Unmerged revisions
- 125. By Luc De Meyer
-
technical update
- 124. By Luc De Meyer
-
technical update
- 123. By Luc De Meyer
-
add account_pain
Preview Diff
1 | === added directory 'account_pain' | |||
2 | === added file 'account_pain/README.txt' | |||
3 | --- account_pain/README.txt 1970-01-01 00:00:00 +0000 | |||
4 | +++ account_pain/README.txt 2013-10-31 17:26:11 +0000 | |||
5 | @@ -0,0 +1,3 @@ | |||
6 | 1 | Installation tips | ||
7 | 2 | ================= | ||
8 | 3 | |||
9 | 0 | 4 | ||
10 | === added file 'account_pain/__init__.py' | |||
11 | --- account_pain/__init__.py 1970-01-01 00:00:00 +0000 | |||
12 | +++ account_pain/__init__.py 2013-10-31 17:26:11 +0000 | |||
13 | @@ -0,0 +1,25 @@ | |||
14 | 1 | # -*- encoding: utf-8 -*- | ||
15 | 2 | ############################################################################## | ||
16 | 3 | # | ||
17 | 4 | # OpenERP, Open Source Management Solution | ||
18 | 5 | # | ||
19 | 6 | # Copyright (c) 2013 Noviat nv/sa (www.noviat.com). All rights reserved. | ||
20 | 7 | # | ||
21 | 8 | # This program is free software: you can redistribute it and/or modify | ||
22 | 9 | # it under the terms of the GNU Affero General Public License as | ||
23 | 10 | # published by the Free Software Foundation, either version 3 of the | ||
24 | 11 | # License, or (at your option) any later version. | ||
25 | 12 | # | ||
26 | 13 | # This program is distributed in the hope that it will be useful, | ||
27 | 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
28 | 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
29 | 16 | # GNU Affero General Public License for more details. | ||
30 | 17 | # | ||
31 | 18 | # You should have received a copy of the GNU Affero General Public License | ||
32 | 19 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
33 | 20 | # | ||
34 | 21 | ############################################################################## | ||
35 | 22 | |||
36 | 23 | from . import account_payment | ||
37 | 24 | from . import account_move_line | ||
38 | 25 | from . import wizard | ||
39 | 0 | 26 | ||
40 | === added file 'account_pain/__openerp__.py' | |||
41 | --- account_pain/__openerp__.py 1970-01-01 00:00:00 +0000 | |||
42 | +++ account_pain/__openerp__.py 2013-10-31 17:26:11 +0000 | |||
43 | @@ -0,0 +1,65 @@ | |||
44 | 1 | # -*- encoding: utf-8 -*- | ||
45 | 2 | ############################################################################## | ||
46 | 3 | # | ||
47 | 4 | # OpenERP, Open Source Management Solution | ||
48 | 5 | # | ||
49 | 6 | # Copyright (c) 2013 Noviat nv/sa (www.noviat.com). All rights reserved. | ||
50 | 7 | # | ||
51 | 8 | # This program is free software: you can redistribute it and/or modify | ||
52 | 9 | # it under the terms of the GNU Affero General Public License as | ||
53 | 10 | # published by the Free Software Foundation, either version 3 of the | ||
54 | 11 | # License, or (at your option) any later version. | ||
55 | 12 | # | ||
56 | 13 | # This program is distributed in the hope that it will be useful, | ||
57 | 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
58 | 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
59 | 16 | # GNU Affero General Public License for more details. | ||
60 | 17 | # | ||
61 | 18 | # You should have received a copy of the GNU Affero General Public License | ||
62 | 19 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
63 | 20 | # | ||
64 | 21 | ############################################################################## | ||
65 | 22 | { | ||
66 | 23 | 'name': 'ISO 20022 XML payment files', | ||
67 | 24 | 'version': '0.1', | ||
68 | 25 | 'license': 'AGPL-3', | ||
69 | 26 | 'author': 'Noviat', | ||
70 | 27 | 'category': 'Generic Modules/Accounting', | ||
71 | 28 | 'description': """ | ||
72 | 29 | |||
73 | 30 | ISO 20022 XML payment files | ||
74 | 31 | =========================== | ||
75 | 32 | |||
76 | 33 | Module to generate Customer Credit Transfer Initiation message ISO 20022 XML - pain.001.001.03. | ||
77 | 34 | |||
78 | 35 | This module implements the following subset of the ISO 20022 specifications: | ||
79 | 36 | |||
80 | 37 | European Credit Transfers: | ||
81 | 38 | -------------------------- | ||
82 | 39 | * debtor and creditor account in SEPA countries | ||
83 | 40 | * debtor account in Company currency | ||
84 | 41 | * creditor account in Company currency | ||
85 | 42 | * creditor account identified by BIC & IBAN | ||
86 | 43 | * support for single payments | ||
87 | 44 | |||
88 | 45 | The module also prohibits the removal of a confirmed Payment Order. | ||
89 | 46 | Such a removal is still possible via the 'Undo Payment' button available to users of the 'Accounting / Manager' group. | ||
90 | 47 | |||
91 | 48 | Features targeted for the Belgian market (cf. febelfin guidelines): | ||
92 | 49 | |||
93 | 50 | * creditor account identified by IBAN (without BIC) for BE IBAN accounts | ||
94 | 51 | * support for belgian structured communication format | ||
95 | 52 | * by default, the right part of the VAT number (KBO/BCE number) is used to identify the Initiating Party | ||
96 | 53 | |||
97 | 54 | """, | ||
98 | 55 | 'depends': ['account','base_iban', 'account_payment'], | ||
99 | 56 | 'demo_xml': [], | ||
100 | 57 | 'init_xml': [], | ||
101 | 58 | 'update_xml' : [ | ||
102 | 59 | # 'security/ir.model.access.csv', | ||
103 | 60 | 'account_pain_wizard.xml', | ||
104 | 61 | 'account_payment_view.xml', | ||
105 | 62 | ], | ||
106 | 63 | 'active': False, | ||
107 | 64 | 'installable': True, | ||
108 | 65 | } | ||
109 | 0 | 66 | ||
110 | === added file 'account_pain/account_move_line.py' | |||
111 | --- account_pain/account_move_line.py 1970-01-01 00:00:00 +0000 | |||
112 | +++ account_pain/account_move_line.py 2013-10-31 17:26:11 +0000 | |||
113 | @@ -0,0 +1,104 @@ | |||
114 | 1 | # -*- encoding: utf-8 -*- | ||
115 | 2 | ############################################################################## | ||
116 | 3 | # | ||
117 | 4 | # OpenERP, Open Source Management Solution | ||
118 | 5 | # | ||
119 | 6 | # Copyright (c) 2013 Noviat nv/sa (www.noviat.com). All rights reserved. | ||
120 | 7 | # | ||
121 | 8 | # This program is free software: you can redistribute it and/or modify | ||
122 | 9 | # it under the terms of the GNU Affero General Public License as | ||
123 | 10 | # published by the Free Software Foundation, either version 3 of the | ||
124 | 11 | # License, or (at your option) any later version. | ||
125 | 12 | # | ||
126 | 13 | # This program is distributed in the hope that it will be useful, | ||
127 | 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
128 | 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
129 | 16 | # GNU Affero General Public License for more details. | ||
130 | 17 | # | ||
131 | 18 | # You should have received a copy of the GNU Affero General Public License | ||
132 | 19 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
133 | 20 | # | ||
134 | 21 | ############################################################################## | ||
135 | 22 | |||
136 | 23 | from openerp.tools.translate import _ | ||
137 | 24 | from openerp.osv import fields, orm | ||
138 | 25 | from operator import itemgetter | ||
139 | 26 | import logging | ||
140 | 27 | _logger = logging.getLogger(__name__) | ||
141 | 28 | |||
142 | 29 | class account_move_line(orm.Model): | ||
143 | 30 | _inherit = "account.move.line" | ||
144 | 31 | |||
145 | 32 | def amount_to_pay(self, cr, uid, ids, name, arg={}, context=None): | ||
146 | 33 | """ Return the amount still to pay regarding all the payment orders | ||
147 | 34 | (excepting cancelled orders)""" | ||
148 | 35 | if not ids: | ||
149 | 36 | return {} | ||
150 | 37 | amounts_residual = self.read(cr, uid, ids, ['amount_residual'], context=context) | ||
151 | 38 | cr.execute("""SELECT ml.id, | ||
152 | 39 | (SELECT coalesce(sum(amount_currency),0) | ||
153 | 40 | FROM payment_line pl | ||
154 | 41 | INNER JOIN payment_order po | ||
155 | 42 | ON (pl.order_id = po.id) | ||
156 | 43 | WHERE move_line_id = ml.id | ||
157 | 44 | AND po.state != 'cancel') AS pl_amount | ||
158 | 45 | FROM account_move_line ml | ||
159 | 46 | WHERE id IN %s""", (tuple(ids),)) | ||
160 | 47 | amounts_paylines = dict(cr.fetchall()) | ||
161 | 48 | amounts_to_pay = {} | ||
162 | 49 | for entry in amounts_residual: | ||
163 | 50 | k = entry['id'] | ||
164 | 51 | v = entry['amount_residual'] - amounts_paylines[k] | ||
165 | 52 | amounts_to_pay[k] = v | ||
166 | 53 | return amounts_to_pay | ||
167 | 54 | |||
168 | 55 | def _to_pay_search(self, cr, uid, obj, name, args, context=None): | ||
169 | 56 | if not args: | ||
170 | 57 | return [] | ||
171 | 58 | if not context: context={} | ||
172 | 59 | context['all_fiscalyear'] = True | ||
173 | 60 | line_obj = self.pool.get('account.move.line') | ||
174 | 61 | query = line_obj._query_get(cr, uid, context={}) | ||
175 | 62 | query += 'AND l.blocked = False ' | ||
176 | 63 | where = ' and '.join(map(lambda x: '''(SELECT | ||
177 | 64 | CASE WHEN l.amount_currency < 0 | ||
178 | 65 | THEN - l.amount_currency | ||
179 | 66 | ELSE l.credit | ||
180 | 67 | END - coalesce(sum(pl.amount_currency), 0) | ||
181 | 68 | FROM payment_line pl | ||
182 | 69 | INNER JOIN payment_order po ON (pl.order_id = po.id) | ||
183 | 70 | WHERE move_line_id = l.id | ||
184 | 71 | AND po.state != 'cancel' | ||
185 | 72 | ) %(operator)s %%s ''' % {'operator': x[1]}, args)) | ||
186 | 73 | sql_args = tuple(map(itemgetter(2), args)) | ||
187 | 74 | |||
188 | 75 | cr.execute(('''SELECT id | ||
189 | 76 | FROM account_move_line l | ||
190 | 77 | WHERE account_id IN (select id | ||
191 | 78 | FROM account_account | ||
192 | 79 | WHERE type in %s AND active) | ||
193 | 80 | AND reconcile_id IS null | ||
194 | 81 | AND credit > 0 | ||
195 | 82 | AND ''' + where + ' AND ' + query), (('payable','receivable'),)+sql_args ) # fix Noviat to include sale refunds | ||
196 | 83 | |||
197 | 84 | res = cr.fetchall() | ||
198 | 85 | if not res: | ||
199 | 86 | return [('id', '=', '0')] | ||
200 | 87 | return [('id', 'in', map(lambda x:x[0], res))] | ||
201 | 88 | |||
202 | 89 | _columns = { | ||
203 | 90 | 'amount_to_pay': fields.function(amount_to_pay, method=True, | ||
204 | 91 | type='float', string='Amount to pay', fnct_search=_to_pay_search), | ||
205 | 92 | } | ||
206 | 93 | |||
207 | 94 | def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): | ||
208 | 95 | if view_type == 'tree': | ||
209 | 96 | mod_obj = self.pool.get('ir.model.data') | ||
210 | 97 | if context is None: | ||
211 | 98 | context = {} | ||
212 | 99 | if context.get('account_payment', False): | ||
213 | 100 | model_data_ids = mod_obj.search(cr, uid,[('model', '=', 'ir.ui.view'), ('name', '=', 'view_move_line_tree_account_pain')], context=context) | ||
214 | 101 | view_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id'] | ||
215 | 102 | return super(account_move_line, self).fields_view_get(cr, uid, view_id, view_type, context=context, toolbar=toolbar, submenu=submenu) | ||
216 | 103 | |||
217 | 104 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
218 | 0 | 105 | ||
219 | === added file 'account_pain/account_pain_wizard.xml' | |||
220 | --- account_pain/account_pain_wizard.xml 1970-01-01 00:00:00 +0000 | |||
221 | +++ account_pain/account_pain_wizard.xml 2013-10-31 17:26:11 +0000 | |||
222 | @@ -0,0 +1,36 @@ | |||
223 | 1 | <?xml version="1.0" ?> | ||
224 | 2 | <openerp> | ||
225 | 3 | <data> | ||
226 | 4 | |||
227 | 5 | <record id="account_pain_save_view" model="ir.ui.view"> | ||
228 | 6 | <field name="name">ISO 20022 payment file</field> | ||
229 | 7 | <field name="model">account.pain.create</field> | ||
230 | 8 | <field name="priority">1</field> | ||
231 | 9 | <field name="arch" type="xml"> | ||
232 | 10 | <form string="The ISO 20022 payment file has been created" version="7.0"> | ||
233 | 11 | <p>Click on link below to download the XML File</p> | ||
234 | 12 | <p> | ||
235 | 13 | <b> | ||
236 | 14 | <field name="pain_data" readonly="1" filename="pain_fname"/> | ||
237 | 15 | <field name="pain_fname" invisible="1"/> | ||
238 | 16 | </b> | ||
239 | 17 | </p> | ||
240 | 18 | <separator colspan="4"/> | ||
241 | 19 | <field name="note" colspan="4" attrs="{'invisible':[('note','=',False)]}"/> | ||
242 | 20 | <separator colspan="4"/> | ||
243 | 21 | </form> | ||
244 | 22 | </field> | ||
245 | 23 | </record> | ||
246 | 24 | |||
247 | 25 | <record id="action_account_pain_create" model="ir.actions.act_window"> | ||
248 | 26 | <field name="name">The ISO 20022 payment file has been created</field> | ||
249 | 27 | <field name="type">ir.actions.act_window</field> | ||
250 | 28 | <field name="res_model">account.pain.create</field> | ||
251 | 29 | <field name="view_type">form</field> | ||
252 | 30 | <field name="view_mode">form</field> | ||
253 | 31 | <field name="view_id" ref="account_pain_save_view"/> | ||
254 | 32 | <field name="target">new</field> | ||
255 | 33 | </record> | ||
256 | 34 | |||
257 | 35 | </data> | ||
258 | 36 | </openerp> | ||
259 | 0 | 37 | ||
260 | === added file 'account_pain/account_payment.py' | |||
261 | --- account_pain/account_payment.py 1970-01-01 00:00:00 +0000 | |||
262 | +++ account_pain/account_payment.py 2013-10-31 17:26:11 +0000 | |||
263 | @@ -0,0 +1,233 @@ | |||
264 | 1 | # -*- encoding: utf-8 -*- | ||
265 | 2 | ############################################################################## | ||
266 | 3 | # | ||
267 | 4 | # OpenERP, Open Source Management Solution | ||
268 | 5 | # | ||
269 | 6 | # Copyright (c) 2013 Noviat nv/sa (www.noviat.com). All rights reserved. | ||
270 | 7 | # | ||
271 | 8 | # This program is free software: you can redistribute it and/or modify | ||
272 | 9 | # it under the terms of the GNU Affero General Public License as | ||
273 | 10 | # published by the Free Software Foundation, either version 3 of the | ||
274 | 11 | # License, or (at your option) any later version. | ||
275 | 12 | # | ||
276 | 13 | # This program is distributed in the hope that it will be useful, | ||
277 | 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
278 | 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
279 | 16 | # GNU Affero General Public License for more details. | ||
280 | 17 | # | ||
281 | 18 | # You should have received a copy of the GNU Affero General Public License | ||
282 | 19 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
283 | 20 | # | ||
284 | 21 | ############################################################################## | ||
285 | 22 | |||
286 | 23 | from openerp.tools.translate import _ | ||
287 | 24 | from openerp.osv import fields, orm | ||
288 | 25 | |||
289 | 26 | from openerp import netsvc | ||
290 | 27 | import re | ||
291 | 28 | import logging | ||
292 | 29 | _logger = logging.getLogger(__name__) | ||
293 | 30 | |||
294 | 31 | def check_bba_comm(val): | ||
295 | 32 | supported_chars = '0-9+*/ ' | ||
296 | 33 | pattern = re.compile('[^' + supported_chars + ']') | ||
297 | 34 | if pattern.findall(val or ''): | ||
298 | 35 | return False | ||
299 | 36 | bbacomm = re.sub('\D', '', val or '') | ||
300 | 37 | if len(bbacomm) == 12: | ||
301 | 38 | base = int(bbacomm[:10]) | ||
302 | 39 | mod = base % 97 or 97 | ||
303 | 40 | if mod == int(bbacomm[-2:]): | ||
304 | 41 | return True | ||
305 | 42 | return False | ||
306 | 43 | |||
307 | 44 | class payment_mode(orm.Model): | ||
308 | 45 | _inherit= 'payment.mode' | ||
309 | 46 | |||
310 | 47 | def _initiatingparty_default(self, cr, uid, field, context=None): | ||
311 | 48 | #_logger.warn('_initiatingparty_default, field=%s, context=%s', field, context) | ||
312 | 49 | company = self.pool.get('res.users').browse(cr, uid, uid).company_id | ||
313 | 50 | vat = company.partner_id.vat | ||
314 | 51 | # Belgium, febelfin specs | ||
315 | 52 | if vat and vat[0:2].upper() == 'BE': | ||
316 | 53 | kbo_nr = vat[2:].replace(' ','') | ||
317 | 54 | if field == 'id': | ||
318 | 55 | return kbo_nr | ||
319 | 56 | else: | ||
320 | 57 | return 'KBO-BCE' | ||
321 | 58 | else: | ||
322 | 59 | # complete for other countries | ||
323 | 60 | return False | ||
324 | 61 | |||
325 | 62 | def _initiatingparty_id_default(self, cr, uid, context=None): | ||
326 | 63 | return self._initiatingparty_default(cr, uid, 'id', context=context) | ||
327 | 64 | |||
328 | 65 | def _initiatingparty_issr_default(self, cr, uid, context=None): | ||
329 | 66 | return self._initiatingparty_default(cr, uid, 'issr', context=context) | ||
330 | 67 | |||
331 | 68 | _columns = { | ||
332 | 69 | 'type': fields.selection([ | ||
333 | 70 | ('manual', 'Manual'), | ||
334 | 71 | ('iso20022', 'ISO 20022')], | ||
335 | 72 | 'Type', select=1, | ||
336 | 73 | help='Select the Payment Type for the Payment Mode.'), | ||
337 | 74 | 'bank_id': fields.many2one('res.partner.bank', "Bank account", | ||
338 | 75 | required=False, help='Bank Account for the Payment Mode'), | ||
339 | 76 | 'initgpty_id': fields.char('Initiating Party Id', size=35, | ||
340 | 77 | help="Identifier of the Initiating Party." | ||
341 | 78 | "\nSpecify KBO-BCE number for Belgium." | ||
342 | 79 | "\n(Field: InitgPty.Id.OrgId.Othr.Id)"), | ||
343 | 80 | 'initgpty_issr': fields.char('Initiating Party Id Issuer', size=35, | ||
344 | 81 | help="Issuer of the Identifier of the Initiating Party." | ||
345 | 82 | "\nSpecify 'KBO-BCE' for Belgium." | ||
346 | 83 | "\n(Field: InitgPty.Id.OrgId.Othr.Issr)"), | ||
347 | 84 | } | ||
348 | 85 | _defaults = { | ||
349 | 86 | 'initgpty_id': _initiatingparty_id_default, | ||
350 | 87 | 'initgpty_issr': _initiatingparty_issr_default, | ||
351 | 88 | } | ||
352 | 89 | |||
353 | 90 | def _check_initiatingparty_id(self, cr, uid, ids, context=None): | ||
354 | 91 | pm = self.browse(cr, uid, ids[0], context=context) | ||
355 | 92 | if pm.initgpty_issr and not pm.initgpty_id: | ||
356 | 93 | return False | ||
357 | 94 | return True | ||
358 | 95 | |||
359 | 96 | _constraints = [ | ||
360 | 97 | (_check_initiatingparty_id, "Configuration Error! Please complete the 'Initiating Party Id' field.", ['initgpty_id']) | ||
361 | 98 | ] | ||
362 | 99 | |||
363 | 100 | class payment_order(orm.Model): | ||
364 | 101 | _inherit = 'payment.order' | ||
365 | 102 | |||
366 | 103 | def get_wizard(self, type): | ||
367 | 104 | if type == 'iso20022': | ||
368 | 105 | return 'account_pain','action_account_pain_create' | ||
369 | 106 | else: | ||
370 | 107 | return super(payment_order, self).get_wizard(type) | ||
371 | 108 | |||
372 | 109 | def action_open(self, cr, uid, ids, *args): | ||
373 | 110 | for payment in self.browse(cr, uid, ids): | ||
374 | 111 | for line in payment.line_ids: | ||
375 | 112 | if line.amount_currency <= 0: | ||
376 | 113 | raise orm.except_orm(_('Payment Instruction Error!'), | ||
377 | 114 | _("Unsupported Payment Instruction in Payment Line %s.\n" \ | ||
378 | 115 | "The value '%s' is less than the minimum value allowed.") | ||
379 | 116 | % (line.name, line.amount_currency)) | ||
380 | 117 | return super(payment_order, self).action_open(cr, uid, ids, *args) | ||
381 | 118 | |||
382 | 119 | def unlink(self, cr, uid, ids, context=None): | ||
383 | 120 | for order in self.browse(cr, uid, ids, context=context): | ||
384 | 121 | if order.state == 'done': | ||
385 | 122 | raise orm.except_orm(_('Error'), | ||
386 | 123 | _("You can not remove a Payment Order that has already been processed !" \ | ||
387 | 124 | "\nIf such an action is required, you should first cancel the Order.")) | ||
388 | 125 | return super(payment_order, self).unlink(cr, uid, ids, context=context) | ||
389 | 126 | |||
390 | 127 | def button_undo_payment(self, cr, uid, ids, context=None): | ||
391 | 128 | att_obj = self.pool.get('ir.attachment') | ||
392 | 129 | for order in self.browse(cr, uid, ids, context=context): | ||
393 | 130 | att_ids = att_obj.search(cr, uid, [('res_model', '=', 'payment.order'), ('res_id', '=', order.id)]) | ||
394 | 131 | if att_ids: | ||
395 | 132 | att_obj.unlink(cr, uid, att_ids) | ||
396 | 133 | self.write(cr, uid, order.id, {'state': 'draft'}) | ||
397 | 134 | wf_service = netsvc.LocalService("workflow") | ||
398 | 135 | wf_service.trg_delete(uid, 'payment.order', order.id, cr) | ||
399 | 136 | wf_service.trg_create(uid, 'payment.order', order.id, cr) | ||
400 | 137 | return True | ||
401 | 138 | |||
402 | 139 | class payment_line(orm.Model): | ||
403 | 140 | _inherit = 'payment.line' | ||
404 | 141 | |||
405 | 142 | def _get_struct_comm_types(self, cr, uid, context=None): | ||
406 | 143 | res = self.pool.get('account.invoice').fields_get(cr, uid, ['reference_type'], context)['reference_type']['selection'] | ||
407 | 144 | res.pop([i for i,x in enumerate(res) if x[0] == 'none'][0]) | ||
408 | 145 | bba_list = [i for i,x in enumerate(res) if x[0] == 'bba'] | ||
409 | 146 | if not bba_list: | ||
410 | 147 | res.append(('bba', 'BBA Structured Communication')) | ||
411 | 148 | return res | ||
412 | 149 | |||
413 | 150 | def _check_communication(self, cr, uid, ids): | ||
414 | 151 | for line in self.browse(cr, uid, ids): | ||
415 | 152 | if line.state == 'structured': | ||
416 | 153 | if line.struct_comm_type == 'bba': | ||
417 | 154 | return check_bba_comm(line.communication) | ||
418 | 155 | return True | ||
419 | 156 | |||
420 | 157 | def fields_get(self, cr, uid, fields=None, context=None): | ||
421 | 158 | fields = super(payment_line,self).fields_get(cr, uid, fields, context) | ||
422 | 159 | if context is None: | ||
423 | 160 | context = {} | ||
424 | 161 | if context.get('payment_line_readonly'): | ||
425 | 162 | for field in fields: | ||
426 | 163 | fields[field]['readonly'] = True | ||
427 | 164 | return fields | ||
428 | 165 | |||
429 | 166 | def unlink(self, cr, uid, ids, context=None): | ||
430 | 167 | if context is None: | ||
431 | 168 | context = {} | ||
432 | 169 | if context.get('payment_line_readonly'): | ||
433 | 170 | raise orm.except_orm(_('Warning'), _('Delete operation not allowed !' \ | ||
434 | 171 | '\nPlease go to the associated Payment Order in order to delete this payment line')) | ||
435 | 172 | return super(payment_line, self).unlink(cr, uid, ids, context=context) | ||
436 | 173 | |||
437 | 174 | def create(self, cr, uid, vals, context=None): | ||
438 | 175 | # copy structured communication of payment line is created by referencing an invoice | ||
439 | 176 | if vals.has_key('move_line_id') and vals['move_line_id']: | ||
440 | 177 | move_line = self.pool.get('account.move.line').browse(cr, uid, vals['move_line_id'], context) | ||
441 | 178 | inv = move_line.invoice | ||
442 | 179 | if inv and inv.reference_type != 'none': | ||
443 | 180 | vals['state'] = 'structured' | ||
444 | 181 | vals['struct_comm_type'] = inv.reference_type | ||
445 | 182 | vals['communication'] = inv.reference | ||
446 | 183 | # verify correctness of bba structured communication when created via the payment line form | ||
447 | 184 | if vals.has_key('state') and (vals['state'] == 'structured'): | ||
448 | 185 | if vals.has_key('struct_comm_type') and (vals['struct_comm_type'] == 'bba'): | ||
449 | 186 | if vals.has_key('communication'): | ||
450 | 187 | bbacomm = vals['communication'] | ||
451 | 188 | if check_bba_comm(bbacomm): | ||
452 | 189 | bbacomm = re.sub('\D', '', bbacomm) | ||
453 | 190 | vals['communication'] = '+++' + bbacomm[0:3] + '/' + bbacomm[3:7] + '/' + bbacomm[7:] + '+++' | ||
454 | 191 | else: | ||
455 | 192 | raise orm.except_orm(_('Payment Instruction Error!'), | ||
456 | 193 | _('Invalid BBA Structured Communication in Payment Line %s , please correct !') % vals['name']) | ||
457 | 194 | return super(payment_line, self).create(cr, uid, vals, context=context) | ||
458 | 195 | |||
459 | 196 | def write(self, cr, uid, ids, vals, context=None): | ||
460 | 197 | if type(ids) is int: | ||
461 | 198 | ids = [ids] | ||
462 | 199 | for line in self.browse(cr, uid, ids, context): | ||
463 | 200 | vals2 = vals.copy() | ||
464 | 201 | if vals.has_key('state'): | ||
465 | 202 | line_state = vals['state'] | ||
466 | 203 | else: | ||
467 | 204 | line_state = line.state | ||
468 | 205 | if line_state == 'structured': | ||
469 | 206 | if vals.has_key('struct_comm_type'): | ||
470 | 207 | struct_comm_type = vals['struct_comm_type'] | ||
471 | 208 | else: | ||
472 | 209 | struct_comm_type = line.struct_comm_type or '' | ||
473 | 210 | if struct_comm_type == 'bba': | ||
474 | 211 | if vals.has_key('communication'): | ||
475 | 212 | bbacomm = vals['communication'] | ||
476 | 213 | else: | ||
477 | 214 | bbacomm = line.communication or '' | ||
478 | 215 | if check_bba_comm(bbacomm): | ||
479 | 216 | bbacomm = re.sub('\D', '', bbacomm) | ||
480 | 217 | vals2['communication'] = '+++' + bbacomm[0:3] + '/' + bbacomm[3:7] + '/' + bbacomm[7:] + '+++' | ||
481 | 218 | else: | ||
482 | 219 | raise orm.except_orm(_('Payment Instruction Error!'), | ||
483 | 220 | _('Invalid BBA Structured Communication in Payment Line %s , please correct !') % line.name) | ||
484 | 221 | super(payment_line, self).write(cr, uid, [line.id], vals2, context) | ||
485 | 222 | return True | ||
486 | 223 | |||
487 | 224 | _columns = { | ||
488 | 225 | 'name': fields.char('Payment Line Ref.', size=64, required=True), | ||
489 | 226 | 'state': fields.selection([('normal','Free Communication'), ('structured','Structured Communication')], 'Communication Type', required=True), | ||
490 | 227 | 'struct_comm_type': fields.selection(_get_struct_comm_types, 'Structured Communication Type'), | ||
491 | 228 | } | ||
492 | 229 | _constraints = [ | ||
493 | 230 | (_check_communication, 'Invalid BBA Structured Communication !', ['Communication']), | ||
494 | 231 | ] | ||
495 | 232 | |||
496 | 233 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
497 | 0 | \ No newline at end of file | 234 | \ No newline at end of file |
498 | 1 | 235 | ||
499 | === added file 'account_pain/account_payment_view.xml' | |||
500 | --- account_pain/account_payment_view.xml 1970-01-01 00:00:00 +0000 | |||
501 | +++ account_pain/account_payment_view.xml 2013-10-31 17:26:11 +0000 | |||
502 | @@ -0,0 +1,143 @@ | |||
503 | 1 | <?xml version="1.0" encoding="utf-8"?> | ||
504 | 2 | <openerp> | ||
505 | 3 | <data> | ||
506 | 4 | |||
507 | 5 | <record id="view_payment_line_search" model="ir.ui.view"> | ||
508 | 6 | <field name="name">payment.line.tree.search</field> | ||
509 | 7 | <field name="model">payment.line</field> | ||
510 | 8 | <field name="arch" type="xml"> | ||
511 | 9 | <search string="Search Payment Lines"> | ||
512 | 10 | <group> | ||
513 | 11 | <field name="order_id"/> | ||
514 | 12 | <field name="ml_inv_ref"/> | ||
515 | 13 | <field name="ml_maturity_date"/> | ||
516 | 14 | <field name="partner_id" select="1"/> | ||
517 | 15 | <field name="communication"/> | ||
518 | 16 | <field name="amount"/> | ||
519 | 17 | <field name="bank_id" domain="[('partner_id', '=', partner_id)]"/> | ||
520 | 18 | <field name="move_line_id" on_change="onchange_move_line(move_line_id,parent.mode)"/> | ||
521 | 19 | <field name="create_date"/> | ||
522 | 20 | <field name="name"/> | ||
523 | 21 | </group> | ||
524 | 22 | <newline/> | ||
525 | 23 | <group expand="0" string="Group By..."> | ||
526 | 24 | <filter string="Payment Mode" context="{'group_by': 'bank_id'}" icon="terp-dolar"/> | ||
527 | 25 | </group> | ||
528 | 26 | </search> | ||
529 | 27 | </field> | ||
530 | 28 | </record> | ||
531 | 29 | |||
532 | 30 | <record id="action_payment_line_tree" model="ir.actions.act_window"> | ||
533 | 31 | <field name="name">Payment Lines</field> | ||
534 | 32 | <field name="res_model">payment.line</field> | ||
535 | 33 | <field name="view_type">form</field> | ||
536 | 34 | <field name="view_mode">tree,form</field> | ||
537 | 35 | <field name="search_view_id" ref="view_payment_line_search"/> | ||
538 | 36 | <field name="view_id" ref="account_payment.view_payment_line_tree"/> | ||
539 | 37 | <field name="context">{'payment_line_readonly':1}</field> | ||
540 | 38 | </record> | ||
541 | 39 | <menuitem action="action_payment_line_tree" id="menu_action_payment_line" parent="account_payment.menu_main_payment" sequence="4"/> | ||
542 | 40 | |||
543 | 41 | <act_window domain="[('move_line_id.move_id.id', '=', move_id)]" | ||
544 | 42 | id="act_account_invoice_2_payment_line" | ||
545 | 43 | name="Payment Lines" | ||
546 | 44 | view_type="form" | ||
547 | 45 | context="{'payment_line_readonly':1}" | ||
548 | 46 | res_model="payment.line" src_model="account.invoice"/> | ||
549 | 47 | |||
550 | 48 | |||
551 | 49 | <record id="account_payment.action_create_payment_order" model="ir.actions.act_window"> | ||
552 | 50 | <field name="view_id" ref="account_payment.view_create_payment_order"/> | ||
553 | 51 | </record> | ||
554 | 52 | |||
555 | 53 | <!-- change compared to view in account payment : 'name'-field replaced by 'invoice'-field --> | ||
556 | 54 | <record model="ir.ui.view" id="view_move_line_tree_account_pain"> | ||
557 | 55 | <field name="name">account.pain.move.line.tree</field> | ||
558 | 56 | <field name="model">account.move.line</field> | ||
559 | 57 | <field name="priority" eval="1"/> | ||
560 | 58 | <field name="arch" type="xml"> | ||
561 | 59 | <tree string="Account Entry Line"> | ||
562 | 60 | <field name="partner_id"/> | ||
563 | 61 | <field name="ref"/> | ||
564 | 62 | <field name="invoice"/> | ||
565 | 63 | <field name="journal_id"/> | ||
566 | 64 | <field name="account_id"/> | ||
567 | 65 | <field name="date_maturity"/> | ||
568 | 66 | <field name="date"/> | ||
569 | 67 | <field name="debit" sum="Total debit"/> | ||
570 | 68 | <field name="credit" sum="Total credit"/> | ||
571 | 69 | <field name="amount_to_pay"/> | ||
572 | 70 | <field name="amount_currency"/> | ||
573 | 71 | <field name="currency_id"/> | ||
574 | 72 | <field name="period_id" invisible="1"/> | ||
575 | 73 | </tree> | ||
576 | 74 | </field> | ||
577 | 75 | </record> | ||
578 | 76 | |||
579 | 77 | <record id="view_payment_order_form_inherit" model="ir.ui.view"> | ||
580 | 78 | <field name="name">payment.order.form.inherit</field> | ||
581 | 79 | <field name="model">payment.order</field> | ||
582 | 80 | <field name="inherit_id" ref="account_payment.view_payment_order_form"/> | ||
583 | 81 | <field name="arch" type="xml"> | ||
584 | 82 | <data> | ||
585 | 83 | <xpath expr="//field[@name='line_ids']//page[@string='Payment']//field[@name='state']" position="after"> | ||
586 | 84 | <group colspan="4" attrs="{'invisible':[('state','=','normal')]}"> | ||
587 | 85 | <field name="struct_comm_type" attrs="{'required':[('state','=','structured')]}"/> | ||
588 | 86 | </group> | ||
589 | 87 | </xpath> | ||
590 | 88 | <button name="cancel" position="after"> | ||
591 | 89 | <button name="button_undo_payment" states="done" string="Undo Payment" type="object" groups="account.group_account_manager" icon="gtk-cancel"/> | ||
592 | 90 | </button> | ||
593 | 91 | <button name="set_done" position="replace"> | ||
594 | 92 | <button name="%(account_payment.action_account_payment_make_payment)d" states="open" string="Make Payments" type="action" icon="gtk-execute"/> | ||
595 | 93 | </button> | ||
596 | 94 | </data> | ||
597 | 95 | </field> | ||
598 | 96 | </record> | ||
599 | 97 | |||
600 | 98 | <record id="view_payment_mode_search_inherit" model="ir.ui.view"> | ||
601 | 99 | <field name="name">payment.mode.search.inherit</field> | ||
602 | 100 | <field name="model">payment.mode</field> | ||
603 | 101 | <field name="inherit_id" ref="account_payment.view_payment_mode_search"/> | ||
604 | 102 | <field name="arch" type="xml"> | ||
605 | 103 | <field name="journal" position="after"> | ||
606 | 104 | <field name="type"/> | ||
607 | 105 | </field> | ||
608 | 106 | </field> | ||
609 | 107 | </record> | ||
610 | 108 | |||
611 | 109 | <record id="view_payment_mode_tree_inherit" model="ir.ui.view"> | ||
612 | 110 | <field name="name">payment.mode.tree.inherit</field> | ||
613 | 111 | <field name="model">payment.mode</field> | ||
614 | 112 | <field name="inherit_id" ref="account_payment.view_payment_mode_tree"/> | ||
615 | 113 | <field name="arch" type="xml"> | ||
616 | 114 | <field name="journal" position="after"> | ||
617 | 115 | <field name="type"/> | ||
618 | 116 | </field> | ||
619 | 117 | </field> | ||
620 | 118 | </record> | ||
621 | 119 | |||
622 | 120 | <record id="view_payment_mode_form_inherit" model="ir.ui.view"> | ||
623 | 121 | <field name="name">payment.mode.form.inherit</field> | ||
624 | 122 | <field name="model">payment.mode</field> | ||
625 | 123 | <field name="inherit_id" ref="account_payment.view_payment_mode_form"/> | ||
626 | 124 | <field name="arch" type="xml"> | ||
627 | 125 | <field name="journal" position="after"> | ||
628 | 126 | <field name="type"/> | ||
629 | 127 | </field> | ||
630 | 128 | <field name="bank_id" position="attributes"> | ||
631 | 129 | <attribute name="attrs">{'required':[('type','=','iso20022')]}</attribute> | ||
632 | 130 | </field> | ||
633 | 131 | <field name="bank_id" position="after"> | ||
634 | 132 | <field name="initgpty_id" attrs="{'invisible':[('type','!=','iso20022')]}"/> | ||
635 | 133 | <field name="initgpty_issr" attrs="{'invisible':[('type','!=','iso20022')]}"/> | ||
636 | 134 | </field> | ||
637 | 135 | <!--correct partner_id field for GTK client --> | ||
638 | 136 | <field name="partner_id" position="replace"> | ||
639 | 137 | <field name="partner_id" invisible="1"/> | ||
640 | 138 | </field> | ||
641 | 139 | </field> | ||
642 | 140 | </record> | ||
643 | 141 | |||
644 | 142 | </data> | ||
645 | 143 | </openerp> | ||
646 | 0 | 144 | ||
647 | === added directory 'account_pain/i18n' | |||
648 | === added file 'account_pain/i18n/fr.po' | |||
649 | --- account_pain/i18n/fr.po 1970-01-01 00:00:00 +0000 | |||
650 | +++ account_pain/i18n/fr.po 2013-10-31 17:26:11 +0000 | |||
651 | @@ -0,0 +1,78 @@ | |||
652 | 1 | # French translation of openobject-addons. | ||
653 | 2 | # This file contains the translation of the following modules: | ||
654 | 3 | # * account_pain | ||
655 | 4 | # | ||
656 | 5 | msgid "" | ||
657 | 6 | msgstr "" | ||
658 | 7 | "Project-Id-Version: openobject-addons\n" | ||
659 | 8 | "Report-Msgid-Bugs-To: support@noviat.be\n" | ||
660 | 9 | "POT-Creation-Date: 2011-03-24 11:18:30.714000\n" | ||
661 | 10 | "PO-Revision-Date: 2011-03-24 11:18:30.714000\n" | ||
662 | 11 | "Last-Translator: Luc De Meyer (Noviat nv/sa)\n" | ||
663 | 12 | "Language-Team: \n" | ||
664 | 13 | "MIME-Version: 1.0\n" | ||
665 | 14 | "Content-Type: text/plain; charset=UTF-8\n" | ||
666 | 15 | "Content-Transfer-Encoding: 8bit\n" | ||
667 | 16 | |||
668 | 17 | #. module: account_pain | ||
669 | 18 | #: view:account.pain.create:0 | ||
670 | 19 | msgid "The ISO 20022 payment file has been created" | ||
671 | 20 | msgstr "Le fichier de paiement ISO 20022 est généré" | ||
672 | 21 | |||
673 | 22 | #. module: account_pain | ||
674 | 23 | #: view:account.pain.create:0 | ||
675 | 24 | msgid "Click on 'Save as' to save the file on your local disk." | ||
676 | 25 | msgstr "Sélectionnez 'Enregistrer sous' pour sauvegarder le fichier sur votre disque local." | ||
677 | 26 | |||
678 | 27 | #. module: account_pain | ||
679 | 28 | #: field:account.pain.create,pain_data:0 | ||
680 | 29 | msgid "Payment File" | ||
681 | 30 | msgstr "Fichier de paiement" | ||
682 | 31 | |||
683 | 32 | #. module: account_pain | ||
684 | 33 | #: field:account.pain.create,pain_fname:0 | ||
685 | 34 | msgid "Filename" | ||
686 | 35 | msgstr "Nom du fichier" | ||
687 | 36 | |||
688 | 37 | #. module: account_pain | ||
689 | 38 | #: field:account.pain.create,note:0 | ||
690 | 39 | msgid "Remarks" | ||
691 | 40 | msgstr "Remarques" | ||
692 | 41 | |||
693 | 42 | #. module: account_pain | ||
694 | 43 | #: code:addons/account_pain/wizard/pain_wizard.py:0 | ||
695 | 44 | #, python-format | ||
696 | 45 | msgid "Warning:\n" | ||
697 | 46 | msgstr "Alerte:\n" | ||
698 | 47 | |||
699 | 48 | #. module: account_pain | ||
700 | 49 | #: code:addons/account_pain/wizard/pain_wizard.py:0 | ||
701 | 50 | #, python-format | ||
702 | 51 | msgid "\nThe Payment Date on Payment Line %s has been changed." | ||
703 | 52 | msgstr "\nLa date de paiement du ligne de paiement %s a changé." | ||
704 | 53 | |||
705 | 54 | #. module: account_pain | ||
706 | 55 | #: field:payment.line,name:0 | ||
707 | 56 | msgid "Payment Line Ref." | ||
708 | 57 | msgstr "Ref. ligne de paiement" | ||
709 | 58 | |||
710 | 59 | #. module: account_pain | ||
711 | 60 | #: field:payment.line,struct_comm_type:0 | ||
712 | 61 | msgid "Structured Communication Type" | ||
713 | 62 | msgstr "Type de communication structurée" | ||
714 | 63 | |||
715 | 64 | #. module: account_pain | ||
716 | 65 | #: selection:payment.line,struct_comm_type:0 | ||
717 | 66 | msgid "BBA Structured Communication" | ||
718 | 67 | msgstr "Communication structurée belge (BBA)" | ||
719 | 68 | |||
720 | 69 | #. module: account_pain | ||
721 | 70 | #: selection:payment.line,state:0 | ||
722 | 71 | msgid "Free Communication" | ||
723 | 72 | msgstr "Communication libre" | ||
724 | 73 | |||
725 | 74 | #. module: account_pain | ||
726 | 75 | #: selection:payment.line,state:0 | ||
727 | 76 | msgid "Structured Communication" | ||
728 | 77 | msgstr "Communication structurée" | ||
729 | 78 | |||
730 | 0 | 79 | ||
731 | === added file 'account_pain/i18n/nl.po' | |||
732 | --- account_pain/i18n/nl.po 1970-01-01 00:00:00 +0000 | |||
733 | +++ account_pain/i18n/nl.po 2013-10-31 17:26:11 +0000 | |||
734 | @@ -0,0 +1,78 @@ | |||
735 | 1 | # Dutch translation of openobject-addons. | ||
736 | 2 | # This file contains the translation of the following modules: | ||
737 | 3 | # * account_pain | ||
738 | 4 | # | ||
739 | 5 | msgid "" | ||
740 | 6 | msgstr "" | ||
741 | 7 | "Project-Id-Version: openobject-addons\n" | ||
742 | 8 | "Report-Msgid-Bugs-To: support@noviat.be\n" | ||
743 | 9 | "POT-Creation-Date: 2011-03-24 11:18:30.654000\n" | ||
744 | 10 | "PO-Revision-Date: 2011-03-24 11:18:30.654000\n" | ||
745 | 11 | "Last-Translator: Luc De Meyer (Noviat nv/sa)\n" | ||
746 | 12 | "Language-Team: \n" | ||
747 | 13 | "MIME-Version: 1.0\n" | ||
748 | 14 | "Content-Type: text/plain; charset=UTF-8\n" | ||
749 | 15 | "Content-Transfer-Encoding: 8bit\n" | ||
750 | 16 | |||
751 | 17 | #. module: account_pain | ||
752 | 18 | #: view:account.pain.create:0 | ||
753 | 19 | msgid "The ISO 20022 payment file has been created" | ||
754 | 20 | msgstr "Het ISO 20022 betalingsbestand is aangemaakt" | ||
755 | 21 | |||
756 | 22 | #. module: account_pain | ||
757 | 23 | #: view:account.pain.create:0 | ||
758 | 24 | msgid "Click on 'Save as' to save the file on your local disk." | ||
759 | 25 | msgstr "Selecteer 'Opslaan als' om dit bestand te bewaren op je lokale schijf." | ||
760 | 26 | |||
761 | 27 | #. module: account_pain | ||
762 | 28 | #: field:account.pain.create,pain_data:0 | ||
763 | 29 | msgid "Payment File" | ||
764 | 30 | msgstr "Betalingsbestand" | ||
765 | 31 | |||
766 | 32 | #. module: account_pain | ||
767 | 33 | #: field:account.pain.create,pain_fname:0 | ||
768 | 34 | msgid "Filename" | ||
769 | 35 | msgstr "Bestandsnaam" | ||
770 | 36 | |||
771 | 37 | #. module: account_pain | ||
772 | 38 | #: field:account.pain.create,note:0 | ||
773 | 39 | msgid "Remarks" | ||
774 | 40 | msgstr "Opmerkingen" | ||
775 | 41 | |||
776 | 42 | #. module: account_pain | ||
777 | 43 | #: code:addons/account_pain/wizard/pain_wizard.py:0 | ||
778 | 44 | #, python-format | ||
779 | 45 | msgid "Warning:\n" | ||
780 | 46 | msgstr "Waarschuwing:\n" | ||
781 | 47 | |||
782 | 48 | #. module: account_pain | ||
783 | 49 | #: code:addons/account_pain/wizard/pain_wizard.py:0 | ||
784 | 50 | #, python-format | ||
785 | 51 | msgid "\nThe Payment Date on Payment Line %s has been changed." | ||
786 | 52 | msgstr "\nDe betaaldatum van betaalregel %s is aangepast." | ||
787 | 53 | |||
788 | 54 | #. module: account_pain | ||
789 | 55 | #: field:payment.line,name:0 | ||
790 | 56 | msgid "Payment Line Ref." | ||
791 | 57 | msgstr "Ref. Betaalregel" | ||
792 | 58 | |||
793 | 59 | #. module: account_pain | ||
794 | 60 | #: field:payment.line,struct_comm_type:0 | ||
795 | 61 | msgid "Structured Communication Type" | ||
796 | 62 | msgstr "Type gestructureerde mededeling" | ||
797 | 63 | |||
798 | 64 | #. module: account_pain | ||
799 | 65 | #: selection:payment.line,struct_comm_type:0 | ||
800 | 66 | msgid "BBA Structured Communication" | ||
801 | 67 | msgstr "Belgische gestructureerde mededeling (BBA)" | ||
802 | 68 | |||
803 | 69 | #. module: account_pain | ||
804 | 70 | #: selection:payment.line,state:0 | ||
805 | 71 | msgid "Free Communication" | ||
806 | 72 | msgstr "Vrije mededeling" | ||
807 | 73 | |||
808 | 74 | #. module: account_pain | ||
809 | 75 | #: selection:payment.line,state:0 | ||
810 | 76 | msgid "Structured Communication" | ||
811 | 77 | msgstr "Gestructureerde mededeling" | ||
812 | 78 | |||
813 | 0 | 79 | ||
814 | === added directory 'account_pain/static' | |||
815 | === added directory 'account_pain/static/src' | |||
816 | === added directory 'account_pain/static/src/img' | |||
817 | === added file 'account_pain/static/src/img/icon.png' | |||
818 | 1 | Binary files account_pain/static/src/img/icon.png 1970-01-01 00:00:00 +0000 and account_pain/static/src/img/icon.png 2013-10-31 17:26:11 +0000 differ | 80 | Binary files account_pain/static/src/img/icon.png 1970-01-01 00:00:00 +0000 and account_pain/static/src/img/icon.png 2013-10-31 17:26:11 +0000 differ |
819 | === added directory 'account_pain/wizard' | |||
820 | === added file 'account_pain/wizard/__init__.py' | |||
821 | --- account_pain/wizard/__init__.py 1970-01-01 00:00:00 +0000 | |||
822 | +++ account_pain/wizard/__init__.py 2013-10-31 17:26:11 +0000 | |||
823 | @@ -0,0 +1,24 @@ | |||
824 | 1 | # -*- encoding: utf-8 -*- | ||
825 | 2 | ############################################################################## | ||
826 | 3 | # | ||
827 | 4 | # OpenERP, Open Source Management Solution | ||
828 | 5 | # | ||
829 | 6 | # Copyright (c) 2013 Noviat nv/sa (www.noviat.com). All rights reserved. | ||
830 | 7 | # | ||
831 | 8 | # This program is free software: you can redistribute it and/or modify | ||
832 | 9 | # it under the terms of the GNU Affero General Public License as | ||
833 | 10 | # published by the Free Software Foundation, either version 3 of the | ||
834 | 11 | # License, or (at your option) any later version. | ||
835 | 12 | # | ||
836 | 13 | # This program is distributed in the hope that it will be useful, | ||
837 | 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
838 | 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
839 | 16 | # GNU Affero General Public License for more details. | ||
840 | 17 | # | ||
841 | 18 | # You should have received a copy of the GNU Affero General Public License | ||
842 | 19 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
843 | 20 | # | ||
844 | 21 | ############################################################################## | ||
845 | 22 | |||
846 | 23 | from . import payment_order_create | ||
847 | 24 | from . import pain_wizard | ||
848 | 0 | \ No newline at end of file | 25 | \ No newline at end of file |
849 | 1 | 26 | ||
850 | === added file 'account_pain/wizard/pain_wizard.py' | |||
851 | --- account_pain/wizard/pain_wizard.py 1970-01-01 00:00:00 +0000 | |||
852 | +++ account_pain/wizard/pain_wizard.py 2013-10-31 17:26:11 +0000 | |||
853 | @@ -0,0 +1,303 @@ | |||
854 | 1 | # -*- encoding: utf-8 -*- | ||
855 | 2 | ############################################################################## | ||
856 | 3 | # | ||
857 | 4 | # OpenERP, Open Source Management Solution | ||
858 | 5 | # | ||
859 | 6 | # Copyright (c) 2013 Noviat nv/sa (www.noviat.com). All rights reserved. | ||
860 | 7 | # | ||
861 | 8 | # This program is free software: you can redistribute it and/or modify | ||
862 | 9 | # it under the terms of the GNU Affero General Public License as | ||
863 | 10 | # published by the Free Software Foundation, either version 3 of the | ||
864 | 11 | # License, or (at your option) any later version. | ||
865 | 12 | # | ||
866 | 13 | # This program is distributed in the hope that it will be useful, | ||
867 | 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
868 | 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
869 | 16 | # GNU Affero General Public License for more details. | ||
870 | 17 | # | ||
871 | 18 | # You should have received a copy of the GNU Affero General Public License | ||
872 | 19 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
873 | 20 | # | ||
874 | 21 | ############################################################################## | ||
875 | 22 | |||
876 | 23 | from openerp.tools.translate import _ | ||
877 | 24 | from openerp.osv import fields, orm | ||
878 | 25 | import re | ||
879 | 26 | import time | ||
880 | 27 | import base64 | ||
881 | 28 | from StringIO import StringIO | ||
882 | 29 | from lxml import etree | ||
883 | 30 | import tools | ||
884 | 31 | import logging | ||
885 | 32 | _logger = logging.getLogger(__name__) | ||
886 | 33 | |||
887 | 34 | class account_payment_make_payment(orm.TransientModel): | ||
888 | 35 | _inherit = 'account.payment.make.payment' | ||
889 | 36 | |||
890 | 37 | def launch_wizard(self, cr, uid, ids, context=None): | ||
891 | 38 | """ | ||
892 | 39 | Search for a wizard to launch according to the type. | ||
893 | 40 | Confirm the order without wizard if type is manual. | ||
894 | 41 | """ | ||
895 | 42 | if context is None: | ||
896 | 43 | context = {} | ||
897 | 44 | obj_payment_order = self.pool.get('payment.order') | ||
898 | 45 | obj_model = self.pool.get('ir.model.data') | ||
899 | 46 | obj_act = self.pool.get('ir.actions.act_window') | ||
900 | 47 | order = obj_payment_order.browse(cr, uid, context['active_id'], context) | ||
901 | 48 | payment_type = order.mode and order.mode.type or 'manual' | ||
902 | 49 | gw = obj_payment_order.get_wizard(payment_type) | ||
903 | 50 | if (not gw) or (payment_type == 'manual'): | ||
904 | 51 | obj_payment_order.set_done(cr, uid, [context['active_id']], context) | ||
905 | 52 | return {'type': 'ir.actions.act_window_close'} | ||
906 | 53 | |||
907 | 54 | # add support community modules using the payment gateway wizard plugin | ||
908 | 55 | module, wizard = gw | ||
909 | 56 | result = obj_model._get_id(cr, uid, module, wizard) | ||
910 | 57 | wiz_id = obj_model.read(cr, uid, [result], ['res_id'])[0]['res_id'] | ||
911 | 58 | if payment_type != 'iso20022': | ||
912 | 59 | return_act = obj_act.read(cr, uid, [wiz_id])[0] | ||
913 | 60 | return_act.update({'context': context}) | ||
914 | 61 | return return_act | ||
915 | 62 | |||
916 | 63 | # generate ISO 20022 XML | ||
917 | 64 | data = self.generate_pain(cr, uid, context) | ||
918 | 65 | apc_id = self.pool.get('account.pain.create').create(cr, uid, data) | ||
919 | 66 | obj_model = self.pool.get('ir.model.data') | ||
920 | 67 | model_data_ids = obj_model.search(cr,uid,[('model','=','ir.ui.view'), ('name','=','account_pain_save_view')]) | ||
921 | 68 | resource_id = obj_model.read(cr, uid, model_data_ids, fields=['res_id'])[0]['res_id'] | ||
922 | 69 | return { | ||
923 | 70 | 'name': _('The ISO 20022 payment file has been created'), | ||
924 | 71 | 'view_type': 'form', | ||
925 | 72 | 'view_mode': 'form', | ||
926 | 73 | 'res_model': 'account.pain.create', | ||
927 | 74 | 'res_id': apc_id, | ||
928 | 75 | 'views': [(resource_id, 'form')], | ||
929 | 76 | 'type': 'ir.actions.act_window', | ||
930 | 77 | 'target': 'new', | ||
931 | 78 | 'context': context, | ||
932 | 79 | } | ||
933 | 80 | |||
934 | 81 | def format_comm(self, comm): | ||
935 | 82 | bbacomm = re.sub('\D', '', comm) | ||
936 | 83 | if len(bbacomm) == 12: | ||
937 | 84 | base = int(bbacomm[:10]) | ||
938 | 85 | mod = base % 97 or 97 | ||
939 | 86 | if mod == int(bbacomm[-2:]): | ||
940 | 87 | return bbacomm | ||
941 | 88 | return False | ||
942 | 89 | |||
943 | 90 | def generate_pain(self, cr, uid, context): | ||
944 | 91 | if not context: | ||
945 | 92 | context = {} | ||
946 | 93 | active_id = context.get('active_id', []) | ||
947 | 94 | |||
948 | 95 | payment_obj = self.pool.get('payment.order') | ||
949 | 96 | payment_line_obj = self.pool.get('payment.line') | ||
950 | 97 | attachment_obj = self.pool.get('ir.attachment') | ||
951 | 98 | payment_line_obj = self.pool.get('payment.line') | ||
952 | 99 | note = '' | ||
953 | 100 | |||
954 | 101 | payment = payment_obj.browse(cr, uid, active_id, context=context) | ||
955 | 102 | payment_mode = payment.mode | ||
956 | 103 | pain_fname = re.sub('\W', '_', payment.reference).lower() + '.xml' | ||
957 | 104 | company = self.pool.get('res.users').browse(cr, uid, uid).company_id | ||
958 | 105 | if not (payment_mode.bank_id.bank_bic or payment_mode.bank_id.bank.bic): | ||
959 | 106 | raise orm.except_orm(_('Configuration Error!'), | ||
960 | 107 | _("Please fill in the BIC code of the Bank Debtor Account for this Payment Order!")) | ||
961 | 108 | if not payment.line_ids: | ||
962 | 109 | raise orm.except_orm(_('Data Error!'), | ||
963 | 110 | _("Your Payment Order does not contain payment instructions!")) | ||
964 | 111 | if payment_mode.journal.currency and (payment_mode.journal.currency != company.currency_id): | ||
965 | 112 | raise orm.except_orm(_('Payment Order Error!'), | ||
966 | 113 | _('Only payments from a bank account in company currency are supported in the current release ' \ | ||
967 | 114 | 'of the ISO 20022 payment module!')) | ||
968 | 115 | |||
969 | 116 | # create XML | ||
970 | 117 | ns_map = { | ||
971 | 118 | None: 'urn:iso:std:iso:20022:tech:xsd:pain.001.001.03', | ||
972 | 119 | 'xsi': 'http://www.w3.org/2001/XMLSchema-instance', | ||
973 | 120 | } | ||
974 | 121 | pain = etree.Element('Document', nsmap = ns_map) | ||
975 | 122 | CstmrCdtTrfInitn = etree.SubElement(pain, 'CstmrCdtTrfInitn') | ||
976 | 123 | # GroupHeader | ||
977 | 124 | GrpHdr = etree.SubElement(CstmrCdtTrfInitn, 'GrpHdr') | ||
978 | 125 | MsgId = etree.SubElement(GrpHdr, 'MsgId') | ||
979 | 126 | MsgId.text = payment.reference | ||
980 | 127 | CreDtTm = etree.SubElement(GrpHdr, 'CreDtTm') | ||
981 | 128 | CreDtTm.text = time.strftime('%Y-%m-%dT%H:%M:%S') | ||
982 | 129 | NbOfTxs = etree.SubElement(GrpHdr, 'NbOfTxs') | ||
983 | 130 | NbOfTxs.text = str(len(payment.line_ids)) | ||
984 | 131 | CtrlSum = etree.SubElement(GrpHdr, 'CtrlSum') | ||
985 | 132 | CtrlSum.text = '%.2f' % payment.total | ||
986 | 133 | InitgPty = etree.SubElement(GrpHdr, 'InitgPty') | ||
987 | 134 | Nm = etree.SubElement(InitgPty, 'Nm') | ||
988 | 135 | Nm.text = company.name | ||
989 | 136 | if payment_mode.initgpty_id: | ||
990 | 137 | Id = etree.SubElement(InitgPty, 'Id') | ||
991 | 138 | OrgId = etree.SubElement(Id, 'OrgId') | ||
992 | 139 | Othr = etree.SubElement(OrgId, 'Othr') | ||
993 | 140 | Id = etree.SubElement(Othr, 'Id') | ||
994 | 141 | Id.text = payment_mode.initgpty_id | ||
995 | 142 | if payment_mode.initgpty_issr: | ||
996 | 143 | Issr = etree.SubElement(Othr, 'Issr') | ||
997 | 144 | Issr.text = payment_mode.initgpty_issr | ||
998 | 145 | # PaymentInformation | ||
999 | 146 | payment_method = 'TRF' | ||
1000 | 147 | for line in payment.line_ids: | ||
1001 | 148 | if line.currency != company.currency_id: | ||
1002 | 149 | raise orm.except_orm(_('Payment Instruction Error!'), | ||
1003 | 150 | _('Unsupported Payment Instruction in Payment Line %s.\n' \ | ||
1004 | 151 | 'Only payments in company currency are supported in the current release ' \ | ||
1005 | 152 | 'of the ISO 20022 payment module!') % line.name) | ||
1006 | 153 | if not line.amount: | ||
1007 | 154 | raise orm.except_orm(_('Payment Instruction Error!'), | ||
1008 | 155 | _('Payment Instruction Error in Payment Line %s.\n' \ | ||
1009 | 156 | 'Please fill in the transaction amount!') %line.name) | ||
1010 | 157 | if not (line.bank_id and line.bank_id.iban): | ||
1011 | 158 | raise orm.except_orm(_('Payment Instruction Error!'), | ||
1012 | 159 | _('Unsupported Payment Instruction in Payment Line %s.\n' \ | ||
1013 | 160 | 'Please fill in the IBAN number of the Bank Creditor Account for this Payment Line!') % line.name) | ||
1014 | 161 | |||
1015 | 162 | if payment.date_prefered == 'now': | ||
1016 | 163 | execution_date = time.strftime('%Y-%m-%d') | ||
1017 | 164 | elif payment.date_prefered == 'fixed': | ||
1018 | 165 | execution_date = payment.date_scheduled | ||
1019 | 166 | elif payment.date_prefered == 'due': | ||
1020 | 167 | if not line.date: | ||
1021 | 168 | if line.ml_maturity_date: | ||
1022 | 169 | excution_date = ml_maturity_date | ||
1023 | 170 | else: | ||
1024 | 171 | execution_date = time.strftime('%Y-%m-%d') | ||
1025 | 172 | else: | ||
1026 | 173 | execution_date = line.date | ||
1027 | 174 | else: | ||
1028 | 175 | raise orm.except_orm(_('Unsupported Payment Order Option!'), | ||
1029 | 176 | _("Please ensure that the 'Preferred date' is equal to 'Due date', 'Directly' or 'Fixed date'!")) | ||
1030 | 177 | if execution_date < time.strftime('%Y-%m-%d'): | ||
1031 | 178 | execution_date = time.strftime('%Y-%m-%d') | ||
1032 | 179 | if line.date != execution_date: | ||
1033 | 180 | note += _('\nThe Payment Date on Payment Line %s has been changed.') % line.name | ||
1034 | 181 | payment_line_obj.write(cr, uid, line.id, {'date': execution_date}) | ||
1035 | 182 | |||
1036 | 183 | PmtInf = etree.SubElement(CstmrCdtTrfInitn, 'PmtInf') | ||
1037 | 184 | PmtInfId = etree.SubElement(PmtInf, 'PmtInfId') | ||
1038 | 185 | PmtInfId.text = line.name | ||
1039 | 186 | PmtMtd = etree.SubElement(PmtInf, 'PmtMtd') | ||
1040 | 187 | PmtMtd.text = payment_method | ||
1041 | 188 | BtchBookg = etree.SubElement(PmtInf, 'BtchBookg') | ||
1042 | 189 | BtchBookg.text = 'false' | ||
1043 | 190 | if payment_method == 'TRF': | ||
1044 | 191 | PmtTpInf = etree.SubElement(PmtInf, 'PmtTpInf') | ||
1045 | 192 | InstrPrty = etree.SubElement(PmtTpInf, 'InstrPrty') | ||
1046 | 193 | InstrPrty.text = 'NORM' | ||
1047 | 194 | SvcLvl = etree.SubElement(PmtTpInf, 'SvcLvl') | ||
1048 | 195 | Cd = etree.SubElement(SvcLvl, 'Cd') | ||
1049 | 196 | Cd.text = 'SEPA' | ||
1050 | 197 | ReqdExctnDt = etree.SubElement(PmtInf, 'ReqdExctnDt') | ||
1051 | 198 | ReqdExctnDt.text = execution_date | ||
1052 | 199 | Dbtr = etree.SubElement(PmtInf, 'Dbtr') | ||
1053 | 200 | Nm = etree.SubElement(Dbtr, 'Nm') | ||
1054 | 201 | Nm.text = company.name | ||
1055 | 202 | DbtrAcct = etree.SubElement(PmtInf, 'DbtrAcct') | ||
1056 | 203 | Id = etree.SubElement(DbtrAcct, 'Id') | ||
1057 | 204 | IBAN = etree.SubElement(Id, 'IBAN') | ||
1058 | 205 | IBAN.text = payment_mode.bank_id.iban.upper().replace(' ','') | ||
1059 | 206 | DbtrAgt = etree.SubElement(PmtInf, 'DbtrAgt') | ||
1060 | 207 | FinInstnId = etree.SubElement(DbtrAgt, 'FinInstnId') | ||
1061 | 208 | BIC = etree.SubElement(FinInstnId, 'BIC') | ||
1062 | 209 | BIC.text = re.sub('\s','',payment_mode.bank_id.bank_bic.upper() or payment_mode.bank_id.bank.bic.upper()) | ||
1063 | 210 | ChrgBr = etree.SubElement(PmtInf, 'ChrgBr') | ||
1064 | 211 | ChrgBr.text = 'SLEV' | ||
1065 | 212 | CdtTrfTxInf = etree.SubElement(PmtInf, 'CdtTrfTxInf') | ||
1066 | 213 | PmtId = etree.SubElement(CdtTrfTxInf, 'PmtId') | ||
1067 | 214 | EndToEndId = etree.SubElement(PmtId, 'EndToEndId') | ||
1068 | 215 | EndToEndId.text = line.name | ||
1069 | 216 | Amt = etree.SubElement(CdtTrfTxInf, 'Amt') | ||
1070 | 217 | InstdAmt = etree.SubElement(Amt, 'InstdAmt', Ccy=line.currency.name) | ||
1071 | 218 | InstdAmt.text = '%.2f' % line.amount | ||
1072 | 219 | if line.bank_id.iban[0:2].upper() not in ['BE']: # to be completed with other countries allowing payments without BIC | ||
1073 | 220 | if not (line.bank_id.bank_bic or line.bank_id.bank.bic): | ||
1074 | 221 | raise orm.except_orm(_('Configuration Error!'), | ||
1075 | 222 | _('Unsupported Payment Instruction in Payment Line %s.\n' \ | ||
1076 | 223 | 'Please fill in the BIC code of the Bank Creditor Account for this Payment Line!') % line.name) | ||
1077 | 224 | if line.bank_id.bank_bic or line.bank_id.bank.bic: | ||
1078 | 225 | CdtrAgt = etree.SubElement(CdtTrfTxInf, 'CdtrAgt') | ||
1079 | 226 | FinInstnId = etree.SubElement(CdtrAgt, 'FinInstnId') | ||
1080 | 227 | BIC = etree.SubElement(FinInstnId, 'BIC') | ||
1081 | 228 | BIC.text = re.sub('\s','',line.bank_id.bank_bic.upper() or line.bank_id.bank.bic.upper()) | ||
1082 | 229 | Cdtr = etree.SubElement(CdtTrfTxInf, 'Cdtr') | ||
1083 | 230 | Nm = etree.SubElement(Cdtr, 'Nm') | ||
1084 | 231 | Nm.text = line.partner_id.name | ||
1085 | 232 | CdtrAcct = etree.SubElement(CdtTrfTxInf, 'CdtrAcct') | ||
1086 | 233 | Id = etree.SubElement(CdtrAcct, 'Id') | ||
1087 | 234 | IBAN = etree.SubElement(Id, 'IBAN') | ||
1088 | 235 | IBAN.text = line.bank_id.iban.upper().replace(' ','') | ||
1089 | 236 | if line.communication: | ||
1090 | 237 | comm = line.communication | ||
1091 | 238 | if line.communication2: | ||
1092 | 239 | comm += ' ' + line.communication2 | ||
1093 | 240 | RmtInf = etree.SubElement(CdtTrfTxInf, 'RmtInf') | ||
1094 | 241 | if line.state == 'normal': | ||
1095 | 242 | Ustrd = etree.SubElement(RmtInf, 'Ustrd') | ||
1096 | 243 | Ustrd.text = comm | ||
1097 | 244 | elif line.state == 'structured': | ||
1098 | 245 | Strd = etree.SubElement(RmtInf, 'Strd') | ||
1099 | 246 | CdtrRefInf = etree.SubElement(Strd, 'CdtrRefInf') | ||
1100 | 247 | Tp = etree.SubElement(CdtrRefInf, 'Tp') | ||
1101 | 248 | CdOrPrtry = etree.SubElement(Tp, 'CdOrPrtry') | ||
1102 | 249 | Cd = etree.SubElement(CdOrPrtry, 'Cd') | ||
1103 | 250 | Cd.text = 'SCOR' | ||
1104 | 251 | Issr = etree.SubElement(Tp, 'Issr') | ||
1105 | 252 | Issr.text = 'BBA' | ||
1106 | 253 | comm = self.format_comm(line.communication) | ||
1107 | 254 | if not comm: | ||
1108 | 255 | raise orm.except_orm(_('Payment Instruction Error!'), | ||
1109 | 256 | _('Unsupported Structured Communication in Payment Line %s.\n' \ | ||
1110 | 257 | 'Only the Belgian Structured Communication format (BBA) is supported in the current release ' \ | ||
1111 | 258 | 'of the ISO 20022 payment module!') % line.name) | ||
1112 | 259 | Ref = etree.SubElement(CdtrRefInf, 'Ref') | ||
1113 | 260 | Ref.text = comm | ||
1114 | 261 | else: | ||
1115 | 262 | raise orm.except_orm(_('Configuration Error!'), | ||
1116 | 263 | _('Unsupported Communication Type in Payment Line %s.\n') % line.name) | ||
1117 | 264 | pain_data = etree.tostring(pain, encoding='UTF-8', xml_declaration=True, pretty_print=True) | ||
1118 | 265 | # validate the generated XML schema | ||
1119 | 266 | xsd = tools.file_open('account_pain/xsd/pain.001.001.03.xsd') | ||
1120 | 267 | xmlschema_doc = etree.parse(xsd) | ||
1121 | 268 | xmlschema = etree.XMLSchema(xmlschema_doc) | ||
1122 | 269 | xml_to_validate = StringIO(pain_data) | ||
1123 | 270 | parse_result = etree.parse(xml_to_validate) | ||
1124 | 271 | if xmlschema.validate(parse_result): | ||
1125 | 272 | pain_data = base64.encodestring(pain_data) | ||
1126 | 273 | attachment_obj.create(cr, uid, { | ||
1127 | 274 | 'name': pain_fname, | ||
1128 | 275 | 'datas': pain_data, | ||
1129 | 276 | 'datas_fname': pain_fname, | ||
1130 | 277 | 'res_model': 'payment.order', | ||
1131 | 278 | 'res_id': active_id, | ||
1132 | 279 | }, context=context) | ||
1133 | 280 | payment_obj.set_done(cr, uid, [active_id], context) | ||
1134 | 281 | else: | ||
1135 | 282 | _logger.error('The generated XML file does not fit the required schema !') | ||
1136 | 283 | _logger.error(tools.ustr(xmlschema.error_log.last_error)) | ||
1137 | 284 | error = xmlschema.error_log[0] | ||
1138 | 285 | raise orm.except_orm(_('The generated XML file does not fit the required schema !'), | ||
1139 | 286 | error.message) | ||
1140 | 287 | |||
1141 | 288 | if note: | ||
1142 | 289 | note = _('Warning:\n') + note | ||
1143 | 290 | |||
1144 | 291 | return {'pain_data': pain_data, 'pain_fname': pain_fname, 'note': note} | ||
1145 | 292 | |||
1146 | 293 | class account_pain_create(orm.TransientModel): | ||
1147 | 294 | _name = 'account.pain.create' | ||
1148 | 295 | _description = 'ISO 20022 payment file' | ||
1149 | 296 | |||
1150 | 297 | _columns = { | ||
1151 | 298 | 'pain_data': fields.binary('Payment File', required=True, readonly=True), | ||
1152 | 299 | 'pain_fname': fields.char('Filename', size=128, required=True), | ||
1153 | 300 | 'note': fields.text('Remarks'), | ||
1154 | 301 | } | ||
1155 | 302 | |||
1156 | 303 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
1157 | 0 | \ No newline at end of file | 304 | \ No newline at end of file |
1158 | 1 | 305 | ||
1159 | === added file 'account_pain/wizard/payment_order_create.py' | |||
1160 | --- account_pain/wizard/payment_order_create.py 1970-01-01 00:00:00 +0000 | |||
1161 | +++ account_pain/wizard/payment_order_create.py 2013-10-31 17:26:11 +0000 | |||
1162 | @@ -0,0 +1,140 @@ | |||
1163 | 1 | # -*- encoding: utf-8 -*- | ||
1164 | 2 | ############################################################################## | ||
1165 | 3 | # | ||
1166 | 4 | # OpenERP, Open Source Management Solution | ||
1167 | 5 | # | ||
1168 | 6 | # Copyright (c) 2013 Noviat nv/sa (www.noviat.com). All rights reserved. | ||
1169 | 7 | # | ||
1170 | 8 | # This program is free software: you can redistribute it and/or modify | ||
1171 | 9 | # it under the terms of the GNU Affero General Public License as | ||
1172 | 10 | # published by the Free Software Foundation, either version 3 of the | ||
1173 | 11 | # License, or (at your option) any later version. | ||
1174 | 12 | # | ||
1175 | 13 | # This program is distributed in the hope that it will be useful, | ||
1176 | 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1177 | 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1178 | 16 | # GNU Affero General Public License for more details. | ||
1179 | 17 | # | ||
1180 | 18 | # You should have received a copy of the GNU Affero General Public License | ||
1181 | 19 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1182 | 20 | # | ||
1183 | 21 | ############################################################################## | ||
1184 | 22 | |||
1185 | 23 | from datetime import datetime, date, timedelta | ||
1186 | 24 | from lxml import etree | ||
1187 | 25 | from openerp.osv import fields, orm | ||
1188 | 26 | from tools.translate import _ | ||
1189 | 27 | import logging | ||
1190 | 28 | _logger = logging.getLogger(__name__) | ||
1191 | 29 | |||
1192 | 30 | class payment_order_create(orm.TransientModel): | ||
1193 | 31 | _inherit = 'payment.order.create' | ||
1194 | 32 | |||
1195 | 33 | _defaults = { | ||
1196 | 34 | 'duedate': lambda *a: (date.today() + timedelta(30)).isoformat(), | ||
1197 | 35 | } | ||
1198 | 36 | |||
1199 | 37 | def journal_domain(self, cr, uid, context=None): | ||
1200 | 38 | """ | ||
1201 | 39 | override this method in order to customise the journals to search on | ||
1202 | 40 | """ | ||
1203 | 41 | journal_domain = [('journal_id.type', 'in', ['purchase', 'sale_refund', 'general', 'situation'])] | ||
1204 | 42 | return journal_domain | ||
1205 | 43 | |||
1206 | 44 | def search_entries(self, cr, uid, ids, context=None): | ||
1207 | 45 | """ | ||
1208 | 46 | Override the search_entries & fields_view_get methods of the account_payment payment.order.create object | ||
1209 | 47 | """ | ||
1210 | 48 | line_obj = self.pool.get('account.move.line') | ||
1211 | 49 | mod_obj = self.pool.get('ir.model.data') | ||
1212 | 50 | if context is None: | ||
1213 | 51 | context = {} | ||
1214 | 52 | data = self.read(cr, uid, ids, [], context=context)[0] | ||
1215 | 53 | search_due_date = data['duedate'] | ||
1216 | 54 | # Search for move line to pay: | ||
1217 | 55 | domain = [('reconcile_id', '=', False), ('partner_id', '!=', False), ('account_id.type', 'in', ['payable', 'receivable']), ('amount_to_pay', '>', 0)] # update Noviat | ||
1218 | 56 | domain = domain + ['|', ('date_maturity', '<=', search_due_date), ('date_maturity', '=', False)] | ||
1219 | 57 | journal_domain = self.journal_domain(cr, uid) | ||
1220 | 58 | domain = domain + journal_domain | ||
1221 | 59 | line_ids = line_obj.search(cr, uid, domain, context=context) | ||
1222 | 60 | context.update({'line_ids': line_ids}) | ||
1223 | 61 | model_data_ids = mod_obj.search(cr, uid,[('model', '=', 'ir.ui.view'), ('name', '=', 'view_create_payment_order_lines')], context=context) | ||
1224 | 62 | resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id'] | ||
1225 | 63 | return {'name': _('Populate Payment'), | ||
1226 | 64 | 'context': context, | ||
1227 | 65 | 'view_type': 'form', | ||
1228 | 66 | 'view_mode': 'form', | ||
1229 | 67 | 'res_model': 'payment.order.create', | ||
1230 | 68 | 'views': [(resource_id,'form')], | ||
1231 | 69 | 'type': 'ir.actions.act_window', | ||
1232 | 70 | 'target': 'new', | ||
1233 | 71 | } | ||
1234 | 72 | |||
1235 | 73 | """ | ||
1236 | 74 | add context to 'entries' field for use in account.move.line | ||
1237 | 75 | """ | ||
1238 | 76 | def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): | ||
1239 | 77 | res = super(payment_order_create, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=False) | ||
1240 | 78 | if context and 'line_ids' in context and view_type == 'form': | ||
1241 | 79 | doc = etree.XML(res['arch']) | ||
1242 | 80 | nodes = doc.xpath("//field[@name='entries']") | ||
1243 | 81 | for node in nodes: | ||
1244 | 82 | # add context for use in account.move.line | ||
1245 | 83 | node.set('context', "{'account_payment':'1', 'view_mode':'tree'}") | ||
1246 | 84 | node.set('colspan', '4') | ||
1247 | 85 | node.set('height', '300') | ||
1248 | 86 | node.set('width', '800') | ||
1249 | 87 | res['arch'] = etree.tostring(doc) | ||
1250 | 88 | return res | ||
1251 | 89 | |||
1252 | 90 | def create_payment(self, cr, uid, ids, context=None): | ||
1253 | 91 | """ | ||
1254 | 92 | This method replaces the original one for multi-currency purposes | ||
1255 | 93 | """ | ||
1256 | 94 | order_obj = self.pool.get('payment.order') | ||
1257 | 95 | line_obj = self.pool.get('account.move.line') | ||
1258 | 96 | payment_obj = self.pool.get('payment.line') | ||
1259 | 97 | if context is None: | ||
1260 | 98 | context = {} | ||
1261 | 99 | data = self.browse(cr, uid, ids, context=context)[0] | ||
1262 | 100 | line_ids = [entry.id for entry in data.entries] | ||
1263 | 101 | if not line_ids: | ||
1264 | 102 | return {'type': 'ir.actions.act_window_close'} | ||
1265 | 103 | |||
1266 | 104 | payment = order_obj.browse(cr, uid, context['active_id'], context=context) | ||
1267 | 105 | t = payment.mode.type == 'iso20022' and payment.mode.id or None | ||
1268 | 106 | line2bank = line_obj.line2bank(cr, uid, line_ids, t, context) | ||
1269 | 107 | |||
1270 | 108 | company_currency = payment.mode.company_id.currency_id | ||
1271 | 109 | payment_mode_currency = payment.mode.journal.currency or company_currency | ||
1272 | 110 | |||
1273 | 111 | ## Finally populate the current payment with new lines: | ||
1274 | 112 | for line in line_obj.browse(cr, uid, line_ids, context=context): | ||
1275 | 113 | if payment.date_prefered == "now": | ||
1276 | 114 | #no payment date => immediate payment | ||
1277 | 115 | date_to_pay = False | ||
1278 | 116 | elif payment.date_prefered == 'due': | ||
1279 | 117 | date_to_pay = line.date_maturity | ||
1280 | 118 | elif payment.date_prefered == 'fixed': | ||
1281 | 119 | date_to_pay = payment.date_scheduled | ||
1282 | 120 | |||
1283 | 121 | transaction_currency = line.currency_id or company_currency | ||
1284 | 122 | if transaction_currency != payment_mode_currency and payment.mode.type == 'iso20022': | ||
1285 | 123 | raise orm.except_orm(_('Unsupported Operation !'), | ||
1286 | 124 | _("The payment in another currency as the originating transaction is not supported in the" \ | ||
1287 | 125 | "current release of the ISO 20022 Payment Gateway" | ||
1288 | 126 | "\nTransaction Currency: %s, Payment Mode Currency: %s)" \ | ||
1289 | 127 | "\n\nPlease contact info@noviat.be if this is a requirement.") | ||
1290 | 128 | %(transaction_currency, payment_mode_currency) ) | ||
1291 | 129 | |||
1292 | 130 | payment_obj.create(cr, uid,{ | ||
1293 | 131 | 'move_line_id': line.id, | ||
1294 | 132 | 'amount_currency': line.amount_to_pay, | ||
1295 | 133 | 'bank_id': line2bank.get(line.id), | ||
1296 | 134 | 'order_id': payment.id, | ||
1297 | 135 | 'partner_id': line.partner_id and line.partner_id.id or False, | ||
1298 | 136 | 'communication': line.ref or '/', | ||
1299 | 137 | 'date': date_to_pay, | ||
1300 | 138 | 'currency': line.currency_id.id or company_currency.id, | ||
1301 | 139 | }, context=context) | ||
1302 | 140 | return {'type': 'ir.actions.act_window_close'} | ||
1303 | 0 | 141 | ||
1304 | === added directory 'account_pain/xsd' | |||
1305 | === added file 'account_pain/xsd/pain.001.001.03.xsd' | |||
1306 | --- account_pain/xsd/pain.001.001.03.xsd 1970-01-01 00:00:00 +0000 | |||
1307 | +++ account_pain/xsd/pain.001.001.03.xsd 2013-10-31 17:26:11 +0000 | |||
1308 | @@ -0,0 +1,921 @@ | |||
1309 | 1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
1310 | 2 | <!--Generated by SWIFTStandards Workstation (build:R6.1.0.2) on 2009 Jan 08 17:30:53--> | ||
1311 | 3 | <xs:schema xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03"> | ||
1312 | 4 | <xs:element name="Document" type="Document"/> | ||
1313 | 5 | <xs:complexType name="AccountIdentification4Choice"> | ||
1314 | 6 | <xs:sequence> | ||
1315 | 7 | <xs:choice> | ||
1316 | 8 | <xs:element name="IBAN" type="IBAN2007Identifier"/> | ||
1317 | 9 | <xs:element name="Othr" type="GenericAccountIdentification1"/> | ||
1318 | 10 | </xs:choice> | ||
1319 | 11 | </xs:sequence> | ||
1320 | 12 | </xs:complexType> | ||
1321 | 13 | <xs:complexType name="AccountSchemeName1Choice"> | ||
1322 | 14 | <xs:sequence> | ||
1323 | 15 | <xs:choice> | ||
1324 | 16 | <xs:element name="Cd" type="ExternalAccountIdentification1Code"/> | ||
1325 | 17 | <xs:element name="Prtry" type="Max35Text"/> | ||
1326 | 18 | </xs:choice> | ||
1327 | 19 | </xs:sequence> | ||
1328 | 20 | </xs:complexType> | ||
1329 | 21 | <xs:simpleType name="ActiveOrHistoricCurrencyAndAmount_SimpleType"> | ||
1330 | 22 | <xs:restriction base="xs:decimal"> | ||
1331 | 23 | <xs:minInclusive value="0"/> | ||
1332 | 24 | <xs:fractionDigits value="5"/> | ||
1333 | 25 | <xs:totalDigits value="18"/> | ||
1334 | 26 | </xs:restriction> | ||
1335 | 27 | </xs:simpleType> | ||
1336 | 28 | <xs:complexType name="ActiveOrHistoricCurrencyAndAmount"> | ||
1337 | 29 | <xs:simpleContent> | ||
1338 | 30 | <xs:extension base="ActiveOrHistoricCurrencyAndAmount_SimpleType"> | ||
1339 | 31 | <xs:attribute name="Ccy" type="ActiveOrHistoricCurrencyCode" use="required"/> | ||
1340 | 32 | </xs:extension> | ||
1341 | 33 | </xs:simpleContent> | ||
1342 | 34 | </xs:complexType> | ||
1343 | 35 | <xs:simpleType name="ActiveOrHistoricCurrencyCode"> | ||
1344 | 36 | <xs:restriction base="xs:string"> | ||
1345 | 37 | <xs:pattern value="[A-Z]{3,3}"/> | ||
1346 | 38 | </xs:restriction> | ||
1347 | 39 | </xs:simpleType> | ||
1348 | 40 | <xs:simpleType name="AddressType2Code"> | ||
1349 | 41 | <xs:restriction base="xs:string"> | ||
1350 | 42 | <xs:enumeration value="ADDR"/> | ||
1351 | 43 | <xs:enumeration value="PBOX"/> | ||
1352 | 44 | <xs:enumeration value="HOME"/> | ||
1353 | 45 | <xs:enumeration value="BIZZ"/> | ||
1354 | 46 | <xs:enumeration value="MLTO"/> | ||
1355 | 47 | <xs:enumeration value="DLVY"/> | ||
1356 | 48 | </xs:restriction> | ||
1357 | 49 | </xs:simpleType> | ||
1358 | 50 | <xs:complexType name="AmountType3Choice"> | ||
1359 | 51 | <xs:sequence> | ||
1360 | 52 | <xs:choice> | ||
1361 | 53 | <xs:element name="InstdAmt" type="ActiveOrHistoricCurrencyAndAmount"/> | ||
1362 | 54 | <xs:element name="EqvtAmt" type="EquivalentAmount2"/> | ||
1363 | 55 | </xs:choice> | ||
1364 | 56 | </xs:sequence> | ||
1365 | 57 | </xs:complexType> | ||
1366 | 58 | <xs:simpleType name="AnyBICIdentifier"> | ||
1367 | 59 | <xs:restriction base="xs:string"> | ||
1368 | 60 | <xs:pattern value="[A-Z]{6,6}[A-Z2-9][A-NP-Z0-9]([A-Z0-9]{3,3}){0,1}"/> | ||
1369 | 61 | </xs:restriction> | ||
1370 | 62 | </xs:simpleType> | ||
1371 | 63 | <xs:complexType name="Authorisation1Choice"> | ||
1372 | 64 | <xs:sequence> | ||
1373 | 65 | <xs:choice> | ||
1374 | 66 | <xs:element name="Cd" type="Authorisation1Code"/> | ||
1375 | 67 | <xs:element name="Prtry" type="Max128Text"/> | ||
1376 | 68 | </xs:choice> | ||
1377 | 69 | </xs:sequence> | ||
1378 | 70 | </xs:complexType> | ||
1379 | 71 | <xs:simpleType name="Authorisation1Code"> | ||
1380 | 72 | <xs:restriction base="xs:string"> | ||
1381 | 73 | <xs:enumeration value="AUTH"/> | ||
1382 | 74 | <xs:enumeration value="FDET"/> | ||
1383 | 75 | <xs:enumeration value="FSUM"/> | ||
1384 | 76 | <xs:enumeration value="ILEV"/> | ||
1385 | 77 | </xs:restriction> | ||
1386 | 78 | </xs:simpleType> | ||
1387 | 79 | <xs:simpleType name="BICIdentifier"> | ||
1388 | 80 | <xs:restriction base="xs:string"> | ||
1389 | 81 | <xs:pattern value="[A-Z]{6,6}[A-Z2-9][A-NP-Z0-9]([A-Z0-9]{3,3}){0,1}"/> | ||
1390 | 82 | </xs:restriction> | ||
1391 | 83 | </xs:simpleType> | ||
1392 | 84 | <xs:simpleType name="BaseOneRate"> | ||
1393 | 85 | <xs:restriction base="xs:decimal"> | ||
1394 | 86 | <xs:fractionDigits value="10"/> | ||
1395 | 87 | <xs:totalDigits value="11"/> | ||
1396 | 88 | </xs:restriction> | ||
1397 | 89 | </xs:simpleType> | ||
1398 | 90 | <xs:simpleType name="BatchBookingIndicator"> | ||
1399 | 91 | <xs:restriction base="xs:boolean"/> | ||
1400 | 92 | </xs:simpleType> | ||
1401 | 93 | <xs:complexType name="BranchAndFinancialInstitutionIdentification4"> | ||
1402 | 94 | <xs:sequence> | ||
1403 | 95 | <xs:element name="FinInstnId" type="FinancialInstitutionIdentification7"/> | ||
1404 | 96 | <xs:element maxOccurs="1" minOccurs="0" name="BrnchId" type="BranchData2"/> | ||
1405 | 97 | </xs:sequence> | ||
1406 | 98 | </xs:complexType> | ||
1407 | 99 | <xs:complexType name="BranchData2"> | ||
1408 | 100 | <xs:sequence> | ||
1409 | 101 | <xs:element maxOccurs="1" minOccurs="0" name="Id" type="Max35Text"/> | ||
1410 | 102 | <xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/> | ||
1411 | 103 | <xs:element maxOccurs="1" minOccurs="0" name="PstlAdr" type="PostalAddress6"/> | ||
1412 | 104 | </xs:sequence> | ||
1413 | 105 | </xs:complexType> | ||
1414 | 106 | <xs:complexType name="CashAccount16"> | ||
1415 | 107 | <xs:sequence> | ||
1416 | 108 | <xs:element name="Id" type="AccountIdentification4Choice"/> | ||
1417 | 109 | <xs:element maxOccurs="1" minOccurs="0" name="Tp" type="CashAccountType2"/> | ||
1418 | 110 | <xs:element maxOccurs="1" minOccurs="0" name="Ccy" type="ActiveOrHistoricCurrencyCode"/> | ||
1419 | 111 | <xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max70Text"/> | ||
1420 | 112 | </xs:sequence> | ||
1421 | 113 | </xs:complexType> | ||
1422 | 114 | <xs:complexType name="CashAccountType2"> | ||
1423 | 115 | <xs:sequence> | ||
1424 | 116 | <xs:choice> | ||
1425 | 117 | <xs:element name="Cd" type="CashAccountType4Code"/> | ||
1426 | 118 | <xs:element name="Prtry" type="Max35Text"/> | ||
1427 | 119 | </xs:choice> | ||
1428 | 120 | </xs:sequence> | ||
1429 | 121 | </xs:complexType> | ||
1430 | 122 | <xs:simpleType name="CashAccountType4Code"> | ||
1431 | 123 | <xs:restriction base="xs:string"> | ||
1432 | 124 | <xs:enumeration value="CASH"/> | ||
1433 | 125 | <xs:enumeration value="CHAR"/> | ||
1434 | 126 | <xs:enumeration value="COMM"/> | ||
1435 | 127 | <xs:enumeration value="TAXE"/> | ||
1436 | 128 | <xs:enumeration value="CISH"/> | ||
1437 | 129 | <xs:enumeration value="TRAS"/> | ||
1438 | 130 | <xs:enumeration value="SACC"/> | ||
1439 | 131 | <xs:enumeration value="CACC"/> | ||
1440 | 132 | <xs:enumeration value="SVGS"/> | ||
1441 | 133 | <xs:enumeration value="ONDP"/> | ||
1442 | 134 | <xs:enumeration value="MGLD"/> | ||
1443 | 135 | <xs:enumeration value="NREX"/> | ||
1444 | 136 | <xs:enumeration value="MOMA"/> | ||
1445 | 137 | <xs:enumeration value="LOAN"/> | ||
1446 | 138 | <xs:enumeration value="SLRY"/> | ||
1447 | 139 | <xs:enumeration value="ODFT"/> | ||
1448 | 140 | </xs:restriction> | ||
1449 | 141 | </xs:simpleType> | ||
1450 | 142 | <xs:complexType name="CategoryPurpose1Choice"> | ||
1451 | 143 | <xs:sequence> | ||
1452 | 144 | <xs:choice> | ||
1453 | 145 | <xs:element name="Cd" type="ExternalCategoryPurpose1Code"/> | ||
1454 | 146 | <xs:element name="Prtry" type="Max35Text"/> | ||
1455 | 147 | </xs:choice> | ||
1456 | 148 | </xs:sequence> | ||
1457 | 149 | </xs:complexType> | ||
1458 | 150 | <xs:simpleType name="ChargeBearerType1Code"> | ||
1459 | 151 | <xs:restriction base="xs:string"> | ||
1460 | 152 | <xs:enumeration value="DEBT"/> | ||
1461 | 153 | <xs:enumeration value="CRED"/> | ||
1462 | 154 | <xs:enumeration value="SHAR"/> | ||
1463 | 155 | <xs:enumeration value="SLEV"/> | ||
1464 | 156 | </xs:restriction> | ||
1465 | 157 | </xs:simpleType> | ||
1466 | 158 | <xs:complexType name="Cheque6"> | ||
1467 | 159 | <xs:sequence> | ||
1468 | 160 | <xs:element maxOccurs="1" minOccurs="0" name="ChqTp" type="ChequeType2Code"/> | ||
1469 | 161 | <xs:element maxOccurs="1" minOccurs="0" name="ChqNb" type="Max35Text"/> | ||
1470 | 162 | <xs:element maxOccurs="1" minOccurs="0" name="ChqFr" type="NameAndAddress10"/> | ||
1471 | 163 | <xs:element maxOccurs="1" minOccurs="0" name="DlvryMtd" type="ChequeDeliveryMethod1Choice"/> | ||
1472 | 164 | <xs:element maxOccurs="1" minOccurs="0" name="DlvrTo" type="NameAndAddress10"/> | ||
1473 | 165 | <xs:element maxOccurs="1" minOccurs="0" name="InstrPrty" type="Priority2Code"/> | ||
1474 | 166 | <xs:element maxOccurs="1" minOccurs="0" name="ChqMtrtyDt" type="ISODate"/> | ||
1475 | 167 | <xs:element maxOccurs="1" minOccurs="0" name="FrmsCd" type="Max35Text"/> | ||
1476 | 168 | <xs:element maxOccurs="2" minOccurs="0" name="MemoFld" type="Max35Text"/> | ||
1477 | 169 | <xs:element maxOccurs="1" minOccurs="0" name="RgnlClrZone" type="Max35Text"/> | ||
1478 | 170 | <xs:element maxOccurs="1" minOccurs="0" name="PrtLctn" type="Max35Text"/> | ||
1479 | 171 | </xs:sequence> | ||
1480 | 172 | </xs:complexType> | ||
1481 | 173 | <xs:simpleType name="ChequeDelivery1Code"> | ||
1482 | 174 | <xs:restriction base="xs:string"> | ||
1483 | 175 | <xs:enumeration value="MLDB"/> | ||
1484 | 176 | <xs:enumeration value="MLCD"/> | ||
1485 | 177 | <xs:enumeration value="MLFA"/> | ||
1486 | 178 | <xs:enumeration value="CRDB"/> | ||
1487 | 179 | <xs:enumeration value="CRCD"/> | ||
1488 | 180 | <xs:enumeration value="CRFA"/> | ||
1489 | 181 | <xs:enumeration value="PUDB"/> | ||
1490 | 182 | <xs:enumeration value="PUCD"/> | ||
1491 | 183 | <xs:enumeration value="PUFA"/> | ||
1492 | 184 | <xs:enumeration value="RGDB"/> | ||
1493 | 185 | <xs:enumeration value="RGCD"/> | ||
1494 | 186 | <xs:enumeration value="RGFA"/> | ||
1495 | 187 | </xs:restriction> | ||
1496 | 188 | </xs:simpleType> | ||
1497 | 189 | <xs:complexType name="ChequeDeliveryMethod1Choice"> | ||
1498 | 190 | <xs:sequence> | ||
1499 | 191 | <xs:choice> | ||
1500 | 192 | <xs:element name="Cd" type="ChequeDelivery1Code"/> | ||
1501 | 193 | <xs:element name="Prtry" type="Max35Text"/> | ||
1502 | 194 | </xs:choice> | ||
1503 | 195 | </xs:sequence> | ||
1504 | 196 | </xs:complexType> | ||
1505 | 197 | <xs:simpleType name="ChequeType2Code"> | ||
1506 | 198 | <xs:restriction base="xs:string"> | ||
1507 | 199 | <xs:enumeration value="CCHQ"/> | ||
1508 | 200 | <xs:enumeration value="CCCH"/> | ||
1509 | 201 | <xs:enumeration value="BCHQ"/> | ||
1510 | 202 | <xs:enumeration value="DRFT"/> | ||
1511 | 203 | <xs:enumeration value="ELDR"/> | ||
1512 | 204 | </xs:restriction> | ||
1513 | 205 | </xs:simpleType> | ||
1514 | 206 | <xs:complexType name="ClearingSystemIdentification2Choice"> | ||
1515 | 207 | <xs:sequence> | ||
1516 | 208 | <xs:choice> | ||
1517 | 209 | <xs:element name="Cd" type="ExternalClearingSystemIdentification1Code"/> | ||
1518 | 210 | <xs:element name="Prtry" type="Max35Text"/> | ||
1519 | 211 | </xs:choice> | ||
1520 | 212 | </xs:sequence> | ||
1521 | 213 | </xs:complexType> | ||
1522 | 214 | <xs:complexType name="ClearingSystemMemberIdentification2"> | ||
1523 | 215 | <xs:sequence> | ||
1524 | 216 | <xs:element maxOccurs="1" minOccurs="0" name="ClrSysId" type="ClearingSystemIdentification2Choice"/> | ||
1525 | 217 | <xs:element name="MmbId" type="Max35Text"/> | ||
1526 | 218 | </xs:sequence> | ||
1527 | 219 | </xs:complexType> | ||
1528 | 220 | <xs:complexType name="ContactDetails2"> | ||
1529 | 221 | <xs:sequence> | ||
1530 | 222 | <xs:element maxOccurs="1" minOccurs="0" name="NmPrfx" type="NamePrefix1Code"/> | ||
1531 | 223 | <xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/> | ||
1532 | 224 | <xs:element maxOccurs="1" minOccurs="0" name="PhneNb" type="PhoneNumber"/> | ||
1533 | 225 | <xs:element maxOccurs="1" minOccurs="0" name="MobNb" type="PhoneNumber"/> | ||
1534 | 226 | <xs:element maxOccurs="1" minOccurs="0" name="FaxNb" type="PhoneNumber"/> | ||
1535 | 227 | <xs:element maxOccurs="1" minOccurs="0" name="EmailAdr" type="Max2048Text"/> | ||
1536 | 228 | <xs:element maxOccurs="1" minOccurs="0" name="Othr" type="Max35Text"/> | ||
1537 | 229 | </xs:sequence> | ||
1538 | 230 | </xs:complexType> | ||
1539 | 231 | <xs:simpleType name="CountryCode"> | ||
1540 | 232 | <xs:restriction base="xs:string"> | ||
1541 | 233 | <xs:pattern value="[A-Z]{2,2}"/> | ||
1542 | 234 | </xs:restriction> | ||
1543 | 235 | </xs:simpleType> | ||
1544 | 236 | <xs:simpleType name="CreditDebitCode"> | ||
1545 | 237 | <xs:restriction base="xs:string"> | ||
1546 | 238 | <xs:enumeration value="CRDT"/> | ||
1547 | 239 | <xs:enumeration value="DBIT"/> | ||
1548 | 240 | </xs:restriction> | ||
1549 | 241 | </xs:simpleType> | ||
1550 | 242 | <xs:complexType name="CreditTransferTransactionInformation10"> | ||
1551 | 243 | <xs:sequence> | ||
1552 | 244 | <xs:element name="PmtId" type="PaymentIdentification1"/> | ||
1553 | 245 | <xs:element maxOccurs="1" minOccurs="0" name="PmtTpInf" type="PaymentTypeInformation19"/> | ||
1554 | 246 | <xs:element name="Amt" type="AmountType3Choice"/> | ||
1555 | 247 | <xs:element maxOccurs="1" minOccurs="0" name="XchgRateInf" type="ExchangeRateInformation1"/> | ||
1556 | 248 | <xs:element maxOccurs="1" minOccurs="0" name="ChrgBr" type="ChargeBearerType1Code"/> | ||
1557 | 249 | <xs:element maxOccurs="1" minOccurs="0" name="ChqInstr" type="Cheque6"/> | ||
1558 | 250 | <xs:element maxOccurs="1" minOccurs="0" name="UltmtDbtr" type="PartyIdentification32"/> | ||
1559 | 251 | <xs:element maxOccurs="1" minOccurs="0" name="IntrmyAgt1" type="BranchAndFinancialInstitutionIdentification4"/> | ||
1560 | 252 | <xs:element maxOccurs="1" minOccurs="0" name="IntrmyAgt1Acct" type="CashAccount16"/> | ||
1561 | 253 | <xs:element maxOccurs="1" minOccurs="0" name="IntrmyAgt2" type="BranchAndFinancialInstitutionIdentification4"/> | ||
1562 | 254 | <xs:element maxOccurs="1" minOccurs="0" name="IntrmyAgt2Acct" type="CashAccount16"/> | ||
1563 | 255 | <xs:element maxOccurs="1" minOccurs="0" name="IntrmyAgt3" type="BranchAndFinancialInstitutionIdentification4"/> | ||
1564 | 256 | <xs:element maxOccurs="1" minOccurs="0" name="IntrmyAgt3Acct" type="CashAccount16"/> | ||
1565 | 257 | <xs:element maxOccurs="1" minOccurs="0" name="CdtrAgt" type="BranchAndFinancialInstitutionIdentification4"/> | ||
1566 | 258 | <xs:element maxOccurs="1" minOccurs="0" name="CdtrAgtAcct" type="CashAccount16"/> | ||
1567 | 259 | <xs:element maxOccurs="1" minOccurs="0" name="Cdtr" type="PartyIdentification32"/> | ||
1568 | 260 | <xs:element maxOccurs="1" minOccurs="0" name="CdtrAcct" type="CashAccount16"/> | ||
1569 | 261 | <xs:element maxOccurs="1" minOccurs="0" name="UltmtCdtr" type="PartyIdentification32"/> | ||
1570 | 262 | <xs:element maxOccurs="unbounded" minOccurs="0" name="InstrForCdtrAgt" type="InstructionForCreditorAgent1"/> | ||
1571 | 263 | <xs:element maxOccurs="1" minOccurs="0" name="InstrForDbtrAgt" type="Max140Text"/> | ||
1572 | 264 | <xs:element maxOccurs="1" minOccurs="0" name="Purp" type="Purpose2Choice"/> | ||
1573 | 265 | <xs:element maxOccurs="10" minOccurs="0" name="RgltryRptg" type="RegulatoryReporting3"/> | ||
1574 | 266 | <xs:element maxOccurs="1" minOccurs="0" name="Tax" type="TaxInformation3"/> | ||
1575 | 267 | <xs:element maxOccurs="10" minOccurs="0" name="RltdRmtInf" type="RemittanceLocation2"/> | ||
1576 | 268 | <xs:element maxOccurs="1" minOccurs="0" name="RmtInf" type="RemittanceInformation5"/> | ||
1577 | 269 | </xs:sequence> | ||
1578 | 270 | </xs:complexType> | ||
1579 | 271 | <xs:complexType name="CreditorReferenceInformation2"> | ||
1580 | 272 | <xs:sequence> | ||
1581 | 273 | <xs:element maxOccurs="1" minOccurs="0" name="Tp" type="CreditorReferenceType2"/> | ||
1582 | 274 | <xs:element maxOccurs="1" minOccurs="0" name="Ref" type="Max35Text"/> | ||
1583 | 275 | </xs:sequence> | ||
1584 | 276 | </xs:complexType> | ||
1585 | 277 | <xs:complexType name="CreditorReferenceType1Choice"> | ||
1586 | 278 | <xs:sequence> | ||
1587 | 279 | <xs:choice> | ||
1588 | 280 | <xs:element name="Cd" type="DocumentType3Code"/> | ||
1589 | 281 | <xs:element name="Prtry" type="Max35Text"/> | ||
1590 | 282 | </xs:choice> | ||
1591 | 283 | </xs:sequence> | ||
1592 | 284 | </xs:complexType> | ||
1593 | 285 | <xs:complexType name="CreditorReferenceType2"> | ||
1594 | 286 | <xs:sequence> | ||
1595 | 287 | <xs:element name="CdOrPrtry" type="CreditorReferenceType1Choice"/> | ||
1596 | 288 | <xs:element maxOccurs="1" minOccurs="0" name="Issr" type="Max35Text"/> | ||
1597 | 289 | </xs:sequence> | ||
1598 | 290 | </xs:complexType> | ||
1599 | 291 | <xs:complexType name="CustomerCreditTransferInitiationV03"> | ||
1600 | 292 | <xs:sequence> | ||
1601 | 293 | <xs:element name="GrpHdr" type="GroupHeader32"/> | ||
1602 | 294 | <xs:element maxOccurs="unbounded" minOccurs="1" name="PmtInf" type="PaymentInstructionInformation3"/> | ||
1603 | 295 | </xs:sequence> | ||
1604 | 296 | </xs:complexType> | ||
1605 | 297 | <xs:complexType name="DateAndPlaceOfBirth"> | ||
1606 | 298 | <xs:sequence> | ||
1607 | 299 | <xs:element name="BirthDt" type="ISODate"/> | ||
1608 | 300 | <xs:element maxOccurs="1" minOccurs="0" name="PrvcOfBirth" type="Max35Text"/> | ||
1609 | 301 | <xs:element name="CityOfBirth" type="Max35Text"/> | ||
1610 | 302 | <xs:element name="CtryOfBirth" type="CountryCode"/> | ||
1611 | 303 | </xs:sequence> | ||
1612 | 304 | </xs:complexType> | ||
1613 | 305 | <xs:complexType name="DatePeriodDetails"> | ||
1614 | 306 | <xs:sequence> | ||
1615 | 307 | <xs:element name="FrDt" type="ISODate"/> | ||
1616 | 308 | <xs:element name="ToDt" type="ISODate"/> | ||
1617 | 309 | </xs:sequence> | ||
1618 | 310 | </xs:complexType> | ||
1619 | 311 | <xs:simpleType name="DecimalNumber"> | ||
1620 | 312 | <xs:restriction base="xs:decimal"> | ||
1621 | 313 | <xs:fractionDigits value="17"/> | ||
1622 | 314 | <xs:totalDigits value="18"/> | ||
1623 | 315 | </xs:restriction> | ||
1624 | 316 | </xs:simpleType> | ||
1625 | 317 | <xs:complexType name="Document"> | ||
1626 | 318 | <xs:sequence> | ||
1627 | 319 | <xs:element name="CstmrCdtTrfInitn" type="CustomerCreditTransferInitiationV03"/> | ||
1628 | 320 | </xs:sequence> | ||
1629 | 321 | </xs:complexType> | ||
1630 | 322 | <xs:complexType name="DocumentAdjustment1"> | ||
1631 | 323 | <xs:sequence> | ||
1632 | 324 | <xs:element name="Amt" type="ActiveOrHistoricCurrencyAndAmount"/> | ||
1633 | 325 | <xs:element maxOccurs="1" minOccurs="0" name="CdtDbtInd" type="CreditDebitCode"/> | ||
1634 | 326 | <xs:element maxOccurs="1" minOccurs="0" name="Rsn" type="Max4Text"/> | ||
1635 | 327 | <xs:element maxOccurs="1" minOccurs="0" name="AddtlInf" type="Max140Text"/> | ||
1636 | 328 | </xs:sequence> | ||
1637 | 329 | </xs:complexType> | ||
1638 | 330 | <xs:simpleType name="DocumentType3Code"> | ||
1639 | 331 | <xs:restriction base="xs:string"> | ||
1640 | 332 | <xs:enumeration value="RADM"/> | ||
1641 | 333 | <xs:enumeration value="RPIN"/> | ||
1642 | 334 | <xs:enumeration value="FXDR"/> | ||
1643 | 335 | <xs:enumeration value="DISP"/> | ||
1644 | 336 | <xs:enumeration value="PUOR"/> | ||
1645 | 337 | <xs:enumeration value="SCOR"/> | ||
1646 | 338 | </xs:restriction> | ||
1647 | 339 | </xs:simpleType> | ||
1648 | 340 | <xs:simpleType name="DocumentType5Code"> | ||
1649 | 341 | <xs:restriction base="xs:string"> | ||
1650 | 342 | <xs:enumeration value="MSIN"/> | ||
1651 | 343 | <xs:enumeration value="CNFA"/> | ||
1652 | 344 | <xs:enumeration value="DNFA"/> | ||
1653 | 345 | <xs:enumeration value="CINV"/> | ||
1654 | 346 | <xs:enumeration value="CREN"/> | ||
1655 | 347 | <xs:enumeration value="DEBN"/> | ||
1656 | 348 | <xs:enumeration value="HIRI"/> | ||
1657 | 349 | <xs:enumeration value="SBIN"/> | ||
1658 | 350 | <xs:enumeration value="CMCN"/> | ||
1659 | 351 | <xs:enumeration value="SOAC"/> | ||
1660 | 352 | <xs:enumeration value="DISP"/> | ||
1661 | 353 | <xs:enumeration value="BOLD"/> | ||
1662 | 354 | <xs:enumeration value="VCHR"/> | ||
1663 | 355 | <xs:enumeration value="AROI"/> | ||
1664 | 356 | <xs:enumeration value="TSUT"/> | ||
1665 | 357 | </xs:restriction> | ||
1666 | 358 | </xs:simpleType> | ||
1667 | 359 | <xs:complexType name="EquivalentAmount2"> | ||
1668 | 360 | <xs:sequence> | ||
1669 | 361 | <xs:element name="Amt" type="ActiveOrHistoricCurrencyAndAmount"/> | ||
1670 | 362 | <xs:element name="CcyOfTrf" type="ActiveOrHistoricCurrencyCode"/> | ||
1671 | 363 | </xs:sequence> | ||
1672 | 364 | </xs:complexType> | ||
1673 | 365 | <xs:complexType name="ExchangeRateInformation1"> | ||
1674 | 366 | <xs:sequence> | ||
1675 | 367 | <xs:element maxOccurs="1" minOccurs="0" name="XchgRate" type="BaseOneRate"/> | ||
1676 | 368 | <xs:element maxOccurs="1" minOccurs="0" name="RateTp" type="ExchangeRateType1Code"/> | ||
1677 | 369 | <xs:element maxOccurs="1" minOccurs="0" name="CtrctId" type="Max35Text"/> | ||
1678 | 370 | </xs:sequence> | ||
1679 | 371 | </xs:complexType> | ||
1680 | 372 | <xs:simpleType name="ExchangeRateType1Code"> | ||
1681 | 373 | <xs:restriction base="xs:string"> | ||
1682 | 374 | <xs:enumeration value="SPOT"/> | ||
1683 | 375 | <xs:enumeration value="SALE"/> | ||
1684 | 376 | <xs:enumeration value="AGRD"/> | ||
1685 | 377 | </xs:restriction> | ||
1686 | 378 | </xs:simpleType> | ||
1687 | 379 | <xs:simpleType name="ExternalAccountIdentification1Code"> | ||
1688 | 380 | <xs:restriction base="xs:string"> | ||
1689 | 381 | <xs:minLength value="1"/> | ||
1690 | 382 | <xs:maxLength value="4"/> | ||
1691 | 383 | </xs:restriction> | ||
1692 | 384 | </xs:simpleType> | ||
1693 | 385 | <xs:simpleType name="ExternalCategoryPurpose1Code"> | ||
1694 | 386 | <xs:restriction base="xs:string"> | ||
1695 | 387 | <xs:minLength value="1"/> | ||
1696 | 388 | <xs:maxLength value="4"/> | ||
1697 | 389 | </xs:restriction> | ||
1698 | 390 | </xs:simpleType> | ||
1699 | 391 | <xs:simpleType name="ExternalClearingSystemIdentification1Code"> | ||
1700 | 392 | <xs:restriction base="xs:string"> | ||
1701 | 393 | <xs:minLength value="1"/> | ||
1702 | 394 | <xs:maxLength value="5"/> | ||
1703 | 395 | </xs:restriction> | ||
1704 | 396 | </xs:simpleType> | ||
1705 | 397 | <xs:simpleType name="ExternalFinancialInstitutionIdentification1Code"> | ||
1706 | 398 | <xs:restriction base="xs:string"> | ||
1707 | 399 | <xs:minLength value="1"/> | ||
1708 | 400 | <xs:maxLength value="4"/> | ||
1709 | 401 | </xs:restriction> | ||
1710 | 402 | </xs:simpleType> | ||
1711 | 403 | <xs:simpleType name="ExternalLocalInstrument1Code"> | ||
1712 | 404 | <xs:restriction base="xs:string"> | ||
1713 | 405 | <xs:minLength value="1"/> | ||
1714 | 406 | <xs:maxLength value="35"/> | ||
1715 | 407 | </xs:restriction> | ||
1716 | 408 | </xs:simpleType> | ||
1717 | 409 | <xs:simpleType name="ExternalOrganisationIdentification1Code"> | ||
1718 | 410 | <xs:restriction base="xs:string"> | ||
1719 | 411 | <xs:minLength value="1"/> | ||
1720 | 412 | <xs:maxLength value="4"/> | ||
1721 | 413 | </xs:restriction> | ||
1722 | 414 | </xs:simpleType> | ||
1723 | 415 | <xs:simpleType name="ExternalPersonIdentification1Code"> | ||
1724 | 416 | <xs:restriction base="xs:string"> | ||
1725 | 417 | <xs:minLength value="1"/> | ||
1726 | 418 | <xs:maxLength value="4"/> | ||
1727 | 419 | </xs:restriction> | ||
1728 | 420 | </xs:simpleType> | ||
1729 | 421 | <xs:simpleType name="ExternalPurpose1Code"> | ||
1730 | 422 | <xs:restriction base="xs:string"> | ||
1731 | 423 | <xs:minLength value="1"/> | ||
1732 | 424 | <xs:maxLength value="4"/> | ||
1733 | 425 | </xs:restriction> | ||
1734 | 426 | </xs:simpleType> | ||
1735 | 427 | <xs:simpleType name="ExternalServiceLevel1Code"> | ||
1736 | 428 | <xs:restriction base="xs:string"> | ||
1737 | 429 | <xs:minLength value="1"/> | ||
1738 | 430 | <xs:maxLength value="4"/> | ||
1739 | 431 | </xs:restriction> | ||
1740 | 432 | </xs:simpleType> | ||
1741 | 433 | <xs:complexType name="FinancialIdentificationSchemeName1Choice"> | ||
1742 | 434 | <xs:sequence> | ||
1743 | 435 | <xs:choice> | ||
1744 | 436 | <xs:element name="Cd" type="ExternalFinancialInstitutionIdentification1Code"/> | ||
1745 | 437 | <xs:element name="Prtry" type="Max35Text"/> | ||
1746 | 438 | </xs:choice> | ||
1747 | 439 | </xs:sequence> | ||
1748 | 440 | </xs:complexType> | ||
1749 | 441 | <xs:complexType name="FinancialInstitutionIdentification7"> | ||
1750 | 442 | <xs:sequence> | ||
1751 | 443 | <xs:element maxOccurs="1" minOccurs="0" name="BIC" type="BICIdentifier"/> | ||
1752 | 444 | <xs:element maxOccurs="1" minOccurs="0" name="ClrSysMmbId" type="ClearingSystemMemberIdentification2"/> | ||
1753 | 445 | <xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/> | ||
1754 | 446 | <xs:element maxOccurs="1" minOccurs="0" name="PstlAdr" type="PostalAddress6"/> | ||
1755 | 447 | <xs:element maxOccurs="1" minOccurs="0" name="Othr" type="GenericFinancialIdentification1"/> | ||
1756 | 448 | </xs:sequence> | ||
1757 | 449 | </xs:complexType> | ||
1758 | 450 | <xs:complexType name="GenericAccountIdentification1"> | ||
1759 | 451 | <xs:sequence> | ||
1760 | 452 | <xs:element name="Id" type="Max34Text"/> | ||
1761 | 453 | <xs:element maxOccurs="1" minOccurs="0" name="SchmeNm" type="AccountSchemeName1Choice"/> | ||
1762 | 454 | <xs:element maxOccurs="1" minOccurs="0" name="Issr" type="Max35Text"/> | ||
1763 | 455 | </xs:sequence> | ||
1764 | 456 | </xs:complexType> | ||
1765 | 457 | <xs:complexType name="GenericFinancialIdentification1"> | ||
1766 | 458 | <xs:sequence> | ||
1767 | 459 | <xs:element name="Id" type="Max35Text"/> | ||
1768 | 460 | <xs:element maxOccurs="1" minOccurs="0" name="SchmeNm" type="FinancialIdentificationSchemeName1Choice"/> | ||
1769 | 461 | <xs:element maxOccurs="1" minOccurs="0" name="Issr" type="Max35Text"/> | ||
1770 | 462 | </xs:sequence> | ||
1771 | 463 | </xs:complexType> | ||
1772 | 464 | <xs:complexType name="GenericOrganisationIdentification1"> | ||
1773 | 465 | <xs:sequence> | ||
1774 | 466 | <xs:element name="Id" type="Max35Text"/> | ||
1775 | 467 | <xs:element maxOccurs="1" minOccurs="0" name="SchmeNm" type="OrganisationIdentificationSchemeName1Choice"/> | ||
1776 | 468 | <xs:element maxOccurs="1" minOccurs="0" name="Issr" type="Max35Text"/> | ||
1777 | 469 | </xs:sequence> | ||
1778 | 470 | </xs:complexType> | ||
1779 | 471 | <xs:complexType name="GenericPersonIdentification1"> | ||
1780 | 472 | <xs:sequence> | ||
1781 | 473 | <xs:element name="Id" type="Max35Text"/> | ||
1782 | 474 | <xs:element maxOccurs="1" minOccurs="0" name="SchmeNm" type="PersonIdentificationSchemeName1Choice"/> | ||
1783 | 475 | <xs:element maxOccurs="1" minOccurs="0" name="Issr" type="Max35Text"/> | ||
1784 | 476 | </xs:sequence> | ||
1785 | 477 | </xs:complexType> | ||
1786 | 478 | <xs:complexType name="GroupHeader32"> | ||
1787 | 479 | <xs:sequence> | ||
1788 | 480 | <xs:element name="MsgId" type="Max35Text"/> | ||
1789 | 481 | <xs:element name="CreDtTm" type="ISODateTime"/> | ||
1790 | 482 | <xs:element maxOccurs="2" minOccurs="0" name="Authstn" type="Authorisation1Choice"/> | ||
1791 | 483 | <xs:element name="NbOfTxs" type="Max15NumericText"/> | ||
1792 | 484 | <xs:element maxOccurs="1" minOccurs="0" name="CtrlSum" type="DecimalNumber"/> | ||
1793 | 485 | <xs:element name="InitgPty" type="PartyIdentification32"/> | ||
1794 | 486 | <xs:element maxOccurs="1" minOccurs="0" name="FwdgAgt" type="BranchAndFinancialInstitutionIdentification4"/> | ||
1795 | 487 | </xs:sequence> | ||
1796 | 488 | </xs:complexType> | ||
1797 | 489 | <xs:simpleType name="IBAN2007Identifier"> | ||
1798 | 490 | <xs:restriction base="xs:string"> | ||
1799 | 491 | <xs:pattern value="[A-Z]{2,2}[0-9]{2,2}[a-zA-Z0-9]{1,30}"/> | ||
1800 | 492 | </xs:restriction> | ||
1801 | 493 | </xs:simpleType> | ||
1802 | 494 | <xs:simpleType name="ISODate"> | ||
1803 | 495 | <xs:restriction base="xs:date"/> | ||
1804 | 496 | </xs:simpleType> | ||
1805 | 497 | <xs:simpleType name="ISODateTime"> | ||
1806 | 498 | <xs:restriction base="xs:dateTime"/> | ||
1807 | 499 | </xs:simpleType> | ||
1808 | 500 | <xs:simpleType name="Instruction3Code"> | ||
1809 | 501 | <xs:restriction base="xs:string"> | ||
1810 | 502 | <xs:enumeration value="CHQB"/> | ||
1811 | 503 | <xs:enumeration value="HOLD"/> | ||
1812 | 504 | <xs:enumeration value="PHOB"/> | ||
1813 | 505 | <xs:enumeration value="TELB"/> | ||
1814 | 506 | </xs:restriction> | ||
1815 | 507 | </xs:simpleType> | ||
1816 | 508 | <xs:complexType name="InstructionForCreditorAgent1"> | ||
1817 | 509 | <xs:sequence> | ||
1818 | 510 | <xs:element maxOccurs="1" minOccurs="0" name="Cd" type="Instruction3Code"/> | ||
1819 | 511 | <xs:element maxOccurs="1" minOccurs="0" name="InstrInf" type="Max140Text"/> | ||
1820 | 512 | </xs:sequence> | ||
1821 | 513 | </xs:complexType> | ||
1822 | 514 | <xs:complexType name="LocalInstrument2Choice"> | ||
1823 | 515 | <xs:sequence> | ||
1824 | 516 | <xs:choice> | ||
1825 | 517 | <xs:element name="Cd" type="ExternalLocalInstrument1Code"/> | ||
1826 | 518 | <xs:element name="Prtry" type="Max35Text"/> | ||
1827 | 519 | </xs:choice> | ||
1828 | 520 | </xs:sequence> | ||
1829 | 521 | </xs:complexType> | ||
1830 | 522 | <xs:simpleType name="Max10Text"> | ||
1831 | 523 | <xs:restriction base="xs:string"> | ||
1832 | 524 | <xs:minLength value="1"/> | ||
1833 | 525 | <xs:maxLength value="10"/> | ||
1834 | 526 | </xs:restriction> | ||
1835 | 527 | </xs:simpleType> | ||
1836 | 528 | <xs:simpleType name="Max128Text"> | ||
1837 | 529 | <xs:restriction base="xs:string"> | ||
1838 | 530 | <xs:minLength value="1"/> | ||
1839 | 531 | <xs:maxLength value="128"/> | ||
1840 | 532 | </xs:restriction> | ||
1841 | 533 | </xs:simpleType> | ||
1842 | 534 | <xs:simpleType name="Max140Text"> | ||
1843 | 535 | <xs:restriction base="xs:string"> | ||
1844 | 536 | <xs:minLength value="1"/> | ||
1845 | 537 | <xs:maxLength value="140"/> | ||
1846 | 538 | </xs:restriction> | ||
1847 | 539 | </xs:simpleType> | ||
1848 | 540 | <xs:simpleType name="Max15NumericText"> | ||
1849 | 541 | <xs:restriction base="xs:string"> | ||
1850 | 542 | <xs:pattern value="[0-9]{1,15}"/> | ||
1851 | 543 | </xs:restriction> | ||
1852 | 544 | </xs:simpleType> | ||
1853 | 545 | <xs:simpleType name="Max16Text"> | ||
1854 | 546 | <xs:restriction base="xs:string"> | ||
1855 | 547 | <xs:minLength value="1"/> | ||
1856 | 548 | <xs:maxLength value="16"/> | ||
1857 | 549 | </xs:restriction> | ||
1858 | 550 | </xs:simpleType> | ||
1859 | 551 | <xs:simpleType name="Max2048Text"> | ||
1860 | 552 | <xs:restriction base="xs:string"> | ||
1861 | 553 | <xs:minLength value="1"/> | ||
1862 | 554 | <xs:maxLength value="2048"/> | ||
1863 | 555 | </xs:restriction> | ||
1864 | 556 | </xs:simpleType> | ||
1865 | 557 | <xs:simpleType name="Max34Text"> | ||
1866 | 558 | <xs:restriction base="xs:string"> | ||
1867 | 559 | <xs:minLength value="1"/> | ||
1868 | 560 | <xs:maxLength value="34"/> | ||
1869 | 561 | </xs:restriction> | ||
1870 | 562 | </xs:simpleType> | ||
1871 | 563 | <xs:simpleType name="Max35Text"> | ||
1872 | 564 | <xs:restriction base="xs:string"> | ||
1873 | 565 | <xs:minLength value="1"/> | ||
1874 | 566 | <xs:maxLength value="35"/> | ||
1875 | 567 | </xs:restriction> | ||
1876 | 568 | </xs:simpleType> | ||
1877 | 569 | <xs:simpleType name="Max4Text"> | ||
1878 | 570 | <xs:restriction base="xs:string"> | ||
1879 | 571 | <xs:minLength value="1"/> | ||
1880 | 572 | <xs:maxLength value="4"/> | ||
1881 | 573 | </xs:restriction> | ||
1882 | 574 | </xs:simpleType> | ||
1883 | 575 | <xs:simpleType name="Max70Text"> | ||
1884 | 576 | <xs:restriction base="xs:string"> | ||
1885 | 577 | <xs:minLength value="1"/> | ||
1886 | 578 | <xs:maxLength value="70"/> | ||
1887 | 579 | </xs:restriction> | ||
1888 | 580 | </xs:simpleType> | ||
1889 | 581 | <xs:complexType name="NameAndAddress10"> | ||
1890 | 582 | <xs:sequence> | ||
1891 | 583 | <xs:element name="Nm" type="Max140Text"/> | ||
1892 | 584 | <xs:element name="Adr" type="PostalAddress6"/> | ||
1893 | 585 | </xs:sequence> | ||
1894 | 586 | </xs:complexType> | ||
1895 | 587 | <xs:simpleType name="NamePrefix1Code"> | ||
1896 | 588 | <xs:restriction base="xs:string"> | ||
1897 | 589 | <xs:enumeration value="DOCT"/> | ||
1898 | 590 | <xs:enumeration value="MIST"/> | ||
1899 | 591 | <xs:enumeration value="MISS"/> | ||
1900 | 592 | <xs:enumeration value="MADM"/> | ||
1901 | 593 | </xs:restriction> | ||
1902 | 594 | </xs:simpleType> | ||
1903 | 595 | <xs:simpleType name="Number"> | ||
1904 | 596 | <xs:restriction base="xs:decimal"> | ||
1905 | 597 | <xs:fractionDigits value="0"/> | ||
1906 | 598 | <xs:totalDigits value="18"/> | ||
1907 | 599 | </xs:restriction> | ||
1908 | 600 | </xs:simpleType> | ||
1909 | 601 | <xs:complexType name="OrganisationIdentification4"> | ||
1910 | 602 | <xs:sequence> | ||
1911 | 603 | <xs:element maxOccurs="1" minOccurs="0" name="BICOrBEI" type="AnyBICIdentifier"/> | ||
1912 | 604 | <xs:element maxOccurs="unbounded" minOccurs="0" name="Othr" type="GenericOrganisationIdentification1"/> | ||
1913 | 605 | </xs:sequence> | ||
1914 | 606 | </xs:complexType> | ||
1915 | 607 | <xs:complexType name="OrganisationIdentificationSchemeName1Choice"> | ||
1916 | 608 | <xs:sequence> | ||
1917 | 609 | <xs:choice> | ||
1918 | 610 | <xs:element name="Cd" type="ExternalOrganisationIdentification1Code"/> | ||
1919 | 611 | <xs:element name="Prtry" type="Max35Text"/> | ||
1920 | 612 | </xs:choice> | ||
1921 | 613 | </xs:sequence> | ||
1922 | 614 | </xs:complexType> | ||
1923 | 615 | <xs:complexType name="Party6Choice"> | ||
1924 | 616 | <xs:sequence> | ||
1925 | 617 | <xs:choice> | ||
1926 | 618 | <xs:element name="OrgId" type="OrganisationIdentification4"/> | ||
1927 | 619 | <xs:element name="PrvtId" type="PersonIdentification5"/> | ||
1928 | 620 | </xs:choice> | ||
1929 | 621 | </xs:sequence> | ||
1930 | 622 | </xs:complexType> | ||
1931 | 623 | <xs:complexType name="PartyIdentification32"> | ||
1932 | 624 | <xs:sequence> | ||
1933 | 625 | <xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/> | ||
1934 | 626 | <xs:element maxOccurs="1" minOccurs="0" name="PstlAdr" type="PostalAddress6"/> | ||
1935 | 627 | <xs:element maxOccurs="1" minOccurs="0" name="Id" type="Party6Choice"/> | ||
1936 | 628 | <xs:element maxOccurs="1" minOccurs="0" name="CtryOfRes" type="CountryCode"/> | ||
1937 | 629 | <xs:element maxOccurs="1" minOccurs="0" name="CtctDtls" type="ContactDetails2"/> | ||
1938 | 630 | </xs:sequence> | ||
1939 | 631 | </xs:complexType> | ||
1940 | 632 | <xs:complexType name="PaymentIdentification1"> | ||
1941 | 633 | <xs:sequence> | ||
1942 | 634 | <xs:element maxOccurs="1" minOccurs="0" name="InstrId" type="Max35Text"/> | ||
1943 | 635 | <xs:element name="EndToEndId" type="Max35Text"/> | ||
1944 | 636 | </xs:sequence> | ||
1945 | 637 | </xs:complexType> | ||
1946 | 638 | <xs:complexType name="PaymentInstructionInformation3"> | ||
1947 | 639 | <xs:sequence> | ||
1948 | 640 | <xs:element name="PmtInfId" type="Max35Text"/> | ||
1949 | 641 | <xs:element name="PmtMtd" type="PaymentMethod3Code"/> | ||
1950 | 642 | <xs:element maxOccurs="1" minOccurs="0" name="BtchBookg" type="BatchBookingIndicator"/> | ||
1951 | 643 | <xs:element maxOccurs="1" minOccurs="0" name="NbOfTxs" type="Max15NumericText"/> | ||
1952 | 644 | <xs:element maxOccurs="1" minOccurs="0" name="CtrlSum" type="DecimalNumber"/> | ||
1953 | 645 | <xs:element maxOccurs="1" minOccurs="0" name="PmtTpInf" type="PaymentTypeInformation19"/> | ||
1954 | 646 | <xs:element name="ReqdExctnDt" type="ISODate"/> | ||
1955 | 647 | <xs:element maxOccurs="1" minOccurs="0" name="PoolgAdjstmntDt" type="ISODate"/> | ||
1956 | 648 | <xs:element name="Dbtr" type="PartyIdentification32"/> | ||
1957 | 649 | <xs:element name="DbtrAcct" type="CashAccount16"/> | ||
1958 | 650 | <xs:element name="DbtrAgt" type="BranchAndFinancialInstitutionIdentification4"/> | ||
1959 | 651 | <xs:element maxOccurs="1" minOccurs="0" name="DbtrAgtAcct" type="CashAccount16"/> | ||
1960 | 652 | <xs:element maxOccurs="1" minOccurs="0" name="UltmtDbtr" type="PartyIdentification32"/> | ||
1961 | 653 | <xs:element maxOccurs="1" minOccurs="0" name="ChrgBr" type="ChargeBearerType1Code"/> | ||
1962 | 654 | <xs:element maxOccurs="1" minOccurs="0" name="ChrgsAcct" type="CashAccount16"/> | ||
1963 | 655 | <xs:element maxOccurs="1" minOccurs="0" name="ChrgsAcctAgt" type="BranchAndFinancialInstitutionIdentification4"/> | ||
1964 | 656 | <xs:element maxOccurs="unbounded" minOccurs="1" name="CdtTrfTxInf" type="CreditTransferTransactionInformation10"/> | ||
1965 | 657 | </xs:sequence> | ||
1966 | 658 | </xs:complexType> | ||
1967 | 659 | <xs:simpleType name="PaymentMethod3Code"> | ||
1968 | 660 | <xs:restriction base="xs:string"> | ||
1969 | 661 | <xs:enumeration value="CHK"/> | ||
1970 | 662 | <xs:enumeration value="TRF"/> | ||
1971 | 663 | <xs:enumeration value="TRA"/> | ||
1972 | 664 | </xs:restriction> | ||
1973 | 665 | </xs:simpleType> | ||
1974 | 666 | <xs:complexType name="PaymentTypeInformation19"> | ||
1975 | 667 | <xs:sequence> | ||
1976 | 668 | <xs:element maxOccurs="1" minOccurs="0" name="InstrPrty" type="Priority2Code"/> | ||
1977 | 669 | <xs:element maxOccurs="1" minOccurs="0" name="SvcLvl" type="ServiceLevel8Choice"/> | ||
1978 | 670 | <xs:element maxOccurs="1" minOccurs="0" name="LclInstrm" type="LocalInstrument2Choice"/> | ||
1979 | 671 | <xs:element maxOccurs="1" minOccurs="0" name="CtgyPurp" type="CategoryPurpose1Choice"/> | ||
1980 | 672 | </xs:sequence> | ||
1981 | 673 | </xs:complexType> | ||
1982 | 674 | <xs:simpleType name="PercentageRate"> | ||
1983 | 675 | <xs:restriction base="xs:decimal"> | ||
1984 | 676 | <xs:fractionDigits value="10"/> | ||
1985 | 677 | <xs:totalDigits value="11"/> | ||
1986 | 678 | </xs:restriction> | ||
1987 | 679 | </xs:simpleType> | ||
1988 | 680 | <xs:complexType name="PersonIdentification5"> | ||
1989 | 681 | <xs:sequence> | ||
1990 | 682 | <xs:element maxOccurs="1" minOccurs="0" name="DtAndPlcOfBirth" type="DateAndPlaceOfBirth"/> | ||
1991 | 683 | <xs:element maxOccurs="unbounded" minOccurs="0" name="Othr" type="GenericPersonIdentification1"/> | ||
1992 | 684 | </xs:sequence> | ||
1993 | 685 | </xs:complexType> | ||
1994 | 686 | <xs:complexType name="PersonIdentificationSchemeName1Choice"> | ||
1995 | 687 | <xs:sequence> | ||
1996 | 688 | <xs:choice> | ||
1997 | 689 | <xs:element name="Cd" type="ExternalPersonIdentification1Code"/> | ||
1998 | 690 | <xs:element name="Prtry" type="Max35Text"/> | ||
1999 | 691 | </xs:choice> | ||
2000 | 692 | </xs:sequence> | ||
2001 | 693 | </xs:complexType> | ||
2002 | 694 | <xs:simpleType name="PhoneNumber"> | ||
2003 | 695 | <xs:restriction base="xs:string"> | ||
2004 | 696 | <xs:pattern value="\+[0-9]{1,3}-[0-9()+\-]{1,30}"/> | ||
2005 | 697 | </xs:restriction> | ||
2006 | 698 | </xs:simpleType> | ||
2007 | 699 | <xs:complexType name="PostalAddress6"> | ||
2008 | 700 | <xs:sequence> | ||
2009 | 701 | <xs:element maxOccurs="1" minOccurs="0" name="AdrTp" type="AddressType2Code"/> | ||
2010 | 702 | <xs:element maxOccurs="1" minOccurs="0" name="Dept" type="Max70Text"/> | ||
2011 | 703 | <xs:element maxOccurs="1" minOccurs="0" name="SubDept" type="Max70Text"/> | ||
2012 | 704 | <xs:element maxOccurs="1" minOccurs="0" name="StrtNm" type="Max70Text"/> | ||
2013 | 705 | <xs:element maxOccurs="1" minOccurs="0" name="BldgNb" type="Max16Text"/> | ||
2014 | 706 | <xs:element maxOccurs="1" minOccurs="0" name="PstCd" type="Max16Text"/> | ||
2015 | 707 | <xs:element maxOccurs="1" minOccurs="0" name="TwnNm" type="Max35Text"/> | ||
2016 | 708 | <xs:element maxOccurs="1" minOccurs="0" name="CtrySubDvsn" type="Max35Text"/> | ||
2017 | 709 | <xs:element maxOccurs="1" minOccurs="0" name="Ctry" type="CountryCode"/> | ||
2018 | 710 | <xs:element maxOccurs="7" minOccurs="0" name="AdrLine" type="Max70Text"/> | ||
2019 | 711 | </xs:sequence> | ||
2020 | 712 | </xs:complexType> | ||
2021 | 713 | <xs:simpleType name="Priority2Code"> | ||
2022 | 714 | <xs:restriction base="xs:string"> | ||
2023 | 715 | <xs:enumeration value="HIGH"/> | ||
2024 | 716 | <xs:enumeration value="NORM"/> | ||
2025 | 717 | </xs:restriction> | ||
2026 | 718 | </xs:simpleType> | ||
2027 | 719 | <xs:complexType name="Purpose2Choice"> | ||
2028 | 720 | <xs:sequence> | ||
2029 | 721 | <xs:choice> | ||
2030 | 722 | <xs:element name="Cd" type="ExternalPurpose1Code"/> | ||
2031 | 723 | <xs:element name="Prtry" type="Max35Text"/> | ||
2032 | 724 | </xs:choice> | ||
2033 | 725 | </xs:sequence> | ||
2034 | 726 | </xs:complexType> | ||
2035 | 727 | <xs:complexType name="ReferredDocumentInformation3"> | ||
2036 | 728 | <xs:sequence> | ||
2037 | 729 | <xs:element maxOccurs="1" minOccurs="0" name="Tp" type="ReferredDocumentType2"/> | ||
2038 | 730 | <xs:element maxOccurs="1" minOccurs="0" name="Nb" type="Max35Text"/> | ||
2039 | 731 | <xs:element maxOccurs="1" minOccurs="0" name="RltdDt" type="ISODate"/> | ||
2040 | 732 | </xs:sequence> | ||
2041 | 733 | </xs:complexType> | ||
2042 | 734 | <xs:complexType name="ReferredDocumentType1Choice"> | ||
2043 | 735 | <xs:sequence> | ||
2044 | 736 | <xs:choice> | ||
2045 | 737 | <xs:element name="Cd" type="DocumentType5Code"/> | ||
2046 | 738 | <xs:element name="Prtry" type="Max35Text"/> | ||
2047 | 739 | </xs:choice> | ||
2048 | 740 | </xs:sequence> | ||
2049 | 741 | </xs:complexType> | ||
2050 | 742 | <xs:complexType name="ReferredDocumentType2"> | ||
2051 | 743 | <xs:sequence> | ||
2052 | 744 | <xs:element name="CdOrPrtry" type="ReferredDocumentType1Choice"/> | ||
2053 | 745 | <xs:element maxOccurs="1" minOccurs="0" name="Issr" type="Max35Text"/> | ||
2054 | 746 | </xs:sequence> | ||
2055 | 747 | </xs:complexType> | ||
2056 | 748 | <xs:complexType name="RegulatoryAuthority2"> | ||
2057 | 749 | <xs:sequence> | ||
2058 | 750 | <xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/> | ||
2059 | 751 | <xs:element maxOccurs="1" minOccurs="0" name="Ctry" type="CountryCode"/> | ||
2060 | 752 | </xs:sequence> | ||
2061 | 753 | </xs:complexType> | ||
2062 | 754 | <xs:complexType name="RegulatoryReporting3"> | ||
2063 | 755 | <xs:sequence> | ||
2064 | 756 | <xs:element maxOccurs="1" minOccurs="0" name="DbtCdtRptgInd" type="RegulatoryReportingType1Code"/> | ||
2065 | 757 | <xs:element maxOccurs="1" minOccurs="0" name="Authrty" type="RegulatoryAuthority2"/> | ||
2066 | 758 | <xs:element maxOccurs="unbounded" minOccurs="0" name="Dtls" type="StructuredRegulatoryReporting3"/> | ||
2067 | 759 | </xs:sequence> | ||
2068 | 760 | </xs:complexType> | ||
2069 | 761 | <xs:simpleType name="RegulatoryReportingType1Code"> | ||
2070 | 762 | <xs:restriction base="xs:string"> | ||
2071 | 763 | <xs:enumeration value="CRED"/> | ||
2072 | 764 | <xs:enumeration value="DEBT"/> | ||
2073 | 765 | <xs:enumeration value="BOTH"/> | ||
2074 | 766 | </xs:restriction> | ||
2075 | 767 | </xs:simpleType> | ||
2076 | 768 | <xs:complexType name="RemittanceAmount1"> | ||
2077 | 769 | <xs:sequence> | ||
2078 | 770 | <xs:element maxOccurs="1" minOccurs="0" name="DuePyblAmt" type="ActiveOrHistoricCurrencyAndAmount"/> | ||
2079 | 771 | <xs:element maxOccurs="1" minOccurs="0" name="DscntApldAmt" type="ActiveOrHistoricCurrencyAndAmount"/> | ||
2080 | 772 | <xs:element maxOccurs="1" minOccurs="0" name="CdtNoteAmt" type="ActiveOrHistoricCurrencyAndAmount"/> | ||
2081 | 773 | <xs:element maxOccurs="1" minOccurs="0" name="TaxAmt" type="ActiveOrHistoricCurrencyAndAmount"/> | ||
2082 | 774 | <xs:element maxOccurs="unbounded" minOccurs="0" name="AdjstmntAmtAndRsn" type="DocumentAdjustment1"/> | ||
2083 | 775 | <xs:element maxOccurs="1" minOccurs="0" name="RmtdAmt" type="ActiveOrHistoricCurrencyAndAmount"/> | ||
2084 | 776 | </xs:sequence> | ||
2085 | 777 | </xs:complexType> | ||
2086 | 778 | <xs:complexType name="RemittanceInformation5"> | ||
2087 | 779 | <xs:sequence> | ||
2088 | 780 | <xs:element maxOccurs="unbounded" minOccurs="0" name="Ustrd" type="Max140Text"/> | ||
2089 | 781 | <xs:element maxOccurs="unbounded" minOccurs="0" name="Strd" type="StructuredRemittanceInformation7"/> | ||
2090 | 782 | </xs:sequence> | ||
2091 | 783 | </xs:complexType> | ||
2092 | 784 | <xs:complexType name="RemittanceLocation2"> | ||
2093 | 785 | <xs:sequence> | ||
2094 | 786 | <xs:element maxOccurs="1" minOccurs="0" name="RmtId" type="Max35Text"/> | ||
2095 | 787 | <xs:element maxOccurs="1" minOccurs="0" name="RmtLctnMtd" type="RemittanceLocationMethod2Code"/> | ||
2096 | 788 | <xs:element maxOccurs="1" minOccurs="0" name="RmtLctnElctrncAdr" type="Max2048Text"/> | ||
2097 | 789 | <xs:element maxOccurs="1" minOccurs="0" name="RmtLctnPstlAdr" type="NameAndAddress10"/> | ||
2098 | 790 | </xs:sequence> | ||
2099 | 791 | </xs:complexType> | ||
2100 | 792 | <xs:simpleType name="RemittanceLocationMethod2Code"> | ||
2101 | 793 | <xs:restriction base="xs:string"> | ||
2102 | 794 | <xs:enumeration value="FAXI"/> | ||
2103 | 795 | <xs:enumeration value="EDIC"/> | ||
2104 | 796 | <xs:enumeration value="URID"/> | ||
2105 | 797 | <xs:enumeration value="EMAL"/> | ||
2106 | 798 | <xs:enumeration value="POST"/> | ||
2107 | 799 | <xs:enumeration value="SMSM"/> | ||
2108 | 800 | </xs:restriction> | ||
2109 | 801 | </xs:simpleType> | ||
2110 | 802 | <xs:complexType name="ServiceLevel8Choice"> | ||
2111 | 803 | <xs:sequence> | ||
2112 | 804 | <xs:choice> | ||
2113 | 805 | <xs:element name="Cd" type="ExternalServiceLevel1Code"/> | ||
2114 | 806 | <xs:element name="Prtry" type="Max35Text"/> | ||
2115 | 807 | </xs:choice> | ||
2116 | 808 | </xs:sequence> | ||
2117 | 809 | </xs:complexType> | ||
2118 | 810 | <xs:complexType name="StructuredRegulatoryReporting3"> | ||
2119 | 811 | <xs:sequence> | ||
2120 | 812 | <xs:element maxOccurs="1" minOccurs="0" name="Tp" type="Max35Text"/> | ||
2121 | 813 | <xs:element maxOccurs="1" minOccurs="0" name="Dt" type="ISODate"/> | ||
2122 | 814 | <xs:element maxOccurs="1" minOccurs="0" name="Ctry" type="CountryCode"/> | ||
2123 | 815 | <xs:element maxOccurs="1" minOccurs="0" name="Cd" type="Max10Text"/> | ||
2124 | 816 | <xs:element maxOccurs="1" minOccurs="0" name="Amt" type="ActiveOrHistoricCurrencyAndAmount"/> | ||
2125 | 817 | <xs:element maxOccurs="unbounded" minOccurs="0" name="Inf" type="Max35Text"/> | ||
2126 | 818 | </xs:sequence> | ||
2127 | 819 | </xs:complexType> | ||
2128 | 820 | <xs:complexType name="StructuredRemittanceInformation7"> | ||
2129 | 821 | <xs:sequence> | ||
2130 | 822 | <xs:element maxOccurs="unbounded" minOccurs="0" name="RfrdDocInf" type="ReferredDocumentInformation3"/> | ||
2131 | 823 | <xs:element maxOccurs="1" minOccurs="0" name="RfrdDocAmt" type="RemittanceAmount1"/> | ||
2132 | 824 | <xs:element maxOccurs="1" minOccurs="0" name="CdtrRefInf" type="CreditorReferenceInformation2"/> | ||
2133 | 825 | <xs:element maxOccurs="1" minOccurs="0" name="Invcr" type="PartyIdentification32"/> | ||
2134 | 826 | <xs:element maxOccurs="1" minOccurs="0" name="Invcee" type="PartyIdentification32"/> | ||
2135 | 827 | <xs:element maxOccurs="3" minOccurs="0" name="AddtlRmtInf" type="Max140Text"/> | ||
2136 | 828 | </xs:sequence> | ||
2137 | 829 | </xs:complexType> | ||
2138 | 830 | <xs:complexType name="TaxAmount1"> | ||
2139 | 831 | <xs:sequence> | ||
2140 | 832 | <xs:element maxOccurs="1" minOccurs="0" name="Rate" type="PercentageRate"/> | ||
2141 | 833 | <xs:element maxOccurs="1" minOccurs="0" name="TaxblBaseAmt" type="ActiveOrHistoricCurrencyAndAmount"/> | ||
2142 | 834 | <xs:element maxOccurs="1" minOccurs="0" name="TtlAmt" type="ActiveOrHistoricCurrencyAndAmount"/> | ||
2143 | 835 | <xs:element maxOccurs="unbounded" minOccurs="0" name="Dtls" type="TaxRecordDetails1"/> | ||
2144 | 836 | </xs:sequence> | ||
2145 | 837 | </xs:complexType> | ||
2146 | 838 | <xs:complexType name="TaxAuthorisation1"> | ||
2147 | 839 | <xs:sequence> | ||
2148 | 840 | <xs:element maxOccurs="1" minOccurs="0" name="Titl" type="Max35Text"/> | ||
2149 | 841 | <xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/> | ||
2150 | 842 | </xs:sequence> | ||
2151 | 843 | </xs:complexType> | ||
2152 | 844 | <xs:complexType name="TaxInformation3"> | ||
2153 | 845 | <xs:sequence> | ||
2154 | 846 | <xs:element maxOccurs="1" minOccurs="0" name="Cdtr" type="TaxParty1"/> | ||
2155 | 847 | <xs:element maxOccurs="1" minOccurs="0" name="Dbtr" type="TaxParty2"/> | ||
2156 | 848 | <xs:element maxOccurs="1" minOccurs="0" name="AdmstnZn" type="Max35Text"/> | ||
2157 | 849 | <xs:element maxOccurs="1" minOccurs="0" name="RefNb" type="Max140Text"/> | ||
2158 | 850 | <xs:element maxOccurs="1" minOccurs="0" name="Mtd" type="Max35Text"/> | ||
2159 | 851 | <xs:element maxOccurs="1" minOccurs="0" name="TtlTaxblBaseAmt" type="ActiveOrHistoricCurrencyAndAmount"/> | ||
2160 | 852 | <xs:element maxOccurs="1" minOccurs="0" name="TtlTaxAmt" type="ActiveOrHistoricCurrencyAndAmount"/> | ||
2161 | 853 | <xs:element maxOccurs="1" minOccurs="0" name="Dt" type="ISODate"/> | ||
2162 | 854 | <xs:element maxOccurs="1" minOccurs="0" name="SeqNb" type="Number"/> | ||
2163 | 855 | <xs:element maxOccurs="unbounded" minOccurs="0" name="Rcrd" type="TaxRecord1"/> | ||
2164 | 856 | </xs:sequence> | ||
2165 | 857 | </xs:complexType> | ||
2166 | 858 | <xs:complexType name="TaxParty1"> | ||
2167 | 859 | <xs:sequence> | ||
2168 | 860 | <xs:element maxOccurs="1" minOccurs="0" name="TaxId" type="Max35Text"/> | ||
2169 | 861 | <xs:element maxOccurs="1" minOccurs="0" name="RegnId" type="Max35Text"/> | ||
2170 | 862 | <xs:element maxOccurs="1" minOccurs="0" name="TaxTp" type="Max35Text"/> | ||
2171 | 863 | </xs:sequence> | ||
2172 | 864 | </xs:complexType> | ||
2173 | 865 | <xs:complexType name="TaxParty2"> | ||
2174 | 866 | <xs:sequence> | ||
2175 | 867 | <xs:element maxOccurs="1" minOccurs="0" name="TaxId" type="Max35Text"/> | ||
2176 | 868 | <xs:element maxOccurs="1" minOccurs="0" name="RegnId" type="Max35Text"/> | ||
2177 | 869 | <xs:element maxOccurs="1" minOccurs="0" name="TaxTp" type="Max35Text"/> | ||
2178 | 870 | <xs:element maxOccurs="1" minOccurs="0" name="Authstn" type="TaxAuthorisation1"/> | ||
2179 | 871 | </xs:sequence> | ||
2180 | 872 | </xs:complexType> | ||
2181 | 873 | <xs:complexType name="TaxPeriod1"> | ||
2182 | 874 | <xs:sequence> | ||
2183 | 875 | <xs:element maxOccurs="1" minOccurs="0" name="Yr" type="ISODate"/> | ||
2184 | 876 | <xs:element maxOccurs="1" minOccurs="0" name="Tp" type="TaxRecordPeriod1Code"/> | ||
2185 | 877 | <xs:element maxOccurs="1" minOccurs="0" name="FrToDt" type="DatePeriodDetails"/> | ||
2186 | 878 | </xs:sequence> | ||
2187 | 879 | </xs:complexType> | ||
2188 | 880 | <xs:complexType name="TaxRecord1"> | ||
2189 | 881 | <xs:sequence> | ||
2190 | 882 | <xs:element maxOccurs="1" minOccurs="0" name="Tp" type="Max35Text"/> | ||
2191 | 883 | <xs:element maxOccurs="1" minOccurs="0" name="Ctgy" type="Max35Text"/> | ||
2192 | 884 | <xs:element maxOccurs="1" minOccurs="0" name="CtgyDtls" type="Max35Text"/> | ||
2193 | 885 | <xs:element maxOccurs="1" minOccurs="0" name="DbtrSts" type="Max35Text"/> | ||
2194 | 886 | <xs:element maxOccurs="1" minOccurs="0" name="CertId" type="Max35Text"/> | ||
2195 | 887 | <xs:element maxOccurs="1" minOccurs="0" name="FrmsCd" type="Max35Text"/> | ||
2196 | 888 | <xs:element maxOccurs="1" minOccurs="0" name="Prd" type="TaxPeriod1"/> | ||
2197 | 889 | <xs:element maxOccurs="1" minOccurs="0" name="TaxAmt" type="TaxAmount1"/> | ||
2198 | 890 | <xs:element maxOccurs="1" minOccurs="0" name="AddtlInf" type="Max140Text"/> | ||
2199 | 891 | </xs:sequence> | ||
2200 | 892 | </xs:complexType> | ||
2201 | 893 | <xs:complexType name="TaxRecordDetails1"> | ||
2202 | 894 | <xs:sequence> | ||
2203 | 895 | <xs:element maxOccurs="1" minOccurs="0" name="Prd" type="TaxPeriod1"/> | ||
2204 | 896 | <xs:element name="Amt" type="ActiveOrHistoricCurrencyAndAmount"/> | ||
2205 | 897 | </xs:sequence> | ||
2206 | 898 | </xs:complexType> | ||
2207 | 899 | <xs:simpleType name="TaxRecordPeriod1Code"> | ||
2208 | 900 | <xs:restriction base="xs:string"> | ||
2209 | 901 | <xs:enumeration value="MM01"/> | ||
2210 | 902 | <xs:enumeration value="MM02"/> | ||
2211 | 903 | <xs:enumeration value="MM03"/> | ||
2212 | 904 | <xs:enumeration value="MM04"/> | ||
2213 | 905 | <xs:enumeration value="MM05"/> | ||
2214 | 906 | <xs:enumeration value="MM06"/> | ||
2215 | 907 | <xs:enumeration value="MM07"/> | ||
2216 | 908 | <xs:enumeration value="MM08"/> | ||
2217 | 909 | <xs:enumeration value="MM09"/> | ||
2218 | 910 | <xs:enumeration value="MM10"/> | ||
2219 | 911 | <xs:enumeration value="MM11"/> | ||
2220 | 912 | <xs:enumeration value="MM12"/> | ||
2221 | 913 | <xs:enumeration value="QTR1"/> | ||
2222 | 914 | <xs:enumeration value="QTR2"/> | ||
2223 | 915 | <xs:enumeration value="QTR3"/> | ||
2224 | 916 | <xs:enumeration value="QTR4"/> | ||
2225 | 917 | <xs:enumeration value="HLF1"/> | ||
2226 | 918 | <xs:enumeration value="HLF2"/> | ||
2227 | 919 | </xs:restriction> | ||
2228 | 920 | </xs:simpleType> | ||
2229 | 921 | </xs:schema> |
Hi, Luc, maybe account-payment repository is better for this module?
Regards.