Merge lp:~jsancho/sepa-tools/sepa-unpaid-6.0 into lp:sepa-tools/6.0

Proposed by Javier Sancho
Status: Needs review
Proposed branch: lp:~jsancho/sepa-tools/sepa-unpaid-6.0
Merge into: lp:sepa-tools/6.0
Diff against target: 641 lines (+604/-0)
7 files modified
account_bank_statement_sepa_unpaid/__init__.py (+24/-0)
account_bank_statement_sepa_unpaid/__openerp__.py (+48/-0)
account_bank_statement_sepa_unpaid/account_bank_statement.py (+194/-0)
account_bank_statement_sepa_unpaid/i18n/es.po (+225/-0)
account_bank_statement_sepa_unpaid/wizard/__init__.py (+23/-0)
account_bank_statement_sepa_unpaid/wizard/import_sepa_unpaid.py (+42/-0)
account_bank_statement_sepa_unpaid/wizard/import_sepa_unpaid_view.xml (+48/-0)
To merge this branch: bzr merge lp:~jsancho/sepa-tools/sepa-unpaid-6.0
Reviewer Review Type Date Requested Status
OpenERP SEPA Team Pending
Review via email: mp+221838@code.launchpad.net

Description of the change

Module to import unpaid payment orders from SEPA XML file format (PAIN version 002.001.03)

To post a comment you must log in.
11. By Javier Sancho <jsancho@72horas.net>

Return codes and translations update

Unmerged revisions

11. By Javier Sancho <jsancho@72horas.net>

Return codes and translations update

10. By Javier Sancho <jsancho@72horas.net>

[ADD] account_bank_statement_sepa_unpaid: import unpaid payment orders from SEPA XML file format

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'account_bank_statement_sepa_unpaid'
2=== added file 'account_bank_statement_sepa_unpaid/__init__.py'
3--- account_bank_statement_sepa_unpaid/__init__.py 1970-01-01 00:00:00 +0000
4+++ account_bank_statement_sepa_unpaid/__init__.py 2014-06-05 08:09:02 +0000
5@@ -0,0 +1,24 @@
6+# -*- coding: utf-8 -*-
7+##############################################################################
8+#
9+# OpenERP, Open Source Management Solution
10+# Copyright (C) 2014 Nayar Systems (<http://www.72horas.net/>)
11+# @author: Javier Sancho <jsancho@72horas.net>
12+#
13+# This program is free software: you can redistribute it and/or modify
14+# it under the terms of the GNU Affero General Public License as
15+# published by the Free Software Foundation, either version 3 of the
16+# License, or (at your option) any later version.
17+#
18+# This program is distributed in the hope that it will be useful,
19+# but WITHOUT ANY WARRANTY; without even the implied warranty of
20+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21+# GNU Affero General Public License for more details.
22+#
23+# You should have received a copy of the GNU Affero General Public License
24+# along with this program. If not, see <http://www.gnu.org/licenses/>.
25+#
26+##############################################################################
27+
28+import account_bank_statement
29+import wizard
30
31=== added file 'account_bank_statement_sepa_unpaid/__openerp__.py'
32--- account_bank_statement_sepa_unpaid/__openerp__.py 1970-01-01 00:00:00 +0000
33+++ account_bank_statement_sepa_unpaid/__openerp__.py 2014-06-05 08:09:02 +0000
34@@ -0,0 +1,48 @@
35+# -*- coding: utf-8 -*-
36+##############################################################################
37+#
38+# OpenERP, Open Source Management Solution
39+# Copyright (C) 2014 Nayar Systems (<http://www.72horas.net/>)
40+# @author: Javier Sancho <jsancho@72horas.net>
41+#
42+# This program is free software: you can redistribute it and/or modify
43+# it under the terms of the GNU Affero General Public License as
44+# published by the Free Software Foundation, either version 3 of the
45+# License, or (at your option) any later version.
46+#
47+# This program is distributed in the hope that it will be useful,
48+# but WITHOUT ANY WARRANTY; without even the implied warranty of
49+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
50+# GNU Affero General Public License for more details.
51+#
52+# You should have received a copy of the GNU Affero General Public License
53+# along with this program. If not, see <http://www.gnu.org/licenses/>.
54+#
55+##############################################################################
56+
57+{
58+ 'name': 'Account Bank Statement SEPA Unpaid',
59+ 'summary': 'Import SEPA files for unpaid payment orders',
60+ 'version': '1.0',
61+ 'license': 'AGPL-3',
62+ 'author': 'Nayar Systems',
63+ 'website': 'http://www.72horas.net',
64+ 'category': 'Banking addons',
65+ 'depends': [
66+ 'account',
67+ 'l10n_es',
68+ 'nan_account_bank_statement',
69+ ],
70+ 'update_xml': [
71+ 'wizard/import_sepa_unpaid_view.xml'
72+ ],
73+ 'description': '''
74+Module to import unpaid payment orders from SEPA XML file format.
75+
76+SEPA PAIN (PAyment INitiation) is the new european standard for Customer-to-Bank payment instructions. This module implements SEPA Direct Debit (SDD), more specifically PAIN version 002.001.03. It is part of the ISO 20022 standard, available on http://www.iso20022.org.
77+
78+Please contact Javier Sancho from Nayar Systems <jsancho@72horas.net> for any help or question about this module.
79+ ''',
80+ 'active': False,
81+ 'installable': True,
82+ }
83
84=== added file 'account_bank_statement_sepa_unpaid/account_bank_statement.py'
85--- account_bank_statement_sepa_unpaid/account_bank_statement.py 1970-01-01 00:00:00 +0000
86+++ account_bank_statement_sepa_unpaid/account_bank_statement.py 2014-06-05 08:09:02 +0000
87@@ -0,0 +1,194 @@
88+# -*- coding: utf-8 -*-
89+##############################################################################
90+#
91+# OpenERP, Open Source Management Solution
92+# Copyright (C) 2014 Nayar Systems (<http://www.72horas.net/>)
93+# @author: Javier Sancho <jsancho@72horas.net>
94+#
95+# This program is free software: you can redistribute it and/or modify
96+# it under the terms of the GNU Affero General Public License as
97+# published by the Free Software Foundation, either version 3 of the
98+# License, or (at your option) any later version.
99+#
100+# This program is distributed in the hope that it will be useful,
101+# but WITHOUT ANY WARRANTY; without even the implied warranty of
102+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
103+# GNU Affero General Public License for more details.
104+#
105+# You should have received a copy of the GNU Affero General Public License
106+# along with this program. If not, see <http://www.gnu.org/licenses/>.
107+#
108+##############################################################################
109+
110+import base64
111+from lxml import etree
112+from osv import osv, fields
113+from tools.translate import _
114+
115+
116+RETURN_CODES = (
117+ ('AC01', _('Account identifier incorrect')),
118+ ('AC04', _('Account closed')),
119+ ('AC06', _('Account blocked for direct debit by the Debtor')),
120+ ('AC13', _('Debtor Account is a consumer account')),
121+ ('AG01', _('Direct debit forbidden on this account for regulatory reasons')),
122+ ('AG02', _('Operation/transaction code incorrect, invalid file format')),
123+ ('AM04', _('Insufficient funds')),
124+ ('AM05', _('Duplicate collection')),
125+ ('BE01', _('Debtor\'s name does not match with the account holder\'s nam')),
126+ ('BE05', _('Identifier of the Creditor incorrect')),
127+ ('FF01', _('Operation/transaction code incorrect, invalid file forma')),
128+ ('FF05', _('Direct Debit type incorrect')),
129+ ('MD01', _('No valid Mandate')),
130+ ('MD02', _('Mandate data missing or incorrect')),
131+ ('MD06', _('Disputed authorised transaction')),
132+ ('MD07', _('Debtor deceased')),
133+ ('MS02', _('Refusal by the Debtor')),
134+ ('MS03', _('Reason not specified')),
135+ ('RC01', _('Bank identifier incorrect')),
136+ ('RR01', _('Missing Debtor Account Or Identification')),
137+ ('RR02', _('Missing Debtors Name Or Address')),
138+ ('RR03', _('Missing Creditors Name Or Address')),
139+ ('RR04', _('Regulatory Reason')),
140+ ('SL01', _('Specific Service offered by the Debtor Bank')),
141+ ('FF01', _('No valid file format')),
142+)
143+
144+RETURN_CODES = dict(RETURN_CODES)
145+
146+class account_bank_statement(osv.osv):
147+ _inherit = 'account.bank.statement'
148+
149+ def import_sepa_unpaid_file(self, cr, uid, statement_id, file_contents, context=None):
150+ """
151+ Import SEPA PAIN.002.001.03 File
152+ """
153+
154+ payment_line_obj = self.pool.get('payment.line')
155+ partner_obj = self.pool.get('res.partner')
156+ statement_line_obj = self.pool.get('account.bank.statement.line')
157+ invoice_obj = self.pool.get('account.invoice')
158+
159+ st_data = self._load_sepa_unpaid_file(cr, uid, file_contents, context=context)
160+ total_amount = 0
161+ for payment in st_data['payments']:
162+ for transaction in payment['transactions']:
163+ invoice_number = transaction['remittance_info']
164+ invoice_id = invoice_obj.search(cr, uid, [('number', '=', invoice_number)])
165+ payment_line_id = payment_line_obj.search(cr, uid, [('name', '=', transaction['id'])], context=context)[0]
166+ payment_line = payment_line_obj.browse(cr, uid, payment_line_id, context=context)
167+ total_amount += transaction['amount']
168+ values = {
169+ 'statement_id': statement_id,
170+ 'date': st_data['header']['date'].split('T')[0],
171+ 'due_date': transaction['reqd_date'],
172+ 'type': 'customer',
173+ 'name': _("Unpaid Inv. %s") % invoice_number,
174+ 'invoice_id': invoice_id and invoice_id[0] or False,
175+ 'partner_id': payment_line.partner_id.id,
176+ 'account_id': payment_line.partner_id.property_account_receivable.id,
177+ 'amount': -1 * transaction['amount'],
178+ 'ref': _(RETURN_CODES.get(transaction['code'], transaction['code'])),
179+ }
180+ # Statement line
181+ line_id = statement_line_obj.create(cr, uid, values, context=context)
182+
183+ # Update statement
184+ statement = self.browse(cr, uid, statement_id)
185+ data = {
186+ 'date': st_data['header']['date'].split('T')[0],
187+ 'balance_end_real': statement.balance_start - total_amount,
188+ }
189+ data.update(self.onchange_date(cr, uid, statement_id, data['date'])['value'])
190+ self.write(cr, uid, [statement_id], data)
191+
192+ # Attach the SEPA file to the current statement
193+ file_name = context.get('file_name', _('unpaid-bank-statement.xml'))
194+ res = self._attach_file_to_statement(cr, uid, file_contents, statement_id, file_name, file_name)
195+
196+
197+ def _load_sepa_unpaid_file(self, cr, uid, file_contents, context=None):
198+ """
199+ Load SEPA PAIN.002.001.03 File
200+ """
201+ decoded_file_contents = base64.decodestring(file_contents)
202+ root = etree.fromstring(decoded_file_contents)
203+ nsmap = root.nsmap[None]
204+
205+ st_data = {
206+ 'header': self._load_header(cr, uid, root, nsmap, context=context),
207+ 'orders': self._load_original_orders(cr, uid, root, nsmap, context=context),
208+ 'payments': self._load_original_payments(cr, uid, root, nsmap, context=context),
209+ }
210+ return st_data
211+
212+
213+ def _load_header(self, cr, uid, root, nsmap, context=None):
214+ header = root.find(".//{" + nsmap + "}GrpHdr")
215+ header_data = {
216+ 'id': header.find("{" + nsmap + "}MsgId").text,
217+ 'date': header.find("{" + nsmap + "}CreDtTm").text,
218+ 'creditor_name': header.find("{" + nsmap + "}InitgPty/{" + nsmap + "}Nm").text,
219+ 'creditor_identifier': header.find("{" + nsmap + "}InitgPty/{" + nsmap + "}Id/{" + nsmap + "}OrgId/{" + nsmap + "}Othr/{" + nsmap + "}Id").text,
220+ }
221+ return header_data
222+
223+
224+ def _load_original_orders(self, cr, uid, root, nsmap, context=None):
225+ orders = root.findall(".//{" + nsmap + "}OrgnlGrpInfAndSts")
226+ orders_data = []
227+ for order in orders:
228+ orders_data.append({
229+ 'id': order.find("{" + nsmap + "}OrgnlMsgId").text,
230+ 'scheme': order.find("{" + nsmap + "}OrgnlMsgNmId").text,
231+ 'total_transactions': int(order.find("{" + nsmap + "}OrgnlNbOfTxs").text),
232+ 'total_amount': float(order.find("{" + nsmap + "}OrgnlCtrlSum").text),
233+ })
234+ return orders_data
235+
236+
237+ def _load_original_payments(self, cr, uid, root, nsmap, context=None):
238+ payments = root.findall(".//{" + nsmap + "}OrgnlPmtInfAndSts")
239+ payments_data = []
240+ for payment in payments:
241+ payments_data.append({
242+ 'id': payment.find("{" + nsmap + "}OrgnlPmtInfId").text,
243+ 'total_transactions': int(payment.find("{" + nsmap + "}OrgnlNbOfTxs").text),
244+ 'total_amount': float(payment.find("{" + nsmap + "}OrgnlCtrlSum").text),
245+ 'transactions': self._load_payment_transactions(cr, uid, payment, nsmap, context=context),
246+ })
247+ return payments_data
248+
249+
250+ def _load_payment_transactions(self, cr, uid, payment, nsmap, context=None):
251+ transactions = payment.findall("{" + nsmap + "}TxInfAndSts")
252+ transactions_data = []
253+ for transaction in transactions:
254+ reference = transaction.find("{" + nsmap + "}OrgnlTxRef")
255+ transactions_data.append({
256+ 'id': transaction.find("{" + nsmap + "}OrgnlEndToEndId").text,
257+ 'status': transaction.find("{" + nsmap + "}TxSts").text,
258+ 'code': transaction.find("{" + nsmap + "}StsRsnInf/{" + nsmap + "}Rsn/{" + nsmap + "}Cd").text,
259+ 'amount': float(reference.find("{" + nsmap + "}Amt/{" + nsmap + "}InstdAmt").text),
260+ 'currency': reference.find("{" + nsmap + "}Amt/{" + nsmap + "}InstdAmt").attrib['Ccy'],
261+ 'reqd_date': reference.find("{" + nsmap + "}ReqdColltnDt").text,
262+ 'mandate_id': reference.find("{" + nsmap + "}MndtRltdInf/{" + nsmap + "}MndtId").text,
263+ 'remittance_info': reference.find("{" + nsmap + "}RmtInf/{" + nsmap + "}Ustrd").text,
264+ 'debtor_name': reference.find("{" + nsmap + "}Dbtr/{" + nsmap + "}Nm").text,
265+ 'debtor_iban': reference.find("{" + nsmap + "}DbtrAcct/{" + nsmap + "}Id/{" + nsmap + "}IBAN").text,
266+ 'debtor_bic': reference.find("{" + nsmap + "}DbtrAgt/{" + nsmap + "}FinInstnId/{" + nsmap + "}BIC").text,
267+ })
268+ return transactions_data
269+
270+account_bank_statement()
271+
272+
273+class account_bank_statement_line(osv.osv):
274+ _inherit = 'account.bank.statement.line'
275+
276+ _columns = {
277+ 'invoice_id': fields.many2one('account.invoice', 'Invoice'),
278+ 'due_date': fields.date('Due Date'),
279+ }
280+
281+account_bank_statement_line()
282
283=== added directory 'account_bank_statement_sepa_unpaid/i18n'
284=== added file 'account_bank_statement_sepa_unpaid/i18n/es.po'
285--- account_bank_statement_sepa_unpaid/i18n/es.po 1970-01-01 00:00:00 +0000
286+++ account_bank_statement_sepa_unpaid/i18n/es.po 2014-06-05 08:09:02 +0000
287@@ -0,0 +1,225 @@
288+# Translation of OpenERP Server.
289+# This file contains the translation of the following modules:
290+# * nayar_bank_statement_sepa_unpaid
291+#
292+msgid ""
293+msgstr ""
294+"Project-Id-Version: OpenERP Server 6.0.4\n"
295+"Report-Msgid-Bugs-To: support@openerp.com\n"
296+"POT-Creation-Date: 2014-06-05 07:23+0000\n"
297+"PO-Revision-Date: 2014-06-05 07:23+0000\n"
298+"Last-Translator: <>\n"
299+"Language-Team: \n"
300+"MIME-Version: 1.0\n"
301+"Content-Type: text/plain; charset=UTF-8\n"
302+"Content-Transfer-Encoding: \n"
303+"Plural-Forms: \n"
304+
305+#. module: nayar_bank_statement_sepa_unpaid
306+#: code:addons/nayar_bank_statement_sepa_unpaid/account_bank_statement.py:51
307+#, python-format
308+msgid "Missing Creditors Name Or Address"
309+msgstr "Falta nombre o direción del acreedor"
310+
311+#. module: nayar_bank_statement_sepa_unpaid
312+#: code:addons/nayar_bank_statement_sepa_unpaid/account_bank_statement.py:42
313+#, python-format
314+msgid "No valid Mandate"
315+msgstr "Mandato no válido"
316+
317+#. module: nayar_bank_statement_sepa_unpaid
318+#: code:addons/nayar_bank_statement_sepa_unpaid/account_bank_statement.py:45
319+#, python-format
320+msgid "Debtor deceased"
321+msgstr "Fallecimiento del deudor"
322+
323+#. module: nayar_bank_statement_sepa_unpaid
324+#: code:addons/nayar_bank_statement_sepa_unpaid/account_bank_statement.py:49
325+#, python-format
326+msgid "Missing Debtor Account Or Identification"
327+msgstr "Falta cuenta o identificación del deudor"
328+
329+#. module: nayar_bank_statement_sepa_unpaid
330+#: code:addons/nayar_bank_statement_sepa_unpaid/account_bank_statement.py:48
331+#, python-format
332+msgid "Bank identifier incorrect"
333+msgstr "Identificador de la entidad incorrecto"
334+
335+#. module: nayar_bank_statement_sepa_unpaid
336+#: code:addons/nayar_bank_statement_sepa_unpaid/account_bank_statement.py:106
337+#, python-format
338+msgid "unpaid-bank-statement.xml"
339+msgstr "unpaid-bank-statement.xml"
340+
341+#. module: nayar_bank_statement_sepa_unpaid
342+#: code:addons/nayar_bank_statement_sepa_unpaid/account_bank_statement.py:32
343+#, python-format
344+msgid "Account blocked for direct debit by the Debtor"
345+msgstr "Cuenta bloqueada por el deudor"
346+
347+#. module: nayar_bank_statement_sepa_unpaid
348+#: code:addons/nayar_bank_statement_sepa_unpaid/account_bank_statement.py:47
349+#, python-format
350+msgid "Reason not specified"
351+msgstr "Motivo no especificado"
352+
353+#. module: nayar_bank_statement_sepa_unpaid
354+#: view:account.bank.statement.sepa.unpaid.import.wizard:0
355+msgid "Import"
356+msgstr "Importar"
357+
358+#. module: nayar_bank_statement_sepa_unpaid
359+#: model:ir.actions.act_window,name:nayar_bank_statement_sepa_unpaid.action_sepa_unpaid_import_wizard
360+msgid "Import SEPA Unpaid File"
361+msgstr "Importar impagados SEPA"
362+
363+#. module: nayar_bank_statement_sepa_unpaid
364+#: code:addons/nayar_bank_statement_sepa_unpaid/account_bank_statement.py:86
365+#, python-format
366+msgid "Unpaid Inv. %s"
367+msgstr "Fact. imp. %s"
368+
369+#. module: nayar_bank_statement_sepa_unpaid
370+#: code:addons/nayar_bank_statement_sepa_unpaid/account_bank_statement.py:35
371+#, python-format
372+msgid "Operation/transaction code incorrect, invalid file format"
373+msgstr "Código de operación incorrecto, formato inválido"
374+
375+#. module: nayar_bank_statement_sepa_unpaid
376+#: code:addons/nayar_bank_statement_sepa_unpaid/account_bank_statement.py:52
377+#, python-format
378+msgid "Regulatory Reason"
379+msgstr "Motivos regulatorios"
380+
381+#. module: nayar_bank_statement_sepa_unpaid
382+#: code:addons/nayar_bank_statement_sepa_unpaid/account_bank_statement.py:50
383+#, python-format
384+msgid "Missing Debtors Name Or Address"
385+msgstr "Falta nombre o dirección del deudor"
386+
387+#. module: nayar_bank_statement_sepa_unpaid
388+#: field:account.bank.statement.sepa.unpaid.import.wizard,file:0
389+#: field:account.bank.statement.sepa.unpaid.import.wizard,file_name:0
390+msgid "Bank Unpaid Statements File"
391+msgstr "Bank Unpaid Statements File"
392+
393+#. module: nayar_bank_statement_sepa_unpaid
394+#: code:addons/nayar_bank_statement_sepa_unpaid/account_bank_statement.py:54
395+#, python-format
396+msgid "No valid file format"
397+msgstr "Formato de fichero no válido"
398+
399+#. module: nayar_bank_statement_sepa_unpaid
400+#: code:addons/nayar_bank_statement_sepa_unpaid/account_bank_statement.py:34
401+#, python-format
402+msgid "Direct debit forbidden on this account for regulatory reasons"
403+msgstr "Adeudos prohibidos en cuenta por motivos regulatorios"
404+
405+#. module: nayar_bank_statement_sepa_unpaid
406+#: code:addons/nayar_bank_statement_sepa_unpaid/account_bank_statement.py:31
407+#, python-format
408+msgid "Account closed"
409+msgstr "Cuenta cerrada"
410+
411+#. module: nayar_bank_statement_sepa_unpaid
412+#: code:addons/nayar_bank_statement_sepa_unpaid/account_bank_statement.py:39
413+#, python-format
414+msgid "Identifier of the Creditor incorrect"
415+msgstr "Identificador de acreedor incorrecto"
416+
417+#. module: nayar_bank_statement_sepa_unpaid
418+#: view:account.bank.statement.sepa.unpaid.import.wizard:0
419+msgid "Bank Statements Import according to SEPA PAIN.002.001.03 XML File Structure"
420+msgstr "Importe de extracto bancario según formato XML SEPA PAIN.002.001.03"
421+
422+#. module: nayar_bank_statement_sepa_unpaid
423+#: model:ir.model,name:nayar_bank_statement_sepa_unpaid.model_account_bank_statement_sepa_unpaid_import_wizard
424+msgid "account.bank.statement.sepa.unpaid.import.wizard"
425+msgstr "account.bank.statement.sepa.unpaid.import.wizard"
426+
427+#. module: nayar_bank_statement_sepa_unpaid
428+#: code:addons/nayar_bank_statement_sepa_unpaid/account_bank_statement.py:43
429+#, python-format
430+msgid "Mandate data missing or incorrect"
431+msgstr "Faltan datos del mandato o son incorrectos"
432+
433+#. module: nayar_bank_statement_sepa_unpaid
434+#: code:addons/nayar_bank_statement_sepa_unpaid/account_bank_statement.py:46
435+#, python-format
436+msgid "Refusal by the Debtor"
437+msgstr "Rechazado por el deudor"
438+
439+#. module: nayar_bank_statement_sepa_unpaid
440+#: code:addons/nayar_bank_statement_sepa_unpaid/account_bank_statement.py:30
441+#, python-format
442+msgid "Account identifier incorrect"
443+msgstr "IBAN no válido"
444+
445+#. module: nayar_bank_statement_sepa_unpaid
446+#: constraint:account.bank.statement.line:0
447+msgid "The amount of the voucher must be the same amount as the one on the statement line"
448+msgstr "El importe del recibo debe ser el mismo importe que el de la línea del extracto"
449+
450+#. module: nayar_bank_statement_sepa_unpaid
451+#: code:addons/nayar_bank_statement_sepa_unpaid/account_bank_statement.py:38
452+#, python-format
453+msgid "Debtor's name does not match with the account holder's nam"
454+msgstr "Nombre del deudor no coincide con propietario de la cuenta"
455+
456+#. module: nayar_bank_statement_sepa_unpaid
457+#: code:addons/nayar_bank_statement_sepa_unpaid/account_bank_statement.py:53
458+#, python-format
459+msgid "Specific Service offered by the Debtor Bank"
460+msgstr "Servicios específicos ofrecidos por la entidad del deudor"
461+
462+#. module: nayar_bank_statement_sepa_unpaid
463+#: code:addons/nayar_bank_statement_sepa_unpaid/account_bank_statement.py:44
464+#, python-format
465+msgid "Disputed authorised transaction"
466+msgstr "Operación autorizada disputada"
467+
468+#. module: nayar_bank_statement_sepa_unpaid
469+#: model:ir.model,name:nayar_bank_statement_sepa_unpaid.model_account_bank_statement_line
470+msgid "Bank Statement Line"
471+msgstr "Línea de extracto bancario"
472+
473+#. module: nayar_bank_statement_sepa_unpaid
474+#: code:addons/nayar_bank_statement_sepa_unpaid/account_bank_statement.py:36
475+#, python-format
476+msgid "Insufficient funds"
477+msgstr "Falta de fondos"
478+
479+#. module: nayar_bank_statement_sepa_unpaid
480+#: model:ir.model,name:nayar_bank_statement_sepa_unpaid.model_account_bank_statement
481+msgid "Bank Statement"
482+msgstr "Extracto bancario"
483+
484+#. module: nayar_bank_statement_sepa_unpaid
485+#: view:account.bank.statement.sepa.unpaid.import.wizard:0
486+msgid "Cancel"
487+msgstr "Cancelar"
488+
489+#. module: nayar_bank_statement_sepa_unpaid
490+#: code:addons/nayar_bank_statement_sepa_unpaid/account_bank_statement.py:41
491+#, python-format
492+msgid "Direct Debit type incorrect"
493+msgstr "Tipo de adeudo incorrecto"
494+
495+#. module: nayar_bank_statement_sepa_unpaid
496+#: code:addons/nayar_bank_statement_sepa_unpaid/account_bank_statement.py:37
497+#, python-format
498+msgid "Duplicate collection"
499+msgstr "Duplicado"
500+
501+#. module: nayar_bank_statement_sepa_unpaid
502+#: code:addons/nayar_bank_statement_sepa_unpaid/account_bank_statement.py:40
503+#, python-format
504+msgid "Operation/transaction code incorrect, invalid file forma"
505+msgstr "Código de operación incorrecto, formato inválido"
506+
507+#. module: nayar_bank_statement_sepa_unpaid
508+#: code:addons/nayar_bank_statement_sepa_unpaid/account_bank_statement.py:33
509+#, python-format
510+msgid "Debtor Account is a consumer account"
511+msgstr "Cuenta del deudor es cuenta de un consumidor"
512+
513
514=== added directory 'account_bank_statement_sepa_unpaid/wizard'
515=== added file 'account_bank_statement_sepa_unpaid/wizard/__init__.py'
516--- account_bank_statement_sepa_unpaid/wizard/__init__.py 1970-01-01 00:00:00 +0000
517+++ account_bank_statement_sepa_unpaid/wizard/__init__.py 2014-06-05 08:09:02 +0000
518@@ -0,0 +1,23 @@
519+# -*- coding: utf-8 -*-
520+##############################################################################
521+#
522+# OpenERP, Open Source Management Solution
523+# Copyright (C) 2014 Nayar Systems (<http://www.72horas.net/>)
524+# @author: Javier Sancho <jsancho@72horas.net>
525+#
526+# This program is free software: you can redistribute it and/or modify
527+# it under the terms of the GNU Affero General Public License as
528+# published by the Free Software Foundation, either version 3 of the
529+# License, or (at your option) any later version.
530+#
531+# This program is distributed in the hope that it will be useful,
532+# but WITHOUT ANY WARRANTY; without even the implied warranty of
533+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
534+# GNU Affero General Public License for more details.
535+#
536+# You should have received a copy of the GNU Affero General Public License
537+# along with this program. If not, see <http://www.gnu.org/licenses/>.
538+#
539+##############################################################################
540+
541+import import_sepa_unpaid
542
543=== added file 'account_bank_statement_sepa_unpaid/wizard/import_sepa_unpaid.py'
544--- account_bank_statement_sepa_unpaid/wizard/import_sepa_unpaid.py 1970-01-01 00:00:00 +0000
545+++ account_bank_statement_sepa_unpaid/wizard/import_sepa_unpaid.py 2014-06-05 08:09:02 +0000
546@@ -0,0 +1,42 @@
547+# -*- coding: utf-8 -*-
548+##############################################################################
549+#
550+# OpenERP, Open Source Management Solution
551+# Copyright (C) 2014 Nayar Systems (<http://www.72horas.net/>)
552+# @author: Javier Sancho <jsancho@72horas.net>
553+#
554+# This program is free software: you can redistribute it and/or modify
555+# it under the terms of the GNU Affero General Public License as
556+# published by the Free Software Foundation, either version 3 of the
557+# License, or (at your option) any later version.
558+#
559+# This program is distributed in the hope that it will be useful,
560+# but WITHOUT ANY WARRANTY; without even the implied warranty of
561+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
562+# GNU Affero General Public License for more details.
563+#
564+# You should have received a copy of the GNU Affero General Public License
565+# along with this program. If not, see <http://www.gnu.org/licenses/>.
566+#
567+##############################################################################
568+
569+from osv import osv, fields
570+
571+class sepa_unpaid_import_wizard(osv.osv_memory):
572+ _name = 'account.bank.statement.sepa.unpaid.import.wizard'
573+
574+ _columns = {
575+ 'file': fields.binary('Bank Unpaid Statements File', required=True, filters="*.xml"),
576+ 'file_name': fields.char('Bank Unpaid Statements File', size=256, required=True),
577+ }
578+
579+ def import_sepa_file(self, cr, uid, ids, context=None):
580+ data = self.browse(cr, uid, ids[0], context=context)
581+ context['file_name'] = data.file_name
582+ file_contents = data.file
583+
584+ st_obj = self.pool.get('account.bank.statement')
585+ st_obj.import_sepa_unpaid_file(cr, uid, context['active_id'], file_contents, context=context)
586+ return {'type': 'ir.actions.act_window_close'}
587+
588+sepa_unpaid_import_wizard()
589
590=== added file 'account_bank_statement_sepa_unpaid/wizard/import_sepa_unpaid_view.xml'
591--- account_bank_statement_sepa_unpaid/wizard/import_sepa_unpaid_view.xml 1970-01-01 00:00:00 +0000
592+++ account_bank_statement_sepa_unpaid/wizard/import_sepa_unpaid_view.xml 2014-06-05 08:09:02 +0000
593@@ -0,0 +1,48 @@
594+<?xml version="1.0" encoding="utf-8"?>
595+<!--
596+ Copyright (C) 2014 Nayar Systems (http://www.72horas.net/)
597+ @author: Javier Sancho <jsancho@72horas.net>
598+ The license is in the file __openerp__.py
599+-->
600+<openerp>
601+ <data>
602+ <record model="ir.ui.view" id="sepa_unpaid_import_wizard">
603+ <field name="name">account.bank.statement.sepa.unpaid.import.wizard.form</field>
604+ <field name="model">account.bank.statement.sepa.unpaid.import.wizard</field>
605+ <field name="type">form</field>
606+ <field name="arch" type="xml">
607+ <form string="Bank Statements Import according to SEPA PAIN.002.001.03 XML File Structure">
608+ <group col="4" colspan="4">
609+ <field name="file_name"/>
610+ <field name="file" filename="file_name" nolabel="1" colspan="2"/>
611+ </group>
612+ <group col="2" colspan="4">
613+ <button icon="gtk-cancel" special="cancel" string="Cancel"/>
614+ <button icon="gtk-ok" name="import_sepa_file" string="Import" type="object"/>
615+ </group>
616+ </form>
617+ </field>
618+ </record>
619+
620+ <record id="action_sepa_unpaid_import_wizard" model="ir.actions.act_window">
621+ <field name="name">account.bank.statement.sepa.unpaid.import.wizard.action</field>
622+ <field name="type">ir.actions.act_window</field>
623+ <field name="res_model">account.bank.statement.sepa.unpaid.import.wizard</field>
624+ <field name="view_type">form</field>
625+ <field name="view_mode">form</field>
626+ <field name="target">new</field>
627+ </record>
628+
629+ <act_window
630+ id="action_sepa_unpaid_import_wizard"
631+ name="Import SEPA Unpaid File"
632+ key2="client_action_multi"
633+ res_model="account.bank.statement.sepa.unpaid.import.wizard"
634+ src_model="account.bank.statement"
635+ view_type="form"
636+ view_mode="form"
637+ target="new"
638+ groups="account.group_account_manager"/>
639+
640+ </data>
641+</openerp>

Subscribers

People subscribed via source and target branches