Merge lp:~acysos-team/openerp-spain/openerp-spain-6.0 into lp:~openerp-spain-team/openerp-spain/6.0

Proposed by Ignacio Ibeas (www.acysos.com)
Status: Merged
Merged at revision: 337
Proposed branch: lp:~acysos-team/openerp-spain/openerp-spain-6.0
Merge into: lp:~openerp-spain-team/openerp-spain/6.0
Diff against target: 2896 lines (+823/-847)
16 files modified
l10n_es_payment_order/__init__.py (+2/-0)
l10n_es_payment_order/__openerp__.py (+12/-2)
l10n_es_payment_order/i18n/es.po (+217/-339)
l10n_es_payment_order/remesas_data.xml (+4/-4)
l10n_es_payment_order/remesas_view.xml (+1/-1)
l10n_es_payment_order/security/ir.model.access.csv (+13/-0)
l10n_es_payment_order/wizard/__init__.py (+10/-0)
l10n_es_payment_order/wizard/converter.py (+83/-90)
l10n_es_payment_order/wizard/csb_19.py (+49/-44)
l10n_es_payment_order/wizard/csb_32.py (+59/-53)
l10n_es_payment_order/wizard/csb_34.py (+79/-74)
l10n_es_payment_order/wizard/csb_34_01.py (+36/-29)
l10n_es_payment_order/wizard/csb_58.py (+44/-38)
l10n_es_payment_order/wizard/export_remesas.py (+129/-173)
l10n_es_payment_order/wizard/export_remesas_view.xml (+40/-0)
l10n_es_payment_order/wizard/log.py (+45/-0)
To merge this branch: bzr merge lp:~acysos-team/openerp-spain/openerp-spain-6.0
Reviewer Review Type Date Requested Status
Ignacio Ibeas (www.acysos.com) Approve
Review via email: mp+142078@code.launchpad.net

Commit message

[FIX] l10n_es_payment_order: refactorización, eliminación del código de OpenERP 5.0 y herencia en CSB

Description of the change

Se ha eliminado todo el código que quedaba de OpenERP 5.0 a partir de los
cambios que realizo Pexego en el wizard para OpenERP 6.1. Este cambio hace que
99% del codigo del módulo sea igual para OpenERP 6.0 y 6.1 a diferencia de
una vista que ha cambiado en OpenERP 6.1 pero que solo afecta a una línea
(línea 26 de remesa_view.xml).
El resto del código es exactamente igual para ambas versiones. Esto facilita
mucho el mantenimiento.

Se ha modificado todas las clases de los cuadernos y del converter,
convirtiendolas en clases del OSV y, por lo tanto, permitiendo la herencia de
OpenERP.

To post a comment you must log in.
Revision history for this message
Joan M. Grande (totaler) wrote :

Genial trabajo. Dos puntualizaciones:

- El objeto "payment.converter.spain" al no tener un reflejo en la base de datos, se le puede poner el atributo "_auto = False" para evitar crear una tabla vacia en postgres.
- Si el código fuera PEP8, ya sería la releche.

338. By Ignacio Ibeas (www.acysos.com)

[FIX] l10n_es_payment_order: fix auto = False en el converter

339. By Ignacio Ibeas (www.acysos.com)

[FIX] l10n_es_payment_order: fix auto = False en las clases que no necesitan tablas

Revision history for this message
Ignacio Ibeas (www.acysos.com) (ignacio-acysos) wrote :

Hola,

Ya esta añadido el _auto = False a todas las clases que no necesitan tablas.

Respecto a PEP8, tendrá que ser en otra revisión, ahora creo que es urgente tener un módulo que no tenga restos de OpenERP 5.0 y que permita herencia, para el desarrollo de nuevos módulos.

Saludos,
Ignacio Ibeas

Revision history for this message
Ignacio Ibeas (www.acysos.com) (ignacio-acysos) wrote :

Como veo que no hay más comentario procedo a hacer el merge.

Saludos

Revision history for this message
Ignacio Ibeas (www.acysos.com) (ignacio-acysos) :
review: Approve
340. By Ignacio Ibeas (www.acysos.com)

Merge: actulizar cambios

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'l10n_es_payment_order/__init__.py'
--- l10n_es_payment_order/__init__.py 2011-08-29 15:11:11 +0000
+++ l10n_es_payment_order/__init__.py 2013-01-11 10:23:22 +0000
@@ -7,6 +7,8 @@
7# Copyright (c) 2008 Pablo Rocandio. All Rights Reserved.7# Copyright (c) 2008 Pablo Rocandio. All Rights Reserved.
8# Copyright (c) 2009 Zikzakmedia S.L. (http://zikzakmedia.com) All Rights Reserved.8# Copyright (c) 2009 Zikzakmedia S.L. (http://zikzakmedia.com) All Rights Reserved.
9# Jordi Esteve <jesteve@zikzakmedia.com>9# Jordi Esteve <jesteve@zikzakmedia.com>
10# AvanzOSC, Advanced Open Source Consulting
11# Copyright (C) 2011-2012 Ainara Galdona (www.avanzosc.com). All Rights Reserved
10# $Id$12# $Id$
11#13#
12# This program is free software: you can redistribute it and/or modify14# This program is free software: you can redistribute it and/or modify
1315
=== modified file 'l10n_es_payment_order/__openerp__.py'
--- l10n_es_payment_order/__openerp__.py 2012-03-03 11:14:30 +0000
+++ l10n_es_payment_order/__openerp__.py 2013-01-11 10:23:22 +0000
@@ -7,8 +7,13 @@
7# Copyright (c) 2008 Acysos SL. All Rights Reserved.7# Copyright (c) 2008 Acysos SL. All Rights Reserved.
8# Ignacio Ibeas <ignacio@acysos.com>8# Ignacio Ibeas <ignacio@acysos.com>
9# Copyright (c) 2008 Pablo Rocandio. All Rights Reserved.9# Copyright (c) 2008 Pablo Rocandio. All Rights Reserved.
10# AvanzOSC, Advanced Open Source Consulting
11# Copyright (C) 2011-2012 Ainara Galdona (www.avanzosc.com). All Rights Reserved
10# $Id$12# $Id$
11#13#
14# Refactorización. Acysos S.L. (http://www.acysos.com) 2012
15# Ignacio Ibeas <ignacio@acysos.com>
16#
12# This program is free software: you can redistribute it and/or modify17# This program is free software: you can redistribute it and/or modify
13# it under the terms of the GNU Affero General Public License as published by18# it under the terms of the GNU Affero General Public License as published by
14# the Free Software Foundation, either version 3 of the License, or19# the Free Software Foundation, either version 3 of the License, or
@@ -26,7 +31,7 @@
2631
27{32{
28 "name" : "Exportación de ficheros bancarios CSB 19, CSB 32, CSB 34 y CSB 58",33 "name" : "Exportación de ficheros bancarios CSB 19, CSB 32, CSB 34 y CSB 58",
29 "version" : "1.5",34 "version" : "1.6",
30 "author" : "Acysos SL, Zikzakmedia SL, Pablo Rocandio, NaN·tic",35 "author" : "Acysos SL, Zikzakmedia SL, Pablo Rocandio, NaN·tic",
31 "category" : "Localisation/Accounting",36 "category" : "Localisation/Accounting",
32 "description" : """Módulo para la exportación de ficheros bancarios según las normas CSB 19 (recibos domiciliados), CBS 32 (descuento comercial), CSB 58 (anticipos de créditos) y CSB 34 (emisión de transferencias, nóminas, cheques, pagarés y pagos certificados) para poder ser enviados a la entidad bancaria.37 "description" : """Módulo para la exportación de ficheros bancarios según las normas CSB 19 (recibos domiciliados), CBS 32 (descuento comercial), CSB 58 (anticipos de créditos) y CSB 34 (emisión de transferencias, nóminas, cheques, pagarés y pagos certificados) para poder ser enviados a la entidad bancaria.
@@ -49,7 +54,12 @@
49 "depends" : ["base", "account", "account_payment_extension",],54 "depends" : ["base", "account", "account_payment_extension",],
50 "init_xml" : ["remesas_data.xml"],55 "init_xml" : ["remesas_data.xml"],
51 "demo_xml" : [],56 "demo_xml" : [],
52 "update_xml" : ["remesas_report.xml", "remesas_view.xml", "remesas_wizard.xml",],57 "update_xml" : [
58 "remesas_report.xml",
59 "remesas_view.xml",
60 "wizard/export_remesas_view.xml",
61 "security/ir.model.access.csv"
62 ],
53 "installable" : True,63 "installable" : True,
54 "active" : False,64 "active" : False,
55}65}
5666
=== modified file 'l10n_es_payment_order/i18n/es.po'
--- l10n_es_payment_order/i18n/es.po 2011-08-03 15:44:39 +0000
+++ l10n_es_payment_order/i18n/es.po 2013-01-11 10:23:22 +0000
@@ -1,67 +1,29 @@
1# Translation of OpenERP Server.1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:2# This file contains the translation of the following modules:
3# * l10n_ES_remesas3# * l10n_es_payment_order
4#4#
5msgid ""5msgid ""
6msgstr ""6msgstr ""
7"Project-Id-Version: OpenERP Server 5.0.15\n"7"Project-Id-Version: OpenERP Server 6.1\n"
8"Report-Msgid-Bugs-To: support@openerp.com\n"8"Report-Msgid-Bugs-To: \n"
9"POT-Creation-Date: 2011-05-24 11:11+0000\n"9"POT-Creation-Date: 2012-09-03 00:18+0000\n"
10"PO-Revision-Date: 2011-05-24 13:34+0100\n"10"PO-Revision-Date: 2012-09-03 00:18+0000\n"
11"Last-Translator: Jesús Martín <jmartin@zikzakmedia.com>\n"11"Last-Translator: <>\n"
12"Language-Team: \n"12"Language-Team: \n"
13"MIME-Version: 1.0\n"13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: 8bit\n"15"Content-Transfer-Encoding: \n"
16"Plural-Forms: \n"16"Plural-Forms: \n"
1717
18#. module: l10n_es_payment_order18#. module: l10n_es_payment_order
19#: report:remesas.report:0
20msgid "Matur. date"
21msgstr "Fecha de vencimiento"
22
23#. module: l10n_es_payment_order
24#: selection:payment.mode,tipo:019#: selection:payment.mode,tipo:0
25msgid "CSB 19"20msgid "CSB 19"
26msgstr "CSB 19"21msgstr "CSB 19"
2722
28#. module: l10n_es_payment_order23#. module: l10n_es_payment_order
29#: model:ir.module.module,description:l10n_es_payment_order.module_meta_information24#: field:payment.mode,send_type:0
30msgid ""25msgid "Send Type"
31"Módulo para la exportación de ficheros bancarios según las normas CSB 19 (recibos domiciliados), CBS 32 (descuento comercial), CSB 58 (anticipos de créditos) y CSB 34 (emisión de transferencias, nóminas, cheques, pagarés y pagos certificados) para poder ser enviados a la entidad bancaria.\n"26msgstr "Tipo de envío"
32"\n"
33"Crea un tipo de pago \"Recibo domiciliado\" con el código RECIBO_CSB. Este código es importante pues permite ejecutar el asistente de creación del fichero de remesas cuando se presiona el botón \"Realizar pagos\" en la orden de pagos o remesa.\n"
34"\n"
35"También crea los tipos de pago \"Transferencia\" (TRANSFERENCIA_CSB), \"Pagaré\" (PAGARE_CSB), \"Cheque\" (CHEQUE_CSB), \"Pago certificado\" (PAGO_CERTIFICADO_CSB).\n"
36"\n"
37"Antes de generar un fichero bancario CSB habrá que definir un modo de pago que use el tipo de pago anterior y donde se defina la forma de pago (CSB 19, CSB 32, CSB 34 o CSB 58), la compañía que emite el fichero y el sufijo y nombre de compañia a incluir en el fichero.\n"
38"\n"
39"Al crear el fichero bancario CSB:\n"
40"\n"
41" * Se pueden agrupar o no los pagos de una misma empresa y cuenta bancaria\n"
42" * El fichero creado se guarda como adjunto de la orden de pagos. Se puede volver a crear el fichero de remesas siempre que sea necesario (puede tener que renombrar el anterior fichero adjunto si tienen el mismo nombre).\n"
43"\n"
44"También se proporciona un informe para imprimir un listado de los pagos/cobros de la orden de pago/cobro (remesa).\n"
45msgstr ""
46"Módulo para la exportación de ficheros bancarios según las normas CSB 19 (recibos domiciliados), CBS 32 (descuento comercial), CSB 58 (anticipos de créditos) y CSB 34 (emisión de transferencias, nóminas, cheques, pagarés y pagos certificados) para poder ser enviados a la entidad bancaria.\n"
47"\n"
48"Crea un tipo de pago \"Recibo domiciliado\" con el código RECIBO_CSB. Este código es importante pues permite ejecutar el asistente de creación del fichero de remesas cuando se presiona el botón \"Realizar pagos\" en la orden de pagos o remesa.\n"
49"\n"
50"También crea los tipos de pago \"Transferencia\" (TRANSFERENCIA_CSB), \"Pagaré\" (PAGARE_CSB), \"Cheque\" (CHEQUE_CSB), \"Pago certificado\" (PAGO_CERTIFICADO_CSB).\n"
51"\n"
52"Antes de generar un fichero bancario CSB habrá que definir un modo de pago que use el tipo de pago anterior y donde se defina la forma de pago (CSB 19, CSB 32, CSB 34 o CSB 58), la compañía que emite el fichero y el sufijo y nombre de compañia a incluir en el fichero.\n"
53"\n"
54"Al crear el fichero bancario CSB:\n"
55"\n"
56" * Se pueden agrupar o no los pagos de una misma empresa y cuenta bancaria\n"
57" * El fichero creado se guarda como adjunto de la orden de pagos. Se puede volver a crear el fichero de remesas siempre que sea necesario (puede tener que renombrar el anterior fichero adjunto si tienen el mismo nombre).\n"
58"\n"
59"También se proporciona un informe para imprimir un listado de los pagos/cobros de la orden de pago/cobro (remesa).\n"
60
61#. module: l10n_es_payment_order
62#: help:payment.mode,send_type:0
63msgid "The sending type of the payment file"
64msgstr "El tipos de envío del archivo de pago"
6527
66#. module: l10n_es_payment_order28#. module: l10n_es_payment_order
67#: field:payment.mode,add_date:029#: field:payment.mode,add_date:0
@@ -79,14 +41,17 @@
79msgstr "CIF"41msgstr "CIF"
8042
81#. module: l10n_es_payment_order43#. module: l10n_es_payment_order
44#: view:wizard.payment.file.spain:0
45msgid "_Export"
46msgstr "_Exportar"
47
48#. module: l10n_es_payment_order
82#: code:addons/l10n_es_payment_order/wizard/converter.py:7149#: code:addons/l10n_es_payment_order/wizard/converter.py:71
83#, python-format50#, python-format
84msgid ""51msgid "Error:\n"
85"Error:\n"
86"\n"52"\n"
87"Can not convert float number %(number).2f to fit in %(size)d characters."53"Can not convert float number %(number).2f to fit in %(size)d characters."
88msgstr ""54msgstr "Error:\n"
89"Error:\n"
90"\n"55"\n"
91"No se puede convertir el número %(number).2f para que quepa en %(size)d caracteres."56"No se puede convertir el número %(number).2f para que quepa en %(size)d caracteres."
9257
@@ -111,49 +76,34 @@
111msgstr "Cedente"76msgstr "Cedente"
11277
113#. module: l10n_es_payment_order78#. module: l10n_es_payment_order
114#: code:addons/l10n_es_payment_order/wizard/export_remesas.py:15179#: model:ir.model,name:l10n_es_payment_order.model_wizard_payment_file_export_spain
115#, python-format80msgid "Pay file export spain"
116msgid ""81msgstr "Pay file export spain"
117"User error:\n"82
118"\n"83#. module: l10n_es_payment_order
119"The payment mode is not CSB 19, CSB 32, CSB 34 or CSB 58"84#: model:ir.model,name:l10n_es_payment_order.model_wizard_payment_file_spain
120msgstr ""85msgid "wizard.payment.file.spain"
121"Error del usuario:\n"86msgstr "wizard.payment.file.spain"
122"\n"87
123"El modo de pago no es CSB 19, CSB 32, CSB 34 ni CSB 58"88#. module: l10n_es_payment_order
12489#: field:payment.mode,not_to_the_order:0
125#. module: l10n_es_payment_order90msgid "Not to the Order"
126#: report:remesas.report:091msgstr "No a la orden"
127msgid "Account:"92
128msgstr "C.C.:"93#. module: l10n_es_payment_order
12994#: code:addons/l10n_es_payment_order/wizard/export_remesas.py:129
130#. module: l10n_es_payment_order95#, python-format
131#: selection:payment.mode,cost_key:096msgid "User error:\n"
132msgid "Expense of the Recipient"
133msgstr "Gastos por cuenta del beneficiario"
134
135#. module: l10n_es_payment_order
136#: wizard_button:export_payment_file_spain,export,end:0
137#: wizard_button:export_payment_file_spain,init,export:0
138msgid "Ok"
139msgstr "Aceptar"
140
141#. module: l10n_es_payment_order
142#: code:addons/l10n_es_payment_order/wizard/export_remesas.py:140
143#, python-format
144msgid ""
145"User error:\n"
146"\n"97"\n"
147"The bank account number of the customer %s has not 20 digits."98"The bank account number of the customer %s has not 20 digits."
148msgstr ""99msgstr "Error del usuario:\n"
149"Error del usuario:\n"
150"\n"100"\n"
151"El número de C.C. del cliente %s no tiene 20 dígitos."101"El número de C.C. del cliente %s no tiene 20 dígitos."
152102
153#. module: l10n_es_payment_order103#. module: l10n_es_payment_order
154#: wizard_field:export_payment_file_spain,export,pay_fname:0104#: field:wizard.payment.file.spain,pay_fname:0
155msgid "File name"105msgid "File name"
156msgstr "Nombre del fichero"106msgstr "Nombre Fichero"
157107
158#. module: l10n_es_payment_order108#. module: l10n_es_payment_order
159#: help:payment.mode,concept:0109#: help:payment.mode,concept:0
@@ -161,19 +111,14 @@
161msgstr "Concepto de la orden."111msgstr "Concepto de la orden."
162112
163#. module: l10n_es_payment_order113#. module: l10n_es_payment_order
164#: model:ir.actions.report.xml,name:l10n_es_payment_order.remesas_report
165msgid "Remesa"
166msgstr "Remesa"
167
168#. module: l10n_es_payment_order
169#: field:payment.mode,barred:0114#: field:payment.mode,barred:0
170msgid "Barred"115msgid "Barred"
171msgstr "Barrado"116msgstr "Barrado"
172117
173#. module: l10n_es_payment_order118#. module: l10n_es_payment_order
174#: field:payment.mode,send_type:0119#: help:payment.mode,send_type:0
175msgid "Send Type"120msgid "The sending type of the payment file"
176msgstr "Tipo de envío"121msgstr "El tipos de envío del archivo de pago"
177122
178#. module: l10n_es_payment_order123#. module: l10n_es_payment_order
179#: help:payment.mode,direct_pay_order:0124#: help:payment.mode,direct_pay_order:0
@@ -181,14 +126,12 @@
181msgstr "Por defecto 'No'."126msgstr "Por defecto 'No'."
182127
183#. module: l10n_es_payment_order128#. module: l10n_es_payment_order
184#: code:addons/l10n_es_payment_order/wizard/export_remesas.py:137129#: code:addons/l10n_es_payment_order/wizard/export_remesas.py:126
185#, python-format130#, python-format
186msgid ""131msgid "User error:\n"
187"User error:\n"
188"\n"132"\n"
189"The bank account number of the customer %s is not defined and current payment mode enforces all lines to have a bank account."133"The bank account number of the customer %s is not defined and current payment mode enforces all lines to have a bank account."
190msgstr ""134msgstr "Error del usuario:\n"
191"Error del usuario:\n"
192"\n"135"\n"
193"La empresa %s no tiene definida ninguna cuenta bancaria y la forma de pago actual fuerza que todas las líneas tengan asignada una cuenta bancaria."136"La empresa %s no tiene definida ninguna cuenta bancaria y la forma de pago actual fuerza que todas las líneas tengan asignada una cuenta bancaria."
194137
@@ -200,12 +143,10 @@
200#. module: l10n_es_payment_order143#. module: l10n_es_payment_order
201#: code:addons/l10n_es_payment_order/wizard/converter.py:98144#: code:addons/l10n_es_payment_order/wizard/converter.py:98
202#, python-format145#, python-format
203msgid ""146msgid "User error:\n"
204"User error:\n"
205"\n"147"\n"
206"The bank account number of %s is not defined."148"The bank account number of %s is not defined."
207msgstr ""149msgstr "Error del usuario:\n"
208"Error del usuario:\n"
209"\n"150"\n"
210"El número de C.C. del cliente %s no existe."151"El número de C.C. del cliente %s no existe."
211152
@@ -215,31 +156,19 @@
215msgstr "Pagaré"156msgstr "Pagaré"
216157
217#. module: l10n_es_payment_order158#. module: l10n_es_payment_order
218#: report:remesas.report:0159#: code:addons/l10n_es_payment_order/wizard/export_remesas.py:73
219msgid "Payment date:"
220msgstr "Fecha cargo:"
221
222#. module: l10n_es_payment_order
223#: code:addons/l10n_es_payment_order/wizard/export_remesas.py:87
224#, python-format160#, python-format
225msgid ""161msgid "User error:\n"
226"User error:\n"
227"\n"162"\n"
228"The bank account of the company %s is not defined."163"The bank account of the company %s is not defined."
229msgstr ""164msgstr "Error del usuario:\n"
230"Error del usuario:\n"
231"\n"165"\n"
232"No se ha definido el C.C. de la compañía %s."166"No se ha definido el C.C. de la compañía %s."
233167
234#. module: l10n_es_payment_order168#. module: l10n_es_payment_order
235#: selection:payment.mode,csb34_type:0169#: model:payment.type,name:l10n_es_payment_order.payment_type_giro0
236msgid "Transfer"170msgid "Giiro"
237msgstr "Transferencia"171msgstr "Giro"
238
239#. module: l10n_es_payment_order
240#: field:payment.mode,ine:0
241msgid "INE code"
242msgstr "Código INE"
243172
244#. module: l10n_es_payment_order173#. module: l10n_es_payment_order
245#: selection:payment.mode,tipo:0174#: selection:payment.mode,tipo:0
@@ -247,6 +176,11 @@
247msgstr "CSB 32"176msgstr "CSB 32"
248177
249#. module: l10n_es_payment_order178#. module: l10n_es_payment_order
179#: model:ir.model,name:l10n_es_payment_order.model_wizard_payment_file_join_spain
180msgid "Pay file join spain"
181msgstr "Pay file join spain"
182
183#. module: l10n_es_payment_order
250#: selection:payment.mode,tipo:0184#: selection:payment.mode,tipo:0
251msgid "CSB 34"185msgid "CSB 34"
252msgstr "CSB 34"186msgstr "CSB 34"
@@ -257,10 +191,9 @@
257msgstr "Modo de pago"191msgstr "Modo de pago"
258192
259#. module: l10n_es_payment_order193#. module: l10n_es_payment_order
260#: model:payment.type,name:l10n_es_payment_order.payment_type_recibodomiciliado0194#: selection:payment.mode,csb34_type:0
261#: model:payment.type,note:l10n_es_payment_order.payment_type_recibodomiciliado0195msgid "Certified Payments"
262msgid "Recibo domiciliado"196msgstr "Pagos certificados"
263msgstr "Recibo domiciliado"
264197
265#. module: l10n_es_payment_order198#. module: l10n_es_payment_order
266#: help:payment.mode,alt_domicile_format:0199#: help:payment.mode,alt_domicile_format:0
@@ -273,19 +206,28 @@
273msgstr "Datos del presentador"206msgstr "Datos del presentador"
274207
275#. module: l10n_es_payment_order208#. module: l10n_es_payment_order
209#: field:payment.mode,csb19_extra_concepts:0
210msgid "Extra Concepts"
211msgstr "Conceptos Extra"
212
213#. module: l10n_es_payment_order
276#: selection:payment.mode,tipo:0214#: selection:payment.mode,tipo:0
277msgid "None"215msgid "None"
278msgstr "Ninguno"216msgstr "Ninguno"
279217
280#. module: l10n_es_payment_order218#. module: l10n_es_payment_order
219#: model:payment.type,name:l10n_es_payment_order.payment_type_recibodomiciliado0
220#: model:payment.type,note:l10n_es_payment_order.payment_type_recibodomiciliado0
221msgid "Recibo domiciliado"
222msgstr "Recibo domiciliado"
223
224#. module: l10n_es_payment_order
281#: code:addons/l10n_es_payment_order/wizard/converter.py:101225#: code:addons/l10n_es_payment_order/wizard/converter.py:101
282#, python-format226#, python-format
283msgid ""227msgid "User error:\n"
284"User error:\n"
285"\n"228"\n"
286"The bank account number of %s does not have 20 digits."229"The bank account number of %s does not have 20 digits."
287msgstr ""230msgstr "Error del usuario:\n"
288"Error del usuario:\n"
289"\n"231"\n"
290"El número de C.C. de %s no tiene 20 dígitos."232"El número de C.C. de %s no tiene 20 dígitos."
291233
@@ -309,54 +251,44 @@
309#: code:addons/l10n_es_payment_order/wizard/csb_32.py:195251#: code:addons/l10n_es_payment_order/wizard/csb_32.py:195
310#: code:addons/l10n_es_payment_order/wizard/csb_32.py:221252#: code:addons/l10n_es_payment_order/wizard/csb_32.py:221
311#, python-format253#, python-format
312msgid ""254msgid "Configuration error:\n"
313"Configuration error:\n"
314"\n"255"\n"
315"The line \"%s\" is not 150 characters long:\n"256"The line \"%s\" is not 150 characters long:\n"
316"%s"257"%s"
317msgstr ""258msgstr "Error de configuración:\n"
318"Error de configuración:\n"
319"\n"259"\n"
320"La línea \"%s\" no tiene 150 caracteres:\n"260"La línea \"%s\" no tiene 150 caracteres:\n"
321"%s"261"%s"
322262
323#. module: l10n_es_payment_order263#. module: l10n_es_payment_order
324#: field:payment.mode,partner_id:0
325#: report:remesas.report:0
326msgid "Partner"
327msgstr "Empresa"
328
329#. module: l10n_es_payment_order
330#: code:addons/l10n_es_payment_order/wizard/csb_34.py:154264#: code:addons/l10n_es_payment_order/wizard/csb_34.py:154
331#: code:addons/l10n_es_payment_order/wizard/csb_34.py:355265#: code:addons/l10n_es_payment_order/wizard/csb_34.py:356
332#: code:addons/l10n_es_payment_order/wizard/csb_34.py:370266#: code:addons/l10n_es_payment_order/wizard/csb_34.py:371
333#, python-format267#, python-format
334msgid ""268msgid "Configuration error:\n"
335"Configuration error:\n"
336"\n"269"\n"
337"The line \"%s\" is not 72 characters long:\n"270"The line \"%s\" is not 72 characters long:\n"
338"%s"271"%s"
339msgstr ""272msgstr "Error de configuración:\n"
340"Error de configuración:\n"
341"\n"273"\n"
342"La línea \"%s\" no tiene 72 caracteres:\n"274"La línea \"%s\" no tiene 72 caracteres:\n"
343"%s"275"%s"
344276
345#. module: l10n_es_payment_order277#. module: l10n_es_payment_order
346#: code:addons/l10n_es_payment_order/wizard/export_remesas.py:174278#: code:addons/l10n_es_payment_order/wizard/export_remesas.py:160
347#, python-format279#, python-format
348msgid ""280msgid "Successfully Exported\n"
349"Successfully Exported\n"
350"\n"281"\n"
351"Summary:\n"282"Summary:\n"
352" Total amount paid: %.2f\n"283" Total amount paid: %.2f\n"
353" Total Number of Payments: %d\n"284" Total Number of Payments: %d\n"
354msgstr ""285""
355"Exportación realizada con éxito\n"286msgstr "Exportación realizada con éxito\n"
356"\n"287"\n"
357"Resumen:\n"288"Resumen:\n"
358" Total importe remesa: %.2f\n"289" Total importe remesa: %.2f\n"
359" Total número de recibos: %d\n"290" Total número de recibos: %d\n"
291""
360292
361#. module: l10n_es_payment_order293#. module: l10n_es_payment_order
362#: field:payment.mode,text3:0294#: field:payment.mode,text3:0
@@ -364,14 +296,12 @@
364msgstr "Línea 3"296msgstr "Línea 3"
365297
366#. module: l10n_es_payment_order298#. module: l10n_es_payment_order
367#: code:addons/l10n_es_payment_order/wizard/csb_19.py:74299#: code:addons/l10n_es_payment_order/wizard/csb_19.py:77
368#, python-format300#, python-format
369msgid ""301msgid "User error:\n"
370"User error:\n"
371"\n"302"\n"
372"Fixed date of charge has not been defined."303"Fixed date of charge has not been defined."
373msgstr ""304msgstr "Error del usuario:\n"
374"Error del usuario:\n"
375"\n"305"\n"
376"No se ha definido una fecha fija de cargo."306"No se ha definido una fecha fija de cargo."
377307
@@ -381,44 +311,55 @@
381msgstr "Nombre compañía para archivo"311msgstr "Nombre compañía para archivo"
382312
383#. module: l10n_es_payment_order313#. module: l10n_es_payment_order
384#: code:addons/l10n_es_payment_order/wizard/export_remesas.py:166314#: view:payment.mode:0
315msgid "CSB 19 Options"
316msgstr "Opciones CSB 19"
317
318#. module: l10n_es_payment_order
319#: code:addons/l10n_es_payment_order/wizard/export_remesas.py:152
385#, python-format320#, python-format
386msgid "remesa"321msgid "remesa"
387msgstr "remesa"322msgstr "remesa"
388323
389#. module: l10n_es_payment_order324#. module: l10n_es_payment_order
390#: code:addons/l10n_es_payment_order/wizard/export_remesas.py:83325#: code:addons/l10n_es_payment_order/wizard/export_remesas.py:69
391#, python-format326#, python-format
392msgid ""327msgid "User error:\n"
393"User error:\n"
394"\n"328"\n"
395"Wizard can not generate export file, there are not payment lines."329"Wizard can not generate export file, there are not payment lines."
396msgstr ""330msgstr "Error del usuario:\n"
397"Error del usuario:\n"
398"\n"331"\n"
399"El asistente no puede generar el archivo de remesas, no existen recibos."332"El asistente no puede generar el archivo de remesas, no existen recibos."
400333
401#. module: l10n_es_payment_order334#. module: l10n_es_payment_order
335#: view:payment.mode:0
336msgid "CSB 32 Options"
337msgstr "Opciones CSB 32"
338
339#. module: l10n_es_payment_order
402#: code:addons/l10n_es_payment_order/wizard/converter.py:80340#: code:addons/l10n_es_payment_order/wizard/converter.py:80
403#, python-format341#, python-format
404msgid ""342msgid "Error:\n"
405"Error:\n"
406"\n"343"\n"
407"Can not convert integer number %(number)d to fit in %(size)d characters."344"Can not convert integer number %(number)d to fit in %(size)d characters."
408msgstr ""345msgstr "Error:\n"
409"Error:\n"
410"\n"346"\n"
411"No se puede convertir el número entero %(number)d para que quepa en %(size)d caracteres."347"No se puede convertir el número entero %(number)d para que quepa en %(size)d caracteres."
412348
413#. module: l10n_es_payment_order349#. module: l10n_es_payment_order
414#: wizard_field:export_payment_file_spain,export,note:0350#: field:wizard.payment.file.spain,note:0
415msgid "Log"351msgid "Log"
416msgstr "Registro"352msgstr "Log"
417353
418#. module: l10n_es_payment_order354#. module: l10n_es_payment_order
419#: report:remesas.report:0355#: code:addons/l10n_es_payment_order/wizard/export_remesas.py:140
420msgid "PAYMENT ORDER Num.:"356#, python-format
421msgstr "REMESA Nº:"357msgid "User error:\n"
358"\n"
359"The payment mode is not CSB 19, CSB 32, CSB 34 or CSB 58"
360msgstr "Error del usuario:\n"
361"\n"
362"El modo de pago no es CSB 19, CSB 32, CSB 34 ni CSB 58"
422363
423#. module: l10n_es_payment_order364#. module: l10n_es_payment_order
424#: selection:payment.mode,tipo:0365#: selection:payment.mode,tipo:0
@@ -426,41 +367,33 @@
426msgstr "CSB 58"367msgstr "CSB 58"
427368
428#. module: l10n_es_payment_order369#. module: l10n_es_payment_order
429#: code:addons/l10n_es_payment_order/remesas.py:107370#: code:addons/l10n_es_payment_order/remesas.py:111
430#, python-format371#, python-format
431msgid "Dear Sir"372msgid "Dear Sir"
432msgstr "Estimado Sr."373msgstr "Estimado Sr."
433374
434#. module: l10n_es_payment_order375#. module: l10n_es_payment_order
435#: report:remesas.report:0376#: field:payment.mode,ine:0
436msgid "........."377msgid "INE code"
437msgstr "........."378msgstr "Código INE"
438
439#. module: l10n_es_payment_order
440#: model:ir.module.module,shortdesc:l10n_es_payment_order.module_meta_information
441msgid "Exportación de ficheros bancarios CSB 19, CSB 32, CSB 34 y CSB 58"
442msgstr "Exportación de ficheros bancarios CSB 19, CSB 32, CSB 34 y CSB 58"
443379
444#. module: l10n_es_payment_order380#. module: l10n_es_payment_order
445#: code:addons/l10n_es_payment_order/wizard/csb_34.py:128381#: code:addons/l10n_es_payment_order/wizard/csb_34.py:128
446#, python-format382#, python-format
447msgid ""383msgid "User error:\n"
448"User error:\n"
449"\n"384"\n"
450"Company %s has no invoicing or default address."385"Company %s has no invoicing or default address."
451msgstr ""386msgstr "Error del usuario:\n"
452"Error del usuario:\n"
453"\n"387"\n"
454"La compañía %s no tiene dirección por defecto o de facturación."388"La compañía %s no tiene dirección por defecto o de facturación."
455389
456#. module: l10n_es_payment_order390#. module: l10n_es_payment_order
457#: model:payment.type,name:l10n_es_payment_order.payment_type_cheque0391#: selection:payment.mode,cost_key:0
458#: model:payment.type,note:l10n_es_payment_order.payment_type_cheque0392msgid "Expense of the Payer"
459msgid "Cheque"393msgstr "Gastos por cuenta del ordenante"
460msgstr "Cheque"
461394
462#. module: l10n_es_payment_order395#. module: l10n_es_payment_order
463#: code:addons/l10n_es_payment_order/wizard/export_remesas.py:168396#: code:addons/l10n_es_payment_order/wizard/export_remesas.py:154
464#, python-format397#, python-format
465msgid "Remesa "398msgid "Remesa "
466msgstr "Remesa "399msgstr "Remesa "
@@ -471,11 +404,6 @@
471msgstr "Clave de gastos"404msgstr "Clave de gastos"
472405
473#. module: l10n_es_payment_order406#. module: l10n_es_payment_order
474#: model:ir.model,name:l10n_es_payment_order.model_payment_order
475msgid "Payment Order"
476msgstr "Orden de pago"
477
478#. module: l10n_es_payment_order
479#: field:payment.mode,concept:0407#: field:payment.mode,concept:0
480msgid "Concept of the Order"408msgid "Concept of the Order"
481msgstr "Concepto de la orden."409msgstr "Concepto de la orden."
@@ -487,6 +415,12 @@
487msgstr "Transferencia"415msgstr "Transferencia"
488416
489#. module: l10n_es_payment_order417#. module: l10n_es_payment_order
418#: model:payment.type,name:l10n_es_payment_order.payment_type_cheque0
419#: model:payment.type,note:l10n_es_payment_order.payment_type_cheque0
420msgid "Cheque"
421msgstr "Cheque"
422
423#. module: l10n_es_payment_order
490#: model:payment.type,note:l10n_es_payment_order.payment_type_pagare0424#: model:payment.type,note:l10n_es_payment_order.payment_type_pagare0
491msgid "Pagare"425msgid "Pagare"
492msgstr "Pagaré"426msgstr "Pagaré"
@@ -497,25 +431,14 @@
497msgstr "Opciones CSB 34"431msgstr "Opciones CSB 34"
498432
499#. module: l10n_es_payment_order433#. module: l10n_es_payment_order
500#: wizard_view:export_payment_file_spain,export:0434#: view:wizard.payment.file.spain:0
501#: wizard_view:export_payment_file_spain,init:0
502msgid "Payment order export"435msgid "Payment order export"
503msgstr "Exportar orden de pago"436msgstr "Exportar fichero de pagos"
504437
505#. module: l10n_es_payment_order438#. module: l10n_es_payment_order
506#: report:remesas.report:0439#: field:wizard.payment.file.spain,join:0
507msgid "Total payment order:"
508msgstr "Total Remesa:"
509
510#. module: l10n_es_payment_order
511#: field:payment.mode,payroll_check:0
512msgid "Payroll Check"
513msgstr "Cheque nómina"
514
515#. module: l10n_es_payment_order
516#: wizard_field:export_payment_file_spain,init,join:0
517msgid "Join payment lines of the same partner and bank account"440msgid "Join payment lines of the same partner and bank account"
518msgstr "Fusionar recibos de la misma empresa y cuenta bancaria"441msgstr "Unir las líneas de pagos del mismo cliente y cuenta bancaria"
519442
520#. module: l10n_es_payment_order443#. module: l10n_es_payment_order
521#: field:payment.mode,alt_domicile_format:0444#: field:payment.mode,alt_domicile_format:0
@@ -533,14 +456,12 @@
533msgstr "Orden de abono directo"456msgstr "Orden de abono directo"
534457
535#. module: l10n_es_payment_order458#. module: l10n_es_payment_order
536#: code:addons/l10n_es_payment_order/wizard/export_remesas.py:94459#: code:addons/l10n_es_payment_order/wizard/export_remesas.py:80
537#, python-format460#, python-format
538msgid ""461msgid "User error:\n"
539"User error:\n"
540"\n"462"\n"
541"The company VAT number related to the bank account of the payment mode is not defined."463"The company VAT number related to the bank account of the payment mode is not defined."
542msgstr ""464msgstr "Error del usuario:\n"
543"Error del usuario:\n"
544"\n"465"\n"
545"No se ha definido el CIF de la compañía asociada al C.C. del modo de pago."466"No se ha definido el CIF de la compañía asociada al C.C. del modo de pago."
546467
@@ -550,9 +471,9 @@
550msgstr "Datos adicionales para pagarés, cheques y pagos certificados."471msgstr "Datos adicionales para pagarés, cheques y pagos certificados."
551472
552#. module: l10n_es_payment_order473#. module: l10n_es_payment_order
553#: report:remesas.report:0474#: view:wizard.payment.file.spain:0
554msgid "Invoice"475msgid "Cancel"
555msgstr "Factura"476msgstr "Cancel"
556477
557#. module: l10n_es_payment_order478#. module: l10n_es_payment_order
558#: field:payment.mode,text1:0479#: field:payment.mode,text1:0
@@ -565,41 +486,35 @@
565msgstr "Línea 2"486msgstr "Línea 2"
566487
567#. module: l10n_es_payment_order488#. module: l10n_es_payment_order
568#: field:payment.mode,not_to_the_order:0489#: selection:payment.mode,cost_key:0
569msgid "Not to the Order"490msgid "Expense of the Recipient"
570msgstr "No a la orden"491msgstr "Gastos por cuenta del beneficiario"
571492
572#. module: l10n_es_payment_order493#. module: l10n_es_payment_order
573#: view:payment.mode:0494#: model:payment.type,name:l10n_es_payment_order.payment_type_reposicion0
574msgid "CSB 32 Options"495#: model:payment.type,note:l10n_es_payment_order.payment_type_reposicion0
575msgstr "Opciones CSB 32"496msgid "Reposición"
576497msgstr "Reposición"
577#. module: l10n_es_payment_order498
578#: wizard_field:export_payment_file_spain,export,pay:0499#. module: l10n_es_payment_order
500#: field:wizard.payment.file.spain,pay:0
579msgid "Payment order file"501msgid "Payment order file"
580msgstr "Archivo remesa"502msgstr "Fichero de pagos"
581503
582#. module: l10n_es_payment_order504#. module: l10n_es_payment_order
583#: report:remesas.report:0505#: selection:payment.mode,csb34_type:0
584msgid "Created date:"506msgid "Transfer"
585msgstr "Fecha confección:"507msgstr "Transferencia"
586
587#. module: l10n_es_payment_order
588#: selection:payment.mode,cost_key:0
589msgid "Expense of the Payer"
590msgstr "Gastos por cuenta del ordenante"
591508
592#. module: l10n_es_payment_order509#. module: l10n_es_payment_order
593#: code:addons/l10n_es_payment_order/wizard/csb_34.py:143510#: code:addons/l10n_es_payment_order/wizard/csb_34.py:143
594#: code:addons/l10n_es_payment_order/wizard/csb_34.py:340511#: code:addons/l10n_es_payment_order/wizard/csb_34.py:341
595#, python-format512#, python-format
596msgid ""513msgid "Configuration error:\n"
597"Configuration error:\n"
598"\n"514"\n"
599"A line in \"%s\" is not 72 characters long:\n"515"A line in \"%s\" is not 72 characters long:\n"
600"%s"516"%s"
601msgstr ""517msgstr "Error de configuración:\n"
602"Error de configuración:\n"
603"\n"518"\n"
604"Una línea del \"%s\" no tiene 72 caracteres:\n"519"Una línea del \"%s\" no tiene 72 caracteres:\n"
605"%s"520"%s"
@@ -610,37 +525,6 @@
610msgstr "Opciones CSB 58"525msgstr "Opciones CSB 58"
611526
612#. module: l10n_es_payment_order527#. module: l10n_es_payment_order
613#: code:addons/l10n_es_payment_order/wizard/csb_19.py:54
614#: code:addons/l10n_es_payment_order/wizard/csb_19.py:86
615#: code:addons/l10n_es_payment_order/wizard/csb_19.py:110
616#: code:addons/l10n_es_payment_order/wizard/csb_19.py:123
617#: code:addons/l10n_es_payment_order/wizard/csb_19.py:138
618#: code:addons/l10n_es_payment_order/wizard/csb_19.py:165
619#: code:addons/l10n_es_payment_order/wizard/csb_58.py:53
620#: code:addons/l10n_es_payment_order/wizard/csb_58.py:71
621#: code:addons/l10n_es_payment_order/wizard/csb_58.py:100
622#: code:addons/l10n_es_payment_order/wizard/csb_58.py:111
623#: code:addons/l10n_es_payment_order/wizard/csb_58.py:231
624#: code:addons/l10n_es_payment_order/wizard/csb_58.py:247
625#: code:addons/l10n_es_payment_order/wizard/csb_58.py:264
626#, python-format
627msgid ""
628"Configuration error:\n"
629"\n"
630"The line \"%s\" is not 162 characters long:\n"
631"%s"
632msgstr ""
633"Error de configuración:\n"
634"\n"
635"La línea \"%s\" no tiene 162 caracteres:\n"
636"%s"
637
638#. module: l10n_es_payment_order
639#: report:remesas.report:0
640msgid "Bank:"
641msgstr "Banco:"
642
643#. module: l10n_es_payment_order
644#: selection:payment.mode,csb34_type:0528#: selection:payment.mode,csb34_type:0
645msgid "Promissory Note"529msgid "Promissory Note"
646msgstr "Pagaré"530msgstr "Pagaré"
@@ -657,12 +541,12 @@
657msgstr "Actívelo si desea añadir el tipo de dato 910 con la fecha de pago en el archivo."541msgstr "Actívelo si desea añadir el tipo de dato 910 con la fecha de pago en el archivo."
658542
659#. module: l10n_es_payment_order543#. module: l10n_es_payment_order
660#: selection:payment.mode,csb34_type:0544#: field:payment.mode,payroll_check:0
661msgid "Certified Payments"545msgid "Payroll Check"
662msgstr "Pagos certificados"546msgstr "Cheque nómina"
663547
664#. module: l10n_es_payment_order548#. module: l10n_es_payment_order
665#: code:addons/l10n_es_payment_order/remesas.py:109549#: code:addons/l10n_es_payment_order/remesas.py:113
666#, python-format550#, python-format
667msgid "Total:"551msgid "Total:"
668msgstr "Total:"552msgstr "Total:"
@@ -683,14 +567,12 @@
683msgstr "Nómina"567msgstr "Nómina"
684568
685#. module: l10n_es_payment_order569#. module: l10n_es_payment_order
686#: code:addons/l10n_es_payment_order/wizard/export_remesas.py:90570#: code:addons/l10n_es_payment_order/wizard/export_remesas.py:76
687#, python-format571#, python-format
688msgid ""572msgid "User error:\n"
689"User error:\n"
690"\n"573"\n"
691"The bank account number of the company %s has not 20 digits."574"The bank account number of the company %s has not 20 digits."
692msgstr ""575msgstr "Error del usuario:\n"
693"Error del usuario:\n"
694"\n"576"\n"
695"El número de C.C. de la compañía %s no tiene 20 dígitos."577"El número de C.C. de la compañía %s no tiene 20 dígitos."
696578
@@ -702,23 +584,26 @@
702#. module: l10n_es_payment_order584#. module: l10n_es_payment_order
703#: code:addons/l10n_es_payment_order/wizard/csb_34.py:166585#: code:addons/l10n_es_payment_order/wizard/csb_34.py:166
704#, python-format586#, python-format
705msgid ""587msgid "User error:\n"
706"User error:\n"
707"\n"588"\n"
708"Partner %s has no invoicing or default address."589"Partner %s has no invoicing or default address."
709msgstr ""590msgstr "Error del usuario:\n"
710"Error del usuario:\n"
711"\n"591"\n"
712"La compañía %s no tiene dirección por defecto o de facturación."592"La compañía %s no tiene dirección por defecto o de facturación."
713593
714#. module: l10n_es_payment_order594#. module: l10n_es_payment_order
715#: code:addons/l10n_es_payment_order/remesas.py:108595#: code:addons/l10n_es_payment_order/remesas.py:112
716#, python-format596#, python-format
717msgid "Payment ref."597msgid "Payment ref."
718msgstr "Ref. de pago"598msgstr "Ref. de pago"
719599
720#. module: l10n_es_payment_order600#. module: l10n_es_payment_order
721#: selection:payment.mode,send_type:0601#: selection:payment.mode,send_type:0
602msgid "Certified Mail"
603msgstr "Correo certificado"
604
605#. module: l10n_es_payment_order
606#: selection:payment.mode,send_type:0
722msgid "Ordinary Mail"607msgid "Ordinary Mail"
723msgstr "Correo ordinario"608msgstr "Correo ordinario"
724609
@@ -730,50 +615,43 @@
730msgstr "Introduzca un texto y/o seleccione un campo de la factura para incluirlo como descripción en la carta. Los posibles valores son: ${amount}, ${communication}, {communication2}, {date}, {ml_maturity_date}, {create_date}, {ml_date_created}"615msgstr "Introduzca un texto y/o seleccione un campo de la factura para incluirlo como descripción en la carta. Los posibles valores son: ${amount}, ${communication}, {communication2}, {date}, {ml_maturity_date}, {create_date}, {ml_date_created}"
731616
732#. module: l10n_es_payment_order617#. module: l10n_es_payment_order
733#: model:ir.actions.wizard,name:l10n_es_payment_order.wizard_create_payment_file_spain618#: code:addons/l10n_es_payment_order/wizard/csb_19.py:57
734msgid "Create payment file"619#: code:addons/l10n_es_payment_order/wizard/csb_19.py:89
735msgstr "Crear fichero de pagos"620#: code:addons/l10n_es_payment_order/wizard/csb_19.py:113
736621#: code:addons/l10n_es_payment_order/wizard/csb_19.py:126
737#. module: l10n_es_payment_order622#: code:addons/l10n_es_payment_order/wizard/csb_19.py:156
738#: report:remesas.report:0623#: code:addons/l10n_es_payment_order/wizard/csb_19.py:162
739msgid "Amount"624#: code:addons/l10n_es_payment_order/wizard/csb_19.py:178
740msgstr "Importe"625#: code:addons/l10n_es_payment_order/wizard/csb_19.py:205
741626#: code:addons/l10n_es_payment_order/wizard/csb_58.py:53
742#. module: l10n_es_payment_order627#: code:addons/l10n_es_payment_order/wizard/csb_58.py:71
743#: report:remesas.report:0628#: code:addons/l10n_es_payment_order/wizard/csb_58.py:100
744msgid "Company:"629#: code:addons/l10n_es_payment_order/wizard/csb_58.py:111
745msgstr "Compañía:"630#: code:addons/l10n_es_payment_order/wizard/csb_58.py:231
746631#: code:addons/l10n_es_payment_order/wizard/csb_58.py:247
747#. module: l10n_es_payment_order632#: code:addons/l10n_es_payment_order/wizard/csb_58.py:264
748#: selection:payment.mode,send_type:0633#, python-format
749msgid "Certified Mail"634msgid "Configuration error:\n"
750msgstr "Correo certificado"635"\n"
751636"The line \"%s\" is not 162 characters long:\n"
752#. module: l10n_es_payment_order637"%s"
753#: report:remesas.report:0638msgstr "Error de configuración:\n"
754msgid "Type:"639"\n"
755msgstr "Tipo:"640"La línea \"%s\" no tiene 162 caracteres:\n"
756641"%s"
757#. module: l10n_es_payment_order642
758#: view:payment.mode:0643#. module: l10n_es_payment_order
759msgid "CSB 19 Options"644#: model:ir.actions.act_window,name:l10n_es_payment_order.action_wizard_payment_file_spain
760msgstr "Opciones CSB 19"645msgid "Create payments file"
761646msgstr "Crear fichero de cobros/pagos"
762#. module: l10n_es_payment_order647
763#: field:payment.mode,csb19_extra_concepts:0648#. module: l10n_es_payment_order
764msgid "Extra Concepts"649#: model:payment.type,name:l10n_es_payment_order.payment_type_convenido0
765msgstr "Conceptos Extra"650#: model:payment.type,note:l10n_es_payment_order.payment_type_convenido0
766651msgid "Convenido"
767#~ msgid ""652msgstr "Convenido"
768#~ "Check it if you want to add the 015 data type and the text of the letter "653
769#~ "in the file."654#. module: l10n_es_payment_order
770#~ msgstr ""655#: help:payment.mode,csb19_extra_concepts:0
771#~ "Actívelo si desea añadir el tipo de dato 015 y el texto de la carta en el "656msgid "Check it if you want to add the invoice lines to the extra concepts (Max. 15 lines)"
772#~ "archivo."657msgstr "Chequear si se quiere añadir a las líneas de factura conceptos extra (Máx. 15 líneas)"
773#~ msgid "Date Check"
774#~ msgstr "Añadir fecha"
775#~ msgid "Invalid XML for View Architecture!"
776#~ msgstr "¡XML inválido para la definición de la vista!"
777#~ msgid "Optional Text for the Letter"
778#~ msgstr "Texto opcional para añadir a la carta."
779
780658
=== modified file 'l10n_es_payment_order/remesas_data.xml'
--- l10n_es_payment_order/remesas_data.xml 2011-10-26 18:26:56 +0000
+++ l10n_es_payment_order/remesas_data.xml 2013-01-11 10:23:22 +0000
@@ -10,28 +10,28 @@
10 </record>10 </record>
11 <record id="payment_type_transferencia0" model="payment.type">11 <record id="payment_type_transferencia0" model="payment.type">
12 <field name="code">TRANSFERENCIA_CSB</field>12 <field name="code">TRANSFERENCIA_CSB</field>
13 <field name="name">Transferencia</field>13 <field name="name">Transferencia CSB</field>
14 <field eval="[(6,0,[ref('base.bank_normal')])]" name="suitable_bank_types"/>14 <field eval="[(6,0,[ref('base.bank_normal')])]" name="suitable_bank_types"/>
15 <field name="note">Transferencia</field>15 <field name="note">Transferencia</field>
16 <field eval="1" name="active"/>16 <field eval="1" name="active"/>
17 </record>17 </record>
18 <record id="payment_type_cheque0" model="payment.type">18 <record id="payment_type_cheque0" model="payment.type">
19 <field name="code">CHEQUE_CSB</field>19 <field name="code">CHEQUE_CSB</field>
20 <field name="name">Cheque</field>20 <field name="name">Cheque CSB</field>
21 <field eval="[(6,0,[ref('base.bank_normal')])]" name="suitable_bank_types"/>21 <field eval="[(6,0,[ref('base.bank_normal')])]" name="suitable_bank_types"/>
22 <field name="note">Cheque</field>22 <field name="note">Cheque</field>
23 <field eval="1" name="active"/>23 <field eval="1" name="active"/>
24 </record>24 </record>
25 <record id="payment_type_pagare0" model="payment.type">25 <record id="payment_type_pagare0" model="payment.type">
26 <field name="code">PAGARE_CSB</field>26 <field name="code">PAGARE_CSB</field>
27 <field name="name">Pagaré</field>27 <field name="name">Pagaré CSB</field>
28 <field eval="[(6,0,[ref('base.bank_normal')])]" name="suitable_bank_types"/>28 <field eval="[(6,0,[ref('base.bank_normal')])]" name="suitable_bank_types"/>
29 <field name="note">Pagare</field>29 <field name="note">Pagare</field>
30 <field eval="1" name="active"/>30 <field eval="1" name="active"/>
31 </record>31 </record>
32 <record id="payment_type_pago_certificado0" model="payment.type">32 <record id="payment_type_pago_certificado0" model="payment.type">
33 <field name="code">PAGO_CERTIFICADO_CSB</field>33 <field name="code">PAGO_CERTIFICADO_CSB</field>
34 <field name="name">Pago certificado</field>34 <field name="name">Pago certificado CSB</field>
35 <field eval="[(6,0,[ref('base.bank_normal')])]" name="suitable_bank_types"/>35 <field eval="[(6,0,[ref('base.bank_normal')])]" name="suitable_bank_types"/>
36 <field name="note">Pago certificado</field>36 <field name="note">Pago certificado</field>
37 <field eval="1" name="active"/>37 <field eval="1" name="active"/>
3838
=== modified file 'l10n_es_payment_order/remesas_view.xml'
--- l10n_es_payment_order/remesas_view.xml 2011-08-03 15:44:39 +0000
+++ l10n_es_payment_order/remesas_view.xml 2013-01-11 10:23:22 +0000
@@ -74,8 +74,8 @@
74 </group>74 </group>
75 </group>75 </group>
76 <newline/>76 <newline/>
77 </field>
77 </field>78 </field>
78 </field>
79 </record>79 </record>
8080
81 </data>81 </data>
8282
=== added directory 'l10n_es_payment_order/security'
=== added file 'l10n_es_payment_order/security/ir.model.access.csv'
--- l10n_es_payment_order/security/ir.model.access.csv 1970-01-01 00:00:00 +0000
+++ l10n_es_payment_order/security/ir.model.access.csv 2013-01-11 10:23:22 +0000
@@ -0,0 +1,13 @@
1id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
2access_csb_19,csb.19,model_csb_19,account_payment.group_account_payment,1,1,1,1
3access_csb_19_user,csb.19.user,model_csb_19,base.group_user,1,0,0,0
4access_csb_32,csb.32,model_csb_32,account_payment.group_account_payment,1,1,1,1
5access_csb_32_user,csb.32.user,model_csb_32,base.group_user,1,0,0,0
6access_csb_34,csb.34,model_csb_34,account_payment.group_account_payment,1,1,1,1
7access_csb_34_user,csb.34.user,model_csb_34,base.group_user,1,0,0,0
8access_csb_3401,csb.3401,model_csb_3401,account_payment.group_account_payment,1,1,1,1
9access_csb_3401_user,csb.3401.user,model_csb_3401,base.group_user,1,0,0,0
10access_csb_58,csb.58,model_csb_58,account_payment.group_account_payment,1,1,1,1
11access_csb_58_user,csb.58.user,model_csb_58,base.group_user,1,0,0,0
12access_payment_converter_spain,payment.converter.spain,model_payment_converter_spain,account_payment.group_account_payment,1,1,1,1
13access_payment_converter_spain_user,payment.converter.spain,model_payment_converter_spain,base.group_user,1,0,0,0
014
=== modified file 'l10n_es_payment_order/wizard/__init__.py'
--- l10n_es_payment_order/wizard/__init__.py 2011-08-29 15:11:11 +0000
+++ l10n_es_payment_order/wizard/__init__.py 2013-01-11 10:23:22 +0000
@@ -7,7 +7,11 @@
7# Copyright (c) 2008 Pablo Rocandio. All Rights Reserved.7# Copyright (c) 2008 Pablo Rocandio. All Rights Reserved.
8# Copyright (c) 2009 Zikzakmedia S.L. (http://zikzakmedia.com) All Rights Reserved.8# Copyright (c) 2009 Zikzakmedia S.L. (http://zikzakmedia.com) All Rights Reserved.
9# Jordi Esteve <jesteve@zikzakmedia.com>9# Jordi Esteve <jesteve@zikzakmedia.com>
10# AvanzOSC, Advanced Open Source Consulting
11# Copyright (C) 2011-2012 Ainara Galdona (www.avanzosc.com). All Rights Reserved
10# $Id$12# $Id$
13# Refactorización. Acysos S.L. (http://www.acysos.com) 2012
14# Ignacio Ibeas <ignacio@acysos.com>
11#15#
12# This program is free software: you can redistribute it and/or modify16# This program is free software: you can redistribute it and/or modify
13# it under the terms of the GNU Affero General Public License as published by17# it under the terms of the GNU Affero General Public License as published by
@@ -25,3 +29,9 @@
25##############################################################################29##############################################################################
2630
27import export_remesas31import export_remesas
32import converter
33import csb_19
34import csb_32
35import csb_34
36import csb_34_01
37import csb_58
2838
=== modified file 'l10n_es_payment_order/wizard/converter.py'
--- l10n_es_payment_order/wizard/converter.py 2012-05-22 15:31:15 +0000
+++ l10n_es_payment_order/wizard/converter.py 2013-01-11 10:23:22 +0000
@@ -10,6 +10,8 @@
10# Copyright (c) 2009 NaN (http://www.nan-tic.com) All Rights Reserved.10# Copyright (c) 2009 NaN (http://www.nan-tic.com) All Rights Reserved.
11# Albert Cervera i Areny <albert@nan-tic.com>11# Albert Cervera i Areny <albert@nan-tic.com>
12# $Id$12# $Id$
13# Refactorización. Acysos S.L. (http://www.acysos.com) 2012
14# Ignacio Ibeas <ignacio@acysos.com>
13#15#
14# This program is free software: you can redistribute it and/or modify16# This program is free software: you can redistribute it and/or modify
15# it under the terms of the GNU Affero General Public License as published by17# it under the terms of the GNU Affero General Public License as published by
@@ -26,95 +28,86 @@
26#28#
27##############################################################################29##############################################################################
2830
31from osv import osv, fields
29from tools.translate import _32from tools.translate import _
3033from log import *
31def digits_only(cc_in):34
32 """Discards non-numeric chars"""35class payment_converter_spain(osv.osv):
3336 _name= 'payment.converter.spain'
34 cc = ""37 _auto = False
35 for i in cc_in or '':38
36 try:39 def digits_only(self, cr, uid, cc_in):
37 int(i)40 """Discards non-numeric chars"""
38 cc += i41
39 except ValueError:42 cc = ""
40 pass43 for i in cc_in or '':
41 return cc44 try:
4245 int(i)
43def to_ascii(text):46 cc += i
44 """Converts special characters such as those with accents to their ASCII equivalents"""47 except ValueError:
45 old_chars = ['á','é','í','ó','ú','à','è','ì','ò','ù','ä','ë','ï','ö','ü','â','ê','î','ô','û','Á','É','Í','Ú','Ó','À','È','Ì','Ò','Ù','Ä','Ë','Ï','Ö','Ü','Â','Ê','Î','Ô','Û','ñ','Ñ','ç','Ç','ª','º','·','\n']48 pass
46 new_chars = ['a','e','i','o','u','a','e','i','o','u','a','e','i','o','u','a','e','i','o','u','A','E','I','O','U','A','E','I','O','U','A','E','I','O','U','A','E','I','O','U','n','N','c','C','a','o','.',' ']49 return cc
47 for old, new in zip(old_chars, new_chars):50
48 text = text.replace(unicode(old,'UTF-8'), new)51 def to_ascii(self, cr, uid, text):
49 return text52 """Converts special characters such as those with accents to their ASCII equivalents"""
5053 old_chars = ['á','é','í','ó','ú','à','è','ì','ò','ù','ä','ë','ï','ö','ü','â','ê','î','ô','û','Á','É','Í','Ú','Ó','À','È','Ì','Ò','Ù','Ä','Ë','Ï','Ö','Ü','Â','Ê','Î','Ô','Û','ñ','Ñ','ç','Ç','ª','º','·','\n']
5154 new_chars = ['a','e','i','o','u','a','e','i','o','u','a','e','i','o','u','a','e','i','o','u','A','E','I','O','U','A','E','I','O','U','A','E','I','O','U','A','E','I','O','U','n','N','c','C','a','o','.',' ']
52class Log(Exception):55 for old, new in zip(old_chars, new_chars):
53 def __init__(self, content = '', error = False):56 text = text.replace(unicode(old,'UTF-8'), new)
54 self.content = content57 return text
55 self.error = error58
56 def add(self, s, error=True):59 def convert_text(self, cr, uid, text, size, justified='left'):
57 self.content = self.content + s60 if justified == 'left':
58 if error:61 return self.to_ascii(cr,uid,text)[:size].ljust(size)
59 self.error = error62 else:
60 def __call__(self):63 return self.to_ascii(cr,uid,text)[:size].rjust(size)
61 return self.content64
62 def __str__(self):65 def convert_float(self, cr, uid, number, size, context):
63 return self.content66 text = str( int( round( number * 100, 0 ) ) )
6467 if len(text) > size:
65def convert_text(text, size, justified='left'):68 raise Log(_('Error:\n\nCan not convert float number %(number).2f to fit in %(size)d characters.') % {
66 if justified == 'left':69 'number': number,
67 return to_ascii(text)[:size].ljust(size)70 'size': size
68 else: 71 })
69 return to_ascii(text)[:size].rjust(size)72 return text.zfill(size)
7073
71def convert_float(cr, number, size, context):74 def convert_int(self, cr, uid, number, size, context):
72 text = str( int( round( number * 100, 0 ) ) )75 text = str( number )
73 if len(text) > size:76 if len(text) > size:
74 raise Log(_('Error:\n\nCan not convert float number %(number).2f to fit in %(size)d characters.') % {77 raise Log( _('Error:\n\nCan not convert integer number %(number)d to fit in %(size)d characters.') % {
75 'number': number, 78 'number': number,
76 'size': size79 'size': size
77 })80 })
78 return text.zfill(size)81 return text.zfill(size)
7982
80def convert_int(cr, number, size, context):83 def convert(self, cr, uid, value, size, context, justified='left'):
81 text = str( number )84 if value == False:
82 if len(text) > size:85 return self.convert_text(cr, uid, '', size)
83 raise Log( _('Error:\n\nCan not convert integer number %(number)d to fit in %(size)d characters.') % {86 elif isinstance(value, float):
84 'number': number, 87 return self.convert_float(cr, uid, value, size, context)
85 'size': size88 elif isinstance(value, int):
86 })89 return self.convert_int(cr, uid, value, size, context)
87 return text.zfill(size)90 else:
8891 return self.convert_text(cr, uid, value, size, justified)
89def convert(cr, value, size, context, justified='left'):92
90 if value == False:93 def convert_bank_account(self, cr, uid, value, partner_name, context):
91 return convert_text('', size)94 if not isinstance(value, basestring):
92 elif isinstance(value, float):95 raise Log( _('User error:\n\nThe bank account number of %s is not defined.') % partner_name )
93 return convert_float(cr, value, size, context)96 ccc = self.digits_only(cr, uid, value)
94 elif isinstance(value, int):97 if len(ccc) != 20:
95 return convert_int(cr, value, size, context)98 raise Log( _('User error:\n\nThe bank account number of %s does not have 20 digits.') % partner_name )
96 else:99 return ccc
97 return convert_text(value, size, justified)100
98101 def bank_account_parts(self, cr, uid, value, partner_name, context):
99def convert_bank_account(cr, value, partner_name, context):102 if not isinstance(value, basestring):
100 if not isinstance(value, basestring):103 raise Log( _('User error:\n\nThe bank account number of %s is not defined.') % partner_name )
101 raise Log( _('User error:\n\nThe bank account number of %s is not defined.') % partner_name )104 ccc = self.digits_only(cr, uid, value)
102 ccc = digits_only(value)105 if len(ccc) != 20:
103 if len(ccc) != 20:106 raise Log( _('User error:\n\nThe bank account number of %s does not have 20 digits.') % partner_name )
104 raise Log( _('User error:\n\nThe bank account number of %s does not have 20 digits.') % partner_name )107 return {'bank':ccc[:4],
105 return ccc108 'office': ccc[4:8],
106109 'dc': ccc[8:10],
107def bank_account_parts(cr, value, partner_name, context):110 'account': ccc[10:]}
108 if not isinstance(value, basestring):111
109 raise Log( _('User error:\n\nThe bank account number of %s is not defined.') % partner_name )112payment_converter_spain()
110 ccc = digits_only(value)
111 if len(ccc) != 20:
112 raise Log( _('User error:\n\nThe bank account number of %s does not have 20 digits.') % partner_name )
113 return {'bank':ccc[:4],
114 'office': ccc[4:8],
115 'dc': ccc[8:10],
116 'account': ccc[10:]}
117
118
119# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
120113
121114
=== modified file 'l10n_es_payment_order/wizard/csb_19.py'
--- l10n_es_payment_order/wizard/csb_19.py 2012-06-12 09:33:58 +0000
+++ l10n_es_payment_order/wizard/csb_19.py 2013-01-11 10:23:22 +0000
@@ -21,6 +21,9 @@
21# Añadidos conceptos extras del CSB 19: Acysos S.L. 201121# Añadidos conceptos extras del CSB 19: Acysos S.L. 2011
22# Ignacio Ibeas <ignacio@acysos.com>22# Ignacio Ibeas <ignacio@acysos.com>
23#23#
24# Refactorización. Acysos S.L. (http://www.acysos.com) 2012
25# Ignacio Ibeas <ignacio@acysos.com>
26#
24# This program is free software: you can redistribute it and/or modify27# This program is free software: you can redistribute it and/or modify
25# it under the terms of the GNU Affero General Public License as published by28# it under the terms of the GNU Affero General Public License as published by
26# the Free Software Foundation, either version 3 of the License, or29# the Free Software Foundation, either version 3 of the License, or
@@ -36,20 +39,23 @@
36#39#
37##############################################################################40##############################################################################
3841
42from osv import osv, fields
39from datetime import datetime43from datetime import datetime
40from tools.translate import _44from tools.translate import _
41from converter import *45from log import *
4246
4347class csb_19(osv.osv):
44class csb_19:48 _name = 'csb.19'
45 def _cabecera_presentador_19(self):49 _auto = False
50 def _cabecera_presentador_19(self,cr,uid):
51 converter = self.pool.get('payment.converter.spain')
46 texto = '5180'52 texto = '5180'
47 texto += (self.order.mode.bank_id.partner_id.vat[2:] + self.order.mode.sufijo).zfill(12)53 texto += (self.order.mode.bank_id.partner_id.vat[2:] + self.order.mode.sufijo).zfill(12)
48 texto += datetime.today().strftime('%d%m%y')54 texto += datetime.today().strftime('%d%m%y')
49 texto += 6*' '55 texto += 6*' '
50 texto += to_ascii(self.order.mode.nombre).ljust(40)56 texto += converter.to_ascii(cr,uid,self.order.mode.nombre).ljust(40)
51 texto += 20*' '57 texto += 20*' '
52 cc = digits_only(self.order.mode.bank_id.acc_number)58 cc = converter.digits_only(cr,uid,self.order.mode.bank_id.acc_number)
53 texto += cc[0:8]59 texto += cc[0:8]
54 texto += 66*' '60 texto += 66*' '
55 texto += '\r\n'61 texto += '\r\n'
@@ -57,7 +63,8 @@
57 raise Log(_('Configuration error:\n\nThe line "%s" is not 162 characters long:\n%s') % ('Cabecera presentador 19', texto), True)63 raise Log(_('Configuration error:\n\nThe line "%s" is not 162 characters long:\n%s') % ('Cabecera presentador 19', texto), True)
58 return texto64 return texto
5965
60 def _cabecera_ordenante_19(self, recibo=None):66 def _cabecera_ordenante_19(self,cr,uid, recibo=None):
67 converter = self.pool.get('payment.converter.spain')
61 texto = '5380'68 texto = '5380'
62 texto += (self.order.mode.bank_id.partner_id.vat[2:] + self.order.mode.sufijo).zfill(12)69 texto += (self.order.mode.bank_id.partner_id.vat[2:] + self.order.mode.sufijo).zfill(12)
63 texto += datetime.today().strftime('%d%m%y')70 texto += datetime.today().strftime('%d%m%y')
@@ -78,8 +85,8 @@
78 date_cargo = datetime.strptime(self.order.date_scheduled,'%Y-%m-%d')85 date_cargo = datetime.strptime(self.order.date_scheduled,'%Y-%m-%d')
7986
80 texto += date_cargo.strftime('%d%m%y')87 texto += date_cargo.strftime('%d%m%y')
81 texto += to_ascii(self.order.mode.nombre).ljust(40)88 texto += converter.to_ascii(cr,uid,self.order.mode.nombre).ljust(40)
82 cc = digits_only(self.order.mode.bank_id.acc_number)89 cc = converter.digits_only(cr,uid,self.order.mode.bank_id.acc_number)
83 texto += cc[0:20]90 texto += cc[0:20]
84 texto += 8*' '91 texto += 8*' '
85 texto += '01'92 texto += '01'
@@ -89,14 +96,15 @@
89 raise Log(_('Configuration error:\n\nThe line "%s" is not 162 characters long:\n%s') % ('Cabecera ordenante 19', texto), True)96 raise Log(_('Configuration error:\n\nThe line "%s" is not 162 characters long:\n%s') % ('Cabecera ordenante 19', texto), True)
90 return texto97 return texto
9198
92 def _individual_obligatorio_19(self, recibo):99 def _individual_obligatorio_19(self,cr,uid, recibo):
100 converter = self.pool.get('payment.converter.spain')
93 texto = '5680'101 texto = '5680'
94 texto += (self.order.mode.bank_id.partner_id.vat[2:] + self.order.mode.sufijo).zfill(12)102 texto += (self.order.mode.bank_id.partner_id.vat[2:] + self.order.mode.sufijo).zfill(12)
95 texto += str(recibo['name'])[-12:].zfill(12)103 texto += str(recibo['name'])[-12:].zfill(12)
96 nombre = to_ascii(recibo['partner_id'].name)104 nombre = converter.to_ascii(cr,uid,recibo['partner_id'].name)
97 texto += nombre[0:40].ljust(40)105 texto += nombre[0:40].ljust(40)
98 ccc = recibo['bank_id'] and recibo['bank_id'].acc_number or ''106 ccc = recibo['bank_id'] and recibo['bank_id'].acc_number or ''
99 ccc = digits_only(ccc)107 ccc = converter.digits_only(cr,uid,ccc)
100 texto += str(ccc)[0:20].zfill(20)108 texto += str(ccc)[0:20].zfill(20)
101 importe = int(round(abs(recibo['amount'])*100,0))109 importe = int(round(abs(recibo['amount'])*100,0))
102 texto += str(importe).zfill(10)110 texto += str(importe).zfill(10)
@@ -104,21 +112,19 @@
104 concepto = ''112 concepto = ''
105 if recibo['communication']:113 if recibo['communication']:
106 concepto = recibo['communication']114 concepto = recibo['communication']
107 texto += to_ascii(concepto)[0:48].ljust(48)115 texto += converter.to_ascii(cr,uid,concepto)[0:48].ljust(48)
108 # Esto es lo convencional, descripción de 40 caracteres, pero se puede aprovechar los 8 espacios en blanco finales
109 #texto += to_ascii(concepto)[0:40].ljust(40)
110 #texto += 8*' '
111 texto += '\r\n'116 texto += '\r\n'
112 if len(texto) != 164:117 if len(texto) != 164:
113 raise Log(_('Configuration error:\n\nThe line "%s" is not 162 characters long:\n%s') % ('Individual obligatorio 19', texto), True)118 raise Log(_('Configuration error:\n\nThe line "%s" is not 162 characters long:\n%s') % ('Individual obligatorio 19', texto), True)
114 return texto119 return texto
115120
116 def _individual_opcional_19(self, recibo):121 def _individual_opcional_19(self,cr,uid, recibo):
117 """Para poner el segundo texto de comunicación (en lugar de nombre, domicilio y localidad opcional)"""122 """Para poner el segundo texto de comunicación (en lugar de nombre, domicilio y localidad opcional)"""
123 converter = self.pool.get('payment.converter.spain')
118 texto = '5686'124 texto = '5686'
119 texto += (self.order.mode.bank_id.partner_id.vat[2:] + self.order.mode.sufijo).zfill(12)125 texto += (self.order.mode.bank_id.partner_id.vat[2:] + self.order.mode.sufijo).zfill(12)
120 texto += str(recibo['name'])[-12:].zfill(12)126 texto += str(recibo['name'])[-12:].zfill(12)
121 texto += to_ascii(recibo['communication2'])[0:115].ljust(115)127 texto += converter.to_ascii(cr,uid,recibo['communication2'])[0:115].ljust(115)
122 texto += '00000' # Campo de código postal ficticio128 texto += '00000' # Campo de código postal ficticio
123 texto += 14*' '129 texto += 14*' '
124 texto += '\r\n'130 texto += '\r\n'
@@ -126,36 +132,37 @@
126 raise Log(_('Configuration error:\n\nThe line "%s" is not 162 characters long:\n%s') % ('Individual opcional 19', texto), True)132 raise Log(_('Configuration error:\n\nThe line "%s" is not 162 characters long:\n%s') % ('Individual opcional 19', texto), True)
127 return texto133 return texto
128134
129 def _extra_opcional_19(self, recibo):135 def _extra_opcional_19(self,cr,uid, recibo):
130 """Para poner los 15 conceptos opcional de los registros 5681-5685 utilizando las lineas de facturación (Máximo 15 lineas)"""136 """Para poner los 15 conceptos opcional de los registros 5681-5685 utilizando las lineas de facturación (Máximo 15 lineas)"""
137 converter = self.pool.get('payment.converter.spain')
131 res = {}138 res = {}
132 res['texto'] = ''139 res['texto'] = ''
133 res['total_lines'] = 0140 res['total_lines'] = 0
134 counter = 1141 counter = 1
135 registry_counter = 1142 registry_counter = 1
136 lenght = 0143 length = 0
137 for invoice in recibo['ml_inv_ref']:144 for invoice in recibo['ml_inv_ref']:
138 if invoice:145 if invoice:
139 lenght += len(invoice.invoice_line)146 length += len(invoice.invoice_line)
140 for invoice in recibo['ml_inv_ref']:147 for invoice in recibo['ml_inv_ref']:
141 if invoice:148 if invoice:
142 for invoice_line in invoice.invoice_line:149 for invoice_line in invoice.invoice_line:
143 if counter <= lenght:150 if counter <= length:
144 if counter <= 15:151 if counter <= 15:
145 if (counter-1)%3 == 0:152 if (counter-1)%3 == 0:
146 res['texto'] += '568'+str(registry_counter)153 res['texto'] += '568'+str(registry_counter)
147 res['texto'] += (self.order.mode.bank_id.partner_id.vat[2:] + self.order.mode.sufijo).zfill(12)154 res['texto'] += (self.order.mode.bank_id.partner_id.vat[2:] + self.order.mode.sufijo).zfill(12)
148 res['texto'] += str(recibo['name']).zfill(12)155 res['texto'] += str(recibo['name']).zfill(12)
149 price = ' %(#).2f ' % {'#' : invoice_line.price_subtotal}156 price = ' %(#).2f ' % {'#' : invoice_line.price_subtotal}
150 res['texto'] += to_ascii(invoice_line.name)[0:(40-len(price))].ljust(40-len(price))157 res['texto'] += converter.to_ascii(cr,uid,invoice_line.name)[0:(40-len(price))].ljust(40-len(price))
151 res['texto'] += to_ascii(price.replace('.',','))158 res['texto'] += converter.to_ascii(cr,uid,price.replace('.',','))
152 if counter % 3 == 0:159 if counter % 3 == 0:
153 res['texto'] += 14*' '+'\r\n'160 res['texto'] += 14*' '+'\r\n'
154 res['total_lines'] += 1161 res['total_lines'] += 1
155 if len(res['texto']) != registry_counter*164:162 if len(res['texto']) != registry_counter*164:
156 raise Log(_('Configuration error:\n\nThe line "%s" is not 162 characters long:\n%s') % ('Individual opcional 19', res['texto']), True)163 raise Log(_('Configuration error:\n\nThe line "%s" is not 162 characters long:\n%s') % ('Individual opcional 19', res['texto']), True)
157 registry_counter += 1164 registry_counter += 1
158 elif counter == lenght:165 elif counter == length:
159 res['texto'] += (3-(counter % 3))*40*' '+14*' '+'\r\n'166 res['texto'] += (3-(counter % 3))*40*' '+14*' '+'\r\n'
160 res['total_lines'] += 1167 res['total_lines'] += 1
161 if len(res['texto']) != registry_counter*164:168 if len(res['texto']) != registry_counter*164:
@@ -163,7 +170,7 @@
163 counter += 1170 counter += 1
164 return res171 return res
165172
166 def _total_ordenante_19(self):173 def _total_ordenante_19(self,cr,uid):
167 texto = '5880'174 texto = '5880'
168 texto += (self.order.mode.bank_id.partner_id.vat[2:] + self.order.mode.sufijo).zfill(12)175 texto += (self.order.mode.bank_id.partner_id.vat[2:] + self.order.mode.sufijo).zfill(12)
169 texto += 72*' '176 texto += 72*' '
@@ -178,7 +185,7 @@
178 raise Log(_('Configuration error:\n\nThe line "%s" is not 162 characters long:\n%s') % ('Total ordenante 19', texto), True)185 raise Log(_('Configuration error:\n\nThe line "%s" is not 162 characters long:\n%s') % ('Total ordenante 19', texto), True)
179 return texto186 return texto
180187
181 def _total_general_19(self):188 def _total_general_19(self,cr,uid):
182 texto = '5980'189 texto = '5980'
183 texto += (self.order.mode.bank_id.partner_id.vat[2:] + self.order.mode.sufijo).zfill(12)190 texto += (self.order.mode.bank_id.partner_id.vat[2:] + self.order.mode.sufijo).zfill(12)
184 texto += 52*' '191 texto += 52*' '
@@ -206,7 +213,7 @@
206 return texto213 return texto
207214
208215
209 def create_file(self, pool, cr, uid, order, lines, context):216 def create_file(self, cr, uid, order, lines, context):
210 self.order = order217 self.order = order
211218
212 txt_remesa = ''219 txt_remesa = ''
@@ -216,7 +223,7 @@
216 self.group_optional_lines = 0223 self.group_optional_lines = 0
217 self.group_amount = 0.0224 self.group_amount = 0.0
218225
219 txt_remesa += self._cabecera_presentador_19()226 txt_remesa += self._cabecera_presentador_19(cr,uid)
220227
221 if order.date_prefered == 'due':228 if order.date_prefered == 'due':
222 # Tantos ordenantes como pagos229 # Tantos ordenantes como pagos
@@ -225,48 +232,46 @@
225 self.group_optional_lines = 0232 self.group_optional_lines = 0
226 self.group_amount = 0.0233 self.group_amount = 0.0
227234
228 txt_remesa += self._cabecera_ordenante_19(recibo)235 txt_remesa += self._cabecera_ordenante_19(cr,uid,recibo)
229 txt_remesa += self._individual_obligatorio_19(recibo)236 txt_remesa += self._individual_obligatorio_19(cr,uid,recibo)
230 self.total_payments += 1237 self.total_payments += 1
231 self.group_payments += 1238 self.group_payments += 1
232 self.group_amount += abs( recibo['amount'] )239 self.group_amount += abs( recibo['amount'] )
233 if order.mode.csb19_extra_concepts:240 if order.mode.csb19_extra_concepts:
234 extra_concepts = self._extra_opcional_19(recibo)241 extra_concepts = self._extra_opcional_19(cr,uid,recibo)
235 txt_remesa += extra_concepts['texto']242 txt_remesa += extra_concepts['texto']
236 self.total_optional_lines += extra_concepts['total_lines']243 self.total_optional_lines += extra_concepts['total_lines']
237 self.group_optional_lines += extra_concepts['total_lines']244 self.group_optional_lines += extra_concepts['total_lines']
238245
239 if recibo['communication2']:246 if recibo['communication2']:
240 txt_remesa += self._individual_opcional_19(recibo)247 txt_remesa += self._individual_opcional_19(cr,uid,recibo)
241 #self.num_lineas_opc = self.num_lineas_opc + 1
242 self.total_optional_lines += 1248 self.total_optional_lines += 1
243 self.group_optional_lines += 1249 self.group_optional_lines += 1
244 txt_remesa += self._total_ordenante_19()250 txt_remesa += self._total_ordenante_19(cr,uid)
245 else:251 else:
246 # Sólo un ordenante252 # Sólo un ordenante
247 txt_remesa += self._cabecera_ordenante_19()253 txt_remesa += self._cabecera_ordenante_19(cr,uid)
248 self.group_payments = 0254 self.group_payments = 0
249 self.group_optional_lines = 0255 self.group_optional_lines = 0
250 self.group_amount = 0.0256 self.group_amount = 0.0
251257
252 for recibo in lines:258 for recibo in lines:
253 txt_remesa += self._individual_obligatorio_19(recibo)259 txt_remesa += self._individual_obligatorio_19(cr,uid,recibo)
254 self.total_payments += 1260 self.total_payments += 1
255 self.group_payments += 1261 self.group_payments += 1
256 self.group_amount += abs( recibo['amount'] )262 self.group_amount += abs( recibo['amount'] )
257 if order.mode.csb19_extra_concepts:263 if order.mode.csb19_extra_concepts:
258 extra_concepts = self._extra_opcional_19(recibo)264 extra_concepts = self._extra_opcional_19(cr,uid,recibo)
259 txt_remesa += extra_concepts['texto']265 txt_remesa += extra_concepts['texto']
260 self.total_optional_lines += extra_concepts['total_lines']266 self.total_optional_lines += extra_concepts['total_lines']
261 self.group_optional_lines += extra_concepts['total_lines']267 self.group_optional_lines += extra_concepts['total_lines']
262 if recibo['communication2']:268 if recibo['communication2']:
263 txt_remesa += self._individual_opcional_19(recibo)269 txt_remesa += self._individual_opcional_19(cr,uid,recibo)
264 self.total_optional_lines += 1270 self.total_optional_lines += 1
265 self.group_optional_lines += 1271 self.group_optional_lines += 1
266272
267 txt_remesa += self._total_ordenante_19()273 txt_remesa += self._total_ordenante_19(cr,uid)
268274
269 txt_remesa += self._total_general_19()275 txt_remesa += self._total_general_19(cr,uid)
270 return txt_remesa276 return txt_remesa
271277csb_19()
272# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
273\ No newline at end of file278\ No newline at end of file
274279
=== modified file 'l10n_es_payment_order/wizard/csb_32.py'
--- l10n_es_payment_order/wizard/csb_32.py 2011-08-29 15:11:11 +0000
+++ l10n_es_payment_order/wizard/csb_32.py 2013-01-11 10:23:22 +0000
@@ -18,6 +18,9 @@
18# Rehecho de nuevo para instalación OpenERP 5.0.0 sobre account_payment_extension: Zikzakmedia S.L. 200918# Rehecho de nuevo para instalación OpenERP 5.0.0 sobre account_payment_extension: Zikzakmedia S.L. 2009
19# Jordi Esteve <jesteve@zikzakmedia.com>19# Jordi Esteve <jesteve@zikzakmedia.com>
20#20#
21# Refactorización. Acysos S.L. (http://www.acysos.com) 2012
22# Ignacio Ibeas <ignacio@acysos.com>
23#
21# This program is free software: you can redistribute it and/or modify24# This program is free software: you can redistribute it and/or modify
22# it under the terms of the GNU Affero General Public License as published by25# it under the terms of the GNU Affero General Public License as published by
23# the Free Software Foundation, either version 3 of the License, or26# the Free Software Foundation, either version 3 of the License, or
@@ -33,20 +36,22 @@
33#36#
34##############################################################################37##############################################################################
3538
39from osv import osv, fields
36from datetime import datetime40from datetime import datetime
37from tools.translate import _41from tools.translate import _
38from converter import *42from log import *
3943
4044class csb_32(osv.osv):
41class csb_32:45 _name = 'csb.32'
4246 _auto = False
43 def _cabecera_fichero_32(self):47 def _cabecera_fichero_32(self, cr, uid):
48 converter = self.pool.get('payment.converter.spain')
44 texto = '0265'49 texto = '0265'
45 texto += ' '50 texto += ' '
46 texto += datetime.today().strftime('%d%m%y')51 texto += datetime.today().strftime('%d%m%y')
47 texto += digits_only( self.order.reference )[-4:]52 texto += converter.digits_only(cr, uid, self.order.reference )[-4:]
48 texto += ' '*3553 texto += ' '*35
49 texto += digits_only( self.order.mode.bank_id.acc_number )[:8]54 texto += converter.digits_only(cr, uid, self.order.mode.bank_id.acc_number )[:8]
50 texto += ' '*655 texto += ' '*6
51 texto += ' '*6156 texto += ' '*61
52 texto += ' '*2457 texto += ' '*24
@@ -55,7 +60,8 @@
55 raise Log(_('Configuration error:\n\nThe line "%s" is not 150 characters long:\n%s') % ('Cabecera fichero 32', texto), True)60 raise Log(_('Configuration error:\n\nThe line "%s" is not 150 characters long:\n%s') % ('Cabecera fichero 32', texto), True)
56 return texto61 return texto
5762
58 def _cabecera_remesa_32(self, cr, context):63 def _cabecera_remesa_32(self, cr, uid, context):
64 converter = self.pool.get('payment.converter.spain')
59 # A: 65 # A:
60 texto = '1165'66 texto = '1165'
61 texto += ' '67 texto += ' '
@@ -66,42 +72,43 @@
66 texto += ' '*1272 texto += ' '*12
6773
68 # C74 # C
69 texto += convert(cr, self.order.mode.cedente, 15, context) # TODO: Identificador del cedente. Qué es?75 texto += converter.convert(cr, uid, self.order.mode.cedente, 15, context) # TODO: Identificador del cedente. Qué es?
70 texto += '1' # Identificativo de efectos truncados76 texto += '1' # Identificativo de efectos truncados
71 texto += ' '*2177 texto += ' '*21
7278
73 # D79 # D
74 texto += digits_only( self.order.mode.bank_id.acc_number )80 texto += converter.digits_only(cr, uid, self.order.mode.bank_id.acc_number )
75 texto += digits_only( self.order.mode.bank_id.acc_number )81 texto += converter.digits_only(cr, uid, self.order.mode.bank_id.acc_number )
76 texto += digits_only( self.order.mode.bank_id.acc_number )82 texto += converter.digits_only(cr, uid, self.order.mode.bank_id.acc_number )
77 texto += ' ' + ' '*2483 texto += ' ' + ' '*24
78 texto += '\r\n'84 texto += '\r\n'
79 if len(texto) != 152:85 if len(texto) != 152:
80 raise Log(_('Configuration error:\n\nThe line "%s" is not 150 characters long:\n%s') % ('Cabecera remesa 32', texto), True)86 raise Log(_('Configuration error:\n\nThe line "%s" is not 150 characters long:\n%s') % ('Cabecera remesa 32', texto), True)
81 return texto87 return texto
8288
83 def _registro_individual_i_32(self, cr, recibo, context):89 def _registro_individual_i_32(self, cr, uid, recibo, context):
90 converter = self.pool.get('payment.converter.spain')
84 # A91 # A
85 texto = '2565'92 texto = '2565'
86 texto += ' '93 texto += ' '
87 # B94 # B
88 texto += convert(cr, self.num_recibos+1, 15, context)95 texto += converter.convert(cr, uid, self.num_recibos+1, 15, context)
89 texto += datetime.today().strftime('%d%m%y')96 texto += datetime.today().strftime('%d%m%y')
90 texto += '0001'97 texto += '0001'
91 98
92 # C99 # C
93 state = self.order.mode.bank_id.state_id and self.order.mode.bank_id.state_id.code or False100 state = self.order.mode.bank_id.state_id and self.order.mode.bank_id.state_id.code or False
94 texto += convert(cr, state, 2, context)101 texto += converter.convert(cr, uid, state, 2, context)
95 texto += ' '*7102 texto += ' '*7
96 texto += ' '103 texto += ' '
97104
98 # D105 # D
99 texto += convert(cr, self.order.mode.bank_id.city, 20, context)106 texto += converter.convert(cr, uid, self.order.mode.bank_id.city, 20, context)
100 texto += ' '107 texto += ' '
101108
102 # E109 # E
103 texto += ' '*24110 texto += ' '*24
104 texto += convert(cr, abs(recibo['amount']), 9, context)111 texto += converter.convert(cr, uid, abs(recibo['amount']), 9, context)
105 texto += ' '*15112 texto += ' '*15
106 texto += datetime.strptime( recibo['ml_maturity_date'], '%Y-%m-%d').strftime('%d%m%y') 113 texto += datetime.strptime( recibo['ml_maturity_date'], '%Y-%m-%d').strftime('%d%m%y')
107 texto += ' '*(6+6+1+4+16)114 texto += ' '*(6+6+1+4+16)
@@ -110,13 +117,14 @@
110 raise Log(_('Configuration error:\n\nThe line "%s" is not 150 characters long:\n%s') % ('Registro individual I 32', texto), True)117 raise Log(_('Configuration error:\n\nThe line "%s" is not 150 characters long:\n%s') % ('Registro individual I 32', texto), True)
111 return texto118 return texto
112119
113 def _registro_individual_ii_32(self, cr, recibo, context):120 def _registro_individual_ii_32(self, cr, uid, recibo, context):
121 converter = self.pool.get('payment.converter.spain')
114 # A: Identificacion de la operacion122 # A: Identificacion de la operacion
115 texto = '2665'123 texto = '2665'
116 texto += ' '124 texto += ' '
117125
118 # B: Datos del efecto126 # B: Datos del efecto
119 texto += convert(cr, self.num_recibos+1, 15, context)127 texto += converter.convert(cr, uid, self.num_recibos+1, 15, context)
120 texto += ' '128 texto += ' '
121 texto += '2' # Recibo129 texto += '2' # Recibo
122 texto += '000000'130 texto += '000000'
@@ -132,42 +140,44 @@
132 texto += ' '*20140 texto += ' '*20
133141
134 # D: Datos del efecto142 # D: Datos del efecto
135 texto += convert(cr, self.order.mode.partner_id.name, 34, context)143 texto += converter.convert(cr, uid, self.order.mode.partner_id.name, 34, context)
136 texto += convert(cr, recibo['partner_id'].name, 34, context)144 texto += converter.convert(cr, uid, recibo['partner_id'].name, 34, context)
137 texto += ' '*30145 texto += ' '*30
138 texto += '\r\n'146 texto += '\r\n'
139 if len(texto) != 152:147 if len(texto) != 152:
140 raise Log(_('Configuration error:\n\nThe line "%s" is not 150 characters long:\n%s') % ('Registro individual II 32', texto), True)148 raise Log(_('Configuration error:\n\nThe line "%s" is not 150 characters long:\n%s') % ('Registro individual II 32', texto), True)
141 return texto149 return texto
142150
143 def _registro_individual_iii_32(self, cr, recibo, context):151 def _registro_individual_iii_32(self, cr, uid, recibo, context):
152 converter = self.pool.get('payment.converter.spain')
144 # A: Identificacion de la operacion153 # A: Identificacion de la operacion
145 texto = '2765'154 texto = '2765'
146 texto += ' '155 texto += ' '
147 156
148 # B: Datos del efecto157 # B: Datos del efecto
149 texto += convert(cr, self.num_recibos+1, 15, context)158 texto += converter.convert(cr, uid, self.num_recibos+1, 15, context)
150 texto += ' '159 texto += ' '
151 addresses = self.pool.get('res.partner').address_get(self.cr, self.uid, [recibo['partner_id'].id] )160 addresses = self.pool.get('res.partner').address_get(cr, uid, [recibo['partner_id'].id] )
152 #if not addresses:161 #if not addresses:
153 # print "NO ADDRESSES"162 # print "NO ADDRESSES"
154 address = self.pool.get('res.partner.address').browse(self.cr, self.uid, addresses['default'], self.context)163 address = self.pool.get('res.partner.address').browse(cr, uid, addresses['default'], context)
155 texto += convert( cr, address.street, 34, context )164 texto += converter.convert( cr, uid, address.street, 34, context )
156 texto += convert( cr, address.zip, 5, context )165 texto += converter.convert( cr, uid, address.zip, 5, context )
157 texto += convert( cr, address.city, 20, context )166 texto += converter.convert( cr, uid, address.city, 20, context )
158 texto += convert( cr, address.state_id and address.state_id.code or False, 2, context )167 texto += converter.convert( cr, uid, address.state_id and address.state_id.code or False, 2, context )
159 texto += '0'*7168 texto += '0'*7
160169
161 # C: Datos del efecto170 # C: Datos del efecto
162 vat = recibo['partner_id'].vat and recibo['partner_id'].vat[2:] or False171 vat = recibo['partner_id'].vat and recibo['partner_id'].vat[2:] or False
163 texto += convert(cr, vat, 9, context)172 texto += converter.convert(cr, uid, vat, 9, context)
164 texto += ' '*50173 texto += ' '*50
165 texto += '\r\n'174 texto += '\r\n'
166 if len(texto) != 152:175 if len(texto) != 152:
167 raise Log(_('Configuration error:\n\nThe line "%s" is not 150 characters long:\n%s') % ('Registro individual III 32', texto), True)176 raise Log(_('Configuration error:\n\nThe line "%s" is not 150 characters long:\n%s') % ('Registro individual III 32', texto), True)
168 return texto177 return texto
169178
170 def _registro_fin_remesa_32(self, cr, context):179 def _registro_fin_remesa_32(self, cr, uid, context):
180 converter = self.pool.get('payment.converter.spain')
171 # A: Identificación de la operación181 # A: Identificación de la operación
172 texto = '7165'182 texto = '7165'
173 texto += ' '183 texto += ' '
@@ -182,20 +192,21 @@
182192
183 # D: Acumuladores de importe193 # D: Acumuladores de importe
184 texto += ' '*10194 texto += ' '*10
185 texto += convert( cr, abs(self.order.total), 10, context )195 texto += converter.convert( cr, uid, abs(self.order.total), 10, context )
186 texto += ' '*(10+6+7+6+6+6)196 texto += ' '*(10+6+7+6+6+6)
187197
188 # E: Controles de lectura de fichero198 # E: Controles de lectura de fichero
189 texto += ' '*5199 texto += ' '*5
190 texto += convert(cr, (self.num_recibos*3) + 2, 7, context)200 texto += converter.convert(cr, uid, (self.num_recibos*3) + 2, 7, context)
191 texto += convert(cr, self.num_recibos, 6, context)201 texto += converter.convert(cr, uid, self.num_recibos, 6, context)
192 texto += ' '*6202 texto += ' '*6
193 texto += '\r\n'203 texto += '\r\n'
194 if len(texto) != 152:204 if len(texto) != 152:
195 raise Log(_('Configuration error:\n\nThe line "%s" is not 150 characters long:\n%s') % ('Fin remesa 32', texto), True)205 raise Log(_('Configuration error:\n\nThe line "%s" is not 150 characters long:\n%s') % ('Fin remesa 32', texto), True)
196 return texto206 return texto
197207
198 def _registro_fin_fichero_32(self, cr, context):208 def _registro_fin_fichero_32(self, cr, uid, context):
209 converter = self.pool.get('payment.converter.spain')
199 # A: Identificación de la operación210 # A: Identificación de la operación
200 texto = '9865'211 texto = '9865'
201 texto += ' '212 texto += ' '
@@ -208,40 +219,35 @@
208219
209 # D: Acumuladores de importes220 # D: Acumuladores de importes
210 texto += ' '*10221 texto += ' '*10
211 texto += convert( cr, abs(self.order.total), 10, context )222 texto += converter.convert( cr, uid, abs(self.order.total), 10, context )
212 texto += ' '*(10+6+7+6+6+6)223 texto += ' '*(10+6+7+6+6+6)
213224
214 # E: Controles de lectura del fichero225 # E: Controles de lectura del fichero
215 texto += '00001'226 texto += '00001'
216 texto += convert(cr, (self.num_recibos*3) + 3, 7, context)227 texto += converter.convert(cr, uid, (self.num_recibos*3) + 3, 7, context)
217 texto += convert(cr, self.num_recibos, 6, context)228 texto += converter.convert(cr, uid, self.num_recibos, 6, context)
218 texto += ' '*6229 texto += ' '*6
219 texto += '\r\n'230 texto += '\r\n'
220 if len(texto) != 152:231 if len(texto) != 152:
221 raise Log(_('Configuration error:\n\nThe line "%s" is not 150 characters long:\n%s') % ('Fin fichero 32', texto), True)232 raise Log(_('Configuration error:\n\nThe line "%s" is not 150 characters long:\n%s') % ('Fin fichero 32', texto), True)
222 return texto233 return texto
223 234
224 def create_file(self, pool, cr, uid, order, lines, context):235 def create_file(self, cr, uid, order, lines, context):
225 self.pool = pool
226 self.cr = cr
227 self.uid = uid
228 self.order = order236 self.order = order
229 self.context = context
230237
231 txt_remesa = ''238 txt_remesa = ''
232 self.num_recibos = 0239 self.num_recibos = 0
233 self.num_lineas_opc = 0240 self.num_lineas_opc = 0
234241
235 txt_remesa += self._cabecera_fichero_32()242 txt_remesa += self._cabecera_fichero_32(cr,uid)
236 txt_remesa += self._cabecera_remesa_32(cr, context)243 txt_remesa += self._cabecera_remesa_32(cr, uid, context)
237 for recibo in lines:244 for recibo in lines:
238 txt_remesa += self._registro_individual_i_32(cr, recibo, context)245 txt_remesa += self._registro_individual_i_32(cr, uid, recibo, context)
239 txt_remesa += self._registro_individual_ii_32(cr, recibo, context)246 txt_remesa += self._registro_individual_ii_32(cr, uid, recibo, context)
240 txt_remesa += self._registro_individual_iii_32(cr, recibo, context)247 txt_remesa += self._registro_individual_iii_32(cr, uid, recibo, context)
241 self.num_recibos = self.num_recibos + 1248 self.num_recibos = self.num_recibos + 1
242 txt_remesa += self._registro_fin_remesa_32(cr, context)249 txt_remesa += self._registro_fin_remesa_32(cr, uid, context)
243 txt_remesa += self._registro_fin_fichero_32(cr, context)250 txt_remesa += self._registro_fin_fichero_32(cr, uid, context)
244 return txt_remesa251 return txt_remesa
245252
246253csb_32()
247# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
248254
=== modified file 'l10n_es_payment_order/wizard/csb_34.py'
--- l10n_es_payment_order/wizard/csb_34.py 2011-09-20 06:47:43 +0000
+++ l10n_es_payment_order/wizard/csb_34.py 2013-01-11 10:23:22 +0000
@@ -20,6 +20,9 @@
20# Rehecho de nuevo para instalación OpenERP 5.0.0 sobre account_payment_extension: Zikzakmedia S.L. 200920# Rehecho de nuevo para instalación OpenERP 5.0.0 sobre account_payment_extension: Zikzakmedia S.L. 2009
21# Jordi Esteve <jesteve@zikzakmedia.com>21# Jordi Esteve <jesteve@zikzakmedia.com>
22#22#
23# Refactorización. Acysos S.L. (http://www.acysos.com) 2012
24# Ignacio Ibeas <ignacio@acysos.com>
25#
23# This program is free software: you can redistribute it and/or modify26# This program is free software: you can redistribute it and/or modify
24# it under the terms of the GNU Affero General Public License as published by27# it under the terms of the GNU Affero General Public License as published by
25# the Free Software Foundation, either version 3 of the License, or28# the Free Software Foundation, either version 3 of the License, or
@@ -35,21 +38,17 @@
35#38#
36##############################################################################39##############################################################################
3740
41from osv import osv, fields
38from datetime import datetime42from datetime import datetime
39from tools.translate import _43from tools.translate import _
40from converter import *44from log import *
41import time45import time
4246
43csb34_code = {47class csb_34(osv.osv):
44 'transfer': '56',48 _name = 'csb.34'
45 'cheques': '57',49 _auto = False
46 'promissory_note': '58',50
47 'certified_payments': '59',51 def get_message(self, cr, uid, recibo, message=None):
48}
49
50class csb_34:
51
52 def get_message(self, recibo, message=None):
53 """52 """
54 Evaluates an expression and returns its value53 Evaluates an expression and returns its value
55 @param recibo: Order line data54 @param recibo: Order line data
@@ -78,17 +77,19 @@
78 message = message.replace('${' + field + '}', value)77 message = message.replace('${' + field + '}', value)
79 return message78 return message
8079
81 def _start_34(self, cr, context):80 def _start_34(self, cr, uid, context):
82 return convert(cr, self.order.mode.bank_id.partner_id.vat[2:] + self.order.mode.sufijo, 12, context)81 converter = self.pool.get('payment.converter.spain')
82 return converter.convert(cr, uid, self.order.mode.bank_id.partner_id.vat[2:] + self.order.mode.sufijo, 12, context)
8383
84 def _cabecera_ordenante_34(self, cr, uid, context):84 def _cabecera_ordenante_34(self, cr, uid, context):
85 converter = self.pool.get('payment.converter.spain')
85 today = datetime.today().strftime('%d%m%y')86 today = datetime.today().strftime('%d%m%y')
8687
87 text = ''88 text = ''
8889
89 # Primer tipo90 # Primer tipo
90 text += '0362'91 text += '0362'
91 text += self._start_34(cr, context)92 text += self._start_34(cr, uid, context)
92 text += 12*' '93 text += 12*' '
93 text += '001'94 text += '001'
94 text += today95 text += today
@@ -97,24 +98,23 @@
97 text += planned.strftime('%d%m%y')98 text += planned.strftime('%d%m%y')
98 else:99 else:
99 text += today100 text += today
100 #text += self.convert(self.order.mode.nombre, 40)101 text += converter.convert_bank_account(cr, uid, self.order.mode.bank_id.acc_number, self.order.mode.partner_id.name, context)
101 text += convert_bank_account(cr, self.order.mode.bank_id.acc_number, self.order.mode.partner_id.name, context)
102 text += '0'102 text += '0'
103 text += 8*' '103 text += 8*' '
104 text += '\r\n'104 text += '\r\n'
105105
106 # Segundo Tipo106 # Segundo Tipo
107 text += '0362'107 text += '0362'
108 text += self._start_34(cr, context)108 text += self._start_34(cr, uid, context)
109 text += 12*' '109 text += 12*' '
110 text += '002'110 text += '002'
111 text += convert(cr, self.order.mode.bank_id.partner_id.name, 36, context)111 text += converter.convert(cr, uid, self.order.mode.bank_id.partner_id.name, 36, context)
112 text += 5*' '112 text += 5*' '
113 text += '\r\n'113 text += '\r\n'
114114
115 # Tercer Tipo 115 # Tercer Tipo
116 text += '0362'116 text += '0362'
117 text += self._start_34(cr, context)117 text += self._start_34(cr, uid, context)
118 text += 12*' '118 text += 12*' '
119 text += '003'119 text += '003'
120 # Direccion120 # Direccion
@@ -126,17 +126,17 @@
126 address = self.pool.get('res.partner.address').read(cr, uid, [address_ids.get('default')], ['street','zip','city'], context)[0]126 address = self.pool.get('res.partner.address').read(cr, uid, [address_ids.get('default')], ['street','zip','city'], context)[0]
127 else:127 else:
128 raise Log( _('User error:\n\nCompany %s has no invoicing or default address.') % self.order.mode.bank_id.partner_id.name )128 raise Log( _('User error:\n\nCompany %s has no invoicing or default address.') % self.order.mode.bank_id.partner_id.name )
129 text += convert(cr, address['street'], 36, context)129 text += converter.convert(cr, uid, address['street'], 36, context)
130 text += 5*' '130 text += 5*' '
131 text += '\r\n'131 text += '\r\n'
132132
133 # Cuarto Tipo 133 # Cuarto Tipo
134 text += '0362'134 text += '0362'
135 text += self._start_34(cr, context)135 text += self._start_34(cr, uid, context)
136 text += 12*' '136 text += 12*' '
137 text += '004'137 text += '004'
138 text += convert(cr, address['zip'], 6, context)138 text += converter.convert(cr, uid, address['zip'], 6, context)
139 text += convert(cr, address['city'], 30, context)139 text += converter.convert(cr, uid, address['city'], 30, context)
140 text += 5*' '140 text += 5*' '
141 text += '\r\n'141 text += '\r\n'
142 if len(text)%74 != 0:142 if len(text)%74 != 0:
@@ -145,7 +145,7 @@
145145
146 def _cabecera_nacionales_34(self, cr, uid, context):146 def _cabecera_nacionales_34(self, cr, uid, context):
147 text = '0456'147 text = '0456'
148 text += self._start_34(cr, context)148 text += self._start_34(cr, uid, context)
149 text += 12*' '149 text += 12*' '
150 text += 3*' '150 text += 3*' '
151 text += 41*' '151 text += 41*' '
@@ -155,7 +155,13 @@
155 return text155 return text
156156
157 def _detalle_nacionales_34(self, cr, uid, recibo, csb34_type, context):157 def _detalle_nacionales_34(self, cr, uid, recibo, csb34_type, context):
158 158 converter = self.pool.get('payment.converter.spain')
159 csb34_code = {
160 'transfer': '56',
161 'cheques': '57',
162 'promissory_note': '58',
163 'certified_payments': '59',
164 }
159 address = None165 address = None
160 address_ids = self.pool.get('res.partner').address_get(cr, uid, [recibo['partner_id'].id], ['invoice', 'default'])166 address_ids = self.pool.get('res.partner').address_get(cr, uid, [recibo['partner_id'].id], ['invoice', 'default'])
161 if address_ids.get('invoice'):167 if address_ids.get('invoice'):
@@ -169,17 +175,16 @@
169 text = ''175 text = ''
170 text += '06'176 text += '06'
171 text += csb34_code[csb34_type]177 text += csb34_code[csb34_type]
172 text += self._start_34(cr, context)178 text += self._start_34(cr, uid, context)
173 text += convert(cr, recibo['partner_id'].vat, 12, context)179 text += converter.convert(cr, uid, recibo['partner_id'].vat, 12, context)
174 text += '010'180 text += '010'
175 text += convert(cr, abs(recibo['amount']), 12, context)181 text += converter.convert(cr, uid, abs(recibo['amount']), 12, context)
176 #text += convert_bank_account(cr, recibo['bank_id'].acc_number, recibo['partner_id'].name, context)
177182
178 # Si la orden se emite para transferencia183 # Si la orden se emite para transferencia
179 csb34_type = self.order.mode.csb34_type184 csb34_type = self.order.mode.csb34_type
180 if csb34_type == 'transfer':185 if csb34_type == 'transfer':
181 ccc = recibo['bank_id'] and recibo['bank_id'].acc_number or ''186 ccc = recibo['bank_id'] and recibo['bank_id'].acc_number or ''
182 ccc = digits_only(ccc)187 ccc = converter.digits_only(cr, uid, ccc)
183 text += ccc[:20].zfill(20)188 text += ccc[:20].zfill(20)
184 # Si la orden se emite para pagaré, cheque o pago certificado189 # Si la orden se emite para pagaré, cheque o pago certificado
185 else:190 else:
@@ -220,10 +225,10 @@
220 # Segundo Registro225 # Segundo Registro
221 text += '06'226 text += '06'
222 text += csb34_code[csb34_type] 227 text += csb34_code[csb34_type]
223 text += self._start_34(cr, context)228 text += self._start_34(cr, uid, context)
224 text += convert(cr, recibo['partner_id'].vat, 12, context)229 text += converter.convert(cr, uid, recibo['partner_id'].vat, 12, context)
225 text += '011'230 text += '011'
226 text += convert(cr, recibo['partner_id'].name, 36, context)231 text += converter.convert(cr, uid, recibo['partner_id'].name, 36, context)
227 text += 5*' '232 text += 5*' '
228 text += '\r\n'233 text += '\r\n'
229234
@@ -236,10 +241,10 @@
236 for (code, street) in lines:241 for (code, street) in lines:
237 text += '06'242 text += '06'
238 text += csb34_code[csb34_type] 243 text += csb34_code[csb34_type]
239 text += self._start_34(cr, context)244 text += self._start_34(cr, uid, context)
240 text += convert(cr, recibo['partner_id'].vat, 12, context)245 text += converter.convert(cr, uid, recibo['partner_id'].vat, 12, context)
241 text += code246 text += code
242 text += convert(cr, street, 36, context)247 text += converter.convert(cr, uid, street, 36, context)
243 text += 5*' '248 text += 5*' '
244 text += '\r\n'249 text += '\r\n'
245250
@@ -247,11 +252,11 @@
247 if address.zip or address.city:252 if address.zip or address.city:
248 text += '06'253 text += '06'
249 text += csb34_code[csb34_type] 254 text += csb34_code[csb34_type]
250 text += self._start_34(cr, context)255 text += self._start_34(cr, uid, context)
251 text += convert(cr, recibo['partner_id'].vat, 12, context)256 text += converter.convert(cr, uid, recibo['partner_id'].vat, 12, context)
252 text += '014'257 text += '014'
253 text += convert(cr, address.zip, 6, context)258 text += converter.convert(cr, uid, address.zip, 6, context)
254 text += convert(cr, address.city, 30, context)259 text += converter.convert(cr, uid, address.city, 30, context)
255 text += 5*' '260 text += 5*' '
256 text += '\r\n'261 text += '\r\n'
257262
@@ -262,13 +267,13 @@
262 # Sexto Registro267 # Sexto Registro
263 text += '06'268 text += '06'
264 text += csb34_code[csb34_type] 269 text += csb34_code[csb34_type]
265 text += self._start_34(cr, context)270 text += self._start_34(cr, uid, context)
266 text += convert(cr, recibo['partner_id'].vat, 12, context)271 text += converter.convert(cr, uid, recibo['partner_id'].vat, 12, context)
267 text += '015'272 text += '015'
268 country_code = address.country_id and address.country_id.code or ''273 country_code = address.country_id and address.country_id.code or ''
269 state = address.state_id and address.state_id.name or ''274 state = address.state_id and address.state_id.name or ''
270 text += convert(cr, country_code, 2, context)275 text += converter.convert(cr, uid, country_code, 2, context)
271 text += convert(cr, state, 34, context)276 text += converter.convert(cr, uid, state, 34, context)
272 text += 5*' '277 text += 5*' '
273 text += '\r\n'278 text += '\r\n'
274279
@@ -278,43 +283,43 @@
278 if self.order.mode.payroll_check:283 if self.order.mode.payroll_check:
279 text += '06'284 text += '06'
280 text += csb34_code[csb34_type] 285 text += csb34_code[csb34_type]
281 text += self._start_34(cr, context)286 text += self._start_34(cr, uid, context)
282 text += convert(cr, recibo['partner_id'].vat, 12, context)287 text += converter.convert(cr, uid, recibo['partner_id'].vat, 12, context)
283 text += '018'288 text += '018'
284 text += convert(cr, recibo['partner_id'].vat, 36, context)289 text += converter.convert(cr, uid, recibo['partner_id'].vat, 36, context)
285 text += 5*' '290 text += 5*' '
286 text += '\r\n'291 text += '\r\n'
287292
288 # Registro ciento uno (registro usados por algunos bancos como texto de la carta)293 # Registro ciento uno (registro usados por algunos bancos como texto de la carta)
289 text += '06'294 text += '06'
290 text += csb34_code[csb34_type] 295 text += csb34_code[csb34_type]
291 text += self._start_34(cr, context)296 text += self._start_34(cr, uid, context)
292 text += convert(cr, recibo['partner_id'].vat, 12, context)297 text += converter.convert(cr, uid, recibo['partner_id'].vat, 12, context)
293 text += '101'298 text += '101'
294 message = self.get_message(recibo, self.order.mode.text1)299 message = self.get_message(cr, uid, recibo, self.order.mode.text1)
295 text += convert(cr, message, 36, context)300 text += converter.convert(cr, uid, message, 36, context)
296 text += 5*' '301 text += 5*' '
297 text += '\r\n'302 text += '\r\n'
298303
299 # Registro ciento dos (registro usados por algunos bancos como texto de la carta)304 # Registro ciento dos (registro usados por algunos bancos como texto de la carta)
300 text += '06'305 text += '06'
301 text += csb34_code[csb34_type] 306 text += csb34_code[csb34_type]
302 text += self._start_34(cr, context)307 text += self._start_34(cr, uid, context)
303 text += convert(cr, recibo['partner_id'].vat, 12, context)308 text += converter.convert(cr, uid, recibo['partner_id'].vat, 12, context)
304 text += '102'309 text += '102'
305 message = self.get_message(recibo, self.order.mode.text2)310 message = self.get_message(cr, uid, recibo, self.order.mode.text2)
306 text += convert(cr, message, 36, context)311 text += converter.convert(cr, uid, message, 36, context)
307 text += 5*' '312 text += 5*' '
308 text += '\r\n'313 text += '\r\n'
309314
310 # Registro ciento tres (registro usados por algunos bancos como texto de la carta)315 # Registro ciento tres (registro usados por algunos bancos como texto de la carta)
311 text += '06'316 text += '06'
312 text += csb34_code[csb34_type] 317 text += csb34_code[csb34_type]
313 text += self._start_34(cr, context)318 text += self._start_34(cr, uid, context)
314 text += convert(cr, recibo['partner_id'].vat, 12, context)319 text += converter.convert(cr, uid, recibo['partner_id'].vat, 12, context)
315 text += '103'320 text += '103'
316 message = self.get_message(recibo, self.order.mode.text3)321 message = self.get_message(cr, uid, recibo, self.order.mode.text3)
317 text += convert(cr, message, 36, context)322 text += converter.convert(cr, uid, message, 36, context)
318 text += 5*' '323 text += 5*' '
319 text += '\r\n'324 text += '\r\n'
320325
@@ -330,10 +335,10 @@
330 message = day+month+year335 message = day+month+year
331 text += '06'336 text += '06'
332 text += csb34_code[csb34_type] 337 text += csb34_code[csb34_type]
333 text += self._start_34(cr, context)338 text += self._start_34(cr, uid, context)
334 text += convert(cr, recibo['partner_id'].vat, 12, context)339 text += converter.convert(cr, uid, recibo['partner_id'].vat, 12, context)
335 text += '910'340 text += '910'
336 text += convert(cr, message, 36, context)341 text += converter.convert(cr, uid, message, 36, context)
337 text += 5*' '342 text += 5*' '
338 text += '\r\n'343 text += '\r\n'
339344
@@ -342,13 +347,14 @@
342 return text347 return text
343348
344 def _totales_nacionales_34(self, cr, uid, values, context):349 def _totales_nacionales_34(self, cr, uid, values, context):
350 converter = self.pool.get('payment.converter.spain')
345 text = '0856'351 text = '0856'
346 text += self._start_34(cr, context)352 text += self._start_34(cr, uid, context)
347 text += 12*' '353 text += 12*' '
348 text += 3*' '354 text += 3*' '
349 text += convert(cr, self.order.total, 12, context)355 text += converter.convert(cr, uid, self.order.total, 12, context)
350 text += convert(cr, values[0], 8, context)356 text += converter.convert(cr, uid, values[0], 8, context)
351 text += convert(cr, values[1], 10, context)357 text += converter.convert(cr, uid, values[1], 10, context)
352 text += 6*' '358 text += 6*' '
353 text += 5*' '359 text += 5*' '
354 text += '\r\n'360 text += '\r\n'
@@ -357,13 +363,14 @@
357 return text363 return text
358364
359 def _total_general_34(self, cr, uid, values, context):365 def _total_general_34(self, cr, uid, values, context):
366 converter = self.pool.get('payment.converter.spain')
360 text = '0962'367 text = '0962'
361 text += self._start_34(cr, context)368 text += self._start_34(cr, uid, context)
362 text += 12*' '369 text += 12*' '
363 text += 3*' '370 text += 3*' '
364 text += convert(cr, self.order.total, 12, context)371 text += converter.convert(cr, uid, self.order.total, 12, context)
365 text += convert(cr, values[0], 8, context)372 text += converter.convert(cr, uid, values[0], 8, context)
366 text += convert(cr, values[1], 10, context)373 text += converter.convert(cr, uid, values[1], 10, context)
367 text += 6*' '374 text += 6*' '
368 text += 5*' '375 text += 5*' '
369 text += '\r\n'376 text += '\r\n'
@@ -371,10 +378,8 @@
371 raise Log(_('Configuration error:\n\nThe line "%s" is not 72 characters long:\n%s') % ('Total general 34', text), True)378 raise Log(_('Configuration error:\n\nThe line "%s" is not 72 characters long:\n%s') % ('Total general 34', text), True)
372 return text379 return text
373380
374 def create_file(self, pool, cr, uid, order, lines, context):381 def create_file(self, cr, uid, order, lines, context):
375 self.pool = pool
376 self.order = order382 self.order = order
377 self.context = context
378383
379 payment_line_count = 0384 payment_line_count = 0
380 record_count = 0385 record_count = 0
@@ -394,4 +399,4 @@
394 file += self._total_general_34(cr, uid, values, context)399 file += self._total_general_34(cr, uid, values, context)
395 return file400 return file
396401
397# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:402csb_34()
398403
=== modified file 'l10n_es_payment_order/wizard/csb_34_01.py'
--- l10n_es_payment_order/wizard/csb_34_01.py 2012-05-28 19:13:52 +0000
+++ l10n_es_payment_order/wizard/csb_34_01.py 2013-01-11 10:23:22 +0000
@@ -23,6 +23,9 @@
23# Adaptacion de la norma 34-01 para emision de pagos. Validado para La Caixa: 201223# Adaptacion de la norma 34-01 para emision de pagos. Validado para La Caixa: 2012
24# Joan M. Grande <totaler@gmail.com>24# Joan M. Grande <totaler@gmail.com>
25#25#
26# Refactorización. Acysos S.L. (http://www.acysos.com) 2012
27# Ignacio Ibeas <ignacio@acysos.com>
28#
26# This program is free software: you can redistribute it and/or modify29# This program is free software: you can redistribute it and/or modify
27# it under the terms of the GNU Affero General Public License as published by30# it under the terms of the GNU Affero General Public License as published by
28# the Free Software Foundation, either version 3 of the License, or31# the Free Software Foundation, either version 3 of the License, or
@@ -38,22 +41,28 @@
38#41#
39##############################################################################42##############################################################################
4043
44from osv import osv, fields
41from datetime import datetime45from datetime import datetime
42from tools.translate import _46from tools.translate import _
43from converter import *47from log import *
4448
45class csb_34_01:49class csb_34_01(osv.osv):
46 def _start_34(self, cr, context):50 _name = 'csb.3401'
47 return convert(cr, self.order.mode.bank_id.partner_id.vat[2:], 10, context, 'right')51 _auto = False
52
53 def _start_34(self, cr, uid, context):
54 converter = self.pool.get('payment.converter.spain')
55 return converter.convert(cr, uid, self.order.mode.bank_id.partner_id.vat[2:], 10, context, 'right')
4856
49 def _cabecera_ordenante_34(self, cr, uid, context):57 def _cabecera_ordenante_34(self, cr, uid, context):
58 converter = self.pool.get('payment.converter.spain')
50 today = datetime.today().strftime('%d%m%y')59 today = datetime.today().strftime('%d%m%y')
5160
52 text = ''61 text = ''
5362
54 # Primer tipo63 # Primer tipo
55 text += '0356'64 text += '0356'
56 text += self._start_34(cr, context)65 text += self._start_34(cr, uid, context)
57 text += '34016'66 text += '34016'
58 text += 7*' '67 text += 7*' '
59 text += '001'68 text += '001'
@@ -64,7 +73,7 @@
64 else:73 else:
65 text += today74 text += today
66 #text += self.convert(self.order.mode.nombre, 40)75 #text += self.convert(self.order.mode.nombre, 40)
67 ccc = bank_account_parts(cr, self.order.mode.bank_id.acc_number, self.order.mode.partner_id.name, context)76 ccc = converter.bank_account_parts(cr, uid, self.order.mode.bank_id.acc_number, self.order.mode.partner_id.name, context)
68 text += ccc['bank']77 text += ccc['bank']
69 text += ccc['office']78 text += ccc['office']
70 text += ccc['account']79 text += ccc['account']
@@ -77,17 +86,17 @@
7786
78 # Segundo Tipo 87 # Segundo Tipo
79 text += '0356'88 text += '0356'
80 text += self._start_34(cr, context)89 text += self._start_34(cr, uid, context)
81 text += '34016'90 text += '34016'
82 text += 7*' '91 text += 7*' '
83 text += '002'92 text += '002'
84 text += convert(cr, self.order.mode.bank_id.partner_id.name, 36, context)93 text += converter.convert(cr, uid, self.order.mode.bank_id.partner_id.name, 36, context)
85 text += 7*' '94 text += 7*' '
86 text += '\n'95 text += '\n'
8796
88 # Tercer Tipo 97 # Tercer Tipo
89 text += '0356'98 text += '0356'
90 text += self._start_34(cr, context)99 text += self._start_34(cr, uid, context)
91 text += '34016'100 text += '34016'
92 text += 7*' '101 text += 7*' '
93 text += '003'102 text += '003'
@@ -97,35 +106,34 @@
97 raise Log( _('User error:\n\nCompany %s has no invoicing address.') % address_id )106 raise Log( _('User error:\n\nCompany %s has no invoicing address.') % address_id )
98107
99 street = self.pool.get('res.partner.address').read(cr, uid, [address_id], ['street'], context)[0]['street']108 street = self.pool.get('res.partner.address').read(cr, uid, [address_id], ['street'], context)[0]['street']
100 text += convert(cr, street, 36, context)109 text += converter.convert(cr, uid, street, 36, context)
101 text += 7*' '110 text += 7*' '
102 text += '\n'111 text += '\n'
103112
104 # Cuarto Tipo 113 # Cuarto Tipo
105 text += '0356'114 text += '0356'
106 text += self._start_34(cr, context)115 text += self._start_34(cr, uid, context)
107 text += '34016'116 text += '34016'
108 text += 7*' '117 text += 7*' '
109 text += '004'118 text += '004'
110 city = self.pool.get('res.partner.address').read(cr, uid, [address_id], ['city'], context)[0]['city']119 city = self.pool.get('res.partner.address').read(cr, uid, [address_id], ['city'], context)[0]['city']
111 text += convert(cr, city, 36, context)120 text += converter.convert(cr, uid, city, 36, context)
112 text += 7*' '121 text += 7*' '
113 text += '\n'122 text += '\n'
114 return text123 return text
115124
116 def _detalle_nacionales_34(self, cr, uid, recibo, context):125 def _detalle_nacionales_34(self, cr, uid, recibo, context):
126 converter = self.pool.get('payment.converter.spain')
117 # Primer Registro127 # Primer Registro
118 text = ''128 text = ''
119 text += '0656'129 text += '0656'
120 text += self._start_34(cr, context)130 text += self._start_34(cr, uid, context)
121 if not recibo['partner_id'].vat:131 if not recibo['partner_id'].vat:
122 raise Log( _('User error:\n\nCompany %s has no vat.') % recibo['partner_id'].name ) 132 raise Log( _('User error:\n\nCompany %s has no vat.') % recibo['partner_id'].name )
123 text += convert(cr, recibo['partner_id'].vat[2:], 12, context, 'right')133 text += converter.convert(cr, uid, recibo['partner_id'].vat[2:], 12, context, 'right')
124 text += '010'134 text += '010'
125 text += convert(cr, recibo['amount'], 12, context)135 text += converter.convert(cr, uid, recibo['amount'], 12, context)
126 #text += convert_bank_account(cr, recibo['bank_id'].acc_number, recibo['partner_id'].name, context)136 ccc = converter.bank_account_parts(cr, uid, recibo['bank_id'].acc_number, recibo['partner_id'].name, context)
127 #ccc = recibo['bank_id'] and recibo['bank_id'].acc_number or ''
128 ccc = bank_account_parts(cr, recibo['bank_id'].acc_number, recibo['partner_id'].name, context)
129 text += ccc['bank']137 text += ccc['bank']
130 text += ccc['office']138 text += ccc['office']
131 text += ccc['account']139 text += ccc['account']
@@ -138,33 +146,32 @@
138146
139 # Segundo Registro147 # Segundo Registro
140 text += '0656'148 text += '0656'
141 text += self._start_34(cr, context)149 text += self._start_34(cr, uid, context)
142 if not recibo['partner_id'].vat:150 if not recibo['partner_id'].vat:
143 raise Log( _('User error:\n\nCompany %s has no vat.') % recibo['partner_id'].name ) 151 raise Log( _('User error:\n\nCompany %s has no vat.') % recibo['partner_id'].name )
144 text += convert(cr, recibo['partner_id'].vat[2:], 12, context, 'right')152 text += converter.convert(cr, uid, recibo['partner_id'].vat[2:], 12, context, 'right')
145 text += '011'153 text += '011'
146 text += convert(cr, recibo['partner_id'].name, 36, context)154 text += converter.convert(cr, uid, recibo['partner_id'].name, 36, context)
147 text += 7*' '155 text += 7*' '
148 text += '\n'156 text += '\n'
149 return text157 return text
150158
151 def _totales_nacionales_34(self, cr, uid, context):159 def _totales_nacionales_34(self, cr, uid, context):
160 converter = self.pool.get('payment.converter.spain')
152 text = '0856'161 text = '0856'
153 text += self._start_34(cr, context)162 text += self._start_34(cr, uid, context)
154 text += 12*' '163 text += 12*' '
155 text += 3*' '164 text += 3*' '
156 text += convert(cr, self.order.total, 12, context)165 text += converter.convert(cr, uid, self.order.total, 12, context)
157 text += convert(cr, self.payment_line_count, 8, context)166 text += converter.convert(cr, uid, self.payment_line_count, 8, context)
158 text += convert(cr, self.record_count, 10, context)167 text += converter.convert(cr, uid, self.record_count, 10, context)
159 text += 6*' '168 text += 6*' '
160 text += 7*' '169 text += 7*' '
161 text += '\n'170 text += '\n'
162 return text171 return text
163172
164 def create_file(self, pool, cr, uid, order, lines, context):173 def create_file(self, cr, uid, order, lines, context):
165 self.pool = pool
166 self.order = order174 self.order = order
167 self.context = context
168175
169 self.payment_line_count = 0176 self.payment_line_count = 0
170 self.record_count = 0177 self.record_count = 0
@@ -181,4 +188,4 @@
181 188
182 return file189 return file
183190
184# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:191csb_34_01()
185192
=== modified file 'l10n_es_payment_order/wizard/csb_58.py'
--- l10n_es_payment_order/wizard/csb_58.py 2011-08-29 15:11:11 +0000
+++ l10n_es_payment_order/wizard/csb_58.py 2013-01-11 10:23:22 +0000
@@ -18,6 +18,9 @@
18# Rehecho de nuevo para instalación OpenERP 5.0.0 sobre account_payment_extension: Zikzakmedia S.L. 200918# Rehecho de nuevo para instalación OpenERP 5.0.0 sobre account_payment_extension: Zikzakmedia S.L. 2009
19# Jordi Esteve <jesteve@zikzakmedia.com>19# Jordi Esteve <jesteve@zikzakmedia.com>
20#20#
21# Refactorización. Acysos S.L. (http://www.acysos.com) 2012
22# Ignacio Ibeas <ignacio@acysos.com>
23#
21# This program is free software: you can redistribute it and/or modify24# This program is free software: you can redistribute it and/or modify
22# it under the terms of the GNU Affero General Public License as published by25# it under the terms of the GNU Affero General Public License as published by
23# the Free Software Foundation, either version 3 of the License, or26# the Free Software Foundation, either version 3 of the License, or
@@ -33,19 +36,24 @@
33#36#
34##############################################################################37##############################################################################
3538
39from osv import osv, fields
36from datetime import datetime40from datetime import datetime
37from tools.translate import _41from tools.translate import _
38from converter import *42from log import *
3943
40class csb_58:44class csb_58(osv.osv):
41 def _cabecera_presentador_58(self):45 _name = 'csb.58'
46 _auto = False
47
48 def _cabecera_presentador_58(self, cr, uid):
49 converter = self.pool.get('payment.converter.spain')
42 texto = '5170'50 texto = '5170'
43 texto += (self.order.mode.bank_id.partner_id.vat[2:] + self.order.mode.sufijo).zfill(12)51 texto += (self.order.mode.bank_id.partner_id.vat[2:] + self.order.mode.sufijo).zfill(12)
44 texto += datetime.today().strftime('%d%m%y')52 texto += datetime.today().strftime('%d%m%y')
45 texto += 6*' '53 texto += 6*' '
46 texto += to_ascii(self.order.mode.nombre).ljust(40)54 texto += converter.to_ascii(cr, uid, self.order.mode.nombre).ljust(40)
47 texto += 20*' '55 texto += 20*' '
48 cc = digits_only(self.order.mode.bank_id.acc_number)56 cc = converter.digits_only(cr, uid, self.order.mode.bank_id.acc_number)
49 texto += cc[0:8]57 texto += cc[0:8]
50 texto += 66*' '58 texto += 66*' '
51 texto += '\r\n'59 texto += '\r\n'
@@ -53,32 +61,34 @@
53 raise Log(_('Configuration error:\n\nThe line "%s" is not 162 characters long:\n%s') % ('Cabecera presentador 58', texto), True)61 raise Log(_('Configuration error:\n\nThe line "%s" is not 162 characters long:\n%s') % ('Cabecera presentador 58', texto), True)
54 return texto62 return texto
5563
56 def _cabecera_ordenante_58(self):64 def _cabecera_ordenante_58(self, cr, uid):
65 converter = self.pool.get('payment.converter.spain')
57 texto = '5370'66 texto = '5370'
58 texto += (self.order.mode.bank_id.partner_id.vat[2:] + self.order.mode.sufijo).zfill(12)67 texto += (self.order.mode.bank_id.partner_id.vat[2:] + self.order.mode.sufijo).zfill(12)
59 texto += datetime.today().strftime('%d%m%y')68 texto += datetime.today().strftime('%d%m%y')
60 texto += 6*' '69 texto += 6*' '
61 texto += to_ascii(self.order.mode.nombre).ljust(40)70 texto += converter.to_ascii(cr, uid, self.order.mode.nombre).ljust(40)
62 cc = digits_only(self.order.mode.bank_id.acc_number)71 cc = converter.digits_only(cr, uid, self.order.mode.bank_id.acc_number)
63 texto += cc[0:20]72 texto += cc[0:20]
64 texto += 8*' '73 texto += 8*' '
65 texto += '06'74 texto += '06'
66 texto += 52*' '75 texto += 52*' '
67 texto += self.order.mode.ine and to_ascii(self.order.mode.ine)[:9].zfill(9) or 9*' '76 texto += self.order.mode.ine and converter.to_ascii(cr, uid, self.order.mode.ine)[:9].zfill(9) or 9*' '
68 texto += 3*' '77 texto += 3*' '
69 texto += '\r\n'78 texto += '\r\n'
70 if len(texto) != 164:79 if len(texto) != 164:
71 raise Log(_('Configuration error:\n\nThe line "%s" is not 162 characters long:\n%s') % ('Cabecera ordenante 58', texto), True)80 raise Log(_('Configuration error:\n\nThe line "%s" is not 162 characters long:\n%s') % ('Cabecera ordenante 58', texto), True)
72 return texto81 return texto
7382
74 def _individual_obligatorio_58(self, recibo):83 def _individual_obligatorio_58(self, cr, uid, recibo):
84 converter = self.pool.get('payment.converter.spain')
75 texto = '5670'85 texto = '5670'
76 texto += (self.order.mode.bank_id.partner_id.vat[2:] + self.order.mode.sufijo).zfill(12)86 texto += (self.order.mode.bank_id.partner_id.vat[2:] + self.order.mode.sufijo).zfill(12)
77 texto += str(recibo['name'])[-12:].zfill(12)87 texto += str(recibo['name'])[-12:].zfill(12)
78 nombre = to_ascii(recibo['partner_id'].name)88 nombre = converter.to_ascii(cr, uid, recibo['partner_id'].name)
79 texto += nombre[0:40].ljust(40)89 texto += nombre[0:40].ljust(40)
80 ccc = recibo['bank_id'] and recibo['bank_id'].acc_number or ''90 ccc = recibo['bank_id'] and recibo['bank_id'].acc_number or ''
81 ccc = digits_only(ccc)91 ccc = converter.digits_only(cr, uid, ccc)
82 texto += str(ccc)[0:20].zfill(20)92 texto += str(ccc)[0:20].zfill(20)
83 importe = int(round(abs(recibo['amount'])*100,0))93 importe = int(round(abs(recibo['amount'])*100,0))
84 texto += str(importe).zfill(10)94 texto += str(importe).zfill(10)
@@ -86,7 +96,7 @@
86 concepto = ''96 concepto = ''
87 if recibo['communication']:97 if recibo['communication']:
88 concepto = recibo['communication']98 concepto = recibo['communication']
89 texto += to_ascii(concepto)[0:40].ljust(40)99 texto += converter.to_ascii(cr, uid, concepto)[0:40].ljust(40)
90 if recibo.get('date'):100 if recibo.get('date'):
91 date_cargo = datetime.strptime(recibo['date'],'%Y-%m-%d')101 date_cargo = datetime.strptime(recibo['date'],'%Y-%m-%d')
92 elif recibo.get('ml_maturity_date'):102 elif recibo.get('ml_maturity_date'):
@@ -100,19 +110,20 @@
100 raise Log(_('Configuration error:\n\nThe line "%s" is not 162 characters long:\n%s') % ('Individual obligatorio 58', texto), True)110 raise Log(_('Configuration error:\n\nThe line "%s" is not 162 characters long:\n%s') % ('Individual obligatorio 58', texto), True)
101 return texto111 return texto
102112
103 def _individual_opcional_58(self, recibo):113 def _individual_opcional_58(self, cr, uid, recibo):
104 """Para poner el segundo texto de comunicación"""114 """Para poner el segundo texto de comunicación"""
115 converter = self.pool.get('payment.converter.spain')
105 texto = '5671'116 texto = '5671'
106 texto += (self.order.mode.bank_id.partner_id.vat[2:] + self.order.mode.sufijo).zfill(12)117 texto += (self.order.mode.bank_id.partner_id.vat[2:] + self.order.mode.sufijo).zfill(12)
107 texto += str(recibo['name'])[-12:].zfill(12)118 texto += str(recibo['name'])[-12:].zfill(12)
108 texto += to_ascii(recibo['communication2'])[0:134].ljust(134)119 texto += converter.to_ascii(cr, uid, recibo['communication2'])[0:134].ljust(134)
109 texto += '\r\n'120 texto += '\r\n'
110 if len(texto) != 164:121 if len(texto) != 164:
111 raise Log(_('Configuration error:\n\nThe line "%s" is not 162 characters long:\n%s') % ('Individual opcional 58', texto), True)122 raise Log(_('Configuration error:\n\nThe line "%s" is not 162 characters long:\n%s') % ('Individual opcional 58', texto), True)
112 return texto123 return texto
113124
114125
115 def _registro_obligatorio_domicilio_58(self, recibo):126 def _registro_obligatorio_domicilio_58(self, cr, uid, recibo):
116 """127 """
117 Registro obligatorio domicilio 58 para no domiciliados.128 Registro obligatorio domicilio 58 para no domiciliados.
118 129
@@ -134,7 +145,7 @@
134 (DDMMAA)145 (DDMMAA)
135 F2 Libre 155 8 Alfanumérico146 F2 Libre 155 8 Alfanumérico
136 """147 """
137148 converter = self.pool.get('payment.converter.spain')
138 alt_format = self.order.mode.alt_domicile_format149 alt_format = self.order.mode.alt_domicile_format
139150
140 #151 #
@@ -207,10 +218,10 @@
207 texto = '5676'218 texto = '5676'
208 texto += (self.order.mode.bank_id.partner_id.vat[2:] + self.order.mode.sufijo).zfill(12)219 texto += (self.order.mode.bank_id.partner_id.vat[2:] + self.order.mode.sufijo).zfill(12)
209 texto += str(recibo['name'])[-12:].zfill(12)220 texto += str(recibo['name'])[-12:].zfill(12)
210 texto += to_ascii(st)[:40].ljust(40) # Domicilio221 texto += converter.to_ascii(cr, uid, st)[:40].ljust(40) # Domicilio
211 texto += to_ascii(city)[:35].ljust(35) # Plaza (ciudad)222 texto += converter.to_ascii(cr, uid, city)[:35].ljust(35) # Plaza (ciudad)
212 texto += to_ascii(zip)[:5].zfill(5) # CP223 texto += converter.to_ascii(cr, uid, zip)[:5].zfill(5) # CP
213 texto += to_ascii(ord_city)[:38].ljust(38) # Localidad del ordenante (ciudad)224 texto += converter.to_ascii(cr, uid, ord_city)[:38].ljust(38) # Localidad del ordenante (ciudad)
214 if alt_format:225 if alt_format:
215 #226 #
216 # Si usamos el formato alternativo (basado en FacturaPlus)227 # Si usamos el formato alternativo (basado en FacturaPlus)
@@ -223,7 +234,7 @@
223 texto += date_ct.strftime('%d%m%y') # Fecha crédito234 texto += date_ct.strftime('%d%m%y') # Fecha crédito
224 texto += 2*' '235 texto += 2*' '
225 else:236 else:
226 texto += to_ascii(ord_state_code)[:2].zfill(2) # Cod prov del ordenante237 texto += converter.to_ascii(cr, uid, ord_state_code)[:2].zfill(2) # Cod prov del ordenante
227 texto += date_ct.strftime('%d%m%y') # Fecha crédito238 texto += date_ct.strftime('%d%m%y') # Fecha crédito
228 texto += 8*' ' # Libre239 texto += 8*' ' # Libre
229 texto += '\r\n'240 texto += '\r\n'
@@ -232,7 +243,7 @@
232 return texto243 return texto
233244
234245
235 def _total_ordenante_58(self):246 def _total_ordenante_58(self, cr, uid):
236 texto = '5870'247 texto = '5870'
237 texto += (self.order.mode.bank_id.partner_id.vat[2:] + self.order.mode.sufijo).zfill(12)248 texto += (self.order.mode.bank_id.partner_id.vat[2:] + self.order.mode.sufijo).zfill(12)
238 texto += 72*' '249 texto += 72*' '
@@ -247,7 +258,7 @@
247 raise Log(_('Configuration error:\n\nThe line "%s" is not 162 characters long:\n%s') % ('Total ordenante 58', texto), True)258 raise Log(_('Configuration error:\n\nThe line "%s" is not 162 characters long:\n%s') % ('Total ordenante 58', texto), True)
248 return texto259 return texto
249260
250 def _total_general_58(self):261 def _total_general_58(self, cr, uid):
251 texto = '5970'262 texto = '5970'
252 texto += (self.order.mode.bank_id.partner_id.vat[2:] + self.order.mode.sufijo).zfill(12)263 texto += (self.order.mode.bank_id.partner_id.vat[2:] + self.order.mode.sufijo).zfill(12)
253 texto += 52*' '264 texto += 52*' '
@@ -264,39 +275,34 @@
264 raise Log(_('Configuration error:\n\nThe line "%s" is not 162 characters long:\n%s') % ('Total general 58', texto), True)275 raise Log(_('Configuration error:\n\nThe line "%s" is not 162 characters long:\n%s') % ('Total general 58', texto), True)
265 return texto276 return texto
266277
267 def create_file(self, pool, cr, uid, order, lines, context):278 def create_file(self, cr, uid, order, lines, context):
268 self.pool = pool
269 self.cr = cr
270 self.uid = uid
271 self.order = order279 self.order = order
272 self.context = context
273280
274 txt_remesa = ''281 txt_remesa = ''
275 self.num_recibos = 0282 self.num_recibos = 0
276 self.num_lineas_opc = 0283 self.num_lineas_opc = 0
277284
278 txt_remesa += self._cabecera_presentador_58()285 txt_remesa += self._cabecera_presentador_58(cr, uid)
279 txt_remesa += self._cabecera_ordenante_58()286 txt_remesa += self._cabecera_ordenante_58(cr, uid)
280287
281 for recibo in lines:288 for recibo in lines:
282 txt_remesa += self._individual_obligatorio_58(recibo)289 txt_remesa += self._individual_obligatorio_58(cr, uid, recibo)
283 self.num_recibos = self.num_recibos + 1290 self.num_recibos = self.num_recibos + 1
284 291
285 # Sólo emitimos el registro individual si communication2 contiene texto292 # Sólo emitimos el registro individual si communication2 contiene texto
286 if recibo['communication2'] and len(recibo['communication2'].strip()) > 0:293 if recibo['communication2'] and len(recibo['communication2'].strip()) > 0:
287 txt_remesa += self._individual_opcional_58(recibo)294 txt_remesa += self._individual_opcional_58(cr, uid, recibo)
288 self.num_lineas_opc = self.num_lineas_opc + 1295 self.num_lineas_opc = self.num_lineas_opc + 1
289296
290 # Para recibos no domiciliados, añadimos el registro obligatorio297 # Para recibos no domiciliados, añadimos el registro obligatorio
291 # de domicilio (necesario con algunos bancos/cajas).298 # de domicilio (necesario con algunos bancos/cajas).
292 if self.order.mode.inc_domicile:299 if self.order.mode.inc_domicile:
293 txt_remesa += self._registro_obligatorio_domicilio_58(recibo)300 txt_remesa += self._registro_obligatorio_domicilio_58(cr, uid, recibo)
294 self.num_lineas_opc = self.num_lineas_opc + 1301 self.num_lineas_opc = self.num_lineas_opc + 1
295302
296 txt_remesa += self._total_ordenante_58()303 txt_remesa += self._total_ordenante_58(cr, uid)
297 txt_remesa += self._total_general_58()304 txt_remesa += self._total_general_58(cr, uid)
298305
299 return txt_remesa306 return txt_remesa
300307
301308csb_58()
302# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
303309
=== modified file 'l10n_es_payment_order/wizard/export_remesas.py'
--- l10n_es_payment_order/wizard/export_remesas.py 2012-05-29 12:23:40 +0000
+++ l10n_es_payment_order/wizard/export_remesas.py 2013-01-11 10:23:22 +0000
@@ -21,6 +21,12 @@
21# Añadidos conceptos extras del CSB 19: Acysos S.L. 201121# Añadidos conceptos extras del CSB 19: Acysos S.L. 2011
22# Ignacio Ibeas <ignacio@acysos.com>22# Ignacio Ibeas <ignacio@acysos.com>
23#23#
24# Migración de wizard.interface para la 6.1: Pexego Sistemas Informáticos. 2012
25# Marta Vázquez Rodríguez <marta@pexego.es>
26#
27# Refactorización. Acysos S.L. (http://www.acysos.com) 2012
28# Ignacio Ibeas <ignacio@acysos.com>
29#
24# This program is free software: you can redistribute it and/or modify30# This program is free software: you can redistribute it and/or modify
25# it under the terms of the GNU Affero General Public License as published by31# it under the terms of the GNU Affero General Public License as published by
26# the Free Software Foundation, either version 3 of the License, or32# the Free Software Foundation, either version 3 of the License, or
@@ -36,180 +42,130 @@
36#42#
37##############################################################################43##############################################################################
3844
39import pooler45from osv import osv, fields
40import wizard
41import base6446import base64
42from tools.translate import _47from tools.translate import _
43from converter import *48from log import *
44import csb_1949
45import csb_3250
46import csb_3451
47import csb_34_0152class wizard_payment_file_spain(osv.osv_memory):
48import csb_5853 _name = 'wizard.payment.file.spain'
4954 _columns = {
50join_form = """<?xml version="1.0"?>55 'join': fields.boolean('Join payment lines of the same partner and bank account'),
51<form string="Payment order export">56 'pay': fields.binary('Payment order file', readonly=True),
52 <field name="join"/>57 'pay_fname': fields.char('File name', size=64),
53</form>"""58 'note': fields.text('Log')
54
55join_fields = {
56 'join' : {'string':'Join payment lines of the same partner and bank account', 'type':'boolean'},
57}
58
59export_form = """<?xml version="1.0"?>
60<form string="Payment order export">
61 <field name="pay" filename="pay_fname"/>
62 <field name="pay_fname" invisible="1"/>
63 <field name="note" colspan="4" nolabel="1"/>
64</form>"""
65
66export_fields = {
67 'pay' : {
68 'string':'Payment order file',
69 'type':'binary',
70 'required': False,
71 'readonly':True,
72 },
73 'pay_fname': {'string':'File name', 'type':'char', 'size':64},
74 'note' : {'string':'Log', 'type':'text'},
75}
76
77
78def _create_payment_file(self, cr, uid, data, context):
79
80 txt_remesa = ''
81 num_lineas_opc = 0
82
83 try:
84 pool = pooler.get_pool(cr.dbname)
85 orden = pool.get('payment.order').browse(cr, uid, data['id'], context)
86 if not orden.line_ids:
87 raise Log( _('User error:\n\nWizard can not generate export file, there are not payment lines.'), True )
88
89 # Comprobamos que exista número de C.C. y que tenga 20 dígitos
90 if not orden.mode.bank_id:
91 raise Log( _('User error:\n\nThe bank account of the company %s is not defined.') % (orden.mode.partner_id.name), True )
92 cc = digits_only(orden.mode.bank_id.acc_number)
93 if len(cc) != 20:
94 raise Log( _('User error:\n\nThe bank account number of the company %s has not 20 digits.') % (orden.mode.partner_id.name), True)
95
96 # Comprobamos que exista el CIF de la compañía asociada al C.C. del modo de pago
97 if not orden.mode.bank_id.partner_id.vat:
98 raise Log(_('User error:\n\nThe company VAT number related to the bank account of the payment mode is not defined.'), True)
99
100 recibos = []
101 if data['form']['join']:
102 # Lista con todos los partners+bancos diferentes de la remesa
103 partner_bank_l = reduce(lambda l, x: x not in l and l.append(x) or l,
104 [(recibo.partner_id,recibo.bank_id) for recibo in orden.line_ids], [])
105 # Cómputo de la lista de recibos agrupados por mismo partner+banco.
106 # Los importes se suman, los textos se concatenan con un espacio en blanco y las fechas se escoge el máximo
107 for partner,bank in partner_bank_l:
108 lineas = [recibo for recibo in orden.line_ids if recibo.partner_id==partner and recibo.bank_id==bank]
109 recibos.append({
110 'partner_id': partner,
111 'bank_id': bank,
112 'name': partner.ref or str(l.partner_id.id),
113 'amount': reduce(lambda x, y: x+y, [l.amount for l in lineas], 0),
114 'communication': reduce(lambda x, y: x+' '+(y or ''), [l.name+' '+l.communication for l in lineas], ''),
115 'communication2': reduce(lambda x, y: x+' '+(y or ''), [l.communication2 for l in lineas], ''),
116 'date': max([l.date for l in lineas]),
117 'ml_maturity_date': max([l.ml_maturity_date for l in lineas]),
118 'create_date': max([l.create_date for l in lineas]),
119 'ml_date_created': max([l.ml_date_created for l in lineas]),
120 'ml_inv_ref': [l.ml_inv_ref for l in lineas]
121 })
122 else:
123 # Cada línea de pago es un recibo
124 for l in orden.line_ids:
125 recibos.append({
126 'partner_id': l.partner_id,
127 'bank_id': l.bank_id,
128 'name': l.partner_id.ref or str(l.partner_id.id),
129 'amount': l.amount,
130 'communication': l.name+' '+l.communication,
131 'communication2': l.communication2,
132 'date': l.date,
133 'ml_maturity_date': l.ml_maturity_date,
134 'create_date': l.create_date,
135 'ml_date_created': l.ml_date_created,
136 'ml_inv_ref':[l.ml_inv_ref]
137 })
138
139 if orden.mode.require_bank_account:
140 for line in recibos:
141 ccc = line['bank_id'] and line['bank_id'].acc_number or False
142 if not ccc:
143 raise Log(_('User error:\n\nThe bank account number of the customer %s is not defined and current payment mode enforces all lines to have a bank account.') % (line['partner_id'].name), True)
144 ccc = digits_only(ccc)
145 if len(ccc) != 20:
146 raise Log(_('User error:\n\nThe bank account number of the customer %s has not 20 digits.') % (line['partner_id'].name), True)
147
148 if orden.mode.tipo == 'csb_19':
149 csb = csb_19.csb_19()
150 elif orden.mode.tipo == 'csb_32':
151 csb = csb_32.csb_32()
152 elif orden.mode.tipo == 'csb_34':
153 csb = csb_34.csb_34()
154 elif orden.mode.tipo == '34_01':
155 csb = csb_34_01.csb_34_01()
156 elif orden.mode.tipo == 'csb_58':
157 csb = csb_58.csb_58()
158 else:
159 raise Log(_('User error:\n\nThe payment mode is not CSB 19, CSB 32, CSB 34 or CSB 58'), True)
160 txt_remesa = csb.create_file(pool, cr, uid, orden, recibos, context)
161
162 except Log, log:
163 return {
164 'note': log(),
165 'reference': orden.id,
166 'pay': False,
167 'state':'failed'
168 }
169 else:
170 # Ensure line breaks use MS-DOS (CRLF) format as standards require.
171 txt_remesa = txt_remesa.replace('\r\n','\n').replace('\n','\r\n')
172
173 file = base64.encodestring(txt_remesa.encode('utf-8'))
174 fname = (_('remesa') + '_' + orden.mode.tipo + '_' + orden.reference + '.txt').replace('/','-')
175 pool.get('ir.attachment').create(cr, uid, {
176 'name': _('Remesa ') + orden.mode.tipo + ' ' + orden.reference,
177 'datas': file,
178 'datas_fname': fname,
179 'res_model': 'payment.order',
180 'res_id': orden.id,
181 }, context=context)
182 log = _("Successfully Exported\n\nSummary:\n Total amount paid: %.2f\n Total Number of Payments: %d\n") % (orden.total, len(recibos))
183 if orden.state == 'open':
184 pool.get('payment.order').set_done(cr, uid, [orden.id], context)
185 return {
186 'note': log,
187 'reference': orden.id,
188 'pay': file,
189 'pay_fname': fname,
190 'state': 'succeeded',
191 }
192
193
194class wizard_payment_file_spain(wizard.interface):
195 states = {
196 'init' : {
197 'actions' : [],
198 'result' : {'type' : 'form',
199 'arch' : join_form,
200 'fields' : join_fields,
201 'state' : [('export', 'Ok','gtk-ok') ]}
202 },
203 'export': {
204 'actions' : [_create_payment_file],
205 'result' : {'type' : 'form',
206 'arch' : export_form,
207 'fields' : export_fields,
208 'state' : [('end', 'Ok','gtk-ok') ]}
209 }
210
211 }59 }
212wizard_payment_file_spain('export_payment_file_spain')60
21361 def create_payment_file(self, cr, uid, ids, context):
214# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:62 converter = self.pool.get('payment.converter.spain')
63 txt_remesa = ''
64 num_lineas_opc = 0
65 form_obj = self.browse(cr, uid, ids)[0]
66 try:
67 orden = self.pool.get('payment.order').browse(cr, uid, context['active_id'], context)
68 if not orden.line_ids:
69 raise Log( _('User error:\n\nWizard can not generate export file, there are not payment lines.'), True )
70
71 # Comprobamos que exista número de C.C. y que tenga 20 dígitos
72 if not orden.mode.bank_id:
73 raise Log( _('User error:\n\nThe bank account of the company %s is not defined.') % (orden.mode.partner_id.name), True )
74 cc = converter.digits_only(cr,uid,orden.mode.bank_id.acc_number)
75 if len(cc) != 20:
76 raise Log( _('User error:\n\nThe bank account number of the company %s has not 20 digits.') % (orden.mode.partner_id.name), True)
77
78 # Comprobamos que exista el CIF de la compañía asociada al C.C. del modo de pago
79 if not orden.mode.bank_id.partner_id.vat:
80 raise Log(_('User error:\n\nThe company VAT number related to the bank account of the payment mode is not defined.'), True)
81
82 recibos = []
83 if form_obj.join:
84 # Lista con todos los partners+bancos diferentes de la remesa
85 partner_bank_l = reduce(lambda l, x: x not in l and l.append(x) or l,
86 [(recibo.partner_id,recibo.bank_id) for recibo in orden.line_ids], [])
87 # Cómputo de la lista de recibos agrupados por mismo partner+banco.
88 # Los importes se suman, los textos se concatenan con un espacio en blanco y las fechas se escoge el máximo
89 for partner,bank in partner_bank_l:
90 lineas = [recibo for recibo in orden.line_ids if recibo.partner_id==partner and recibo.bank_id==bank]
91 recibos.append({
92 'partner_id': partner,
93 'bank_id': bank,
94 'name': partner.ref or str(l.partner_id.id),
95 'amount': reduce(lambda x, y: x+y, [l.amount for l in lineas], 0),
96 'communication': reduce(lambda x, y: x+' '+(y or ''), [l.name+' '+l.communication for l in lineas], ''),
97 'communication2': reduce(lambda x, y: x+' '+(y or ''), [l.communication2 for l in lineas], ''),
98 'date': max([l.date for l in lineas]),
99 'ml_maturity_date': max([l.ml_maturity_date for l in lineas]),
100 'create_date': max([l.create_date for l in lineas]),
101 'ml_date_created': max([l.ml_date_created for l in lineas]),
102 'ml_inv_ref': [l.ml_inv_ref for l in lineas]
103 })
104 else:
105 # Cada línea de pago es un recibo
106 for l in orden.line_ids:
107 recibos.append({
108 'partner_id': l.partner_id,
109 'bank_id': l.bank_id,
110 'name': l.partner_id.ref or str(l.partner_id.id),
111 'amount': l.amount,
112 'communication': l.name+' '+l.communication,
113 'communication2': l.communication2,
114 'date': l.date,
115 'ml_maturity_date': l.ml_maturity_date,
116 'create_date': l.create_date,
117 'ml_date_created': l.ml_date_created,
118 'ml_inv_ref':[l.ml_inv_ref]
119 })
120
121 if orden.mode.require_bank_account:
122 for line in recibos:
123 ccc = line['bank_id'] and line['bank_id'].acc_number or False
124 if not ccc:
125 raise Log(_('User error:\n\nThe bank account number of the customer %s is not defined and current payment mode enforces all lines to have a bank account.') % (line['partner_id'].name), True)
126 ccc = converter.digits_only(cr,uid,ccc)
127 if len(ccc) != 20:
128 raise Log(_('User error:\n\nThe bank account number of the customer %s has not 20 digits.') % (line['partner_id'].name), True)
129
130 if orden.mode.tipo == 'csb_19':
131 csb = self.pool.get('csb.19')
132 elif orden.mode.tipo == 'csb_32':
133 csb = self.pool.get('csb.32')
134 elif orden.mode.tipo == 'csb_34':
135 csb = self.pool.get('csb.34')
136 elif orden.mode.tipo == '34_01':
137 csb = self.pool.get('csb.3401')
138 elif orden.mode.tipo == 'csb_58':
139 csb = self.pool.get('csb.58')
140 else:
141 raise Log(_('User error:\n\nThe payment mode is not CSB 19, CSB 32, CSB 34 or CSB 58'), True)
142 txt_remesa = csb.create_file(cr, uid, orden, recibos, context)
143
144 except Log, log:
145 form_obj.write({'note': log,'pay': False})
146 return True
147
148 else:
149 # Ensure line breaks use MS-DOS (CRLF) format as standards require.
150 txt_remesa = txt_remesa.replace('\r\n','\n').replace('\n','\r\n')
151
152 file = base64.encodestring(txt_remesa.encode('utf-8'))
153 fname = (_('remesa') + '_' + orden.mode.tipo + '_' + orden.reference + '.txt').replace('/','-')
154 self.pool.get('ir.attachment').create(cr, uid, {
155 'name': _('Remesa ') + orden.mode.tipo + ' ' + orden.reference,
156 'datas': file,
157 'datas_fname': fname,
158 'res_model': 'payment.order',
159 'res_id': orden.id,
160 }, context=context)
161 log = _("Successfully Exported\n\nSummary:\n Total amount paid: %.2f\n Total Number of Payments: %d\n") % (orden.total, len(recibos))
162 self.pool.get('payment.order').set_done(cr, uid, [orden.id], context)
163
164 form_obj.write({'note': log,'pay': file,'pay_fname': fname})
165
166 return True
167wizard_payment_file_spain()
168
169
170
215171
216172
=== added file 'l10n_es_payment_order/wizard/export_remesas_view.xml'
--- l10n_es_payment_order/wizard/export_remesas_view.xml 1970-01-01 00:00:00 +0000
+++ l10n_es_payment_order/wizard/export_remesas_view.xml 2013-01-11 10:23:22 +0000
@@ -0,0 +1,40 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<openerp>
3 <data>
4 <record id="view_wizard_payment_file_spain_form" model="ir.ui.view">
5 <field name="name">wizard.payment.file.spain.form</field>
6 <field name="model">wizard.payment.file.spain</field>
7 <field name="type">form</field>
8 <field name="arch" type="xml">
9 <form string="Payment order export">
10 <field name="join"/>
11 <field name="pay" filename="pay_fname"/>
12 <field name="pay_fname" invisible="1"/>
13 <field name="note" colspan="4" nolabel="1"/>
14 <separator string="" colspan="4" />
15 <group colspan="4" col="6">
16 <button icon="gtk-cancel" special="cancel" string="Cancel"/>
17 <button icon="gtk-execute" string="_Export" name="create_payment_file" type="object"/>
18 </group>
19 </form>
20 </field>
21 </record>
22
23 <record id="action_wizard_payment_file_spain" model="ir.actions.act_window">
24 <field name="name">Create payments file</field>
25 <field name="res_model">wizard.payment.file.spain</field>
26 <field name="view_type">form</field>
27 <field name="view_mode">tree,form</field>
28 <field name="view_id" ref="view_wizard_payment_file_spain_form"/>
29 <field name="target">new</field>
30 </record>
31 <record id="action_wizard_payment_file_spain2" model="ir.values">
32 <field name="object" eval="1" />
33 <field name="name">Create payments file</field>
34 <field name="key2">client_action_multi</field>
35 <field name="value" eval="'ir.actions.act_window,' + str(ref('action_wizard_payment_file_spain'))"/>
36 <field name="key">action</field>
37 <field name="model">payment.order</field>
38 </record>
39 </data>
40</openerp>
041
=== added file 'l10n_es_payment_order/wizard/log.py'
--- l10n_es_payment_order/wizard/log.py 1970-01-01 00:00:00 +0000
+++ l10n_es_payment_order/wizard/log.py 2013-01-11 10:23:22 +0000
@@ -0,0 +1,45 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (c) 2006 ACYSOS S.L. (http://acysos.com) All Rights Reserved.
6# Pedro Tarrafeta <pedro@acysos.com>
7# Copyright (c) 2008 Pablo Rocandio. All Rights Reserved.
8# Copyright (c) 2009 Zikzakmedia S.L. (http://zikzakmedia.com) All Rights Reserved.
9# Jordi Esteve <jesteve@zikzakmedia.com>
10# Copyright (c) 2009 NaN (http://www.nan-tic.com) All Rights Reserved.
11# Albert Cervera i Areny <albert@nan-tic.com>
12# $Id$
13# Refactorización. Acysos S.L. (http://www.acysos.com) 2012
14# Ignacio Ibeas <ignacio@acysos.com>
15#
16# This program is free software: you can redistribute it and/or modify
17# it under the terms of the GNU Affero General Public License as published by
18# the Free Software Foundation, either version 3 of the License, or
19# (at your option) any later version.
20#
21# This program is distributed in the hope that it will be useful,
22# but WITHOUT ANY WARRANTY; without even the implied warranty of
23# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24# GNU Affero General Public License for more details.
25#
26# You should have received a copy of the GNU Affero General Public License
27# along with this program. If not, see <http://www.gnu.org/licenses/>.
28#
29##############################################################################
30
31from tools.translate import _
32
33class Log(Exception):
34 def __init__(self, content = '', error = False):
35 self.content = content
36 self.error = error
37 def add(self, s, error=True):
38 self.content = self.content + s
39 if error:
40 self.error = error
41 def __call__(self):
42 return self.content
43 def __str__(self):
44 return self.content
45