Merge lp:~asertigs/openerp-spain/7.0-l10n_es_aeat_mod340-binversion into lp:~openerp-spain-team/openerp-spain/7.0

Proposed by PabloCM
Status: Rejected
Rejected by: Pedro Manuel Baeza
Proposed branch: lp:~asertigs/openerp-spain/7.0-l10n_es_aeat_mod340-binversion
Merge into: lp:~openerp-spain-team/openerp-spain/7.0
Diff against target: 4092 lines (+1996/-803) (has conflicts)
13 files modified
l10n_es_aeat_mod340/__openerp__.py (+13/-5)
l10n_es_aeat_mod340/account.py (+216/-151)
l10n_es_aeat_mod340/account_invoice.py (+74/-0)
l10n_es_aeat_mod340/account_view.xml (+33/-4)
l10n_es_aeat_mod340/i18n/es.po (+285/-318)
l10n_es_aeat_mod340/i18n/l10n_es_aeat_mod340.pot (+249/-168)
l10n_es_aeat_mod340/mod340.py (+174/-38)
l10n_es_aeat_mod340/mod340_view.xml (+342/-0)
l10n_es_aeat_mod340/res_partner.py (+1/-3)
l10n_es_aeat_mod340/security/ir.model.access.csv (+2/-0)
l10n_es_aeat_mod340/taxes_common.xml (+284/-0)
l10n_es_aeat_mod340/wizard/calculate_mod340_records.py (+148/-75)
l10n_es_aeat_mod340/wizard/export_mod340_to_boe.py (+175/-41)
Text conflict in l10n_es_aeat_mod340/__openerp__.py
Text conflict in l10n_es_aeat_mod340/account_view.xml
Text conflict in l10n_es_aeat_mod340/i18n/es.po
Text conflict in l10n_es_aeat_mod340/mod340_view.xml
Contents conflict in l10n_es_aeat_mod340/taxes_data.xml
To merge this branch: bzr merge lp:~asertigs/openerp-spain/7.0-l10n_es_aeat_mod340-binversion
Reviewer Review Type Date Requested Status
Pedro Manuel Baeza Pending
Review via email: mp+221637@code.launchpad.net

Description of the change

Soporte para bienes de inversión, IVA agrario, arreglo de bugs y adaptación a v7

Más info: https://groups.google.com/d/msg/openerp-spain/FsDXI4YOaZw/DNx8ZqXEW58J

To post a comment you must log in.
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

El proyecto está hospedado ahora en https://github.com/OCA/l10n-spain.

Mueve por favor tu propuesta allí. Esta guía puede ayudarte: https://github.com/OCA/maintainers-tools/wiki/How-to-move-a-Merge-Proposal-to-GitHub

De todas formas, tal como hemos hablado en la lista, la propuesta requiere reelaboración que pasaremos a tratar en el code sprint.

Un saludo.

Unmerged revisions

462. By Pablo <pablo@pablo-pc>

[IMP] Para determinar las claves de una factura se tiene ahora en cuenta primero la línea de mayor importe
[FIX] Los registros de IVA se crean ahora con clave B si la factura tiene marcado el check de resumen de tickets
[IMP] Mejorado el mensaje de error cuando no se puede determinar el tipo de una línea de impuesto

461. By Pablo <pablo@pablo-pc>

[FIX] Eliminado código basura que faltó por quitar en la anterior revisión al eliminar la clave amount_tax
[FIX] Problema con los signos de las bases surgido al soportar moneda distinta a la de la compañía
[MOD] Se permite un descuadre de 1 céntimo al comprobar las bases de los impuestos contra el subtotal de la factura

460. By Pablo <pablo@pablo-pc>

[ADD] Añadida opción tiques / factura simplificada a las claves operacionales
[FIX] Arreglada comparación de las bases cuando las bases sumaban 0 (-0.0 != 0.0 en string)
[FIX] Ahora se tiene en cuenta que la moneda de la factura pueda ser distinta de la de la empresa

459. By Pablo <pablo@pablo-pc>

[ADD] chart_update para cargar las claves de libro y operación
[ADD] Traducción

458. By Pablo <pablo@pablo-pc>

[FIX] Problema en el cálculo de totales cuando no hay ningún registro en el modelo
[FIX] Descuadre en las cuotas debido al recuento doble de las cuotas en compras intracomunitarias
[FIX] Arreglado descuadre en el total de las bases por la separación en líneas de impuesto distintas de un mismo impuesto sobre bases de distinto signo que hace OpenERP

457. By Pablo <pablo@pablo-pc>

[FIX] Eliminada opción obsoleta "select" de las vistas
[FIX] Duplicidad en la fecha de cálculo en la vista
[FIX] Eliminada redeclaración de la fecha de cálculo que la convertía en date (en lugar de datetime)
[FIX] Corregido el cálculo de los sumatorios de registros y totales (campos funcionales) y eliminados los sumatorios manuales que se hacían en el calculate, que eran código basura
[FIX] Eliminado código obsoleto en vistas

456. By Pablo <pablo@pablo-pc>

[ADD] Añadidos campos de clave operacional y clave de libro a los registros de factura (emitida, recibida, bienes, intra) e impuestos que determinan la clasificación de los registros de IVA.
[MOD] El campo mod340 en los códigos de impuesto ha pasado a ser funcional almacenado, dependiendo de la clave de libro de los impuestos. Si algún impuesto que use un código para su base tiene asignada una clave de libro, el código se considera que debe ser incluido en el 340
[FIX] Ahora los impuestos que se desdoblan por tener impuestos hijo (ej: compras intracomunitarias) sólo generan un registro
[FIX] Cuando una factura es rectificativa y con varios impuestos predomina la clave operacional rectificativa y el número de registros en el desglose es 1 (antes salían múltiples)
[FIX] Soporte para facturas con recargo de equivalencia, ya no se exporta el recargo como otro registro
[ADD] Soporte para IVA agrario: cuando se detecta un impuesto con clave operacional X, su tipo se exporta como 0%
[ADD] Soporte para facturas de bienes de inversión
[ADD] Añadida opción para aplicar o no prorrateo a los bienes de inversión, que determina si se exportarán las facturas de bienes de inversión en su libro o como simples facturas recibidas
[FIX] Ahora las claves de libro se cogen del modelo calculado y no son valores fijos en la exportación a fichero

[IMP/TODO] Añadida función para la exportación de fechas que falta mover a l10n_es_aeat
[TODO] Algunos campos de la exportación de los registros de bienes de inversión. Más información en la descripción de la función
[TODO] Account chart update para cargar claves de libro y operacionales

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'l10n_es_aeat_mod340/__openerp__.py'
2--- l10n_es_aeat_mod340/__openerp__.py 2014-03-21 01:45:15 +0000
3+++ l10n_es_aeat_mod340/__openerp__.py 2014-06-01 16:57:08 +0000
4@@ -26,25 +26,29 @@
5 'name' : 'Generación de fichero modelo 340 y libro de IVA',
6 'version' : '2.0',
7 'author' : 'Acysos S.L., Francisco Pascual (Ting), Nan-tic',
8+ 'contributors': ["Aserti Global Solutions"],
9 'website' : 'www.acysos.com, www.ting.es, www.nan-tic.com',
10 'category' : 'Localisation/Accounting',
11 'description' : '''
12 Módulo para la presentación del modelo 340. Exportación a formato AEAT. Libro de IVA
13
14-Los impuestos incluidos en este modelo se indican en el Código base cuenta. Por defecto actualiza todos los código base que deban incluirse.
15-Si el plan contable esta instalado recuerde utilizar account_chart_update para actualizar los códigos. Contabilidad y Finanzas -> Configuración -> Contabilidad Financiera -> Actualizar plan contable a partir de una plantila de plan contable
16+Los impuestos incluidos en este modelo se indican asignándoles una clave de libro.
17+Si el plan contable esta instalado recuerde utilizar account_chart_update para actualizar los impuestos.
18+Contabilidad -> Configuración -> Cuentas -> Actualizar plan de cuentas
19
20-Búsqueda de facturas emitidas y recibidas.
21-Exportación a formato de AEAT de facturas emitidas y recibidas.
22+Búsqueda de facturas emitidas, recibidas y de inversión.
23+Exportación a formato de AEAT de facturas emitidas, recibidas y de inversión.
24 Exportación de facturas con varios tipos impositivos. Clave de operación C.
25 Facturas intracomunitarias excepto las operaciones a las que hace referencia el artículo 66 del RIVA que tienen un tratamiento especial.
26 Facturas rectificativas.
27 Facturas resumen de tiques.
28+Recargos de equivalencia.
29 Permite imprimir el libro de IVA, basado en la misma legislación.
30
31+
32 --- COSAS PENDIENTES (TODO LIST) ----------------------------------------------
33
34-Facturas bienes de inversión
35+Facturas bienes de inversión: la prorrata anual definitiva hay que introducirla a mano una vez calculado el modelo. Integrar con módulo assets
36 Facturas intracomunitarias. Operaciones a las que hace referencia el artículo 66 del RIVA.
37 Asientos contables de resumen de tiques
38 Exportación de asientos resumen de facturas
39@@ -67,8 +71,12 @@
40 'mod340_sequence.xml',
41 'account_invoice_view.xml',
42 'account_view.xml',
43+<<<<<<< TREE
44 'taxes_data.xml',
45 ],
46+=======
47+ 'taxes_common.xml'],
48+>>>>>>> MERGE-SOURCE
49 'installable' : True,
50 'active' : False,
51 }
52
53=== modified file 'l10n_es_aeat_mod340/account.py'
54--- l10n_es_aeat_mod340/account.py 2014-02-09 16:33:45 +0000
55+++ l10n_es_aeat_mod340/account.py 2014-06-01 16:57:08 +0000
56@@ -21,171 +21,236 @@
57
58 from openerp.osv import orm, fields
59 from openerp.tools.translate import _
60-
61-class account_tax_code_template(orm.Model):
62-
63- _inherit = 'account.tax.code.template'
64-
65- _columns = {
66- 'mod340':fields.boolean("Include in mod340"),
67+from collections import defaultdict
68+
69+class account_tax(orm.Model):
70+
71+ _inherit = 'account.tax'
72+
73+ def _allowed_pct_by_ledger(self, cr, uid, context=None):
74+ tax_obj = self.pool.get('account.tax')
75+ res = defaultdict(set)
76+ tax_ids = tax_obj.search(cr, uid, [('ledger_key','!=',False)], context=context)
77+ for tax in tax_obj.browse(cr, uid, tax_ids, context):
78+ res[tax.ledger_key].add(abs(tax.amount))
79+ return res
80+
81+
82+ def get_operation_keys(self, cr, uid, context=None):
83+ return [('-', u'Recargo de equivalencia'),
84+ (' ', u'Operación habitual'),
85+ ('F', u'F-Adquisiciones realizadas por las agencias de viajes directamente en interés del viajero (Régimen especial de agencias de viajes)'),
86+ ('H', u'H-Régimen especial de oro de inversión'),
87+ ('I', u'I-Inversión del Sujeto pasivo (ISP)'),
88+ ('J', u'J-Tiques / Factura simplificada'),
89+ ('L', u'L-Adquisiciones a comerciantes minoristas del IGIC'),
90+ ('N', u'N-Facturación de las prestaciones de servicios de agencias de viaje que actúan como mediadoras en nombre y por cuenta ajena'),
91+ ('P', u'P-Adquisiciones intracomunitarias de bienes.'),
92+ ('Q', u'Q-Operaciones a las que se aplique el Régimen especial de bienes usados, objetos de arte, antigüedades y objetos de colección'),
93+ ('R', u'R-Operación de arrendamiento de local de negocio'),
94+ ('S', u'S-Subvenciones, auxilios o ayudas satisfechas o recibidas, tanto por parte de Administraciones públicas como de entidades privadas'),
95+ ('V', u'V-Compras de Agencias viajes'),
96+ ('W', u'W-Operaciones sujetas al Impuesto sobre la Producción, los Servicios y la Importación en las Ciudades de Ceuta y Melilla'),
97+ ('X', u'X-Operaciones por las que los empresarios o profesionales que satisfagan compensaciones agrícolas, ganaderas y/o pesqueras hayan expedido el recibo correspondiente'),]
98+
99+ def _get_operation_keys(self, cr, uid, context=None):
100+ return self.get_operation_keys(cr, uid, context=context)
101+
102+ def get_ledger_keys(self, cr, uid, context=None):
103+ return [('E', u'E-Libro registro de facturas expedidas.'),
104+ ('F', u'F-Libro registro de facturas expedidas IGIC.'),
105+ ('R', u'R-Libro registro de facturas recibidas.'),
106+ ('I', u'I-Libro registro de bienes de inversión.'),
107+ ('J', u'J-Libro de registro de bienes de inversión IGIC.'),
108+ ('S', u'S-Libro de registro de facturas recibidas IGIC.'),
109+ ('U', u'U-Libro registro de determinadas operaciones intracomunitarias.')]
110+
111+ def _get_ledger_keys(self, cr, uid, context=None):
112+ return self.get_ledger_keys(cr, uid, context=context)
113+
114+ def get_ledger_keys_out(self, cr, uid, context=None):
115+ return [('E', u'E-Libro registro de facturas expedidas.'),
116+ ('F', u'F-Libro registro de facturas expedidas IGIC.'),
117+ ('U', u'U-Libro registro de determinadas operaciones intracomunitarias.')]
118+
119+ def _get_ledger_keys_out(self, cr, uid, context=None):
120+ return self.get_ledger_keys_out(cr, uid, context=context)
121+
122+ def get_ledger_keys_in(self, cr, uid, context=None):
123+ return [('R', u'R-Libro registro de facturas recibidas.'),
124+ ('I', u'I-Libro registro de bienes de inversión.'),
125+ ('J', u'J-Libro de registro de bienes de inversión IGIC.'),
126+ ('S', u'S-Libro de registro de facturas recibidas IGIC.'),
127+ ('U', u'U-Libro registro de determinadas operaciones intracomunitarias.')]
128+
129+ def _get_ledger_keys_in(self, cr, uid, context=None):
130+ return self.get_ledger_keys_in(cr, uid, context=context)
131+
132+ def _calc_ledger(self, cr, uid, ids, field_names, arg, context=None):
133+ res = dict.fromkeys(ids, {})
134+ for tax in self.browse(cr, uid, ids, context):
135+ res[tax.id]['ledger_key_out'] = False
136+ res[tax.id]['ledger_key_in'] = False
137+ if tax.type_tax_use == "purchase":
138+ res[tax.id]['ledger_key_in'] = tax.ledger_key
139+ elif tax.type_tax_use == "sale":
140+ res[tax.id]['ledger_key_out'] = tax.ledger_key
141+ return res
142+
143+ def _set_ledger(self, cr, uid, ids, field_names, field_value, arg, context):
144+ if not isinstance(ids, (tuple, list)):
145+ ids = [ids]
146+ taxes = self.browse(cr, uid, ids, context)
147+ for field in field_names:
148+ if field == "ledger_key_in":
149+ self.write(cr, uid, [tax.id for tax in taxes if tax.type_tax_use in ('purchase', 'all')], {'ledger_key': field_value}, context)
150+ else:
151+ self.write(cr, uid, [tax.id for tax in taxes if tax.type_tax_use in ('sale', 'all')], {'ledger_key': field_value}, context)
152+
153+ def onchange_ledger(self, cr, uid, ids, field, key, context=None):
154+ value = {
155+ 'ledger_key': key
156+ }
157+ return {'value': value}
158+
159+ def onchange_type_tax_use(self, cr, uid, ids, context=None):
160+ value = {
161+ 'ledger_key': False,
162+ 'ledger_key_in': False,
163+ 'ledger_key_out': False
164+ }
165+ return { 'value': value }
166+
167+ _columns = {
168+ 'operation_key': fields.selection(_get_operation_keys, 'Operation Key'),
169+ 'ledger_key': fields.selection(_get_ledger_keys, 'Ledger Key', help="Determines to which ledger the invoice with this tax will be assigned. Setting a value makes the tax to be accounted in 340 declaration"),
170+ 'ledger_key_in': fields.function(_calc_ledger, type="selection", fnct_inv=_set_ledger, selection=_get_ledger_keys_in, string='Ledger Key', multi="ledger",
171+ help="Determines to which ledger the invoice with this tax will be assigned. Setting a value makes the tax to be accounted in 340 declaration"),
172+ 'ledger_key_out': fields.function(_calc_ledger, type="selection", fnct_inv=_set_ledger, selection=_get_ledger_keys_out, string='Ledger Key', multi="ledger",
173+ help="Determines to which ledger the invoice with this tax will be assigned. Setting a value makes the tax to be accounted in 340 declaration"),
174+ }
175+
176+class account_tax_template(orm.Model):
177+
178+ _inherit = 'account.tax.template'
179+
180+ def _get_ledger_keys(self, cr, uid, context=None):
181+ return self.pool.get('account.tax').get_ledger_keys(cr, uid, context=context)
182+
183+ def _get_operation_keys(self, cr, uid, context=None):
184+ return self.pool.get('account.tax').get_operation_keys(cr, uid, context=context)
185+
186+ _columns = {
187+ 'operation_key': fields.selection(_get_operation_keys, 'Operation Key'),
188+ 'ledger_key': fields.selection(_get_ledger_keys, 'Ledger Key'),
189 }
190
191 class account_tax_code(orm.Model):
192
193 _inherit = 'account.tax.code'
194
195+ def _calc_mod340(self, cr, uid, ids, name, args, context=None):
196+ tax_obj = self.pool.get('account.tax')
197+ res = {}
198+ for tax in self.browse(cr, uid, ids, context=context):
199+ res[tax.id] = len(tax_obj.search(cr, uid, [('base_code_id','=',tax.id),('ledger_key','!=',False)], context=context)) > 0
200+ return res
201+
202+ def _get_code_affected_by_tax(self, cr, uid, ids, context=None):
203+ code_ids = set()
204+ for tax in self.pool.get('account.tax').browse(cr, uid, ids, context=context):
205+ code_ids.add(tax.base_code_id.id)
206+ return list(code_ids)
207+
208 _columns = {
209- 'mod340':fields.boolean("Include in mod340"),
210+ 'mod340': fields.function(_calc_mod340, type="boolean", string="Include in mod340",
211+ store={
212+ 'account.tax': (_get_code_affected_by_tax, ['base_code_id', 'ledger_key'], 10),
213+ })
214 }
215
216 class wizard_update_charts_accounts(orm.TransientModel):
217 _inherit = 'wizard.update.charts.accounts'
218
219- def _find_tax_codes(self, cr, uid, wizard, context=None):
220- """
221- Search for, and load, tax code templates to create/update.
222- """
223- new_tax_codes = 0
224- updated_tax_codes = 0
225- tax_code_template_mapping = {}
226-
227- tax_code_templ_obj = self.pool.get('account.tax.code.template')
228- tax_code_obj = self.pool.get('account.tax.code')
229- wiz_tax_code_obj = self.pool.get('wizard.update.charts.accounts.tax.code')
230-
231- # Remove previous tax codes
232- wiz_tax_code_obj.unlink(cr, uid, wiz_tax_code_obj.search(cr, uid, []))
233-
234- #
235- # Search for new / updated tax codes
236- #
237- root_tax_code_id = wizard.chart_template_id.tax_code_root_id.id
238- children_tax_code_template = tax_code_templ_obj.search(cr, uid,
239- [('parent_id', 'child_of', [root_tax_code_id])], order='id')
240- for tax_code_template in tax_code_templ_obj.browse(cr, uid,
241- children_tax_code_template):
242- # Ensure the tax code template is on the map (search for the mapped tax code id).
243- self._map_tax_code_template(cr, uid, wizard,
244- tax_code_template_mapping,
245- tax_code_template, context)
246+ def _find_taxes(self, cr, uid, wizard, chart_template_ids, context=None):
247+ """
248+ En caso de actualizar impuestos, añade a los impuestos modificados los que
249+ tengan claves de operación o libro distintas de sus plantillas
250+ """
251+ tax_obj = self.pool['account.tax']
252+ tax_templ_obj = self.pool['account.tax.template']
253+ wiz_taxes_obj = self.pool['wizard.update.charts.accounts.tax']
254+ res = super(wizard_update_charts_accounts, self)._find_taxes(cr, uid, wizard, chart_template_ids, context)
255+
256+ if not wizard.update_tax:
257+ return res
258+ updated_taxes = res['updated']
259+ tax_templ_mapping = res['mapping']
260+ tax_templ_ids = tax_templ_obj.search(cr, uid,
261+ [('chart_template_id',
262+ 'in',
263+ chart_template_ids)],
264+ context=context)
265+
266+ for tax_templ in tax_templ_obj.browse(cr, uid, tax_templ_ids,
267+ context=context):
268
269- tax_code_id = tax_code_template_mapping.get(tax_code_template.id)
270- if not tax_code_id:
271- new_tax_codes += 1
272- wiz_tax_code_obj.create(cr, uid, {
273- 'tax_code_id': tax_code_template.id,
274+ tax_id = self._map_tax_template(cr, uid, wizard,
275+ tax_templ_mapping,
276+ tax_templ, context=context)
277+
278+ if not tax_id:
279+ continue
280+
281+ modified = False
282+ notes = ""
283+ tax = tax_obj.browse(cr, uid, tax_id, context=context)
284+ if tax.operation_key != tax_templ.operation_key:
285+ notes += _("The operation key is different.\n")
286+ modified = True
287+ if tax.ledger_key != tax_templ.ledger_key:
288+ notes += _("The ledger key is different.\n")
289+ modified = True
290+ if modified:
291+ wiz_tax_id = wiz_taxes_obj.search(cr, uid, [('update_chart_wizard_id','=',wizard.id),('update_tax_id','=',tax.id)], context=context)
292+ if wiz_tax_id:
293+ wiz_tax_line = wiz_taxes_obj.browse(cr, uid, wiz_tax_id[0], context)
294+ wiz_taxes_obj.write(cr, uid, wiz_tax_line.id, {'notes': wiz_tax_line.notes + notes}, context)
295+ else:
296+ updated_taxes += 1
297+ wiz_taxes_obj.create(cr, uid, {
298+ 'tax_id': tax_templ.id,
299 'update_chart_wizard_id': wizard.id,
300- 'type': 'new',
301+ 'type': 'updated',
302+ 'update_tax_id': tax_id,
303+ 'notes': notes,
304 }, context)
305- elif wizard.update_tax_code:
306- #
307- # Check the tax code for changes.
308- #
309- modified = False
310- notes = ""
311- tax_code = tax_code_obj.browse(cr, uid, tax_code_id, context=context)
312-
313- if tax_code.code != tax_code_template.code:
314- notes += _("The code field is different.\n")
315- modified = True
316- if tax_code.info != tax_code_template.info:
317- notes += _("The info field is different.\n")
318- modified = True
319- if tax_code.sign != tax_code_template.sign:
320- notes += _("The sign field is different.\n")
321- modified = True
322- if tax_code.mod340 != tax_code_template.mod340:
323- notes += _("The Mod 340 field is different.\n")
324- modified = True
325-
326- # TODO: We could check other account fields for changes...
327-
328- if modified:
329- #
330- # Tax code to update.
331- #
332- updated_tax_codes += 1
333- wiz_tax_code_obj.create(cr, uid, {
334- 'tax_code_id': tax_code_template.id,
335- 'update_chart_wizard_id': wizard.id,
336- 'type': 'updated',
337- 'update_tax_code_id': tax_code_id,
338- 'notes': notes,
339- }, context)
340-
341- return { 'new': new_tax_codes, 'updated': updated_tax_codes,
342- 'mapping': tax_code_template_mapping }
343-
344- def _update_tax_codes(self, cr, uid, wizard, log, context=None):
345- """
346- Search for, and load, tax code templates to create/update.
347- """
348- tax_code_obj = self.pool.get('account.tax.code')
349-
350- root_tax_code_id = wizard.chart_template_id.tax_code_root_id.id
351-
352- new_tax_codes = 0
353- updated_tax_codes = 0
354- tax_code_template_mapping = {}
355-
356- for wiz_tax_code in wizard.tax_code_ids:
357- tax_code_template = wiz_tax_code.tax_code_id
358- tax_code_name = (root_tax_code_id == tax_code_template.id) and wizard.company_id.name or tax_code_template.name
359-
360- # Ensure the parent tax code template is on the map.
361- self._map_tax_code_template(cr, uid, wizard,
362- tax_code_template_mapping,
363- tax_code_template.parent_id, context)
364-
365- #
366- # Values
367- #
368- vals = {
369- 'name': tax_code_name,
370- 'code': tax_code_template.code,
371- 'info': tax_code_template.info,
372- 'parent_id': tax_code_template.parent_id and tax_code_template_mapping.get(tax_code_template.parent_id.id),
373- 'company_id': wizard.company_id.id,
374- 'sign': tax_code_template.sign,
375- 'mod340': tax_code_template.mod340
376+
377+ res['updated'] = updated_taxes
378+ return res
379+
380+ def _update_taxes(self, cr, uid, wizard, log, tax_code_template_mapping, context=None):
381+ """
382+ Vuelve a reprocesar las líneas de impuestos para actualizar las claves de operación y libro
383+ """
384+ res = super(wizard_update_charts_accounts, self)._update_taxes(cr, uid, wizard, log, tax_code_template_mapping, context)
385+ taxes = self.pool['account.tax']
386+
387+ if not wizard.update_tax:
388+ return res
389+
390+ for wiz_tax in wizard.tax_ids:
391+ tax_template = wiz_tax.tax_id
392+
393+ vals_tax = {
394+ 'operation_key': tax_template.operation_key,
395+ 'ledger_key': tax_template.ledger_key
396 }
397
398- tax_code_id = None
399- modified = False
400-
401- if wiz_tax_code.type == 'new':
402- #
403- # Create the tax code
404- #
405- tax_code_id = tax_code_obj.create(cr, uid, vals)
406- log.add(_("Created tax code %s.\n") % tax_code_name)
407- new_tax_codes += 1
408- modified = True
409- elif wizard.update_tax_code and wiz_tax_code.update_tax_code_id:
410- #
411- # Update the tax code
412- #
413- tax_code_id = wiz_tax_code.update_tax_code_id.id
414- tax_code_obj.write(cr, uid, [tax_code_id], vals)
415- log.add(_("Updated tax code %s.\n") % tax_code_name)
416- updated_tax_codes += 1
417- modified = True
418- else:
419- tax_code_id = wiz_tax_code.update_tax_code_id and wiz_tax_code.update_tax_code_id.id
420- modified = False
421-
422- # Store the tax codes on the map
423- tax_code_template_mapping[tax_code_template.id] = tax_code_id
424-
425- if modified:
426- #
427- # Detect errors
428- #
429- if tax_code_template.parent_id and not tax_code_template_mapping.get(tax_code_template.parent_id.id):
430- log.add(_("Tax code %s: The parent tax code %s can not be set.\n") % (tax_code_name, tax_code_template.parent_id.name), True)
431-
432- return {
433- 'new': new_tax_codes,
434- 'updated': updated_tax_codes,
435- 'mapping': tax_code_template_mapping
436- }
437+ if wiz_tax.type == 'updated' and wiz_tax.update_tax_id:
438+ taxes.write(cr, uid, [wiz_tax.update_tax_id.id], vals_tax)
439+# log.add(_("mod340: Updated tax %s.\n") % tax_template.name)
440+
441+ #No necesitamos llevar control de taxes_pending_for_accounts ni detectar errores, ya lo hizo super
442+ return res
443+
444
445=== modified file 'l10n_es_aeat_mod340/account_invoice.py'
446--- l10n_es_aeat_mod340/account_invoice.py 2014-02-09 16:33:45 +0000
447+++ l10n_es_aeat_mod340/account_invoice.py 2014-06-01 16:57:08 +0000
448@@ -21,10 +21,84 @@
449
450 from openerp.osv import orm, fields
451 from openerp.tools.translate import _
452+from openerp.tools.float_utils import float_round
453
454 class account_invoice(orm.Model):
455 _inherit = 'account.invoice'
456
457+ def get_340_classification(self, cr, uid, invoice_id, context=None):
458+ invoice = self.browse(cr, uid, invoice_id, context)
459+ if invoice.is_ticket_summary:
460+ return 'E', 'B'
461+ #Intentamos determinar la clasificación primero en función de la línea de más importe
462+ max_line = max(invoice.invoice_line, key=lambda x: abs(x.price_subtotal))
463+ taxes = filter(lambda x: x.ledger_key and x.operation_key != '-', max_line.invoice_line_tax_id)
464+ if taxes:
465+ return taxes[0].ledger_key, (taxes[0].operation_key or ' ')
466+ #y si no cualquier otra
467+ for line in invoice.invoice_line:
468+ taxes = filter(lambda x: x.ledger_key and x.operation_key != '-', line.invoice_line_tax_id)
469+ if taxes:
470+ return taxes[0].ledger_key, (taxes[0].operation_key or ' ')
471+ raise orm.except_orm(
472+ 'Error',
473+ 'No se pudo determinar la clasificacion de la factura %s porque sus impuestos no se declaran en el modelo 340' % invoice.number)
474+
475+
476+ def get_inv_good_names(self, cr, uid, invoice_id, tax_percentage, context=None):
477+ names = []
478+ invoice = self.browse(cr, uid, invoice_id, context)
479+ tax_percentage = abs(tax_percentage)
480+ for line in invoice.invoice_line:
481+ for tax in line.invoice_line_tax_id:
482+ if tax.ledger_key in ('I','J') and tax.amount == tax_percentage:
483+ names.append(line.name)
484+ break
485+ return ', '.join(names)
486+
487+ def get_cc_amounts(self, cr, uid, invoice_id, context=None):
488+ #Créditos Zikzakmedia SL @ account_invoice_currency
489+ invoice = self.browse(cr, uid, invoice_id, context)
490+ if invoice.company_id.currency_id == invoice.currency_id:
491+ return {
492+ 'cc_amount_untaxed': invoice.amount_untaxed,
493+ 'cc_amount_tax': invoice.amount_tax,
494+ 'cc_amount_total': invoice.amount_total,
495+ }
496+
497+ res = {
498+ 'cc_amount_untaxed': 0.0,
499+ 'cc_amount_tax': 0.0,
500+ 'cc_amount_total': 0.0,
501+ }
502+
503+ ## It could be computed only in open or paid invoices with a generated account move
504+ if invoice.move_id:
505+ precision = self.pool.get('decimal.precision').precision_get(cr, uid, 'Account')
506+ ## Accounts to compute amount_untaxed
507+ line_account = []
508+ for line in invoice.invoice_line:
509+ if line.account_id.id not in line_account:
510+ line_account.append(line.account_id.id)
511+
512+ ## Accounts to compute amount_tax
513+ tax_account = []
514+ for line in invoice.tax_line:
515+ if line.account_id.id not in tax_account and line.amount != 0:
516+ tax_account.append(line.account_id.id)
517+
518+ ## The company currency amounts are the debit-credit amounts in the account moves
519+ for line in invoice.move_id.line_id:
520+ if line.account_id.id in line_account:
521+ res['cc_amount_untaxed'] += float_round(line.debit - line.credit, precision)
522+ if line.account_id.id in tax_account:
523+ res['cc_amount_tax'] += float_round(line.debit - line.credit, precision)
524+ if invoice.type in ('out_invoice', 'in_refund'):
525+ res['cc_amount_untaxed'] = -res['cc_amount_untaxed']
526+ res['cc_amount_tax'] = -res['cc_amount_tax']
527+ res['cc_amount_total'] = res['cc_amount_tax'] + res['cc_amount_untaxed']
528+ return res
529+
530 _columns = {
531 'is_ticket_summary': fields.boolean('Ticket Summary',
532 help='Check if this invoice is a ticket summary'),
533
534=== modified file 'l10n_es_aeat_mod340/account_view.xml'
535--- l10n_es_aeat_mod340/account_view.xml 2014-03-20 00:33:19 +0000
536+++ l10n_es_aeat_mod340/account_view.xml 2014-06-01 16:57:08 +0000
537@@ -1,17 +1,28 @@
538 <?xml version="1.0" encoding="utf-8"?>
539 <openerp>
540 <data>
541+<<<<<<< TREE
542 <record id="view_tax_code_template_form_mod340" model="ir.ui.view">
543 <field name="name">account.tax.code.template.form.mod340</field>
544 <field name="model">account.tax.code.template</field>
545 <field name="inherit_id" ref="account.view_tax_code_template_form"/>
546+=======
547+
548+ <record id="view_account_tax_template_form_mod340" model="ir.ui.view">
549+ <field name="name">account.tax.template.form</field>
550+ <field name="model">account.tax.template</field>
551+ <field name="inherit_id" ref="account.view_account_tax_template_form"/>
552+>>>>>>> MERGE-SOURCE
553 <field name="arch" type="xml">
554- <field name="sign" position="after">
555- <field name="mod340"/>
556- </field>
557+ <xpath expr="//field[@name='ref_tax_sign']" position="after">
558+ <group string="Modelo 340">
559+ <field name="ledger_key"/>
560+ <field name="operation_key"/>
561+ </group>
562+ </xpath>
563 </field>
564 </record>
565-
566+
567 <record id="view_tax_code_form_mod340" model="ir.ui.view">
568 <field name="name">account.tax.code.form.mod340</field>
569 <field name="model">account.tax.code</field>
570@@ -22,5 +33,23 @@
571 </field>
572 </field>
573 </record>
574+
575+ <record id="view_tax_form_mod340" model="ir.ui.view">
576+ <field name="name">account.tax.form.mod340</field>
577+ <field name="model">account.tax</field>
578+ <field name="inherit_id" ref="account.view_tax_form"/>
579+ <field name="arch" type="xml">
580+ <field name="child_depend" position="after">
581+ <separator string="Modelo 340" colspan="2"/>
582+ <field name="ledger_key" on_change="onchange_ledger('ledger_key', ledger_key, context)" attrs="{'invisible': [('type_tax_use','!=','all')]}"/>
583+ <field name="ledger_key_in" on_change="onchange_ledger('ledger_key_in', ledger_key_in, context)" attrs="{'invisible': [('type_tax_use','!=','purchase')]}"/>
584+ <field name="ledger_key_out" on_change="onchange_ledger('ledger_key_out', ledger_key_out, context)" attrs="{'invisible': [('type_tax_use','!=','sale')]}"/>
585+ <field name="operation_key"/>
586+ </field>
587+ <field name="type_tax_use" position="attributes">
588+ <attribute name="on_change">onchange_type_tax_use(context)</attribute>
589+ </field>
590+ </field>
591+ </record>
592 </data>
593 </openerp>
594\ No newline at end of file
595
596=== modified file 'l10n_es_aeat_mod340/i18n/es.po'
597--- l10n_es_aeat_mod340/i18n/es.po 2014-05-12 06:40:26 +0000
598+++ l10n_es_aeat_mod340/i18n/es.po 2014-06-01 16:57:08 +0000
599@@ -4,21 +4,26 @@
600 #
601 msgid ""
602 msgstr ""
603-"Project-Id-Version: OpenERP Server 7.0\n"
604+"Project-Id-Version: OpenERP Server 7.0-20140331-231318\n"
605 "Report-Msgid-Bugs-To: \n"
606-"POT-Creation-Date: 2014-02-02 18:10+0000\n"
607-"PO-Revision-Date: 2014-03-18 22:33+0000\n"
608-"Last-Translator: Ignacio Ibeas (www.acysos.com) <ignacio@acysos.com>\n"
609+"POT-Creation-Date: 2014-04-01 10:51+0000\n"
610+"PO-Revision-Date: 2014-04-01 10:51+0000\n"
611+"Last-Translator: <>\n"
612 "Language-Team: \n"
613 "MIME-Version: 1.0\n"
614 "Content-Type: text/plain; charset=UTF-8\n"
615+<<<<<<< TREE
616 "Content-Transfer-Encoding: 8bit\n"
617 "X-Launchpad-Export-Date: 2014-05-12 06:39+0000\n"
618 "X-Generator: Launchpad (build 16996)\n"
619+=======
620+"Content-Transfer-Encoding: \n"
621+"Plural-Forms: \n"
622+>>>>>>> MERGE-SOURCE
623
624 #. module: l10n_es_aeat_mod340
625 #: report:report mod340:0
626-#: report:vat_book:0
627+#: report:vat book:0
628 msgid "FACTURAS DE SALIDA"
629 msgstr "FACTURAS DE SALIDA"
630
631@@ -29,16 +34,14 @@
632
633 #. module: l10n_es_aeat_mod340
634 #: report:report mod340:0
635-#: report:report_mod340:0
636 #: report:vat book:0
637-#: report:vat_book:0
638 msgid "Compañía:"
639 msgstr "Compañía:"
640
641 #. module: l10n_es_aeat_mod340
642 #: model:ir.actions.act_window,name:l10n_es_aeat_mod340.action_l10n_es_aeat_mod340_report
643 msgid "AEAT model 340"
644-msgstr "Declaración AEAT 340"
645+msgstr "Modelo AEAT 340"
646
647 #. module: l10n_es_aeat_mod340
648 #: view:l10n.es.aeat.mod340.issued:0
649@@ -51,10 +54,14 @@
650 msgstr "Exportar Modelo AEAT 340 al formato del BOE"
651
652 #. module: l10n_es_aeat_mod340
653-#: code:addons/l10n_es_aeat_mod340/account.py:89
654-#, python-format
655-msgid "The code field is different.\n"
656-msgstr "El campo código es diferente.\n"
657+#: help:l10n.es.aeat.mod340.report,investment_goods_prorating:0
658+msgid "If checked, the investment goods invoices will be exported in their ledger. If not, they will be exported as received invoices"
659+msgstr "Si se marca, las facturas de bienes de inversión se exportarán en su libro. Si no, se exportarán como facturas recibidas"
660+
661+#. module: l10n_es_aeat_mod340
662+#: field:l10n.es.aeat.mod340.report,investment_goods_prorating:0
663+msgid "Investment goods prorating"
664+msgstr "Prorrata de bienes de inversión"
665
666 #. module: l10n_es_aeat_mod340
667 #: view:l10n.es.aeat.mod340.report:0
668@@ -67,26 +74,22 @@
669 msgstr "Total"
670
671 #. module: l10n_es_aeat_mod340
672-#: code:addons/l10n_es_aeat_mod340/account.py:161
673+#: code:addons/l10n_es_aeat_mod340/wizard/calculate_mod340_records.py:126
674 #, python-format
675-msgid "Created tax code %s.\n"
676-msgstr "Código de impuesto %s creado.\n"
677+msgid "The periods selected don't belong to the fiscal year %s"
678+msgstr "Los periodos seleccionados no pertenecen al año fiscal %s"
679
680 #. module: l10n_es_aeat_mod340
681-#: view:l10n.es.aeat.mod340.report:0
682-msgid "Susbtitutive/complementary declaration"
683-msgstr "Declaración sustitutiva/complementaría"
684+#: code:addons/l10n_es_aeat_mod340/wizard/calculate_mod340_records.py:87
685+#, python-format
686+msgid "No match found for tax percentage %s"
687+msgstr "No match found for tax percentage %s"
688
689 #. module: l10n_es_aeat_mod340
690 #: view:l10n.es.aeat.mod340.report:0
691 #: field:l10n.es.aeat.mod340.report,company_id:0
692 msgid "Company"
693-msgstr "Compañía"
694-
695-#. module: l10n_es_aeat_mod340
696-#: field:l10n.es.aeat.mod340.report,total_sharetax:0
697-msgid "Total Share Tax"
698-msgstr "Total impuestos"
699+msgstr "Compañia"
700
701 #. module: l10n_es_aeat_mod340
702 #: field:l10n.es.aeat.mod340.report,number_records:0
703@@ -94,13 +97,10 @@
704 msgstr "Registros"
705
706 #. module: l10n_es_aeat_mod340
707-#: code:addons/l10n_es_aeat_mod340/wizard/export_mod340_to_boe.py:390
708+#: code:addons/l10n_es_aeat_mod340/wizard/export_mod340_to_boe.py:411
709 #, python-format
710-msgid ""
711-"The type 2 received record must be 500 characters long for each Vat registry"
712-msgstr ""
713-"El registro de tipo 2 debe tener una longitud de 500 caracteres por cada "
714-"registro de IVA"
715+msgid "The type 2 received record must be 500 characters long for each Vat registry"
716+msgstr "El registro de tipo 2 debe tener una longitud de 500 caracteres por cada registro de IVA"
717
718 #. module: l10n_es_aeat_mod340
719 #: selection:l10n.es.aeat.mod340.report,type:0
720@@ -117,6 +117,8 @@
721 #: field:l10n.es.aeat.mod340.investment,base_tax:0
722 #: field:l10n.es.aeat.mod340.issued,base_tax:0
723 #: field:l10n.es.aeat.mod340.received,base_tax:0
724+#: field:l10n.es.aeat.mod340.tax_line_intra,base_amount:0
725+#: field:l10n.es.aeat.mod340.tax_line_investment,base_amount:0
726 #: field:l10n.es.aeat.mod340.tax_line_issued,base_amount:0
727 #: field:l10n.es.aeat.mod340.tax_line_received,base_amount:0
728 msgid "Base tax bill"
729@@ -129,9 +131,7 @@
730
731 #. module: l10n_es_aeat_mod340
732 #: report:report mod340:0
733-#: report:report_mod340:0
734 #: report:vat book:0
735-#: report:vat_book:0
736 msgid "Apellidos y nombre de contacto:"
737 msgstr "Apellidos y nombre de contacto:"
738
739@@ -142,7 +142,6 @@
740
741 #. module: l10n_es_aeat_mod340
742 #: field:account.tax.code,mod340:0
743-#: field:account.tax.code.template,mod340:0
744 msgid "Include in mod340"
745 msgstr "Incluir en el modelo 340"
746
747@@ -177,13 +176,11 @@
748 msgstr "6 - Otro documento probatorio"
749
750 #. module: l10n_es_aeat_mod340
751-#: code:addons/l10n_es_aeat_mod340/wizard/export_mod340_to_boe.py:283
752+#: code:addons/l10n_es_aeat_mod340/wizard/export_mod340_to_boe.py:291
753+#: code:addons/l10n_es_aeat_mod340/wizard/export_mod340_to_boe.py:529
754 #, python-format
755-msgid ""
756-"The type 2 issued record must be 500 characters long for each Vat registry"
757-msgstr ""
758-"El registro de tipo 2 debe tener una longitud de 500 caracteres por cada "
759-"registro de IVA"
760+msgid "The type 2 issued record must be 500 characters long for each Vat registry"
761+msgstr "El registro de tipo 2 debe tener una longitud de 500 caracteres por cada registro de IVA"
762
763 #. module: l10n_es_aeat_mod340
764 #: field:l10n.es.aeat.mod340.report,period_from:0
765@@ -191,24 +188,21 @@
766 msgstr "Periodo inicial"
767
768 #. module: l10n_es_aeat_mod340
769-#: code:addons/l10n_es_aeat_mod340/account.py:170
770-#, python-format
771-msgid "Updated tax code %s.\n"
772-msgstr "Código de impuesto %s actualizado.\n"
773+#: model:ir.model,name:l10n_es_aeat_mod340.model_l10n_es_aeat_mod340_report
774+#: field:l10n.es.aeat.mod340.intracomunitarias,mod340_id:0
775+#: field:l10n.es.aeat.mod340.investment,mod340_id:0
776+#: field:l10n.es.aeat.mod340.issued,mod340_id:0
777+#: field:l10n.es.aeat.mod340.received,mod340_id:0
778+#: view:l10n.es.aeat.mod340.report:0
779+msgid "Model 340"
780+msgstr "Modelo 340"
781
782 #. module: l10n_es_aeat_mod340
783 #: model:ir.model,name:l10n_es_aeat_mod340.model_l10n_es_aeat_mod340_intracomunitarias
784-#: field:l10n.es.aeat.mod340.report,intracomunitarias:0
785 msgid "Operations Intracomunitarias"
786 msgstr "Operaciones intracomunitarias"
787
788 #. module: l10n_es_aeat_mod340
789-#: field:l10n.es.aeat.mod340.tax_line_issued,tax_amount:0
790-#: field:l10n.es.aeat.mod340.tax_line_received,tax_amount:0
791-msgid "Tax amount"
792-msgstr "Impuestos"
793-
794-#. module: l10n_es_aeat_mod340
795 #: view:l10n.es.aeat.mod340.report:0
796 #: field:l10n.es.aeat.mod340.report,ean13:0
797 msgid "Electronic Code VAT reverse charge"
798@@ -220,35 +214,20 @@
799 msgstr "Periodo final"
800
801 #. module: l10n_es_aeat_mod340
802-#: code:addons/l10n_es_aeat_mod340/account.py:98
803-#, python-format
804-msgid "The Mod 340 field is different.\n"
805-msgstr "El campo Mod 340 es diferente.\n"
806-
807-#. module: l10n_es_aeat_mod340
808 #: view:l10n.es.aeat.mod340.report:0
809 msgid "Identification"
810 msgstr "Identificación"
811
812 #. module: l10n_es_aeat_mod340
813-#: view:l10n.es.aeat.mod340.report:0
814-msgid "295"
815-msgstr "295"
816-
817-#. module: l10n_es_aeat_mod340
818+#: view:l10n.es.aeat.mod340.intracomunitarias:0
819+#: view:l10n.es.aeat.mod340.investment:0
820 #: view:l10n.es.aeat.mod340.issued:0
821 #: view:l10n.es.aeat.mod340.received:0
822 msgid "Total Tax"
823-msgstr "Total Impuestos"
824-
825-#. module: l10n_es_aeat_mod340
826-#: model:ir.actions.report.xml,name:l10n_es_aeat_mod340.report_mod340_action
827-msgid "mod340 report"
828-msgstr "mod340 report"
829+msgstr "Cuota"
830
831 #. module: l10n_es_aeat_mod340
832 #: report:vat book:0
833-#: report:vat_book:0
834 msgid "LIBRO DE IVA"
835 msgstr "LIBRO DE IVA"
836
837@@ -258,10 +237,42 @@
838 msgstr "Facturas"
839
840 #. module: l10n_es_aeat_mod340
841-#: code:addons/l10n_es_aeat_mod340/wizard/calculate_mod340_records.py:66
842-#, python-format
843-msgid "This company dont have NIF"
844-msgstr "Esta compañía no tiene CIF/NIF"
845+#: field:l10n.es.aeat.mod340.tax_line_intra,tax_amount:0
846+#: field:l10n.es.aeat.mod340.tax_line_investment,tax_amount:0
847+#: field:l10n.es.aeat.mod340.tax_line_issued,tax_amount:0
848+#: field:l10n.es.aeat.mod340.tax_line_received,tax_amount:0
849+msgid "Tax amount"
850+msgstr "Cuota"
851+
852+#. module: l10n_es_aeat_mod340
853+#: field:account.tax,ledger_key:0
854+#: field:account.tax,ledger_key_in:0
855+#: field:account.tax,ledger_key_out:0
856+#: field:account.tax.template,ledger_key:0
857+#: field:l10n.es.aeat.mod340.intracomunitarias,ledger_key:0
858+#: field:l10n.es.aeat.mod340.investment,ledger_key:0
859+#: field:l10n.es.aeat.mod340.issued,ledger_key:0
860+#: field:l10n.es.aeat.mod340.received,ledger_key:0
861+msgid "Ledger Key"
862+msgstr "Clave de libro"
863+
864+#. module: l10n_es_aeat_mod340
865+#: field:l10n.es.aeat.mod340.tax_line_intra,surcharge_percentage:0
866+#: field:l10n.es.aeat.mod340.tax_line_investment,surcharge_percentage:0
867+#: field:l10n.es.aeat.mod340.tax_line_issued,surcharge_percentage:0
868+#: field:l10n.es.aeat.mod340.tax_line_received,surcharge_percentage:0
869+msgid "Surcharge percentage"
870+msgstr "Tipo de recargo"
871+
872+#. module: l10n_es_aeat_mod340
873+#: model:ir.model,name:l10n_es_aeat_mod340.model_account_tax
874+msgid "Tax"
875+msgstr "Impuesto"
876+
877+#. module: l10n_es_aeat_mod340
878+#: view:l10n.es.aeat.mod340.report:0
879+msgid "Fiscal Year"
880+msgstr "Año fiscal"
881
882 #. module: l10n_es_aeat_mod340
883 #: selection:res.partner,vat_type:0
884@@ -279,6 +290,11 @@
885 msgstr "Estado"
886
887 #. module: l10n_es_aeat_mod340
888+#: model:ir.model,name:l10n_es_aeat_mod340.model_account_tax_template
889+msgid "Templates for Taxes"
890+msgstr "Plantilla para los impuestos"
891+
892+#. module: l10n_es_aeat_mod340
893 #: model:ir.ui.menu,name:l10n_es_aeat_mod340.menu_aeat_mod340_report
894 msgid "AEAT 340 Model"
895 msgstr "Declaración AEAT 340"
896@@ -289,11 +305,10 @@
897 #: field:l10n.es.aeat.mod340.issued,amount_tax:0
898 #: field:l10n.es.aeat.mod340.received,amount_tax:0
899 msgid "Total tax"
900-msgstr "Total impuestos"
901+msgstr "Cuota"
902
903 #. module: l10n_es_aeat_mod340
904 #: report:vat book:0
905-#: report:vat_book:0
906 msgid "Nº de factura"
907 msgstr "Nº de factura"
908
909@@ -303,9 +318,19 @@
910 #: field:l10n.es.aeat.mod340.issued,date_invoice:0
911 #: field:l10n.es.aeat.mod340.received,date_invoice:0
912 msgid "Date Invoice"
913-msgstr "Fecha Factura"
914-
915-#. module: l10n_es_aeat_mod340
916+msgstr "Fecha factura"
917+
918+#. module: l10n_es_aeat_mod340
919+#: field:l10n.es.aeat.mod340.tax_line_intra,surcharge_amount:0
920+#: field:l10n.es.aeat.mod340.tax_line_investment,surcharge_amount:0
921+#: field:l10n.es.aeat.mod340.tax_line_issued,surcharge_amount:0
922+#: field:l10n.es.aeat.mod340.tax_line_received,surcharge_amount:0
923+msgid "Surcharge amount"
924+msgstr "Cuota de recargo"
925+
926+#. module: l10n_es_aeat_mod340
927+#: view:account.tax:0
928+#: view:account.tax.template:0
929 #: model:ir.actions.report.xml,name:l10n_es_aeat_mod340.report_mod340
930 msgid "Modelo 340"
931 msgstr "Modelo 340"
932@@ -321,7 +346,7 @@
933 msgstr "Tipo de soporte"
934
935 #. module: l10n_es_aeat_mod340
936-#: code:addons/l10n_es_aeat_mod340/wizard/export_mod340_to_boe.py:105
937+#: code:addons/l10n_es_aeat_mod340/wizard/export_mod340_to_boe.py:113
938 #, python-format
939 msgid "The period hasn't a valid Mod340 period"
940 msgstr "El periodo no es válido para el Módelo 340"
941@@ -337,32 +362,24 @@
942 msgstr "1 - Corresponde a un NIF"
943
944 #. module: l10n_es_aeat_mod340
945-#: model:ir.model,name:l10n_es_aeat_mod340.model_l10n_es_aeat_mod340_export_to_boe
946-msgid "Export AEAT Model 340 to BOE format"
947-msgstr "Exportar Modelo AEAT 340 al formato del BOE"
948-
949-#. module: l10n_es_aeat_mod340
950-#: code:addons/l10n_es_aeat_mod340/wizard/export_mod340_to_boe.py:126
951+#: code:addons/l10n_es_aeat_mod340/wizard/export_mod340_to_boe.py:134
952 #, python-format
953 msgid "The type 1 record must be 500 characters long"
954 msgstr "El registro de tipo 1 tiene que tener 500 caracteres de longitud"
955
956 #. module: l10n_es_aeat_mod340
957 #: report:report mod340:0
958-#: report:report_mod340:0
959 #: report:vat book:0
960-#: report:vat_book:0
961 msgid "CIF/NIF:"
962 msgstr "CIF/NIF:"
963
964 #. module: l10n_es_aeat_mod340
965-#: model:ir.model,name:l10n_es_aeat_mod340.model_l10n_es_aeat_mod340_tax_line_issued
966-msgid "Mod340 vat lines issued"
967-msgstr "Líneas de impuestos emitidos"
968+#: field:l10n.es.aeat.mod340.report,calculation_date:0
969+msgid "Calculation date"
970+msgstr "Fecha de cálculo"
971
972 #. module: l10n_es_aeat_mod340
973 #: report:report mod340:0
974-#: report:report_mod340:0
975 msgid "CIF/NIF del representante legal:"
976 msgstr "CIF/NIF del representante legal:"
977
978@@ -376,21 +393,13 @@
979 msgstr "Empresa"
980
981 #. module: l10n_es_aeat_mod340
982-#: code:addons/l10n_es_aeat_mod340/wizard/calculate_mod340_records.py:80
983-#, python-format
984-msgid "The periods selected don't belong to the fiscal year %s"
985-msgstr "Los periodos seleccionados no pertenecen al año fiscal %s"
986-
987-#. module: l10n_es_aeat_mod340
988 #: model:ir.actions.act_window,help:l10n_es_aeat_mod340.action_l10n_es_aeat_mod340_report
989 msgid "Create and query AEAT Model 340 reports"
990 msgstr "Crear informe del Modelo AEAT 340"
991
992 #. module: l10n_es_aeat_mod340
993 #: report:report mod340:0
994-#: report:report_mod340:0
995 #: report:vat book:0
996-#: report:vat_book:0
997 msgid "Cuota impuesto"
998 msgstr "Cuota impuesto"
999
1000@@ -400,30 +409,42 @@
1001 msgstr "Líneas de impuestos recibidos"
1002
1003 #. module: l10n_es_aeat_mod340
1004+#: view:l10n.es.aeat.mod340.report:0
1005+msgid "Other intracommunity operations"
1006+msgstr "Otras opreaciones intracomunitarias"
1007+
1008+#. module: l10n_es_aeat_mod340
1009 #: report:report mod340:0
1010-#: report:report_mod340:0
1011 msgid "MODELO AEAT 340"
1012 msgstr "MODELO AEAT 340"
1013
1014 #. module: l10n_es_aeat_mod340
1015-#: code:addons/l10n_es_aeat_mod340/account.py:95
1016-#, python-format
1017-msgid "The sign field is different.\n"
1018-msgstr "El campo signo es diferente.\n"
1019+#: view:l10n.es.aeat.mod340.investment:0
1020+#: view:l10n.es.aeat.mod340.report:0
1021+msgid "Investment goods"
1022+msgstr "Bienes de inversión"
1023+
1024+#. module: l10n_es_aeat_mod340
1025+#: field:l10n.es.aeat.mod340.export_to_boe,state:0
1026+msgid "unknown"
1027+msgstr "unknown"
1028+
1029+#. module: l10n_es_aeat_mod340
1030+#: model:ir.model,name:l10n_es_aeat_mod340.model_l10n_es_aeat_mod340_tax_line_investment
1031+msgid "Mod340 vat lines investment"
1032+msgstr "Líneas de inversión del mod340"
1033
1034 #. module: l10n_es_aeat_mod340
1035 #: report:report mod340:0
1036-#: report:report_mod340:0
1037 msgid "Tipo de declaración"
1038 msgstr "Tipo de declaración"
1039
1040 #. module: l10n_es_aeat_mod340
1041-#: field:l10n.es.aeat.mod340.report,calculation_date:0
1042-msgid "Calculation date"
1043-msgstr "Fecha de cálculo"
1044+#: model:ir.model,name:l10n_es_aeat_mod340.model_l10n_es_aeat_mod340_tax_line_issued
1045+msgid "Mod340 vat lines issued"
1046+msgstr "Líneas de impuestos emitidos"
1047
1048 #. module: l10n_es_aeat_mod340
1049-#: model:ir.actions.report.xml,name:l10n_es_aeat_mod340.report_vat_book_action
1050 #: model:ir.actions.report.xml,name:l10n_es_aeat_mod340.vat_book
1051 msgid "Vat Book"
1052 msgstr "Libro de IVA"
1053@@ -434,10 +455,9 @@
1054 msgstr "Número de tiques"
1055
1056 #. module: l10n_es_aeat_mod340
1057-#: code:addons/l10n_es_aeat_mod340/account.py:185
1058-#, python-format
1059-msgid "Tax code %s: The parent tax code %s can not be set.\n"
1060-msgstr "Código de impuesto %s: el padre de %s no puede ser guardado.\n"
1061+#: field:l10n.es.aeat.mod340.report,total_sharetax:0
1062+msgid "Total Share Tax"
1063+msgstr "Total impuestos"
1064
1065 #. module: l10n_es_aeat_mod340
1066 #: selection:l10n.es.aeat.mod340.report,support_type:0
1067@@ -446,9 +466,7 @@
1068
1069 #. module: l10n_es_aeat_mod340
1070 #: report:report mod340:0
1071-#: report:report_mod340:0
1072 #: report:vat book:0
1073-#: report:vat_book:0
1074 msgid "Fecha"
1075 msgstr "Fecha"
1076
1077@@ -458,15 +476,21 @@
1078 msgstr "En processo"
1079
1080 #. module: l10n_es_aeat_mod340
1081-#: model:ir.model,name:l10n_es_aeat_mod340.model_l10n_es_aeat_mod340
1082-#: model:ir.model,name:l10n_es_aeat_mod340.model_l10n_es_aeat_mod340_report
1083-#: field:l10n.es.aeat.mod340.intracomunitarias,mod340_id:0
1084-#: field:l10n.es.aeat.mod340.investment,mod340_id:0
1085-#: field:l10n.es.aeat.mod340.issued,mod340_id:0
1086-#: field:l10n.es.aeat.mod340.received,mod340_id:0
1087-#: view:l10n.es.aeat.mod340.report:0
1088-msgid "Model 340"
1089-msgstr "Modelo 340"
1090+#: field:l10n.es.aeat.mod340.investment,prorata:0
1091+msgid "Definitive yearly prorata"
1092+msgstr "Prorrata anual definitiva"
1093+
1094+#. module: l10n_es_aeat_mod340
1095+#: code:addons/l10n_es_aeat_mod340/wizard/calculate_mod340_records.py:115
1096+#, python-format
1097+msgid "This company dont have NIF"
1098+msgstr "Esta compañía no tiene CIF/NIF"
1099+
1100+#. module: l10n_es_aeat_mod340
1101+#: model:ir.model,name:l10n_es_aeat_mod340.model_l10n_es_aeat_mod340_received
1102+#: field:l10n.es.aeat.mod340.report,received:0
1103+msgid "Invoices Received"
1104+msgstr "Facturas recibidas"
1105
1106 #. module: l10n_es_aeat_mod340
1107 #: view:l10n.es.aeat.mod340.report:0
1108@@ -485,14 +509,15 @@
1109 msgstr "open"
1110
1111 #. module: l10n_es_aeat_mod340
1112-#: view:l10n.es.aeat.mod340.issued:0
1113-#: view:l10n.es.aeat.mod340.received:0
1114-msgid "Total Base"
1115-msgstr "Total Base"
1116+#: code:addons/l10n_es_aeat_mod340/account.py:211
1117+#, python-format
1118+msgid "The ledger key is different.\n"
1119+""
1120+msgstr "La clave de libro es diferente.\n"
1121+""
1122
1123 #. module: l10n_es_aeat_mod340
1124 #: report:report mod340:0
1125-#: report:report_mod340:0
1126 msgid "Número de la declaración anterior:"
1127 msgstr "Número de la declaración anterior:"
1128
1129@@ -512,19 +537,36 @@
1130 msgstr "Active si esta factura es un resumen de tiques"
1131
1132 #. module: l10n_es_aeat_mod340
1133-#: field:l10n.es.aeat.mod340.export_to_boe,state:0
1134-msgid "unknown"
1135-msgstr "unknown"
1136-
1137-#. module: l10n_es_aeat_mod340
1138-#: field:l10n.es.aeat.mod340.report,contact_phone:0
1139-msgid "Phone"
1140-msgstr "Teléfono"
1141-
1142-#. module: l10n_es_aeat_mod340
1143-#: field:account.invoice,last_ticket:0
1144-msgid "Last ticket"
1145-msgstr "Último tique"
1146+#: view:l10n.es.aeat.mod340.tax_line_investment:0
1147+msgid "Tax line investment goods"
1148+msgstr "Línea de impuesto de bienes de inversión"
1149+
1150+#. module: l10n_es_aeat_mod340
1151+#: report:report mod340:0
1152+#: report:vat book:0
1153+msgid "Teléfono de contacto:"
1154+msgstr "Teléfono de contacto:"
1155+
1156+#. module: l10n_es_aeat_mod340
1157+#: field:l10n.es.aeat.mod340.tax_line_investment,goods_identification:0
1158+msgid "Investment goods identification"
1159+msgstr "Identificación del bien"
1160+
1161+#. module: l10n_es_aeat_mod340
1162+#: field:l10n.es.aeat.mod340.investment,use_date:0
1163+msgid "Goods use start date"
1164+msgstr "Fecha de inicio de utilización"
1165+
1166+#. module: l10n_es_aeat_mod340
1167+#: code:addons/l10n_es_aeat_mod340/wizard/calculate_mod340_records.py:260
1168+#, python-format
1169+msgid "Invoice %s: Unable to determine the surcharged tax because it is not mapped in the partner's fiscal position %s"
1170+msgstr "Factura %s: No se pudo determinar el impuesto con recargo porque no está mapeado en la posición fiscal de la empresa %s"
1171+
1172+#. module: l10n_es_aeat_mod340
1173+#: view:l10n.es.aeat.mod340.tax_line_intra:0
1174+msgid "Tax line intracommunity"
1175+msgstr "Línea de impuesto intracomunitaria"
1176
1177 #. module: l10n_es_aeat_mod340
1178 #: field:l10n.es.aeat.mod340.report,previous_number:0
1179@@ -538,13 +580,16 @@
1180
1181 #. module: l10n_es_aeat_mod340
1182 #: report:report mod340:0
1183-#: report:report_mod340:0
1184 #: report:vat book:0
1185-#: report:vat_book:0
1186 msgid "Ejercicio fiscal:"
1187 msgstr "Ejercicio fiscal:"
1188
1189 #. module: l10n_es_aeat_mod340
1190+#: field:account.invoice,last_ticket:0
1191+msgid "Last ticket"
1192+msgstr "Último tique"
1193+
1194+#. module: l10n_es_aeat_mod340
1195 #: field:l10n.es.aeat.mod340.intracomunitarias,partner_country_code:0
1196 #: field:l10n.es.aeat.mod340.investment,partner_country_code:0
1197 #: field:l10n.es.aeat.mod340.issued,partner_country_code:0
1198@@ -573,12 +618,20 @@
1199 msgstr "Facturas emitidas"
1200
1201 #. module: l10n_es_aeat_mod340
1202-#: code:addons/l10n_es_aeat_mod340/wizard/calculate_mod340_records.py:79
1203+#: code:addons/l10n_es_aeat_mod340/wizard/calculate_mod340_records.py:58
1204+#: code:addons/l10n_es_aeat_mod340/wizard/calculate_mod340_records.py:86
1205+#: code:addons/l10n_es_aeat_mod340/wizard/calculate_mod340_records.py:125
1206+#: code:addons/l10n_es_aeat_mod340/wizard/calculate_mod340_records.py:259
1207 #, python-format
1208 msgid "Error"
1209 msgstr "Error"
1210
1211 #. module: l10n_es_aeat_mod340
1212+#: view:l10n.es.aeat.mod340.report:0
1213+msgid "Susbtitutive/complementary declaration"
1214+msgstr "Declaración sustitutiva/complementaría"
1215+
1216+#. module: l10n_es_aeat_mod340
1217 #: field:l10n.es.aeat.mod340.intracomunitarias,representative_vat:0
1218 #: field:l10n.es.aeat.mod340.investment,representative_vat:0
1219 #: field:l10n.es.aeat.mod340.issued,representative_vat:0
1220@@ -598,14 +651,19 @@
1221 msgstr "Facturas emitidas"
1222
1223 #. module: l10n_es_aeat_mod340
1224+#: view:l10n.es.aeat.mod340.intracomunitarias:0
1225+msgid "Other Intracommunity Operations"
1226+msgstr "Otras operaciones intracomunitarias"
1227+
1228+#. module: l10n_es_aeat_mod340
1229 #: report:report mod340:0
1230-#: report:report_mod340:0
1231 #: report:vat book:0
1232-#: report:vat_book:0
1233 msgid "Base imponible"
1234 msgstr "Base imponible"
1235
1236 #. module: l10n_es_aeat_mod340
1237+#: field:l10n.es.aeat.mod340.tax_line_intra,invoice_record_id:0
1238+#: field:l10n.es.aeat.mod340.tax_line_investment,invoice_record_id:0
1239 #: field:l10n.es.aeat.mod340.tax_line_received,invoice_record_id:0
1240 msgid "Invoice received"
1241 msgstr "Facturas recibidas"
1242@@ -652,19 +710,17 @@
1243
1244 #. module: l10n_es_aeat_mod340
1245 #: report:report mod340:0
1246-#: report:report_mod340:0
1247-#: report:vat book:0
1248-#: report:vat_book:0
1249-msgid "Teléfono de contacto:"
1250-msgstr "Teléfono de contacto:"
1251-
1252-#. module: l10n_es_aeat_mod340
1253-#: report:report mod340:0
1254-#: report:report_mod340:0
1255 msgid "Código electrónico autoliquidación IVA:"
1256 msgstr "Código electrónico autoliquidación IVA:"
1257
1258 #. module: l10n_es_aeat_mod340
1259+#: help:account.tax,ledger_key:0
1260+#: help:account.tax,ledger_key_in:0
1261+#: help:account.tax,ledger_key_out:0
1262+msgid "Determines to which ledger the invoice with this tax will be assigned. Setting a value makes the tax to be accounted in 340 declaration"
1263+msgstr "Determina a qué libro se asignará una factura con este impuesto. Establecer un valor hace que el impuesto se tenga en cuenta en la declaración del modelo 340"
1264+
1265+#. module: l10n_es_aeat_mod340
1266 #: selection:res.partner,vat_type:0
1267 msgid "5 - Certificado de residencia fiscal"
1268 msgstr "5 - Certificado de residencia fiscal"
1269@@ -676,6 +732,8 @@
1270 msgstr "AEAT 340"
1271
1272 #. module: l10n_es_aeat_mod340
1273+#: field:l10n.es.aeat.mod340.tax_line_intra,tax_percentage:0
1274+#: field:l10n.es.aeat.mod340.tax_line_investment,tax_percentage:0
1275 #: field:l10n.es.aeat.mod340.tax_line_issued,tax_percentage:0
1276 #: field:l10n.es.aeat.mod340.tax_line_received,tax_percentage:0
1277 msgid "Tax percentage"
1278@@ -687,12 +745,16 @@
1279 msgstr "Facturas recibidas"
1280
1281 #. module: l10n_es_aeat_mod340
1282+#: model:ir.model,name:l10n_es_aeat_mod340.model_l10n_es_aeat_mod340_tax_line_intra
1283+msgid "Mod340 vat lines intra-community"
1284+msgstr "Línea de impuesto intracomunitario del mod340"
1285+
1286+#. module: l10n_es_aeat_mod340
1287 #: help:l10n.es.aeat.mod340.report,number_records:0
1288 #: help:l10n.es.aeat.mod340.report,total:0
1289 #: help:l10n.es.aeat.mod340.report,total_sharetax:0
1290 #: help:l10n.es.aeat.mod340.report,total_taxable:0
1291-msgid ""
1292-"The declaration will include partners with the total \n"
1293+msgid "The declaration will include partners with the total \n"
1294 " of operations over this limit"
1295 msgstr "La declaración incluye las empresas que no superen este limite"
1296
1297@@ -703,21 +765,15 @@
1298
1299 #. module: l10n_es_aeat_mod340
1300 #: report:report mod340:0
1301-#: report:report_mod340:0
1302 #: report:vat book:0
1303-#: report:vat_book:0
1304 msgid "CIF/NIF"
1305 msgstr "CIF/NIF"
1306
1307 #. module: l10n_es_aeat_mod340
1308-#: code:addons/l10n_es_aeat_mod340/wizard/calculate_mod340_records.py:196
1309+#: code:addons/l10n_es_aeat_mod340/wizard/calculate_mod340_records.py:275
1310 #, python-format
1311-msgid ""
1312-"Invoice %s, Amount untaxed Lines %.2f do not correspond to AmountUntaxed on "
1313-"Invoice %.2f"
1314-msgstr ""
1315-"Invoice %s, Amount untaxed Lines %.2f do not correspond to AmountUntaxed on "
1316-"Invoice %.2f"
1317+msgid "Invoice %s, Amount untaxed Lines %.2f do not correspond to AmountUntaxed on Invoice %.2f"
1318+msgstr "Factura %s, el importe sin impuesto de las líneas %.2f no se corresponde con el importe sin impuesto de la factura %.2f"
1319
1320 #. module: l10n_es_aeat_mod340
1321 #: help:res.partner,vat_type:0
1322@@ -725,10 +781,13 @@
1323 msgstr "Clave número de identificación en el país de residencia. Modelo 340."
1324
1325 #. module: l10n_es_aeat_mod340
1326+#: view:l10n.es.aeat.mod340.report:0
1327+msgid "322"
1328+msgstr "322"
1329+
1330+#. module: l10n_es_aeat_mod340
1331 #: report:report mod340:0
1332-#: report:report_mod340:0
1333 #: report:vat book:0
1334-#: report:vat_book:0
1335 msgid "Número de factura"
1336 msgstr "Número de factura"
1337
1338@@ -746,8 +805,17 @@
1339 msgstr "NIF del representante legal."
1340
1341 #. module: l10n_es_aeat_mod340
1342+#: field:account.tax,operation_key:0
1343+#: field:account.tax.template,operation_key:0
1344+#: field:l10n.es.aeat.mod340.intracomunitarias,operation_key:0
1345+#: field:l10n.es.aeat.mod340.investment,operation_key:0
1346+#: field:l10n.es.aeat.mod340.issued,operation_key:0
1347+#: field:l10n.es.aeat.mod340.received,operation_key:0
1348+msgid "Operation Key"
1349+msgstr "Clave de operación"
1350+
1351+#. module: l10n_es_aeat_mod340
1352 #: model:ir.model,name:l10n_es_aeat_mod340.model_l10n_es_aeat_mod340_investment
1353-#: field:l10n.es.aeat.mod340.report,investment:0
1354 msgid "Property Investment"
1355 msgstr "Inmovilizado"
1356
1357@@ -758,12 +826,13 @@
1358
1359 #. module: l10n_es_aeat_mod340
1360 #: report:report mod340:0
1361-#: report:report_mod340:0
1362 msgid "Número:"
1363 msgstr "Número:"
1364
1365 #. module: l10n_es_aeat_mod340
1366 #: field:l10n.es.aeat.mod340.report,name:0
1367+#: field:l10n.es.aeat.mod340.tax_line_intra,name:0
1368+#: field:l10n.es.aeat.mod340.tax_line_investment,name:0
1369 #: field:l10n.es.aeat.mod340.tax_line_issued,name:0
1370 #: field:l10n.es.aeat.mod340.tax_line_received,name:0
1371 msgid "Name"
1372@@ -783,25 +852,33 @@
1373 msgstr "NIF del representante legal"
1374
1375 #. module: l10n_es_aeat_mod340
1376+#: code:addons/l10n_es_aeat_mod340/account.py:208
1377+#, python-format
1378+msgid "The operation key is different.\n"
1379+""
1380+msgstr "La clave de operación es diferente.\n"
1381+""
1382+
1383+#. module: l10n_es_aeat_mod340
1384+#: field:l10n.es.aeat.mod340.report,investment:0
1385+msgid "Investment Goods"
1386+msgstr "Bienes de inversión"
1387+
1388+#. module: l10n_es_aeat_mod340
1389 #: report:report mod340:0
1390-#: report:report_mod340:0
1391 msgid "Tipo de soporte:"
1392 msgstr "Tipo de soporte:"
1393
1394 #. module: l10n_es_aeat_mod340
1395-#: field:l10n.es.aeat.mod340.report,attach_id:0
1396-msgid "BOE file"
1397-msgstr "Archivo BOE"
1398-
1399-#. module: l10n_es_aeat_mod340
1400 #: view:l10n.es.aeat.mod340.report:0
1401 msgid "Draft models"
1402 msgstr "Modelos en borrador"
1403
1404 #. module: l10n_es_aeat_mod340
1405-#: view:l10n.es.aeat.mod340.report:0
1406-msgid "Fiscal Year"
1407-msgstr "Año fiscal"
1408+#: code:addons/l10n_es_aeat_mod340/wizard/calculate_mod340_records.py:59
1409+#, python-format
1410+msgid "Invoice %s: Unable to determine the tax line %s source tax. The base code of the source tax may have been changed, please recompute the invoice taxes"
1411+msgstr "Factura %s: No se pudo determinar el impuesto origen de la línea de impuesto %s. El código de la base del impuesto origen puede haber sido cambiado, por favor recalcule los impuestos de la factura"
1412
1413 #. module: l10n_es_aeat_mod340
1414 #: view:account.invoice:0
1415@@ -809,16 +886,22 @@
1416 msgstr "Pagos"
1417
1418 #. module: l10n_es_aeat_mod340
1419-#: model:ir.model,name:l10n_es_aeat_mod340.model_l10n_es_aeat_mod340_received
1420-#: field:l10n.es.aeat.mod340.report,received:0
1421-msgid "Invoices Received"
1422-msgstr "Facturas recibidas"
1423-
1424-#. module: l10n_es_aeat_mod340
1425-#: code:addons/l10n_es_aeat_mod340/account.py:92
1426-#, python-format
1427-msgid "The info field is different.\n"
1428-msgstr "El campo descripción es diferente.\n"
1429+#: field:l10n.es.aeat.mod340.report,intracomunitarias:0
1430+msgid "Intra-community Operations"
1431+msgstr "Operaciones intracomunitarias"
1432+
1433+#. module: l10n_es_aeat_mod340
1434+#: sql_constraint:l10n.es.aeat.mod340.investment:0
1435+msgid "The prorata must be between 0 and 100."
1436+msgstr "La prorrata debe estar entre 0 y 100."
1437+
1438+#. module: l10n_es_aeat_mod340
1439+#: view:l10n.es.aeat.mod340.intracomunitarias:0
1440+#: view:l10n.es.aeat.mod340.investment:0
1441+#: view:l10n.es.aeat.mod340.issued:0
1442+#: view:l10n.es.aeat.mod340.received:0
1443+msgid "Total Base"
1444+msgstr "Total Base"
1445
1446 #. module: l10n_es_aeat_mod340
1447 #: selection:l10n.es.aeat.mod340.report,support_type:0
1448@@ -832,13 +915,16 @@
1449
1450 #. module: l10n_es_aeat_mod340
1451 #: report:report mod340:0
1452-#: report:report_mod340:0
1453 #: report:vat book:0
1454-#: report:vat_book:0
1455 msgid "Empresa"
1456 msgstr "Empresa"
1457
1458 #. module: l10n_es_aeat_mod340
1459+#: model:ir.model,name:l10n_es_aeat_mod340.model_l10n_es_aeat_mod340_export_to_boe
1460+msgid "Export Report to BOE Format"
1461+msgstr "Exportar a formato BOE"
1462+
1463+#. module: l10n_es_aeat_mod340
1464 #: selection:l10n.es.aeat.mod340.report,type:0
1465 msgid "Complementary"
1466 msgstr "Complementaria"
1467@@ -850,9 +936,7 @@
1468
1469 #. module: l10n_es_aeat_mod340
1470 #: report:report mod340:0
1471-#: report:report_mod340:0
1472 #: report:vat book:0
1473-#: report:vat_book:0
1474 msgid "Total factura"
1475 msgstr "Total factura"
1476
1477@@ -862,15 +946,20 @@
1478 msgstr "Archivo"
1479
1480 #. module: l10n_es_aeat_mod340
1481+#: view:account.tax:0
1482+msgid "onchange_type_tax_use(context)"
1483+msgstr "onchange_type_tax_use(context)"
1484+
1485+#. module: l10n_es_aeat_mod340
1486 #: report:report mod340:0
1487-#: report:report_mod340:0
1488 #: report:vat book:0
1489-#: report:vat_book:0
1490 msgid "FACTURAS DE ENTRADA"
1491 msgstr "FACTURAS DE ENTRADA"
1492
1493 #. module: l10n_es_aeat_mod340
1494+#: view:l10n.es.aeat.mod340.intracomunitarias:0
1495 #: field:l10n.es.aeat.mod340.intracomunitarias,total:0
1496+#: view:l10n.es.aeat.mod340.investment:0
1497 #: field:l10n.es.aeat.mod340.investment,total:0
1498 #: view:l10n.es.aeat.mod340.issued:0
1499 #: field:l10n.es.aeat.mod340.issued,total:0
1500@@ -881,130 +970,8 @@
1501 msgstr "Total"
1502
1503 #. module: l10n_es_aeat_mod340
1504-#: model:ir.model,name:l10n_es_aeat_mod340.model_account_tax_code_template
1505-msgid "Tax Code Template"
1506-msgstr "Plantilla códigos de impuestos"
1507-
1508-#. module: l10n_es_aeat_mod340
1509-#: code:addons/l10n_es_aeat_mod340/wizard/calculate_mod340_records.py:118
1510+#: code:addons/l10n_es_aeat_mod340/wizard/calculate_mod340_records.py:167
1511 #, python-format
1512 msgid "La siguiente empresa no tiene asignado nif:"
1513 msgstr "La siguiente empresa no tiene asignado nif:"
1514
1515-#~ msgid "May"
1516-#~ msgstr "Mayo"
1517-
1518-#~ msgid "June"
1519-#~ msgstr "Junio"
1520-
1521-#~ msgid "First quarter"
1522-#~ msgstr "Primer trimestre"
1523-
1524-#~ msgid "Third quarter"
1525-#~ msgstr "Tercer trimestre"
1526-
1527-#~ msgid "Second quarter"
1528-#~ msgstr "Segundo trimestre"
1529-
1530-#~ msgid "January"
1531-#~ msgstr "Enero"
1532-
1533-#~ msgid "Fourth quarter"
1534-#~ msgstr "Cuarto trimestre"
1535-
1536-#~ msgid "March"
1537-#~ msgstr "Marzo"
1538-
1539-#~ msgid "February"
1540-#~ msgstr "Febrero"
1541-
1542-#~ msgid "April"
1543-#~ msgstr "Abril"
1544-
1545-#~ msgid "August"
1546-#~ msgstr "Agosto"
1547-
1548-#~ msgid "September"
1549-#~ msgstr "Septiembre"
1550-
1551-#~ msgid "October"
1552-#~ msgstr "Octubre"
1553-
1554-#~ msgid "November"
1555-#~ msgstr "Noviembre"
1556-
1557-#~ msgid "December"
1558-#~ msgstr "Diciembre"
1559-
1560-#~ msgid "July"
1561-#~ msgstr "Julio"
1562-
1563-#, python-format
1564-#~ msgid "All real state records state code field must be filled."
1565-#~ msgstr ""
1566-#~ "Los registros de propiedades inmobiliarias deben ser rellenados manualmente."
1567-
1568-#~ msgid "Create and query AEAT Model 340 Reports"
1569-#~ msgstr "Crear informe del Model AEAT 340"
1570-
1571-#, python-format
1572-#~ msgid "Error!"
1573-#~ msgstr "Error!"
1574-
1575-#~ msgid "Confirm"
1576-#~ msgstr "Confirmar"
1577-
1578-#, python-format
1579-#~ msgid "340_report_%s.txt"
1580-#~ msgstr "340_report_%s.txt"
1581-
1582-#, python-format
1583-#~ msgid "%Y-%m-%d"
1584-#~ msgstr "%d-%m-%Y"
1585-
1586-#~ msgid "Export to BOE"
1587-#~ msgstr "Exportar al BOE"
1588-
1589-#, python-format
1590-#~ msgid "The periods selected don't belong to the fiscal year %s"
1591-#~ msgstr "Los periodos seleccionados no pertenecen al año fiscal %s"
1592-
1593-#~ msgid "Declaration Number"
1594-#~ msgstr "Número de declaración"
1595-
1596-#~ msgid "Canceled"
1597-#~ msgstr "Cancelado"
1598-
1599-#~ msgid "Calculate"
1600-#~ msgstr "Calcular"
1601-
1602-#, python-format
1603-#~ msgid "All partner state code field must be filled."
1604-#~ msgstr "Todos las empresas deben tener provincia."
1605-
1606-#, python-format
1607-#~ msgid "All partner vat number field must be filled."
1608-#~ msgstr "Todas las empresas deben tener CIF/NIF."
1609-
1610-#~ msgid "Processing"
1611-#~ msgstr "Procesando"
1612-
1613-#~ msgid "Cancel"
1614-#~ msgstr "Cancelar"
1615-
1616-#~ msgid "Recalculate"
1617-#~ msgstr "Recalcular"
1618-
1619-#~ msgid "AEAT Model 340"
1620-#~ msgstr "Modelo AEAT 340"
1621-
1622-#~ msgid ""
1623-#~ "The declaration will include partners with the total of operations over this "
1624-#~ "limit"
1625-#~ msgstr "La declaración incluye las empresas que no superen este limite"
1626-
1627-#~ msgid "Previous Declaration Number"
1628-#~ msgstr "Número de la declaración anterior"
1629-
1630-#~ msgid "Period"
1631-#~ msgstr "Periodo"
1632
1633=== modified file 'l10n_es_aeat_mod340/i18n/l10n_es_aeat_mod340.pot'
1634--- l10n_es_aeat_mod340/i18n/l10n_es_aeat_mod340.pot 2014-02-14 18:31:18 +0000
1635+++ l10n_es_aeat_mod340/i18n/l10n_es_aeat_mod340.pot 2014-06-01 16:57:08 +0000
1636@@ -4,10 +4,10 @@
1637 #
1638 msgid ""
1639 msgstr ""
1640-"Project-Id-Version: OpenERP Server 7.0\n"
1641+"Project-Id-Version: OpenERP Server 7.0-20140331-231318\n"
1642 "Report-Msgid-Bugs-To: \n"
1643-"POT-Creation-Date: 2014-02-02 18:10+0000\n"
1644-"PO-Revision-Date: 2014-02-02 18:10+0000\n"
1645+"POT-Creation-Date: 2014-04-01 10:50+0000\n"
1646+"PO-Revision-Date: 2014-04-01 10:50+0000\n"
1647 "Last-Translator: <>\n"
1648 "Language-Team: \n"
1649 "MIME-Version: 1.0\n"
1650@@ -17,7 +17,7 @@
1651
1652 #. module: l10n_es_aeat_mod340
1653 #: report:report mod340:0
1654-#: report:vat_book:0
1655+#: report:vat book:0
1656 msgid "FACTURAS DE SALIDA"
1657 msgstr ""
1658
1659@@ -28,9 +28,7 @@
1660
1661 #. module: l10n_es_aeat_mod340
1662 #: report:report mod340:0
1663-#: report:report_mod340:0
1664 #: report:vat book:0
1665-#: report:vat_book:0
1666 msgid "Compañía:"
1667 msgstr ""
1668
1669@@ -50,10 +48,13 @@
1670 msgstr ""
1671
1672 #. module: l10n_es_aeat_mod340
1673-#: code:addons/l10n_es_aeat_mod340/account.py:89
1674-#, python-format
1675-msgid "The code field is different.\n"
1676-""
1677+#: help:l10n.es.aeat.mod340.report,investment_goods_prorating:0
1678+msgid "If checked, the investment goods invoices will be exported in their ledger. If not, they will be exported as received invoices"
1679+msgstr ""
1680+
1681+#. module: l10n_es_aeat_mod340
1682+#: field:l10n.es.aeat.mod340.report,investment_goods_prorating:0
1683+msgid "Investment goods prorating"
1684 msgstr ""
1685
1686 #. module: l10n_es_aeat_mod340
1687@@ -67,15 +68,15 @@
1688 msgstr ""
1689
1690 #. module: l10n_es_aeat_mod340
1691-#: code:addons/l10n_es_aeat_mod340/account.py:161
1692+#: code:addons/l10n_es_aeat_mod340/wizard/calculate_mod340_records.py:126
1693 #, python-format
1694-msgid "Created tax code %s.\n"
1695-""
1696+msgid "The periods selected don't belong to the fiscal year %s"
1697 msgstr ""
1698
1699 #. module: l10n_es_aeat_mod340
1700-#: view:l10n.es.aeat.mod340.report:0
1701-msgid "Susbtitutive/complementary declaration"
1702+#: code:addons/l10n_es_aeat_mod340/wizard/calculate_mod340_records.py:87
1703+#, python-format
1704+msgid "No match found for tax percentage %s"
1705 msgstr ""
1706
1707 #. module: l10n_es_aeat_mod340
1708@@ -85,17 +86,12 @@
1709 msgstr ""
1710
1711 #. module: l10n_es_aeat_mod340
1712-#: field:l10n.es.aeat.mod340.report,total_sharetax:0
1713-msgid "Total Share Tax"
1714-msgstr ""
1715-
1716-#. module: l10n_es_aeat_mod340
1717 #: field:l10n.es.aeat.mod340.report,number_records:0
1718 msgid "Records"
1719 msgstr ""
1720
1721 #. module: l10n_es_aeat_mod340
1722-#: code:addons/l10n_es_aeat_mod340/wizard/export_mod340_to_boe.py:390
1723+#: code:addons/l10n_es_aeat_mod340/wizard/export_mod340_to_boe.py:411
1724 #, python-format
1725 msgid "The type 2 received record must be 500 characters long for each Vat registry"
1726 msgstr ""
1727@@ -115,6 +111,8 @@
1728 #: field:l10n.es.aeat.mod340.investment,base_tax:0
1729 #: field:l10n.es.aeat.mod340.issued,base_tax:0
1730 #: field:l10n.es.aeat.mod340.received,base_tax:0
1731+#: field:l10n.es.aeat.mod340.tax_line_intra,base_amount:0
1732+#: field:l10n.es.aeat.mod340.tax_line_investment,base_amount:0
1733 #: field:l10n.es.aeat.mod340.tax_line_issued,base_amount:0
1734 #: field:l10n.es.aeat.mod340.tax_line_received,base_amount:0
1735 msgid "Base tax bill"
1736@@ -127,9 +125,7 @@
1737
1738 #. module: l10n_es_aeat_mod340
1739 #: report:report mod340:0
1740-#: report:report_mod340:0
1741 #: report:vat book:0
1742-#: report:vat_book:0
1743 msgid "Apellidos y nombre de contacto:"
1744 msgstr ""
1745
1746@@ -140,7 +136,6 @@
1747
1748 #. module: l10n_es_aeat_mod340
1749 #: field:account.tax.code,mod340:0
1750-#: field:account.tax.code.template,mod340:0
1751 msgid "Include in mod340"
1752 msgstr ""
1753
1754@@ -175,7 +170,8 @@
1755 msgstr ""
1756
1757 #. module: l10n_es_aeat_mod340
1758-#: code:addons/l10n_es_aeat_mod340/wizard/export_mod340_to_boe.py:283
1759+#: code:addons/l10n_es_aeat_mod340/wizard/export_mod340_to_boe.py:291
1760+#: code:addons/l10n_es_aeat_mod340/wizard/export_mod340_to_boe.py:529
1761 #, python-format
1762 msgid "The type 2 issued record must be 500 characters long for each Vat registry"
1763 msgstr ""
1764@@ -186,25 +182,21 @@
1765 msgstr ""
1766
1767 #. module: l10n_es_aeat_mod340
1768-#: code:addons/l10n_es_aeat_mod340/account.py:170
1769-#, python-format
1770-msgid "Updated tax code %s.\n"
1771-""
1772+#: model:ir.model,name:l10n_es_aeat_mod340.model_l10n_es_aeat_mod340_report
1773+#: field:l10n.es.aeat.mod340.intracomunitarias,mod340_id:0
1774+#: field:l10n.es.aeat.mod340.investment,mod340_id:0
1775+#: field:l10n.es.aeat.mod340.issued,mod340_id:0
1776+#: field:l10n.es.aeat.mod340.received,mod340_id:0
1777+#: view:l10n.es.aeat.mod340.report:0
1778+msgid "Model 340"
1779 msgstr ""
1780
1781 #. module: l10n_es_aeat_mod340
1782 #: model:ir.model,name:l10n_es_aeat_mod340.model_l10n_es_aeat_mod340_intracomunitarias
1783-#: field:l10n.es.aeat.mod340.report,intracomunitarias:0
1784 msgid "Operations Intracomunitarias"
1785 msgstr ""
1786
1787 #. module: l10n_es_aeat_mod340
1788-#: field:l10n.es.aeat.mod340.tax_line_issued,tax_amount:0
1789-#: field:l10n.es.aeat.mod340.tax_line_received,tax_amount:0
1790-msgid "Tax amount"
1791-msgstr ""
1792-
1793-#. module: l10n_es_aeat_mod340
1794 #: view:l10n.es.aeat.mod340.report:0
1795 #: field:l10n.es.aeat.mod340.report,ean13:0
1796 msgid "Electronic Code VAT reverse charge"
1797@@ -216,36 +208,20 @@
1798 msgstr ""
1799
1800 #. module: l10n_es_aeat_mod340
1801-#: code:addons/l10n_es_aeat_mod340/account.py:98
1802-#, python-format
1803-msgid "The Mod 340 field is different.\n"
1804-""
1805-msgstr ""
1806-
1807-#. module: l10n_es_aeat_mod340
1808 #: view:l10n.es.aeat.mod340.report:0
1809 msgid "Identification"
1810 msgstr ""
1811
1812 #. module: l10n_es_aeat_mod340
1813-#: view:l10n.es.aeat.mod340.report:0
1814-msgid "295"
1815-msgstr ""
1816-
1817-#. module: l10n_es_aeat_mod340
1818+#: view:l10n.es.aeat.mod340.intracomunitarias:0
1819+#: view:l10n.es.aeat.mod340.investment:0
1820 #: view:l10n.es.aeat.mod340.issued:0
1821 #: view:l10n.es.aeat.mod340.received:0
1822 msgid "Total Tax"
1823 msgstr ""
1824
1825 #. module: l10n_es_aeat_mod340
1826-#: model:ir.actions.report.xml,name:l10n_es_aeat_mod340.report_mod340_action
1827-msgid "mod340 report"
1828-msgstr ""
1829-
1830-#. module: l10n_es_aeat_mod340
1831 #: report:vat book:0
1832-#: report:vat_book:0
1833 msgid "LIBRO DE IVA"
1834 msgstr ""
1835
1836@@ -255,9 +231,41 @@
1837 msgstr ""
1838
1839 #. module: l10n_es_aeat_mod340
1840-#: code:addons/l10n_es_aeat_mod340/wizard/calculate_mod340_records.py:66
1841-#, python-format
1842-msgid "This company dont have NIF"
1843+#: field:l10n.es.aeat.mod340.tax_line_intra,tax_amount:0
1844+#: field:l10n.es.aeat.mod340.tax_line_investment,tax_amount:0
1845+#: field:l10n.es.aeat.mod340.tax_line_issued,tax_amount:0
1846+#: field:l10n.es.aeat.mod340.tax_line_received,tax_amount:0
1847+msgid "Tax amount"
1848+msgstr ""
1849+
1850+#. module: l10n_es_aeat_mod340
1851+#: field:account.tax,ledger_key:0
1852+#: field:account.tax,ledger_key_in:0
1853+#: field:account.tax,ledger_key_out:0
1854+#: field:account.tax.template,ledger_key:0
1855+#: field:l10n.es.aeat.mod340.intracomunitarias,ledger_key:0
1856+#: field:l10n.es.aeat.mod340.investment,ledger_key:0
1857+#: field:l10n.es.aeat.mod340.issued,ledger_key:0
1858+#: field:l10n.es.aeat.mod340.received,ledger_key:0
1859+msgid "Ledger Key"
1860+msgstr ""
1861+
1862+#. module: l10n_es_aeat_mod340
1863+#: field:l10n.es.aeat.mod340.tax_line_intra,surcharge_percentage:0
1864+#: field:l10n.es.aeat.mod340.tax_line_investment,surcharge_percentage:0
1865+#: field:l10n.es.aeat.mod340.tax_line_issued,surcharge_percentage:0
1866+#: field:l10n.es.aeat.mod340.tax_line_received,surcharge_percentage:0
1867+msgid "Surcharge percentage"
1868+msgstr ""
1869+
1870+#. module: l10n_es_aeat_mod340
1871+#: model:ir.model,name:l10n_es_aeat_mod340.model_account_tax
1872+msgid "Tax"
1873+msgstr ""
1874+
1875+#. module: l10n_es_aeat_mod340
1876+#: view:l10n.es.aeat.mod340.report:0
1877+msgid "Fiscal Year"
1878 msgstr ""
1879
1880 #. module: l10n_es_aeat_mod340
1881@@ -276,6 +284,11 @@
1882 msgstr ""
1883
1884 #. module: l10n_es_aeat_mod340
1885+#: model:ir.model,name:l10n_es_aeat_mod340.model_account_tax_template
1886+msgid "Templates for Taxes"
1887+msgstr ""
1888+
1889+#. module: l10n_es_aeat_mod340
1890 #: model:ir.ui.menu,name:l10n_es_aeat_mod340.menu_aeat_mod340_report
1891 msgid "AEAT 340 Model"
1892 msgstr ""
1893@@ -290,7 +303,6 @@
1894
1895 #. module: l10n_es_aeat_mod340
1896 #: report:vat book:0
1897-#: report:vat_book:0
1898 msgid "Nº de factura"
1899 msgstr ""
1900
1901@@ -303,6 +315,16 @@
1902 msgstr ""
1903
1904 #. module: l10n_es_aeat_mod340
1905+#: field:l10n.es.aeat.mod340.tax_line_intra,surcharge_amount:0
1906+#: field:l10n.es.aeat.mod340.tax_line_investment,surcharge_amount:0
1907+#: field:l10n.es.aeat.mod340.tax_line_issued,surcharge_amount:0
1908+#: field:l10n.es.aeat.mod340.tax_line_received,surcharge_amount:0
1909+msgid "Surcharge amount"
1910+msgstr ""
1911+
1912+#. module: l10n_es_aeat_mod340
1913+#: view:account.tax:0
1914+#: view:account.tax.template:0
1915 #: model:ir.actions.report.xml,name:l10n_es_aeat_mod340.report_mod340
1916 msgid "Modelo 340"
1917 msgstr ""
1918@@ -318,7 +340,7 @@
1919 msgstr ""
1920
1921 #. module: l10n_es_aeat_mod340
1922-#: code:addons/l10n_es_aeat_mod340/wizard/export_mod340_to_boe.py:105
1923+#: code:addons/l10n_es_aeat_mod340/wizard/export_mod340_to_boe.py:113
1924 #, python-format
1925 msgid "The period hasn't a valid Mod340 period"
1926 msgstr ""
1927@@ -334,32 +356,24 @@
1928 msgstr ""
1929
1930 #. module: l10n_es_aeat_mod340
1931-#: model:ir.model,name:l10n_es_aeat_mod340.model_l10n_es_aeat_mod340_export_to_boe
1932-msgid "Export AEAT Model 340 to BOE format"
1933-msgstr ""
1934-
1935-#. module: l10n_es_aeat_mod340
1936-#: code:addons/l10n_es_aeat_mod340/wizard/export_mod340_to_boe.py:126
1937+#: code:addons/l10n_es_aeat_mod340/wizard/export_mod340_to_boe.py:134
1938 #, python-format
1939 msgid "The type 1 record must be 500 characters long"
1940 msgstr ""
1941
1942 #. module: l10n_es_aeat_mod340
1943 #: report:report mod340:0
1944-#: report:report_mod340:0
1945 #: report:vat book:0
1946-#: report:vat_book:0
1947 msgid "CIF/NIF:"
1948 msgstr ""
1949
1950 #. module: l10n_es_aeat_mod340
1951-#: model:ir.model,name:l10n_es_aeat_mod340.model_l10n_es_aeat_mod340_tax_line_issued
1952-msgid "Mod340 vat lines issued"
1953+#: field:l10n.es.aeat.mod340.report,calculation_date:0
1954+msgid "Calculation date"
1955 msgstr ""
1956
1957 #. module: l10n_es_aeat_mod340
1958 #: report:report mod340:0
1959-#: report:report_mod340:0
1960 msgid "CIF/NIF del representante legal:"
1961 msgstr ""
1962
1963@@ -373,21 +387,13 @@
1964 msgstr ""
1965
1966 #. module: l10n_es_aeat_mod340
1967-#: code:addons/l10n_es_aeat_mod340/wizard/calculate_mod340_records.py:80
1968-#, python-format
1969-msgid "The periods selected don't belong to the fiscal year %s"
1970-msgstr ""
1971-
1972-#. module: l10n_es_aeat_mod340
1973 #: model:ir.actions.act_window,help:l10n_es_aeat_mod340.action_l10n_es_aeat_mod340_report
1974 msgid "Create and query AEAT Model 340 reports"
1975 msgstr ""
1976
1977 #. module: l10n_es_aeat_mod340
1978 #: report:report mod340:0
1979-#: report:report_mod340:0
1980 #: report:vat book:0
1981-#: report:vat_book:0
1982 msgid "Cuota impuesto"
1983 msgstr ""
1984
1985@@ -397,31 +403,42 @@
1986 msgstr ""
1987
1988 #. module: l10n_es_aeat_mod340
1989+#: view:l10n.es.aeat.mod340.report:0
1990+msgid "Other intracommunity operations"
1991+msgstr ""
1992+
1993+#. module: l10n_es_aeat_mod340
1994 #: report:report mod340:0
1995-#: report:report_mod340:0
1996 msgid "MODELO AEAT 340"
1997 msgstr ""
1998
1999 #. module: l10n_es_aeat_mod340
2000-#: code:addons/l10n_es_aeat_mod340/account.py:95
2001-#, python-format
2002-msgid "The sign field is different.\n"
2003-""
2004+#: view:l10n.es.aeat.mod340.investment:0
2005+#: view:l10n.es.aeat.mod340.report:0
2006+msgid "Investment goods"
2007+msgstr ""
2008+
2009+#. module: l10n_es_aeat_mod340
2010+#: field:l10n.es.aeat.mod340.export_to_boe,state:0
2011+msgid "unknown"
2012+msgstr ""
2013+
2014+#. module: l10n_es_aeat_mod340
2015+#: model:ir.model,name:l10n_es_aeat_mod340.model_l10n_es_aeat_mod340_tax_line_investment
2016+msgid "Mod340 vat lines investment"
2017 msgstr ""
2018
2019 #. module: l10n_es_aeat_mod340
2020 #: report:report mod340:0
2021-#: report:report_mod340:0
2022 msgid "Tipo de declaración"
2023 msgstr ""
2024
2025 #. module: l10n_es_aeat_mod340
2026-#: field:l10n.es.aeat.mod340.report,calculation_date:0
2027-msgid "Calculation date"
2028+#: model:ir.model,name:l10n_es_aeat_mod340.model_l10n_es_aeat_mod340_tax_line_issued
2029+msgid "Mod340 vat lines issued"
2030 msgstr ""
2031
2032 #. module: l10n_es_aeat_mod340
2033-#: model:ir.actions.report.xml,name:l10n_es_aeat_mod340.report_vat_book_action
2034 #: model:ir.actions.report.xml,name:l10n_es_aeat_mod340.vat_book
2035 msgid "Vat Book"
2036 msgstr ""
2037@@ -432,10 +449,8 @@
2038 msgstr ""
2039
2040 #. module: l10n_es_aeat_mod340
2041-#: code:addons/l10n_es_aeat_mod340/account.py:185
2042-#, python-format
2043-msgid "Tax code %s: The parent tax code %s can not be set.\n"
2044-""
2045+#: field:l10n.es.aeat.mod340.report,total_sharetax:0
2046+msgid "Total Share Tax"
2047 msgstr ""
2048
2049 #. module: l10n_es_aeat_mod340
2050@@ -445,9 +460,7 @@
2051
2052 #. module: l10n_es_aeat_mod340
2053 #: report:report mod340:0
2054-#: report:report_mod340:0
2055 #: report:vat book:0
2056-#: report:vat_book:0
2057 msgid "Fecha"
2058 msgstr ""
2059
2060@@ -457,14 +470,20 @@
2061 msgstr ""
2062
2063 #. module: l10n_es_aeat_mod340
2064-#: model:ir.model,name:l10n_es_aeat_mod340.model_l10n_es_aeat_mod340
2065-#: model:ir.model,name:l10n_es_aeat_mod340.model_l10n_es_aeat_mod340_report
2066-#: field:l10n.es.aeat.mod340.intracomunitarias,mod340_id:0
2067-#: field:l10n.es.aeat.mod340.investment,mod340_id:0
2068-#: field:l10n.es.aeat.mod340.issued,mod340_id:0
2069-#: field:l10n.es.aeat.mod340.received,mod340_id:0
2070-#: view:l10n.es.aeat.mod340.report:0
2071-msgid "Model 340"
2072+#: field:l10n.es.aeat.mod340.investment,prorata:0
2073+msgid "Definitive yearly prorata"
2074+msgstr ""
2075+
2076+#. module: l10n_es_aeat_mod340
2077+#: code:addons/l10n_es_aeat_mod340/wizard/calculate_mod340_records.py:115
2078+#, python-format
2079+msgid "This company dont have NIF"
2080+msgstr ""
2081+
2082+#. module: l10n_es_aeat_mod340
2083+#: model:ir.model,name:l10n_es_aeat_mod340.model_l10n_es_aeat_mod340_received
2084+#: field:l10n.es.aeat.mod340.report,received:0
2085+msgid "Invoices Received"
2086 msgstr ""
2087
2088 #. module: l10n_es_aeat_mod340
2089@@ -484,14 +503,14 @@
2090 msgstr ""
2091
2092 #. module: l10n_es_aeat_mod340
2093-#: view:l10n.es.aeat.mod340.issued:0
2094-#: view:l10n.es.aeat.mod340.received:0
2095-msgid "Total Base"
2096+#: code:addons/l10n_es_aeat_mod340/account.py:211
2097+#, python-format
2098+msgid "The ledger key is different.\n"
2099+""
2100 msgstr ""
2101
2102 #. module: l10n_es_aeat_mod340
2103 #: report:report mod340:0
2104-#: report:report_mod340:0
2105 msgid "Número de la declaración anterior:"
2106 msgstr ""
2107
2108@@ -511,18 +530,35 @@
2109 msgstr ""
2110
2111 #. module: l10n_es_aeat_mod340
2112-#: field:l10n.es.aeat.mod340.export_to_boe,state:0
2113-msgid "unknown"
2114-msgstr ""
2115-
2116-#. module: l10n_es_aeat_mod340
2117-#: field:l10n.es.aeat.mod340.report,contact_phone:0
2118-msgid "Phone"
2119-msgstr ""
2120-
2121-#. module: l10n_es_aeat_mod340
2122-#: field:account.invoice,last_ticket:0
2123-msgid "Last ticket"
2124+#: view:l10n.es.aeat.mod340.tax_line_investment:0
2125+msgid "Tax line investment goods"
2126+msgstr ""
2127+
2128+#. module: l10n_es_aeat_mod340
2129+#: report:report mod340:0
2130+#: report:vat book:0
2131+msgid "Teléfono de contacto:"
2132+msgstr ""
2133+
2134+#. module: l10n_es_aeat_mod340
2135+#: field:l10n.es.aeat.mod340.tax_line_investment,goods_identification:0
2136+msgid "Investment goods identification"
2137+msgstr ""
2138+
2139+#. module: l10n_es_aeat_mod340
2140+#: field:l10n.es.aeat.mod340.investment,use_date:0
2141+msgid "Goods use start date"
2142+msgstr ""
2143+
2144+#. module: l10n_es_aeat_mod340
2145+#: code:addons/l10n_es_aeat_mod340/wizard/calculate_mod340_records.py:260
2146+#, python-format
2147+msgid "Invoice %s: Unable to determine the surcharged tax because it is not mapped in the partner's fiscal position %s"
2148+msgstr ""
2149+
2150+#. module: l10n_es_aeat_mod340
2151+#: view:l10n.es.aeat.mod340.tax_line_intra:0
2152+msgid "Tax line intracommunity"
2153 msgstr ""
2154
2155 #. module: l10n_es_aeat_mod340
2156@@ -537,13 +573,16 @@
2157
2158 #. module: l10n_es_aeat_mod340
2159 #: report:report mod340:0
2160-#: report:report_mod340:0
2161 #: report:vat book:0
2162-#: report:vat_book:0
2163 msgid "Ejercicio fiscal:"
2164 msgstr ""
2165
2166 #. module: l10n_es_aeat_mod340
2167+#: field:account.invoice,last_ticket:0
2168+msgid "Last ticket"
2169+msgstr ""
2170+
2171+#. module: l10n_es_aeat_mod340
2172 #: field:l10n.es.aeat.mod340.intracomunitarias,partner_country_code:0
2173 #: field:l10n.es.aeat.mod340.investment,partner_country_code:0
2174 #: field:l10n.es.aeat.mod340.issued,partner_country_code:0
2175@@ -572,12 +611,20 @@
2176 msgstr ""
2177
2178 #. module: l10n_es_aeat_mod340
2179-#: code:addons/l10n_es_aeat_mod340/wizard/calculate_mod340_records.py:79
2180+#: code:addons/l10n_es_aeat_mod340/wizard/calculate_mod340_records.py:58
2181+#: code:addons/l10n_es_aeat_mod340/wizard/calculate_mod340_records.py:86
2182+#: code:addons/l10n_es_aeat_mod340/wizard/calculate_mod340_records.py:125
2183+#: code:addons/l10n_es_aeat_mod340/wizard/calculate_mod340_records.py:259
2184 #, python-format
2185 msgid "Error"
2186 msgstr ""
2187
2188 #. module: l10n_es_aeat_mod340
2189+#: view:l10n.es.aeat.mod340.report:0
2190+msgid "Susbtitutive/complementary declaration"
2191+msgstr ""
2192+
2193+#. module: l10n_es_aeat_mod340
2194 #: field:l10n.es.aeat.mod340.intracomunitarias,representative_vat:0
2195 #: field:l10n.es.aeat.mod340.investment,representative_vat:0
2196 #: field:l10n.es.aeat.mod340.issued,representative_vat:0
2197@@ -597,14 +644,19 @@
2198 msgstr ""
2199
2200 #. module: l10n_es_aeat_mod340
2201+#: view:l10n.es.aeat.mod340.intracomunitarias:0
2202+msgid "Other Intracommunity Operations"
2203+msgstr ""
2204+
2205+#. module: l10n_es_aeat_mod340
2206 #: report:report mod340:0
2207-#: report:report_mod340:0
2208 #: report:vat book:0
2209-#: report:vat_book:0
2210 msgid "Base imponible"
2211 msgstr ""
2212
2213 #. module: l10n_es_aeat_mod340
2214+#: field:l10n.es.aeat.mod340.tax_line_intra,invoice_record_id:0
2215+#: field:l10n.es.aeat.mod340.tax_line_investment,invoice_record_id:0
2216 #: field:l10n.es.aeat.mod340.tax_line_received,invoice_record_id:0
2217 msgid "Invoice received"
2218 msgstr ""
2219@@ -651,19 +703,17 @@
2220
2221 #. module: l10n_es_aeat_mod340
2222 #: report:report mod340:0
2223-#: report:report_mod340:0
2224-#: report:vat book:0
2225-#: report:vat_book:0
2226-msgid "Teléfono de contacto:"
2227-msgstr ""
2228-
2229-#. module: l10n_es_aeat_mod340
2230-#: report:report mod340:0
2231-#: report:report_mod340:0
2232 msgid "Código electrónico autoliquidación IVA:"
2233 msgstr ""
2234
2235 #. module: l10n_es_aeat_mod340
2236+#: help:account.tax,ledger_key:0
2237+#: help:account.tax,ledger_key_in:0
2238+#: help:account.tax,ledger_key_out:0
2239+msgid "Determines to which ledger the invoice with this tax will be assigned. Setting a value makes the tax to be accounted in 340 declaration"
2240+msgstr ""
2241+
2242+#. module: l10n_es_aeat_mod340
2243 #: selection:res.partner,vat_type:0
2244 msgid "5 - Certificado de residencia fiscal"
2245 msgstr ""
2246@@ -675,6 +725,8 @@
2247 msgstr ""
2248
2249 #. module: l10n_es_aeat_mod340
2250+#: field:l10n.es.aeat.mod340.tax_line_intra,tax_percentage:0
2251+#: field:l10n.es.aeat.mod340.tax_line_investment,tax_percentage:0
2252 #: field:l10n.es.aeat.mod340.tax_line_issued,tax_percentage:0
2253 #: field:l10n.es.aeat.mod340.tax_line_received,tax_percentage:0
2254 msgid "Tax percentage"
2255@@ -686,6 +738,11 @@
2256 msgstr ""
2257
2258 #. module: l10n_es_aeat_mod340
2259+#: model:ir.model,name:l10n_es_aeat_mod340.model_l10n_es_aeat_mod340_tax_line_intra
2260+msgid "Mod340 vat lines intra-community"
2261+msgstr ""
2262+
2263+#. module: l10n_es_aeat_mod340
2264 #: help:l10n.es.aeat.mod340.report,number_records:0
2265 #: help:l10n.es.aeat.mod340.report,total:0
2266 #: help:l10n.es.aeat.mod340.report,total_sharetax:0
2267@@ -701,14 +758,12 @@
2268
2269 #. module: l10n_es_aeat_mod340
2270 #: report:report mod340:0
2271-#: report:report_mod340:0
2272 #: report:vat book:0
2273-#: report:vat_book:0
2274 msgid "CIF/NIF"
2275 msgstr ""
2276
2277 #. module: l10n_es_aeat_mod340
2278-#: code:addons/l10n_es_aeat_mod340/wizard/calculate_mod340_records.py:196
2279+#: code:addons/l10n_es_aeat_mod340/wizard/calculate_mod340_records.py:275
2280 #, python-format
2281 msgid "Invoice %s, Amount untaxed Lines %.2f do not correspond to AmountUntaxed on Invoice %.2f"
2282 msgstr ""
2283@@ -719,10 +774,13 @@
2284 msgstr ""
2285
2286 #. module: l10n_es_aeat_mod340
2287+#: view:l10n.es.aeat.mod340.report:0
2288+msgid "322"
2289+msgstr ""
2290+
2291+#. module: l10n_es_aeat_mod340
2292 #: report:report mod340:0
2293-#: report:report_mod340:0
2294 #: report:vat book:0
2295-#: report:vat_book:0
2296 msgid "Número de factura"
2297 msgstr ""
2298
2299@@ -740,8 +798,17 @@
2300 msgstr ""
2301
2302 #. module: l10n_es_aeat_mod340
2303+#: field:account.tax,operation_key:0
2304+#: field:account.tax.template,operation_key:0
2305+#: field:l10n.es.aeat.mod340.intracomunitarias,operation_key:0
2306+#: field:l10n.es.aeat.mod340.investment,operation_key:0
2307+#: field:l10n.es.aeat.mod340.issued,operation_key:0
2308+#: field:l10n.es.aeat.mod340.received,operation_key:0
2309+msgid "Operation Key"
2310+msgstr ""
2311+
2312+#. module: l10n_es_aeat_mod340
2313 #: model:ir.model,name:l10n_es_aeat_mod340.model_l10n_es_aeat_mod340_investment
2314-#: field:l10n.es.aeat.mod340.report,investment:0
2315 msgid "Property Investment"
2316 msgstr ""
2317
2318@@ -752,12 +819,13 @@
2319
2320 #. module: l10n_es_aeat_mod340
2321 #: report:report mod340:0
2322-#: report:report_mod340:0
2323 msgid "Número:"
2324 msgstr ""
2325
2326 #. module: l10n_es_aeat_mod340
2327 #: field:l10n.es.aeat.mod340.report,name:0
2328+#: field:l10n.es.aeat.mod340.tax_line_intra,name:0
2329+#: field:l10n.es.aeat.mod340.tax_line_investment,name:0
2330 #: field:l10n.es.aeat.mod340.tax_line_issued,name:0
2331 #: field:l10n.es.aeat.mod340.tax_line_received,name:0
2332 msgid "Name"
2333@@ -777,24 +845,31 @@
2334 msgstr ""
2335
2336 #. module: l10n_es_aeat_mod340
2337+#: code:addons/l10n_es_aeat_mod340/account.py:208
2338+#, python-format
2339+msgid "The operation key is different.\n"
2340+""
2341+msgstr ""
2342+
2343+#. module: l10n_es_aeat_mod340
2344+#: field:l10n.es.aeat.mod340.report,investment:0
2345+msgid "Investment Goods"
2346+msgstr ""
2347+
2348+#. module: l10n_es_aeat_mod340
2349 #: report:report mod340:0
2350-#: report:report_mod340:0
2351 msgid "Tipo de soporte:"
2352 msgstr ""
2353
2354 #. module: l10n_es_aeat_mod340
2355-#: field:l10n.es.aeat.mod340.report,attach_id:0
2356-msgid "BOE file"
2357-msgstr ""
2358-
2359-#. module: l10n_es_aeat_mod340
2360 #: view:l10n.es.aeat.mod340.report:0
2361 msgid "Draft models"
2362 msgstr ""
2363
2364 #. module: l10n_es_aeat_mod340
2365-#: view:l10n.es.aeat.mod340.report:0
2366-msgid "Fiscal Year"
2367+#: code:addons/l10n_es_aeat_mod340/wizard/calculate_mod340_records.py:59
2368+#, python-format
2369+msgid "Invoice %s: Unable to determine the tax line %s source tax. The base code of the source tax may have been changed, please recompute the invoice taxes"
2370 msgstr ""
2371
2372 #. module: l10n_es_aeat_mod340
2373@@ -803,16 +878,21 @@
2374 msgstr ""
2375
2376 #. module: l10n_es_aeat_mod340
2377-#: model:ir.model,name:l10n_es_aeat_mod340.model_l10n_es_aeat_mod340_received
2378-#: field:l10n.es.aeat.mod340.report,received:0
2379-msgid "Invoices Received"
2380-msgstr ""
2381-
2382-#. module: l10n_es_aeat_mod340
2383-#: code:addons/l10n_es_aeat_mod340/account.py:92
2384-#, python-format
2385-msgid "The info field is different.\n"
2386-""
2387+#: field:l10n.es.aeat.mod340.report,intracomunitarias:0
2388+msgid "Intra-community Operations"
2389+msgstr ""
2390+
2391+#. module: l10n_es_aeat_mod340
2392+#: sql_constraint:l10n.es.aeat.mod340.investment:0
2393+msgid "The prorata must be between 0 and 100."
2394+msgstr ""
2395+
2396+#. module: l10n_es_aeat_mod340
2397+#: view:l10n.es.aeat.mod340.intracomunitarias:0
2398+#: view:l10n.es.aeat.mod340.investment:0
2399+#: view:l10n.es.aeat.mod340.issued:0
2400+#: view:l10n.es.aeat.mod340.received:0
2401+msgid "Total Base"
2402 msgstr ""
2403
2404 #. module: l10n_es_aeat_mod340
2405@@ -827,13 +907,16 @@
2406
2407 #. module: l10n_es_aeat_mod340
2408 #: report:report mod340:0
2409-#: report:report_mod340:0
2410 #: report:vat book:0
2411-#: report:vat_book:0
2412 msgid "Empresa"
2413 msgstr ""
2414
2415 #. module: l10n_es_aeat_mod340
2416+#: model:ir.model,name:l10n_es_aeat_mod340.model_l10n_es_aeat_mod340_export_to_boe
2417+msgid "Export Report to BOE Format"
2418+msgstr ""
2419+
2420+#. module: l10n_es_aeat_mod340
2421 #: selection:l10n.es.aeat.mod340.report,type:0
2422 msgid "Complementary"
2423 msgstr ""
2424@@ -845,9 +928,7 @@
2425
2426 #. module: l10n_es_aeat_mod340
2427 #: report:report mod340:0
2428-#: report:report_mod340:0
2429 #: report:vat book:0
2430-#: report:vat_book:0
2431 msgid "Total factura"
2432 msgstr ""
2433
2434@@ -857,15 +938,20 @@
2435 msgstr ""
2436
2437 #. module: l10n_es_aeat_mod340
2438+#: view:account.tax:0
2439+msgid "onchange_type_tax_use(context)"
2440+msgstr ""
2441+
2442+#. module: l10n_es_aeat_mod340
2443 #: report:report mod340:0
2444-#: report:report_mod340:0
2445 #: report:vat book:0
2446-#: report:vat_book:0
2447 msgid "FACTURAS DE ENTRADA"
2448 msgstr ""
2449
2450 #. module: l10n_es_aeat_mod340
2451+#: view:l10n.es.aeat.mod340.intracomunitarias:0
2452 #: field:l10n.es.aeat.mod340.intracomunitarias,total:0
2453+#: view:l10n.es.aeat.mod340.investment:0
2454 #: field:l10n.es.aeat.mod340.investment,total:0
2455 #: view:l10n.es.aeat.mod340.issued:0
2456 #: field:l10n.es.aeat.mod340.issued,total:0
2457@@ -876,12 +962,7 @@
2458 msgstr ""
2459
2460 #. module: l10n_es_aeat_mod340
2461-#: model:ir.model,name:l10n_es_aeat_mod340.model_account_tax_code_template
2462-msgid "Tax Code Template"
2463-msgstr ""
2464-
2465-#. module: l10n_es_aeat_mod340
2466-#: code:addons/l10n_es_aeat_mod340/wizard/calculate_mod340_records.py:118
2467+#: code:addons/l10n_es_aeat_mod340/wizard/calculate_mod340_records.py:167
2468 #, python-format
2469 msgid "La siguiente empresa no tiene asignado nif:"
2470 msgstr ""
2471
2472=== modified file 'l10n_es_aeat_mod340/mod340.py'
2473--- l10n_es_aeat_mod340/mod340.py 2014-02-24 14:45:52 +0000
2474+++ l10n_es_aeat_mod340/mod340.py 2014-06-01 16:57:08 +0000
2475@@ -27,12 +27,10 @@
2476
2477 from openerp.osv import orm, fields
2478 import time
2479-from datetime import datetime
2480-from openerp import netsvc
2481-from openerp import tools
2482-import math
2483-from openerp.tools.translate import _
2484-from openerp import pooler
2485+import netsvc
2486+import tools
2487+import pooler
2488+
2489
2490 class l10n_es_aeat_mod340_report(orm.Model):
2491
2492@@ -65,26 +63,34 @@
2493 return result
2494
2495 def _get_number_records( self, cr, uid,ids, field_name, args,context ):
2496-
2497- result = {}
2498- for id in ids:
2499- result[id] = {}.fromkeys(
2500- ['number_records','total_taxable','total_sharetax','total'],
2501- 0.0)
2502+ result = dict.fromkeys(ids,
2503+ dict.fromkeys(['number_records','total_taxable','total_sharetax','total'], 0))
2504
2505 for model in self.browse(cr, uid, ids,context):
2506
2507- for issue in model.issued:
2508- result[model.id]['number_records'] += len( issue.tax_line_ids )
2509- result[model.id]['total_taxable'] += issue.base_tax
2510- result[model.id]['total_sharetax'] += issue.amount_tax
2511- result[model.id]['total'] += issue.base_tax + issue.amount_tax
2512+ for invoice_rec in model.issued:
2513+ result[model.id]['number_records'] += len( invoice_rec.tax_line_ids )
2514+ result[model.id]['total_taxable'] += invoice_rec.base_tax
2515+ result[model.id]['total_sharetax'] += invoice_rec.amount_tax
2516+ result[model.id]['total'] += invoice_rec.base_tax + invoice_rec.amount_tax
2517
2518- for issue in model.received:
2519- result[model.id]['number_records'] += len( issue.tax_line_ids )
2520- result[model.id]['total_taxable'] += issue.base_tax
2521- result[model.id]['total_sharetax'] += issue.amount_tax
2522- result[model.id]['total'] += issue.base_tax + issue.amount_tax
2523+ for invoice_rec in model.received:
2524+ result[model.id]['number_records'] += len( invoice_rec.tax_line_ids )
2525+ result[model.id]['total_taxable'] += invoice_rec.base_tax
2526+ result[model.id]['total_sharetax'] += invoice_rec.amount_tax
2527+ result[model.id]['total'] += invoice_rec.base_tax + invoice_rec.amount_tax
2528+
2529+ for invoice_rec in model.investment:
2530+ result[model.id]['number_records'] += len( invoice_rec.tax_line_ids )
2531+ result[model.id]['total_taxable'] += invoice_rec.base_tax
2532+ result[model.id]['total_sharetax'] += invoice_rec.amount_tax
2533+ result[model.id]['total'] += invoice_rec.base_tax + invoice_rec.amount_tax
2534+
2535+ for invoice_rec in model.intracomunitarias:
2536+ result[model.id]['number_records'] += len( invoice_rec.tax_line_ids )
2537+ result[model.id]['total_taxable'] += invoice_rec.base_tax
2538+ result[model.id]['total_sharetax'] += invoice_rec.amount_tax
2539+ result[model.id]['total'] += invoice_rec.base_tax + invoice_rec.amount_tax
2540
2541 return result
2542
2543@@ -96,8 +102,8 @@
2544 size=64, string="Name"),
2545 'declaration_number': fields.char("Declaration number", size=64,
2546 readonly=True),
2547- 'phone_contact' : fields.char('Phone Contact',size=9),
2548- 'name_contact' : fields.char('Name And Surname Contact',size=40),
2549+ 'phone_contact': fields.char('Phone Contact',size=9),
2550+ 'name_contact': fields.char('Name And Surname Contact',size=40),
2551 'period_from': fields.many2one('account.period', 'Start period',
2552 states={'done': [('readonly', True)]}),
2553 'period_to': fields.many2one('account.period', 'End period',
2554@@ -109,14 +115,14 @@
2555 'mod340_id','Invoices Received',
2556 states={'done': [('readonly', True)]}),
2557 'investment': fields.one2many('l10n.es.aeat.mod340.investment',
2558- 'mod340_id','Property Investment'),
2559+ 'mod340_id','Investment Goods'),
2560 'intracomunitarias': fields.one2many(
2561 'l10n.es.aeat.mod340.intracomunitarias',
2562- 'mod340_id','Operations Intracomunitarias'),
2563+ 'mod340_id','Intra-community Operations'),
2564
2565 'ean13': fields.char('Electronic Code VAT reverse charge', size=16),
2566
2567- 'total_taxable': fields.function(_get_number_records, method=True,
2568+ 'total_taxable': fields.function(_get_number_records, method=True,
2569 type='float', string='Total Taxable', multi='recalc',
2570 help="""The declaration will include partners with the total
2571 of operations over this limit"""),
2572@@ -132,12 +138,13 @@
2573 type='float', string="Total", multi='recalc',
2574 help="""The declaration will include partners with the total
2575 of operations over this limit"""),
2576- 'calculation_date': fields.date('Calculation date', readonly=True),
2577+ 'investment_goods_prorating': fields.boolean("Investment goods prorating",
2578+ help="If checked, the investment goods invoices will be exported in their ledger. If not, they will be exported as received invoices")
2579 }
2580 _defaults = {
2581- 'number' : lambda *a: '340',
2582- 'declaration_number' : lambda *a: '340',
2583- }
2584+ 'number': '340',
2585+ 'declaration_number': '340',
2586+ }
2587
2588 def set_done(self, cr, uid, id, *args):
2589 self.write(cr,uid,id,{'calculation_date': time.strftime('%Y-%m-%d'),
2590@@ -159,23 +166,70 @@
2591 class l10n_es_aeat_mod340_issued(orm.Model):
2592 _name = 'l10n.es.aeat.mod340.issued'
2593 _description = 'Invoices invoice'
2594+
2595+ def get_ledger_keys(self, cr, uid, context=None):
2596+ return [('E', u'E-Libro registro de facturas expedidas.'),
2597+ ('F', u'F-Libro registro de facturas expedidas IGIC.'),
2598+ ('U', u'U-Libro registro de determinadas operaciones intracomunitarias (envío).')]
2599+
2600+ def _get_ledger_keys(self, cr, uid, context=None):
2601+ return self.get_ledger_keys(cr, uid, context=context)
2602+
2603+ def get_operation_keys(self, cr, uid, context=None):
2604+ return [(' ', u'Operación habitual'),
2605+ ('A', u'A-Asiento resumen de facturas'),
2606+ ('B', u'B-Asiento resumen de tique'),
2607+ ('C', u'C-Factura con varios asientos (varios tipos impositivos)'),
2608+ ('D', u'D-Factura rectificativa'),
2609+ ('E', u'E-IVA/IGIC devengado pendiente de emitir factura'),
2610+ ('G', u'G-Régimen especial de grupo de entidades en IVA o IGIC'),
2611+ ('H', u'H-Régimen especial de oro de inversión'),
2612+ ('I', u'I-Inversión del Sujeto pasivo (ISP)'),
2613+ ('J', u'J-Tiques'),
2614+ ('K', u'K-Rectificación de errores registrales'),
2615+ ('M', u'M-IVA/IGIC facturado pendiente de devengar (emitida factura)'),
2616+ ('N', u'N-Facturación de las prestaciones de servicios de agencias de viaje que actúan como mediadoras en nombre y por cuenta ajena'),
2617+ ('O', u'O-Factura emitida en sustitución de tiques facturados y declarados'),
2618+ ('Q', u'Q-Operaciones a las que se aplique el Régimen especial de bienes usados, objetos de arte, antigüedades y objetos de colección'),
2619+ ('R', u'R-Operación de arrendamiento de local de negocio'),
2620+ ('S', u'S-Subvenciones, auxilios o ayudas satisfechas o recibidas, tanto por parte de Administraciones públicas como de entidades privadas'),
2621+ ('T', u'T-Cobros por cuenta de terceros de honorarios profesionales o de derechos derivados de la propiedad intelectual, industrial, de autor u otros por cuenta de sus socios, asociados o colegiados efectuados por sociedades, asociaciones, colegios profesionales u otras entidades que, entre sus funciones, realicen las de cobro'),
2622+ ('U', u'U-Operación de seguros'),
2623+ ('V', u'V-Compras de Agencias viajes'),
2624+ ('W', u'W-Operaciones sujetas al Impuesto sobre la Producción, los Servicios y la Importación en las Ciudades de Ceuta y Melilla'),
2625+ ('X', u'X-Operaciones por las que los empresarios o profesionales que satisfagan compensaciones agrícolas, ganaderas y/o pesqueras hayan expedido el recibo correspondiente'),
2626+ ('Z', u'Z-Régimen especial del criterio de caja'),
2627+ ('1', u'1-IVA criterio de caja. Asiento resumen de facturas'),
2628+ ('2', u'2-IVA criterio de caja. Factura con varios asientos (varios tipos impositivos)'),
2629+ ('3', u'3-IVA criterio de caja. Factura rectificativa'),
2630+ ('4', u'4-IVA criterio de caja. Adquisiciones realizadas por las agencias de viajes directamente en interés del viajero (Régimen especial de agencia de viajes)'),
2631+ ('5', u'5-IVA criterio de caja. Factura simplificada'),
2632+ ('6', u'6-IVA criterio de caja. Rectificación de errores registrales'),
2633+ ('7', u'7-IVA criterio de caja. Facturación de las prestaciones de servicios de agencias de viaje que actúan como mediadoras en nombre y por cuenta ajena. (Disposición adicional 4.ª RD 1496/2003)'),
2634+ ('8', u'8-IVA criterio de caja. Operación de arrendamiento de local de negocio.')]
2635+
2636+ def _get_operation_keys(self, cr, uid, context=None):
2637+ return self.get_operation_keys(cr, uid, context=context)
2638+
2639 _columns = {
2640 'mod340_id': fields.many2one('l10n.es.aeat.mod340.report','Model 340',
2641 ondelete="cascade"),
2642- 'partner_id':fields.many2one('res.partner','Partner',
2643+ 'partner_id': fields.many2one('res.partner','Partner',
2644 ondelete="cascade"),
2645- 'partner_vat':fields.char('Company CIF/NIF',size=12),
2646+ 'partner_vat': fields.char('Company CIF/NIF',size=12),
2647 'representative_vat': fields.char('L.R. VAT number', size=9,
2648 help="Legal Representative VAT number"),
2649 'partner_country_code': fields.char('Country Code', size=2),
2650 'invoice_id':fields.many2one('account.invoice','Invoice',
2651 ondelete="cascade"),
2652- 'base_tax':fields.float('Base tax bill',digits=(13,2)),
2653- 'amount_tax':fields.float('Total tax',digits=(13,2)),
2654- 'total':fields.float('Total',digits=(13,2)),
2655+ 'base_tax': fields.float('Base tax bill',digits=(13,2)),
2656+ 'amount_tax': fields.float('Total tax',digits=(13,2)),
2657+ 'total': fields.float('Total',digits=(13,2)),
2658 'tax_line_ids': fields.one2many('l10n.es.aeat.mod340.tax_line_issued',
2659 'invoice_record_id', 'Tax lines'),
2660 'date_invoice': fields.date('Date Invoice', readonly=True),
2661+ 'ledger_key': fields.selection(_get_ledger_keys, 'Ledger Key', required=True, readonly=True),
2662+ 'operation_key': fields.selection(_get_operation_keys, 'Operation Key', required=True, readonly=True),
2663 }
2664
2665 _order = 'date_invoice asc, invoice_id asc'
2666@@ -184,20 +238,79 @@
2667 _name = 'l10n.es.aeat.mod340.received'
2668 _description = 'Invoices Received'
2669 _inherit = 'l10n.es.aeat.mod340.issued'
2670+
2671+ def get_ledger_keys(self, cr, uid, context=None):
2672+ return [('R', u'R-Libro registro de facturas recibidas.'),
2673+ ('I', u'I-Libro registro de bienes de inversión.'),
2674+ ('J', u'J-Libro de registro de bienes de inversión IGIC.'),
2675+ ('S', u'S-Libro de registro de facturas recibidas IGIC.'),
2676+ ('U', u'U-Libro registro de determinadas operaciones intracomunitarias (recepción).')]
2677+
2678+ def _get_ledger_keys(self, cr, uid, context=None):
2679+ return self.get_ledger_keys(cr, uid, context=context)
2680+
2681+ def get_operation_keys(self, cr, uid, context=None):
2682+ return [(' ', u'Operación habitual'),
2683+ ('A', u'A-Asiento resumen de facturas'),
2684+ ('B', u'B-Asiento resumen de tiques / facturas simplificadas'),
2685+ ('C', u'C-Factura con varios asientos(varios tipo impositivos)'),
2686+ ('D', u'D-Factura rectificativa'),
2687+ ('F', u'F-Adquisiciones realizadas por las agencias de viajes directamente en interés del viajero (Régimen especial de agencias de viajes)'),
2688+ ('G', u'G-Régimen especial de grupo de entidades en IVA o IGIC'),
2689+ ('H', u'H-Régimen especial de oro de inversión'),
2690+ ('I', u'I-Inversión del Sujeto pasivo (ISP)'),
2691+ ('J', u'J-Tiques / facturas simplificadas'),
2692+ ('K', u'K-Rectificación anotaciones registrales'),
2693+ ('L', u'L-Adquisiciones a comerciantes minoristas del IGIC'),
2694+ ('P', u'P-Adquisiciones intracomunitarias de bienes.'),
2695+ ('Q', u'Q-Operaciones a las que se aplique el régimen especial de bienes usados, ...'),
2696+ ('R', u'R-Operación de arrendamiento de local de negocio.'),
2697+ ('S', u'S-Subvenciones, auxilios o ayudas satisfechas o recibidas, tanto por parte de Administraciones públicas como de entidades privadas.'),
2698+ ('W', u'W-Operaciones sujetas al Impuesto sobre la Producción, los Servicios y la Importación en las Ciudades de Ceuta y Melilla.'),
2699+ ('X', u'X-Operaciones por las que los empresarios o profesionales que satisfagan compensaciones agrícolas, ganaderas y/o pesqueras hayan expedido el recibo correspondiente.'),
2700+ ('Z', u'Z-Régimen especial del criterio de caja.'),
2701+ ('1', u'1-IVA criterio de caja. Asiento resumen de facturas.'),
2702+ ('2', u'2-IVA criterio de caja. Factura con varios asientos (varios tipos impositivos).'),
2703+ ('3', u'3-IVA criterio de caja. Factura rectificativa.'),
2704+ ('4', u'4-IVA criterio de caja. Adquisiciones realizadas por las agencias de viajes directamente en interés del viajero (Régimen especial de agencias de viajes.'),
2705+ ('5', u'5-IVA criterio de caja. Factura simplificada.'),
2706+ ('6', u'6-IVA criterio de caja. Rectificación de errores registrales.'),
2707+ ('7', u'7-IVA criterio de caja. Facturación de las prestaciones de servicios de agencias de viaje que actúan como mediadoras en nombre y por cuenta ajena (Disposición adicional 4ª RD 1496/2003).'),
2708+ ('8', u'8-IVA criterio de caja. Operación de arrendamiento de local de negocio.')]
2709+
2710+ def _get_operation_keys(self, cr, uid, context=None):
2711+ return self.get_operation_keys(cr, uid, context=context)
2712+
2713 _columns = {
2714- 'tax_line_ids':fields.one2many('l10n.es.aeat.mod340.tax_line_received',
2715+ 'tax_line_ids': fields.one2many('l10n.es.aeat.mod340.tax_line_received',
2716 'invoice_record_id', 'Tax lines'),
2717+ 'ledger_key': fields.selection(_get_ledger_keys, 'Ledger Key', required=True, readonly=True),
2718+ 'operation_key': fields.selection(_get_operation_keys, 'Operation Key', required=True),
2719 }
2720
2721 class l10n_es_aeat_mod340_investment(orm.Model):
2722 _name = 'l10n.es.aeat.mod340.investment'
2723 _description = 'Property Investment'
2724- _inherit = 'l10n.es.aeat.mod340.issued'
2725+ _inherit = 'l10n.es.aeat.mod340.received'
2726+
2727+ _columns = {
2728+ 'tax_line_ids': fields.one2many('l10n.es.aeat.mod340.tax_line_investment',
2729+ 'invoice_record_id', 'Tax lines'),
2730+ 'use_date': fields.date("Goods use start date"),
2731+ 'prorata': fields.integer("Definitive yearly prorata"),
2732+ }
2733+
2734+ _sql_constraints = [('prorata_range','check(prorata >= 0 and prorata <= 100)','The prorata must be between 0 and 100.')]
2735
2736 class l10n_es_aeat_mod340_intracomunitarias(orm.Model):
2737 _name = 'l10n.es.aeat.mod340.intracomunitarias'
2738 _description = 'Operations Intracomunitarias'
2739 _inherit = 'l10n.es.aeat.mod340.issued'
2740+
2741+ _columns = {
2742+ 'tax_line_ids': fields.one2many('l10n.es.aeat.mod340.tax_line_intra',
2743+ 'invoice_record_id', 'Tax lines'),
2744+ }
2745
2746 class l10n_es_aeat_mod340_tax_line_issued(orm.Model):
2747 _name = 'l10n.es.aeat.mod340.tax_line_issued'
2748@@ -209,6 +322,8 @@
2749 'base_amount': fields.float('Base tax bill',digits=(13,2)),
2750 'invoice_record_id': fields.many2one('l10n.es.aeat.mod340.issued',
2751 'Invoice issued', required=True, ondelete="cascade", select=1),
2752+ 'surcharge_percentage': fields.float('Surcharge percentage',digits=(0,2)),
2753+ 'surcharge_amount': fields.float('Surcharge amount',digits=(13,2)),
2754 }
2755
2756 class l10n_es_aeat_mod340_tax_line_received(orm.Model):
2757@@ -219,3 +334,24 @@
2758 'invoice_record_id': fields.many2one('l10n.es.aeat.mod340.received',
2759 'Invoice received', required=True, ondelete="cascade", select=1),
2760 }
2761+
2762+class l10n_es_aeat_mod340_tax_line_investment(orm.Model):
2763+ _name = 'l10n.es.aeat.mod340.tax_line_investment'
2764+ _description = 'Mod340 vat lines investment'
2765+ _inherit = 'l10n.es.aeat.mod340.tax_line_issued'
2766+ _columns = {
2767+ 'invoice_record_id': fields.many2one('l10n.es.aeat.mod340.investment',
2768+ 'Invoice received', required=True, ondelete="cascade", select=1),
2769+ 'goods_identification': fields.char("Investment goods identification", size=17),
2770+ }
2771+
2772+
2773+
2774+class l10n_es_aeat_mod340_tax_line_intra(orm.Model):
2775+ _name = 'l10n.es.aeat.mod340.tax_line_intra'
2776+ _description = 'Mod340 vat lines intra-community'
2777+ _inherit = 'l10n.es.aeat.mod340.tax_line_issued'
2778+ _columns = {
2779+ 'invoice_record_id': fields.many2one('l10n.es.aeat.mod340.intracomunitarias',
2780+ 'Invoice received', required=True, ondelete="cascade", select=1),
2781+ }
2782
2783=== modified file 'l10n_es_aeat_mod340/mod340_view.xml'
2784--- l10n_es_aeat_mod340/mod340_view.xml 2014-03-20 00:33:19 +0000
2785+++ l10n_es_aeat_mod340/mod340_view.xml 2014-06-01 16:57:08 +0000
2786@@ -1,6 +1,7 @@
2787 <?xml version="1.0" encoding="utf-8"?>
2788 <openerp>
2789 <data>
2790+<<<<<<< TREE
2791 <!-- Modelo 340 -->
2792 <record model="ir.ui.view" id="view_l10n_es_aeat_mod340_tree">
2793 <field name="name">l10n.es.aeat.mod340.tree</field>
2794@@ -17,11 +18,30 @@
2795 </field>
2796 </record>
2797
2798+=======
2799+ <!-- Modelo 340 -->
2800+ <record model="ir.ui.view" id="view_l10n_es_aeat_mod340_tree">
2801+ <field name="name">l10n.es.aeat.mod340.tree</field>
2802+ <field name="model">l10n.es.aeat.mod340.report</field>
2803+ <field name="arch" type="xml">
2804+ <tree string="Model 340">
2805+ <field name="fiscalyear_id"/>
2806+ <field name="period_from"/>
2807+ <field name="period_to"/>
2808+ <field name="number"/>
2809+ <field name="type"/>
2810+ <field name="state" invisible="1"/>
2811+ </tree>
2812+ </field>
2813+ </record>
2814+
2815+>>>>>>> MERGE-SOURCE
2816 <record id="view_l10n_es_aeat_mod340_form" model="ir.ui.view">
2817 <field name="name">l10n_es.aeat.mod340.form</field>
2818 <field name="model">l10n.es.aeat.mod340.report</field>
2819 <field name="inherit_id" ref="l10n_es_aeat.view_l10n_es_aeat_report_form"/>
2820 <field name="arch" type="xml">
2821+<<<<<<< TREE
2822 <button name="%(l10n_es_aeat.action_wizard_aeat_export)d" position="attributes">
2823 <attribute name="name">%(action_wizard_aeat_mod340_export)d</attribute>
2824 </button>
2825@@ -183,6 +203,328 @@
2826 </record>
2827
2828 <record id="view_l10n_es_aeat_mod340_report_search" model="ir.ui.view">
2829+=======
2830+ <button name="%(l10n_es_aeat.action_wizard_aeat_export)d" position="attributes">
2831+ <attribute name="name">%(action_wizard_aeat_mod340_export)d</attribute>
2832+ </button>
2833+ <field name="fiscalyear_id" position="after">
2834+ <field name="period_from" required="1" domain="[('fiscalyear_id','=',fiscalyear_id)]"/>
2835+ <field name="period_to" required="1" domain="[('fiscalyear_id','=',fiscalyear_id)]"/>
2836+ </field>
2837+ <field name="calculation_date" position="after">
2838+ <field name="declaration_number"/>
2839+ <field name="support_type"/>
2840+ <field name="investment_goods_prorating"/>
2841+ </field>
2842+ <group string="Declaración" position="after">
2843+ <notebook colspan="4">
2844+ <page string="General">
2845+ <group string="Identification" colspan="4">
2846+ <field name="phone_contact" />
2847+ <field name="name_contact" />
2848+ <field name="representative_vat" />
2849+ </group>
2850+ <group string="Susbtitutive/complementary declaration" colspan="4">
2851+ <field name="type"/>
2852+ <field name="previous_number"/>
2853+ </group>
2854+ <group string="Electronic Code VAT reverse charge" colspan="4">
2855+ <field name="ean13" nolabel="1"/>
2856+ </group>
2857+ <group string="Summary" colspan="4">
2858+ <field name="number_records"/>
2859+ <field name="total_taxable"/>
2860+ <field name="total_sharetax"/>
2861+ <field name="total"/>
2862+ </group>
2863+ <group colspan="4" col="10">
2864+ </group>
2865+ </page>
2866+ <page string="Issued invoice">
2867+ <field name="issued" nolabel="1" />
2868+ </page>
2869+ <page string="Received invoice">
2870+ <field name="received" nolabel="1" />
2871+ </page>
2872+ <page string="Investment goods">
2873+ <field name="investment" nolabel="1"/>
2874+ </page>
2875+ <!-- TODO: intracommunity-->
2876+ <page string="Other intracommunity operations" invisible="1">
2877+ <field name="intracomunitarias" nolabel="1"/>
2878+ </page>
2879+ </notebook>
2880+ </group>
2881+ </field>
2882+ </record>
2883+ <!-- FIN Modelo 340 -->
2884+
2885+
2886+ <!--Invoice Issued-->
2887+
2888+ <record id="view_l10n_es_aeat_mod340_invoice_issued_tree" model="ir.ui.view">
2889+ <field name="name">l10n.es.aeat.mod340.issued.tree</field>
2890+ <field name="model">l10n.es.aeat.mod340.issued</field>
2891+ <field name="arch" type="xml">
2892+ <tree string="Issued invoices">
2893+ <field name="date_invoice"/>
2894+ <field name="partner_id"/>
2895+ <field name="operation_key"/>
2896+ <field name="partner_country_code"/>
2897+ <field name="partner_vat"/>
2898+ <field name="invoice_id"/>
2899+ <field name="base_tax" sum="Total Base" />
2900+ <field name="amount_tax" sum="Total Tax" />
2901+ <field name="total" sum="Total"/>
2902+ </tree>
2903+ </field>
2904+ </record>
2905+
2906+ <record id="view_l10n_es_aeat_mod340_invoice_issued_form" model="ir.ui.view">
2907+ <field name="name">l10n.es.aeat.mod340.issued.form</field>
2908+ <field name="model">l10n.es.aeat.mod340.issued</field>
2909+ <field name="arch" type="xml">
2910+ <form string="Issued invoices">
2911+ <field name="invoice_id"/>
2912+ <newline/>
2913+ <field name="partner_id"/>
2914+ <field name="partner_vat"/>
2915+ <field name="representative_vat"/>
2916+ <field name="partner_country_code"/>
2917+ <newline/>
2918+ <field name="base_tax" />
2919+ <field name="amount_tax" />
2920+ <newline/>
2921+ <field name="total"/>
2922+ <field name="ledger_key"/>
2923+ <field name="tax_line_ids"/>
2924+ <field name="operation_key"/>
2925+ </form>
2926+ </field>
2927+ </record>
2928+
2929+ <!--Invoice Received-->
2930+
2931+ <record id="view_l10n_es_aeat_mod340_invoice_received_tree" model="ir.ui.view">
2932+ <field name="name">l10n.es.aeat.mod340.received.tree</field>
2933+ <field name="model">l10n.es.aeat.mod340.received</field>
2934+ <field name="arch" type="xml">
2935+ <tree string="Received invoices">
2936+ <field name="partner_id"/>
2937+ <field name="operation_key"/>
2938+ <field name="partner_country_code"/>
2939+ <field name="partner_vat"/>
2940+ <field name="invoice_id"/>
2941+ <field name="base_tax" sum="Total Base"/>
2942+ <field name="amount_tax" sum="Total Tax"/>
2943+ <field name="total" sum="Total"/>
2944+ </tree>
2945+ </field>
2946+ </record>
2947+
2948+ <record id="view_l10n_es_aeat_mod340_invoice_received_form" model="ir.ui.view">
2949+ <field name="name">l10n.es.aeat.mod340.received.form</field>
2950+ <field name="model">l10n.es.aeat.mod340.received</field>
2951+ <field name="arch" type="xml">
2952+ <form string="Received invoices">
2953+ <field name="invoice_id"/>
2954+ <newline/>
2955+ <field name="partner_id"/>
2956+ <field name="partner_vat"/>
2957+ <field name="representative_vat"/>
2958+ <field name="partner_country_code"/>
2959+ <newline/>
2960+ <field name="base_tax"/>
2961+ <field name="amount_tax"/>
2962+ <newline/>
2963+ <field name="total"/>
2964+ <field name="ledger_key"/>
2965+ <field name="tax_line_ids"/>
2966+ <field name="operation_key"/>
2967+ </form>
2968+ </field>
2969+ </record>
2970+
2971+ <!--Investment goods -->
2972+
2973+ <record id="view_l10n_es_aeat_mod340_invoice_investment_tree" model="ir.ui.view">
2974+ <field name="name">l10n.es.aeat.mod340.investment.tree</field>
2975+ <field name="model">l10n.es.aeat.mod340.investment</field>
2976+ <field name="arch" type="xml">
2977+ <tree string="Investment goods">
2978+ <field name="partner_id"/>
2979+ <field name="operation_key"/>
2980+ <field name="partner_country_code"/>
2981+ <field name="partner_vat"/>
2982+ <field name="invoice_id"/>
2983+ <field name="base_tax" sum="Total Base"/>
2984+ <field name="amount_tax" sum="Total Tax"/>
2985+ <field name="total" sum="Total"/>
2986+ </tree>
2987+ </field>
2988+ </record>
2989+
2990+ <record id="view_l10n_es_aeat_mod340_invoice_investment_form" model="ir.ui.view">
2991+ <field name="name">l10n.es.aeat.mod340.investment.form</field>
2992+ <field name="model">l10n.es.aeat.mod340.investment</field>
2993+ <field name="arch" type="xml">
2994+ <form string="Investment goods">
2995+ <group>
2996+ <field name="invoice_id"/>
2997+ <field name="partner_id"/>
2998+ <field name="representative_vat"/>
2999+ <field name="base_tax"/>
3000+ <field name="amount_tax"/>
3001+ <field name="total"/>
3002+ <field name="tax_line_ids"/>
3003+ </group>
3004+ <group>
3005+ <field name="partner_vat"/>
3006+ <field name="partner_country_code"/>
3007+ <field name="ledger_key"/>
3008+ <field name="operation_key"/>
3009+ <field name="use_date"/>
3010+ <field name="prorata"/>
3011+ </group>
3012+ </form>
3013+ </field>
3014+ </record>
3015+
3016+ <!--Other Intracommunity Operations -->
3017+
3018+ <record id="view_l10n_es_aeat_mod340_invoice_intra_tree" model="ir.ui.view">
3019+ <field name="name">l10n.es.aeat.mod340.intra.tree</field>
3020+ <field name="model">l10n.es.aeat.mod340.intracomunitarias</field>
3021+ <field name="arch" type="xml">
3022+ <tree string="Other Intracommunity Operations">
3023+ <field name="partner_id"/>
3024+ <field name="operation_key"/>
3025+ <field name="partner_country_code"/>
3026+ <field name="partner_vat"/>
3027+ <field name="invoice_id"/>
3028+ <field name="base_tax" sum="Total Base"/>
3029+ <field name="amount_tax" sum="Total Tax"/>
3030+ <field name="total" sum="Total"/>
3031+ </tree>
3032+ </field>
3033+ </record>
3034+
3035+ <record id="view_l10n_es_aeat_mod340_invoice_intra_form" model="ir.ui.view">
3036+ <field name="name">l10n.es.aeat.mod340.intra.form</field>
3037+ <field name="model">l10n.es.aeat.mod340.intracomunitarias</field>
3038+ <field name="arch" type="xml">
3039+ <form string="Other Intracommunity Operations">
3040+ <field name="invoice_id"/>
3041+ <newline/>
3042+ <field name="partner_id"/>
3043+ <field name="partner_vat"/>
3044+ <field name="representative_vat"/>
3045+ <field name="partner_country_code"/>
3046+ <newline/>
3047+ <field name="base_tax"/>
3048+ <field name="amount_tax"/>
3049+ <newline/>
3050+ <field name="total"/>
3051+ <field name="ledger_key"/>
3052+ <field name="tax_line_ids"/>
3053+ <field name="operation_key"/>
3054+ </form>
3055+ </field>
3056+ </record>
3057+
3058+
3059+ <!--Vat Lines-->
3060+
3061+ <record id="view_l10n_es_aeat_mod340_tax_line_issued_form" model="ir.ui.view">
3062+ <field name="name">l10n.es.aeat.mod340.tax_line_issued.form</field>
3063+ <field name="model">l10n.es.aeat.mod340.tax_line_issued</field>
3064+ <field name="arch" type="xml">
3065+ <form string="Tax line issued">
3066+ <group>
3067+ <field name="name"/>
3068+ <field name="base_amount"/>
3069+ <field name="tax_percentage"/>
3070+ <field name="tax_amount"/>
3071+ </group>
3072+ <group>
3073+ <separator colspan="2"/>
3074+ <separator colspan="2"/>
3075+ <separator colspan="2"/>
3076+ <field name="surcharge_percentage"/>
3077+ <field name="surcharge_amount"/>
3078+ </group>
3079+ </form>
3080+ </field>
3081+ </record>
3082+
3083+ <record id="view_l10n_es_aeat_mod340_tax_line_issued_tree" model="ir.ui.view">
3084+ <field name="name">l10n.es.aeat.mod340.tax_line_issued.tree</field>
3085+ <field name="model">l10n.es.aeat.mod340.tax_line_issued</field>
3086+ <field name="arch" type="xml">
3087+ <tree string="Tax line issued">
3088+ <field name="name"/>
3089+ <field name="surcharge_percentage"/>
3090+ </tree>
3091+ </field>
3092+ </record>
3093+
3094+ <record id="view_l10n_es_aeat_mod340_tax_line_received_form" model="ir.ui.view">
3095+ <field name="name">l10n.es.aeat.mod340.tax_line_received.form</field>
3096+ <field name="model">l10n.es.aeat.mod340.tax_line_received</field>
3097+ <field name="arch" type="xml">
3098+ <form string="Tax line received">
3099+ <group>
3100+ <field name="name"/>
3101+ <field name="base_amount"/>
3102+ <field name="tax_percentage"/>
3103+ <field name="tax_amount"/>
3104+ </group>
3105+ <group>
3106+ <separator colspan="2"/>
3107+ <separator colspan="2"/>
3108+ <separator colspan="2"/>
3109+ <field name="surcharge_percentage"/>
3110+ <field name="surcharge_amount"/>
3111+ </group>
3112+ </form>
3113+ </field>
3114+ </record>
3115+
3116+ <record id="view_l10n_es_aeat_mod340_tax_line_investment_form" model="ir.ui.view">
3117+ <field name="name">l10n.es.aeat.mod340.tax_line_investment.form</field>
3118+ <field name="model">l10n.es.aeat.mod340.tax_line_investment</field>
3119+ <field name="arch" type="xml">
3120+ <form string="Tax line investment goods">
3121+ <group>
3122+ <field name="name"/>
3123+ <field name="base_amount"/>
3124+ <field name="tax_percentage"/>
3125+ <field name="tax_amount"/>
3126+ </group>
3127+ <group>
3128+ <field name="goods_identification"/>
3129+ </group>
3130+ </form>
3131+ </field>
3132+ </record>
3133+
3134+ <record id="view_l10n_es_aeat_mod340_tax_line_intra_form" model="ir.ui.view">
3135+ <field name="name">l10n.es.aeat.mod340.tax_line_intra.form</field>
3136+ <field name="model">l10n.es.aeat.mod340.tax_line_intra</field>
3137+ <field name="arch" type="xml">
3138+ <form string="Tax line intracommunity">
3139+ <group>
3140+ <field name="name"/>
3141+ <field name="base_amount"/>
3142+ <field name="tax_percentage"/>
3143+ <field name="tax_amount"/>
3144+ </group>
3145+ </form>
3146+ </field>
3147+ </record>
3148+
3149+ <record id="view_l10n_es_aeat_mod340_report_search" model="ir.ui.view">
3150+>>>>>>> MERGE-SOURCE
3151 <field name="name">AEAT Model 340 (search)</field>
3152 <field name="model">l10n.es.aeat.mod340.report</field>
3153 <field name="arch" type="xml">
3154
3155=== modified file 'l10n_es_aeat_mod340/res_partner.py'
3156--- l10n_es_aeat_mod340/res_partner.py 2014-02-09 16:33:45 +0000
3157+++ l10n_es_aeat_mod340/res_partner.py 2014-06-01 16:57:08 +0000
3158@@ -26,9 +26,7 @@
3159 from openerp.osv import orm, fields
3160
3161 class res_partner(orm.Model):
3162- """
3163- Extends the partners to add the include_in_mod347 field
3164- """
3165+
3166 _inherit = "res.partner"
3167
3168 _columns = {
3169
3170=== modified file 'l10n_es_aeat_mod340/security/ir.model.access.csv'
3171--- l10n_es_aeat_mod340/security/ir.model.access.csv 2014-02-09 16:33:45 +0000
3172+++ l10n_es_aeat_mod340/security/ir.model.access.csv 2014-06-01 16:57:08 +0000
3173@@ -6,3 +6,5 @@
3174 access_l10n_es_aeat_mod340_intracomunitarias_manager,l10n_es_aeat_mod340_intracomunitarias manager,model_l10n_es_aeat_mod340_intracomunitarias,l10n_es_aeat.group_account_aeat,1,1,1,1
3175 access_l10n_es_aeat_mod340_tax_line_issued,l10n_es_aeat_mod340_tax_line_issued,model_l10n_es_aeat_mod340_tax_line_issued,l10n_es_aeat.group_account_aeat,1,1,1,1
3176 access_l10n_es_aeat_mod340_tax_line_received,l10n_es_aeat_mod340_tax_line_received,model_l10n_es_aeat_mod340_tax_line_received,l10n_es_aeat.group_account_aeat,1,1,1,1
3177+access_l10n_es_aeat_mod340_tax_line_investment,l10n_es_aeat_mod340_tax_line_investment,model_l10n_es_aeat_mod340_tax_line_investment,l10n_es_aeat.group_account_aeat,1,1,1,1
3178+access_l10n_es_aeat_mod340_tax_line_intra,l10n_es_aeat_mod340_tax_line_intra,model_l10n_es_aeat_mod340_tax_line_intra,l10n_es_aeat.group_account_aeat,1,1,1,1
3179
3180=== added file 'l10n_es_aeat_mod340/taxes_common.xml'
3181--- l10n_es_aeat_mod340/taxes_common.xml 1970-01-01 00:00:00 +0000
3182+++ l10n_es_aeat_mod340/taxes_common.xml 2014-06-01 16:57:08 +0000
3183@@ -0,0 +1,284 @@
3184+<?xml version="1.0" encoding="utf-8"?>
3185+<openerp>
3186+ <data noupdate="0">
3187+ <!-- Plantilla común de impuestos para España.
3188+
3189+ Cargamos las claves para los impuestos presentes en l10n_es rev XXXXXX
3190+
3191+ TODO: poner revisión o fecha cuando se mergee la refactorización que ha hecho Pedro
3192+ https://code.launchpad.net/~pedro.baeza/openerp-spain/7.0-l10n_es-refactorized/+merge/196807
3193+ -->
3194+
3195+ <!-- NUEVOS (mover a su sitio) -->
3196+ <!-- 12% IVA Soportado régimen agricultura -->
3197+ <record id="l10n_es.iva_sop_12_agr" model="account.tax.template">
3198+ <field name="ledger_key">R</field>
3199+ <field name="operation_key">X</field>
3200+ </record>
3201+ <!-- IVA 21% Intracomunitario. Servicios -->
3202+ <record id="l10n_es.iva_IC_compras_21_sv" model="account.tax.template">
3203+ <field name="ledger_key">R</field>
3204+ <field name="operation_key">I</field>
3205+ </record>
3206+ <!-- IVA 21% Intracomunitario. Servicios (1) -->
3207+ <record id="l10n_es.iva_IC_compras_21_sv_1" model="account.tax.template">
3208+ <field name="ledger_key">R</field>
3209+ <field name="operation_key">I</field>
3210+ </record>
3211+ <!-- IVA 21% Intracomunitario. Servicios (2) -->
3212+ <record id="l10n_es.iva_IC_compras_21_sv_2" model="account.tax.template">
3213+ <field name="ledger_key">R</field>
3214+ <field name="operation_key">I</field>
3215+ </record>
3216+ <!-- FIN NUEVOS -->
3217+
3218+ <!-- IVA soportado -->
3219+ <!-- 4% IVA Soportado (operaciones corrientes) -->
3220+ <record id="l10n_es.iva_sop_4" model="account.tax.template">
3221+ <field name="ledger_key">R</field>
3222+ </record>
3223+
3224+ <!-- 4% IVA Soportado (bienes de inversión) -->
3225+ <record id="l10n_es.iva_sop_4_inv" model="account.tax.template">
3226+ <field name="ledger_key">I</field>
3227+ </record>
3228+
3229+ <!-- 10% IVA Soportado (operaciones corrientes) -->
3230+ <record id="l10n_es.iva_sop_10" model="account.tax.template">
3231+ <field name="ledger_key">R</field>
3232+ </record>
3233+
3234+ <!-- 10% IVA Soportado (bienes de inversión) -->
3235+ <record id="l10n_es.iva_sop_10_inv" model="account.tax.template">
3236+ <field name="ledger_key">I</field>
3237+ </record>
3238+
3239+ <!-- 21% IVA Soportado (operaciones corrientes) -->
3240+ <record id="l10n_es.iva_sop_21" model="account.tax.template">
3241+ <field name="ledger_key">R</field>
3242+ </record>
3243+
3244+ <!-- 21% IVA Soportado (bienes de inversión) -->
3245+ <record id="l10n_es.iva_sop_21_inv" model="account.tax.template">
3246+ <field name="ledger_key">I</field>
3247+ </record>
3248+
3249+ <!-- Plantillas para Extracomunitario-->
3250+ <!-- IVA compras -->
3251+ <!-- IVA 0% Importaciones bienes corrientes -->
3252+ <record id="l10n_es.iva_X0_compras_bc" model="account.tax.template">
3253+ <field name="ledger_key">R</field>
3254+ </record>
3255+ <!-- IVA 0% Importaciones bienes de inversión -->
3256+ <record id="l10n_es.iva_X0_compras_bi" model="account.tax.template">
3257+ <field name="ledger_key">I</field>
3258+ </record>
3259+ <!-- IVA 4% Importaciones bienes corrientes -->
3260+ <record id="l10n_es.iva_X4_compras_bc" model="account.tax.template">
3261+ <field name="ledger_key">R</field>
3262+ </record>
3263+ <!-- IVA 4% Importaciones bienes de inversión -->
3264+ <record id="l10n_es.iva_X4_compras_bi" model="account.tax.template">
3265+ <field name="ledger_key">I</field>
3266+ </record>
3267+ <!-- IVA 10% Importaciones bienes corrientes -->
3268+ <record id="l10n_es.iva_X10_compras_bc" model="account.tax.template">
3269+ <field name="ledger_key">R</field>
3270+ </record>
3271+ <!-- IVA 10% Importaciones bienes de inversión -->
3272+ <record id="l10n_es.iva_X10_compras_bi" model="account.tax.template">
3273+ <field name="ledger_key">I</field>
3274+ </record>
3275+ <!-- IVA 21% Importaciones bienes corrientes -->
3276+ <record id="l10n_es.iva_X21_compras_bc" model="account.tax.template">
3277+ <field name="ledger_key">R</field>
3278+ </record>
3279+ <!-- IVA 21% Importaciones bienes de inversión -->
3280+ <record id="l10n_es.iva_X21_compras_bi" model="account.tax.template">
3281+ <field name="ledger_key">I</field>
3282+ </record>
3283+
3284+ <!-- IVA EXPORTACIONES (VENTAS )-->
3285+ <!-- IVA 0% Exportaciones -->
3286+ <record id="l10n_es.iva_X0" model="account.tax.template">
3287+ <field name="ledger_key">E</field>
3288+ </record>
3289+
3290+ <!-- Inversión del sujeto pasivo -->
3291+ <!-- IVA 21% Inversión del sujeto pasivo -->
3292+ <record id="l10n_es.iva_ISP_compras_21" model="account.tax.template">
3293+ <field name="ledger_key">R</field>
3294+ <field name="operation_key">I</field>
3295+ </record>
3296+ <!-- IVA 21% Inversión del sujeto pasivo (1) -->
3297+ <record id="l10n_es.iva_ISP_compras_21_1" model="account.tax.template">
3298+ <field name="ledger_key">R</field>
3299+ <field name="operation_key">I</field>
3300+ </record>
3301+ <!-- IVA 21% Inversión del sujeto pasivo (2) -->
3302+ <record id="l10n_es.iva_ISP_compras_21_2" model="account.tax.template">
3303+ <field name="ledger_key">R</field>
3304+ <field name="operation_key">I</field>
3305+ </record>
3306+ <!-- IVA 21% Inversión del sujeto pasivo (3) -->
3307+ <record id="l10n_es.iva_ISP_compras_21_3" model="account.tax.template">
3308+ <field name="ledger_key">R</field>
3309+ <field name="operation_key">I</field>
3310+ </record>
3311+
3312+ <!-- IVA REPERCUTIDO-->
3313+ <!-- IVA 4% -->
3314+ <record id="l10n_es.iva_rep_4" model="account.tax.template">
3315+ <field name="ledger_key">E</field>
3316+ </record>
3317+ <!-- IVA 10% -->
3318+ <record id="l10n_es.iva_rep_10" model="account.tax.template">
3319+ <field name="ledger_key">E</field>
3320+ </record>
3321+ <!-- IVA 21% -->
3322+ <record id="l10n_es.iva_rep_21" model="account.tax.template">
3323+ <field name="ledger_key">E</field>
3324+ </record>
3325+
3326+ <!-- Plantillas para recargo de equivalencia-->
3327+ <!-- 0.50% Recargo Equivalencia Ventas -->
3328+ <record id="l10n_es.re_05" model="account.tax.template">
3329+ <field name="ledger_key">E</field>
3330+ <field name="operation_key">-</field>
3331+ </record>
3332+ <!-- 1.4% Recargo Equivalencia Ventas -->
3333+ <record id="l10n_es.re_14" model="account.tax.template">
3334+ <field name="ledger_key">E</field>
3335+ <field name="operation_key">-</field>
3336+ </record>
3337+ <!-- 5.2% Recargo Equivalencia Ventas -->
3338+ <record id="l10n_es.re_52" model="account.tax.template">
3339+ <field name="ledger_key">E</field>
3340+ <field name="operation_key">-</field>
3341+ </record>
3342+ <!-- 0.50% Recargo Equivalencia Compras -->
3343+ <record id="l10n_es.re_buy_05" model="account.tax.template">
3344+ <field name="ledger_key">R</field>
3345+ <field name="operation_key">-</field>
3346+ </record>
3347+ <!-- 1.4% Recargo Equivalencia Compras -->
3348+ <record id="l10n_es.re_buy_14" model="account.tax.template">
3349+ <field name="ledger_key">R</field>
3350+ <field name="operation_key">-</field>
3351+ </record>
3352+ <!-- 5.2% Recargo Equivalencia Compras -->
3353+ <record id="l10n_es.re_buy_52" model="account.tax.template">
3354+ <field name="ledger_key">R</field>
3355+ <field name="operation_key">-</field>
3356+ </record>
3357+
3358+ <!-- OPERACIONES INTRACOMUNITARIAS -->
3359+
3360+ <!-- VENTAS -->
3361+ <!-- IVA 0% Intracomunitario -->
3362+ <record id="l10n_es.iva_IO" model="account.tax.template">
3363+ <field name="ledger_key">E</field>
3364+ </record>
3365+
3366+ <!-- COMPRAS -->
3367+ <!-- IVA 4% Intracomunitario. Bienes corrientes -->
3368+ <record id="l10n_es.iva_IC_compras_4_bc" model="account.tax.template">
3369+ <field name="ledger_key">R</field>
3370+ <field name="operation_key">P</field>
3371+ </record>
3372+ <!-- IVA 4% Intracomunitario. Bienes corrientes (1) -->
3373+ <record id="l10n_es.iva_IC_compras_4_bc_1" model="account.tax.template">
3374+ <field name="ledger_key">R</field>
3375+ <field name="operation_key">P</field>
3376+ </record>
3377+ <!-- IVA 4% Intracomunitario. Bienes corrientes (2) -->
3378+ <record id="l10n_es.iva_IC_compras_4_bc_2" model="account.tax.template">
3379+ <field name="ledger_key">R</field>
3380+ <field name="operation_key">P</field>
3381+ </record>
3382+ <!-- IVA 4% Intracomunitario. Bienes de inversión -->
3383+ <record id="l10n_es.iva_IC_compras_4_bi" model="account.tax.template">
3384+ <field name="ledger_key">I</field>
3385+ <field name="operation_key">P</field>
3386+ </record>
3387+ <!-- IVA 4% Intracomunitario. Bienes de inversión (1) -->
3388+ <record id="l10n_es.iva_IC_compras_4_bi_1" model="account.tax.template">
3389+ <field name="ledger_key">I</field>
3390+ <field name="operation_key">P</field>
3391+ </record>
3392+ <!-- IVA 4% Intracomunitario. Bienes de inversión (2) -->
3393+ <record id="l10n_es.iva_IC_compras_4_bi_2" model="account.tax.template">
3394+ <field name="ledger_key">I</field>
3395+ <field name="operation_key">P</field>
3396+ </record>
3397+ <!-- IVA 10% Intracomunitario. Bienes corrientes -->
3398+ <record id="l10n_es.iva_IC_compras_10_bc" model="account.tax.template">
3399+ <field name="ledger_key">R</field>
3400+ <field name="operation_key">P</field>
3401+ </record>
3402+ <!-- IVA 10% Intracomunitario. Bienes corrientes (1) -->
3403+ <record id="l10n_es.iva_IC_compras_10_bc_1" model="account.tax.template">
3404+ <field name="ledger_key">R</field>
3405+ <field name="operation_key">P</field>
3406+ </record>
3407+ <!-- IVA 10% Intracomunitario. Bienes corrientes (2) -->
3408+ <record id="l10n_es.iva_IC_compras_10_bc_2" model="account.tax.template">
3409+ <field name="ledger_key">R</field>
3410+ <field name="operation_key">P</field>
3411+ </record>
3412+ <!-- IVA 10% Intracomunitario. Bienes de inversión -->
3413+ <record id="l10n_es.iva_IC_compras_10_bi" model="account.tax.template">
3414+ <field name="ledger_key">I</field>
3415+ <field name="operation_key">P</field>
3416+ </record>
3417+ <!-- IVA 10% Intracomunitario. Bienes de inversión (1) -->
3418+ <record id="l10n_es.iva_IC_compras_10_bi_1" model="account.tax.template">
3419+ <field name="ledger_key">I</field>
3420+ <field name="operation_key">P</field>
3421+ </record>
3422+ <!-- IVA 10% Intracomunitario. Bienes de inversión (2) -->
3423+ <record id="l10n_es.iva_IC_compras_10_bi_2" model="account.tax.template">
3424+ <field name="ledger_key">I</field>
3425+ <field name="operation_key">P</field>
3426+ </record>
3427+ <!-- IVA 21% Intracomunitario. Bienes corrientes -->
3428+ <record id="l10n_es.iva_IC_compras_21_bc" model="account.tax.template">
3429+ <field name="ledger_key">R</field>
3430+ <field name="operation_key">P</field>
3431+ </record>
3432+ <!-- IVA 21% Intracomunitario. Bienes corrientes (1) -->
3433+ <record id="l10n_es.iva_IC_compras_21_bc_1" model="account.tax.template">
3434+ <field name="ledger_key">R</field>
3435+ <field name="operation_key">P</field>
3436+ </record>
3437+ <!-- IVA 21% Intracomunitario. Bienes corrientes (2) -->
3438+ <record id="l10n_es.iva_IC_compras_21_bc_2" model="account.tax.template">
3439+ <field name="ledger_key">R</field>
3440+ <field name="operation_key">P</field>
3441+ </record>
3442+ <!-- IVA 21% Intracomunitario. Bienes de inversión -->
3443+ <record id="l10n_es.iva_IC_compras_21_bi" model="account.tax.template">
3444+ <field name="ledger_key">I</field>
3445+ <field name="operation_key">P</field>
3446+ </record>
3447+ <!-- IVA 21% Intracomunitario. Bienes de inversión (1) -->
3448+ <record id="l10n_es.iva_IC_compras_21_bi_1" model="account.tax.template">
3449+ <field name="ledger_key">I</field>
3450+ <field name="operation_key">P</field>
3451+ </record>
3452+ <!-- IVA 21% Intracomunitario. Bienes de inversión (2) -->
3453+ <record id="l10n_es.iva_IC_compras_21_bi_2" model="account.tax.template">
3454+ <field name="ledger_key">I</field>
3455+ <field name="operation_key">P</field>
3456+ </record>
3457+ <!-- IVA Soportado exento (operaciones corrientes) -->
3458+ <record id="l10n_es.iva_sop_ex" model="account.tax.template">
3459+ <field name="ledger_key">R</field>
3460+ </record>
3461+ <!-- IVA Exento -->
3462+ <record id="l10n_es.iva_rep_ex" model="account.tax.template">
3463+ <field name="ledger_key">E</field>
3464+ </record>
3465+
3466+ </data>
3467+</openerp>
3468
3469=== renamed file 'l10n_es_aeat_mod340/taxes_data.xml' => 'l10n_es_aeat_mod340/taxes_data.xml.THIS'
3470=== modified file 'l10n_es_aeat_mod340/wizard/calculate_mod340_records.py'
3471--- l10n_es_aeat_mod340/wizard/calculate_mod340_records.py 2014-02-24 14:45:52 +0000
3472+++ l10n_es_aeat_mod340/wizard/calculate_mod340_records.py 2014-06-01 16:57:08 +0000
3473@@ -26,8 +26,8 @@
3474 import re
3475 from openerp.tools.translate import _
3476 from openerp.osv import orm
3477-from datetime import datetime
3478-from dateutil.relativedelta import relativedelta
3479+from openerp.tools.misc import DEFAULT_SERVER_DATETIME_FORMAT
3480+from openerp.tools.float_utils import float_round
3481
3482 class l10n_es_aeat_mod340_calculate_records(orm.TransientModel):
3483 _name = "l10n.es.aeat.mod340.calculate_records"
3484@@ -45,6 +45,48 @@
3485
3486
3487 def _calculate_records(self, cr, uid, ids, context=None, recalculate=True):
3488+ fiscal_position_tax_obj = self.pool.get('account.fiscal.position.tax')
3489+ def _get_source_tax(tax_line, pct, inv):
3490+ ''' Recupera cuál es el impuesto que originó la línea de impuesto a partir
3491+ de su tipo y su código base '''
3492+ for line in inv.invoice_line:
3493+ for tax in line.invoice_line_tax_id:
3494+ if tax.base_code_id.id == tax_line.base_code_id.id and pct == tax.amount:
3495+ return tax
3496+ for child_tax in tax.child_ids:
3497+ if child_tax.base_code_id.id == tax_line.base_code_id.id and pct == child_tax.amount:
3498+ return child_tax
3499+ raise orm.except_orm(_('Error'),
3500+ _("Invoice %s: Unable to determine the tax line %s source tax. The base code of the source tax may have been changed, please recompute the invoice taxes") % (inv.number,tax_line.name))
3501+
3502+
3503+ def _get_surcharged_tax(position_id, surcharge_id):
3504+ mapping_ids = fiscal_position_tax_obj.search(cr, uid, [('position_id','=',position_id),
3505+ ('tax_dest_id','=',surcharge_id)], context=context)
3506+ if not mapping_ids:
3507+ return False
3508+ mapping = fiscal_position_tax_obj.browse(cr, uid, mapping_ids[0], context)
3509+ mapping_ids = fiscal_position_tax_obj.search(cr, uid, [('position_id','=',position_id),
3510+ ('tax_src_id','=',mapping.tax_src_id.id),
3511+ ('tax_dest_id','!=',surcharge_id)], context=context)
3512+ if not mapping_ids:
3513+ return False
3514+ mapping = fiscal_position_tax_obj.browse(cr, uid, mapping_ids[0], context)
3515+ return mapping.tax_dest_id.id
3516+
3517+ def _rounded_pct(allowed_pcts, pct, key, invoice, threshold=0.01):
3518+ pcts = allowed_pcts[key]
3519+ sign = 1
3520+ if pct < 0:
3521+ sign = -1
3522+ pct = pct * -1
3523+ candidates = [(x, abs(x-pct)) for x in pcts]
3524+ candidates.sort(key=lambda x: x[1])
3525+ if candidates[0][1] <= threshold:
3526+ return candidates[0][0] * sign
3527+ raise orm.except_orm(_('Error'),
3528+ _("Invoice %s: No match found for tax percentage %s") % (invoice.number, pct))
3529+
3530 if context is None:
3531 context = {}
3532
3533@@ -54,12 +96,22 @@
3534
3535 invoices340 = self.pool.get('l10n.es.aeat.mod340.issued')
3536 invoices340_rec = self.pool.get('l10n.es.aeat.mod340.received')
3537+ invoices340_inv = self.pool.get('l10n.es.aeat.mod340.investment')
3538+ invoices340_intra = self.pool.get('l10n.es.aeat.mod340.intracomunitarias')
3539 period_obj = self.pool.get('account.period')
3540+ precision = self.pool.get('decimal.precision').precision_get(cr, uid, 'Account')
3541+ tax_obj = self.pool.get('account.tax')
3542
3543- mod340.write({
3544- 'state' : 'calculated',
3545- 'calculation_date' : time.strftime('%Y-%m-%d %H:%M:%S')
3546- })
3547+ allowed_tax_pct = tax_obj._allowed_pct_by_ledger(cr, uid, context)
3548+ ledger2obj = {
3549+ 'I': invoices340_inv,
3550+ 'J': invoices340_inv,
3551+ 'U': invoices340_intra,
3552+ 'E': invoices340,
3553+ 'F': invoices340,
3554+ 'R': invoices340_rec,
3555+ 'S': invoices340_rec
3556+ }
3557
3558 if not mod340.company_id.partner_id.vat:
3559 raise orm.except_orm(mod340.company_id.partner_id.name,
3560@@ -68,9 +120,6 @@
3561 wf_service = netsvc.LocalService("workflow")
3562 wf_service.trg_validate(uid, 'l10n.es.aeat.mod347.report',
3563 ids and ids[0], 'calculate', cr)
3564-
3565- code = '340' + mod340.fiscalyear_id.code + ''
3566- code += mod340.period_to.date_stop[5:7] + '0001'
3567
3568 account_period_ids = period_obj.build_ctx_periods(cr, uid,
3569 mod340.period_from.id, mod340.period_to.id)
3570@@ -80,25 +129,27 @@
3571 _("The periods selected don't belong to the fiscal year %s")
3572 % (mod340.fiscalyear_id.name))
3573
3574- tot_base = 0
3575- tot_amount = 0
3576- tot_tot = 0
3577- tot_rec = 0
3578-
3579-
3580 #Limpieza de las facturas calculadas anteriormente
3581
3582- del_ids = invoices340.search(cr, uid, [
3583- ('mod340_id', '=', mod340.id)])
3584+ del_ids = invoices340.search(cr, uid, [('mod340_id', '=', mod340.id)])
3585
3586 if del_ids:
3587 invoices340.unlink(cr, uid, del_ids, context=context)
3588
3589- del_ids = invoices340_rec.search(cr, uid, [
3590- ('mod340_id', '=', mod340.id)])
3591+ del_ids = invoices340_rec.search(cr, uid, [('mod340_id', '=', mod340.id)])
3592
3593 if del_ids:
3594 invoices340_rec.unlink(cr, uid, del_ids, context=context)
3595+
3596+ del_ids = invoices340_inv.search(cr, uid, [('mod340_id', '=', mod340.id)])
3597+
3598+ if del_ids:
3599+ invoices340_inv.unlink(cr, uid, del_ids, context=context)
3600+
3601+ del_ids = invoices340_intra.search(cr, uid, [('mod340_id', '=', mod340.id)])
3602+
3603+ if del_ids:
3604+ invoices340_intra.unlink(cr, uid, del_ids, context=context)
3605
3606 domain = [('period_id', 'in',account_period_ids),
3607 ('state', 'in', ('open', 'paid'))]
3608@@ -111,6 +162,7 @@
3609 if tax_line.base_code_id and tax_line.base:
3610 if tax_line.base_code_id.mod340 == True:
3611 include = True
3612+ break
3613 if include == True:
3614 if invoice.partner_id.vat_type == 1:
3615 if not invoice.partner_id.vat:
3616@@ -122,7 +174,8 @@
3617 re.match(r"([A-Z]{0,2})(.*)",
3618 invoice.partner_id.vat).groups()[1]
3619 country_code = invoice.partner_id.country_id.code
3620-
3621+ ledger_key, operation_key = invoice_obj.get_340_classification(cr, uid, invoice.id, context)
3622+ amounts = invoice_obj.get_cc_amounts(cr, uid, invoice.id, context)
3623 values = {
3624 'mod340_id': mod340.id,
3625 'partner_id': invoice.partner_id.id,
3626@@ -130,33 +183,49 @@
3627 'representative_vat': '',
3628 'partner_country_code': country_code,
3629 'invoice_id': invoice.id,
3630- 'base_tax': invoice.amount_untaxed,
3631- 'amount_tax': invoice.amount_tax,
3632- 'total': invoice.amount_total,
3633+ 'base_tax': amounts['cc_amount_untaxed'],
3634+ 'total': amounts['cc_amount_total'],
3635 'date_invoice': invoice.date_invoice,
3636+ 'ledger_key': ledger_key,
3637+ 'operation_key': operation_key
3638 }
3639+ if ledger_key in ('I', 'J'):
3640+ values['use_date'] = invoice.date_invoice
3641 if invoice.type in ( 'out_refund','in_refund'):
3642 values['base_tax'] *= -1
3643- values['amount_tax'] *= -1
3644 values['total'] *= -1
3645-
3646
3647- if invoice.type=="out_invoice" or invoice.type=="out_refund":
3648- invoice_created = invoices340.create(cr,uid,values)
3649-
3650- if invoice.type=="in_invoice" or invoice.type=="in_refund":
3651- invoice_created = invoices340_rec.create(cr,uid,values)
3652+ invoice_created = ledger2obj[ledger_key].create(cr,uid,values)
3653
3654 tot_tax_invoice = 0
3655- check_tax = 0
3656 check_base = 0
3657-
3658+ added_tax_lines = []
3659+ values_taxes = {}
3660+ values_surcharges = {}
3661 # Add the invoices detail to the partner record
3662 for tax_line in invoice.tax_line:
3663 if tax_line.base_code_id and tax_line.base:
3664 if tax_line.base_code_id.mod340 == True:
3665 tax_percentage = tax_line.amount/tax_line.base
3666-
3667+ tax_percentage = _rounded_pct(allowed_tax_pct, tax_percentage, ledger_key, invoice)
3668+ source_tax = _get_source_tax(tax_line, tax_percentage, invoice)
3669+
3670+ #El IVA agrario aunque tenga tipo 12% debe declararse con 0%
3671+ if source_tax.operation_key and source_tax.operation_key == 'X':
3672+ tax_percentage = 0
3673+
3674+ #No se debe contar la base de los recargos de equivalencia o el
3675+ #check fallará al sumar el doble que el subtotal de la factura
3676+ if tax_percentage >= 0 and source_tax.operation_key != '-':
3677+ check_base += tax_line.base
3678+
3679+ #Los impuestos que se desdoblan en 2 hijos como los de
3680+ #compras intra solo deben generar un registro
3681+ if (tax_line.base_amount, tax_percentage) in added_tax_lines:
3682+ continue
3683+
3684+ tot_tax_invoice += tax_line.tax_amount
3685+ added_tax_lines.append((tax_line.base_amount, tax_percentage*-1))
3686 values = {
3687 'name': tax_line.name,
3688 'tax_percentage': tax_percentage,
3689@@ -164,54 +233,58 @@
3690 'base_amount': tax_line.base_amount,
3691 'invoice_record_id': invoice_created,
3692 }
3693- if invoice.type=="out_invoice" or invoice.type=="out_refund":
3694- issued_obj = self.pool.get('l10n.es.aeat.mod340.tax_line_issued')
3695- issued_obj.create(cr, uid, values)
3696- if invoice.type=="in_invoice" or invoice.type=="in_refund":
3697- received_obj = self.pool.get('l10n.es.aeat.mod340.tax_line_received')
3698- received_obj.create(cr, uid, values)
3699- tot_tax_invoice += tax_line.tax_amount
3700- tot_rec += 1
3701- check_tax += tax_line.tax_amount
3702- if tax_percentage >= 0:
3703- check_base += tax_line.base_amount
3704-
3705- tot_base += invoice.amount_untaxed
3706- tot_amount += tot_tax_invoice
3707- tot_tot += invoice.amount_untaxed + tot_tax_invoice
3708-
3709- if invoice.type == "out_invoice" or invoice.type == "out_refund":
3710- invoices340.write(cr,uid,invoice_created,
3711- {'amount_tax':tot_tax_invoice})
3712- if invoice.type == "in_invoice" or invoice.type == "in_refund":
3713- invoices340_rec.write(cr,uid,invoice_created,
3714- {'amount_tax':tot_tax_invoice})
3715-
3716- sign=1
3717- if invoice.type in ( 'out_refund','in_refund' ):
3718- sign = -1
3719-
3720- if str(invoice.amount_untaxed*sign) != str(check_base):
3721+ if source_tax.ledger_key in ('I','J'):
3722+ values['goods_identification'] = invoice_obj.get_inv_good_names(cr, uid, invoice.id, tax_percentage, context)
3723+
3724+ # Separamos recargos de los impuestos corrientes y agrupamos por impuesto
3725+ # Esta agrupación se hace porque un mismo impuesto OpenERP lo desdobla en 2 líneas de impuestos
3726+ # si hay líneas con importe positivo (línea impuesto con base con un signo)
3727+ # y negativo (línea impuesto con base de signo opuesto)
3728+ if source_tax.operation_key and source_tax.operation_key == '-':
3729+ if source_tax.id in values_surcharges:
3730+ for key in ['tax_amount', 'base_amount']:
3731+ values_surcharges[source_tax.id][key] += values[key]
3732+ else:
3733+ values_surcharges[source_tax.id] = values
3734+ else:
3735+ if source_tax.id in values_taxes:
3736+ for key in ['tax_amount', 'base_amount']:
3737+ values_taxes[source_tax.id][key] += values[key]
3738+ else:
3739+ values_taxes[source_tax.id] = values
3740+
3741+ #Juntamos los recargos con los registros de impuestos a los que afectan
3742+ position_id = invoice.fiscal_position.id
3743+ for surcharge_id, values in values_surcharges.items():
3744+ surcharged_tax_id = _get_surcharged_tax(position_id, surcharge_id)
3745+ if not surcharged_tax_id:
3746+ raise orm.except_orm(_('Error'),
3747+ _("Invoice %s: Unable to determine the surcharged tax because it is not mapped in the partner's fiscal position %s")
3748+ % (invoice.number, surcharge_id.description))
3749+ values_taxes[surcharged_tax_id]['surcharge_percentage'] = values['tax_percentage']
3750+ values_taxes[surcharged_tax_id]['surcharge_amount'] = values['tax_amount']
3751+
3752+ ledger2obj[ledger_key].write(cr, uid, invoice_created,
3753+ {'tax_line_ids': [(0,0, values) for values in values_taxes.values()],
3754+ 'amount_tax':tot_tax_invoice}, context)
3755+
3756+ if abs(float_round(invoice.amount_untaxed, precision)-float_round(check_base, precision)) > 0.01:
3757 raise orm.except_orm( "REVIEW INVOICE",
3758- _('Invoice %s, Amount untaxed Lines %.2f do not correspond to AmountUntaxed on Invoice %.2f' )
3759+ _('Invoice %s, Amount untaxed on Lines %.2f do not correspond to AmountUntaxed on Invoice %.2f' )
3760 %(invoice.number, check_base,
3761- invoice.amount_untaxed*sign) )
3762+ invoice.amount_untaxed) )
3763
3764- mod340.write({'total_taxable':tot_base,'total_sharetax':tot_amount,
3765- 'number_records':tot_rec,'total':tot_tot,
3766- 'declaration_number':code})
3767-
3768- if recalculate:
3769- mod340.write({
3770- 'state' : 'calculated',
3771- 'calculation_date' : time.strftime('%Y-%m-%d %H:%M:%S')
3772- })
3773+ code = '340' + mod340.fiscalyear_id.code
3774+ code += mod340.period_to.date_stop[5:7] + '0001'
3775+ mod340.write({
3776+ 'declaration_number':code,
3777+ 'state' : 'calculated',
3778+ 'calculation_date' : time.strftime(DEFAULT_SERVER_DATETIME_FORMAT)
3779+ })
3780
3781 except Exception, ex:
3782 raise
3783-
3784-
3785-
3786+
3787 return True
3788
3789
3790
3791=== modified file 'l10n_es_aeat_mod340/wizard/export_mod340_to_boe.py'
3792--- l10n_es_aeat_mod340/wizard/export_mod340_to_boe.py 2014-02-16 18:24:48 +0000
3793+++ l10n_es_aeat_mod340/wizard/export_mod340_to_boe.py 2014-06-01 16:57:08 +0000
3794@@ -26,11 +26,19 @@
3795 from openerp.osv import orm
3796 import base64
3797 import time
3798+from openerp.tools.misc import DEFAULT_SERVER_DATE_FORMAT
3799
3800
3801 class l10n_es_aeat_mod340_export_to_boe(orm.TransientModel):
3802 _inherit = "l10n.es.aeat.report.export_to_boe"
3803 _name = "l10n.es.aeat.mod340.export_to_boe"
3804+
3805+ def _formatDate(self, date_str):
3806+ #TODO: mover este método a l10n.es.aeat.report.export_to_boe
3807+ if not date_str:
3808+ return '0'*8
3809+ date = datetime.strptime(date_str,DEFAULT_SERVER_DATE_FORMAT)
3810+ return datetime.strftime(date, "%Y%m%d")
3811
3812 def _get_formatted_declaration_record(self, cr, uid, report, context=None):
3813 """
3814@@ -146,10 +154,9 @@
3815 79-95 Número de identificación fiscal en el país de
3816 residencia. TODO de momento blancos.
3817 96-98 Blancos
3818- 99 Clave tipo de libro. Constante 'E'.
3819- 100 Clave de operación. Constante ' ' para un solo tipo de
3820- IVA. Constante 'C' para varios tipos de IVA. TODO Resto
3821- de operaciones. Varios tipos impositivos.
3822+ 99 Clave tipo de libro.
3823+ 100 Clave de operación. Recuperado de los impuestos de la factura.
3824+ Constante 'C' para varios tipos de IVA.
3825 101-108 Fecha de expedición
3826 109-116 Fecha de operación. Se consigna la misma que
3827 expedición. TODO. Fecha del uso del bien.
3828@@ -167,8 +174,8 @@
3829 246-325 Intervalo de acumulación. Vacio. TODO Intervalo de
3830 resumenes de facturas o tickets.
3831 326-365 Identificación de la factura rectificativa. TODO.
3832- 366-370 Tipo recargo de equivalencia. TODO.
3833- 371-384 Cuota recargo de equivalencia. TODO.
3834+ 366-370 Tipo recargo de equivalencia.
3835+ 371-384 Cuota recargo de equivalencia.
3836 385 Situación del Inmueble #TODO
3837 386-410 Referencia Catastral #TODO
3838 411-425 Importe Percibido en Metálico #TODO
3839@@ -210,27 +217,19 @@
3840 else: text += 17 * ' '
3841 # Blancos
3842 text += 3 * ' '
3843- # Clave tipo de libro. Constante 'E'.
3844- text += 'E'
3845+ # Clave tipo de libro.
3846+ text += self._formatString(invoice_issued.ledger_key, 1)
3847 # Clave de operación
3848 if invoice_issued.invoice_id.origin_invoices_ids:
3849- text += 'D'
3850- elif len(invoice_issued.tax_line_ids) > 1: text += 'C'
3851- elif invoice_issued.invoice_id.is_ticket_summary == 1: text += 'B'
3852- else: text += ' '
3853-
3854- text += self._formatNumber(
3855- invoice_issued.invoice_id.date_invoice.split('-')[0], 4)
3856- text += self._formatNumber(
3857- invoice_issued.invoice_id.date_invoice.split('-')[1], 2)
3858- text += self._formatNumber(
3859- invoice_issued.invoice_id.date_invoice.split('-')[2], 2)
3860- text += self._formatNumber(
3861- invoice_issued.invoice_id.date_invoice.split('-')[0], 4)
3862- text += self._formatNumber(
3863- invoice_issued.invoice_id.date_invoice.split('-')[1], 2)
3864- text += self._formatNumber(
3865- invoice_issued.invoice_id.date_invoice.split('-')[2], 2)
3866+ clave_operacion = 'D'
3867+ elif len(invoice_issued.tax_line_ids) > 1: clave_operacion = 'C'
3868+ elif invoice_issued.invoice_id.is_ticket_summary == 1: clave_operacion = 'B'
3869+ else: clave_operacion = self._formatString(invoice_issued.operation_key, 1)
3870+ text += clave_operacion
3871+
3872+ text += self._formatDate(invoice_issued.invoice_id.date_invoice)
3873+ text += self._formatDate(invoice_issued.invoice_id.date_invoice)
3874+
3875 #Tipo impositivo
3876 text += self._formatNumber(tax_line.tax_percentage * 100, 3, 2)
3877 # Base imponible
3878@@ -252,7 +251,12 @@
3879 text += self._formatNumber(invoice_issued.invoice_id.number_tickets, 8)
3880 else: text += self._formatNumber(1, 8)
3881 # Número de registros (Desglose)
3882- text += self._formatNumber(len(invoice_issued.tax_line_ids), 2)
3883+ # Si una rectificativa lleva varios tipos de impuesto,
3884+ # se debe declarar con clave D y registros 1 (como si fueran facturas individuales)
3885+ if clave_operacion == 'D':
3886+ text += self._formatNumber(1, 2)
3887+ else:
3888+ text += self._formatNumber(len(invoice_issued.tax_line_ids), 2)
3889 # Intervalo de identificación de la acumulación
3890 if invoice_issued.invoice_id.is_ticket_summary == 1:
3891 text += self._formatString(invoice_issued.invoice_id.first_ticket, 40)
3892@@ -262,9 +266,9 @@
3893 text += self._formatString( ",".join( [x.number for x in \
3894 invoice_issued.invoice_id.origin_invoices_ids]) , 40 )
3895 # Tipo Recargo de equivalencia
3896- text += self._formatNumber(0, 5)
3897+ text += self._formatNumber(tax_line.surcharge_percentage, 3, 2)
3898 # Couta del recargo de equivalencia
3899- text += ' '+self._formatNumber(0, 11, 2)
3900+ text += self._formatNumber(tax_line.surcharge_amount, 11, 2,True)
3901 #Situación del Inmueble #TODO
3902 text += '0'
3903 #Referencia Catastral #TODO
3904@@ -305,8 +309,9 @@
3905 78 Clave de identificación en el país de residencia
3906 79-95 Número de identificación fiscal en el país de residencia. TODO de momento blancos.
3907 96-98 Blancos
3908- 99 Clave tipo de libro. Constante 'R'.
3909- 100 Clave de operación. Constante ' ' para un solo tipo de IVA. Constante 'C' para varios tipos de IVA. TODO Resto de operaciones. Varios tipos impositivos.
3910+ 99 Clave tipo de libro.
3911+ 100 Clave de operación. Constante ' ' para un solo tipo de IVA. Recuperado de los impuestos de la factura.
3912+ Constante 'C' para varios tipos de IVA.
3913 101-108 Fecha de expedición
3914 109-116 Fecha de operación. Se consigna la misma que expedición. TODO. Fecha del uso del bien.
3915 117-121 Tipo impositivo
3916@@ -354,19 +359,18 @@
3917 else: text += 17*' '
3918 # Blancos
3919 text += 3*' '
3920- # Clave tipo de libro. Constante 'R'.
3921- text += 'R'
3922+ # Clave tipo de libro.
3923+ ledger_key = invoice_received.ledger_key
3924+ if ledger_key in ('I','J'):
3925+ ledger_key = 'R'
3926+ text += self._formatString(ledger_key, 1)
3927 # Clave de operación
3928- if len(invoice_received.tax_line_ids) > 1: text += 'C'
3929- else: text += ' '
3930+ if len(invoice_received.tax_line_ids) > 1 and invoice_received.operation_key not in ('P','I'): text += 'C'
3931+ else: text += self._formatString(invoice_received.operation_key, 1)
3932 # Fecha de expedición
3933- text += self._formatNumber(invoice_received.invoice_id.date_invoice.split('-')[0], 4)
3934- text += self._formatNumber(invoice_received.invoice_id.date_invoice.split('-')[1], 2)
3935- text += self._formatNumber(invoice_received.invoice_id.date_invoice.split('-')[2], 2)
3936+ text += self._formatDate(invoice_received.invoice_id.date_invoice)
3937 # Fecha de operación
3938- text += self._formatNumber(invoice_received.invoice_id.date_invoice.split('-')[0], 4)
3939- text += self._formatNumber(invoice_received.invoice_id.date_invoice.split('-')[1], 2)
3940- text += self._formatNumber(invoice_received.invoice_id.date_invoice.split('-')[2], 2)
3941+ text += self._formatDate(invoice_received.invoice_id.date_invoice)
3942 #Tipo impositivo
3943 text += self._formatNumber(tax_line.tax_percentage * 100, 3, 2)
3944 # Base imponible
3945@@ -406,6 +410,127 @@
3946
3947 assert len(text) == 502*len(invoice_received.tax_line_ids), _("The type 2 received record must be 500 characters long for each Vat registry")
3948 return text
3949+
3950+
3951+ def _get_formatted_invoice_investment(self, cr, uid, report, invoice_investment):
3952+ """
3953+ Returns a type 2, investment goods invoice, formated record
3954+
3955+ Format of the record:
3956+ Tipo de Registro 2 – Registro de facturas de bienes de inversión
3957+ Posiciones Descripción
3958+ 1 Tipo de Registro
3959+ 2-4 Modelo Declaración
3960+ 5-8 Ejercicio
3961+ 9-17 NIF del declarante
3962+ 18-26 NIF del declarado
3963+ 27-35 NIF del representante legal
3964+ 36-75 Apellidos y nombre, razón social o
3965+ denominación del declarado
3966+ 76-77 Código país
3967+ 78 Clave de identificación en el país de residencia
3968+ 79-95 Número de identificación fiscal en el país de
3969+ residencia. TODO de momento blancos.
3970+ 96-98 Blancos
3971+ 99 Clave tipo de libro. 'I' o 'J' (IGIC), según impuesto.
3972+ 100 Clave de operación. Recuperado de los impuestos de la factura.
3973+ Constante 'C' para varios tipos de IVA.
3974+ 101-108 Fecha de expedición
3975+ 109-116 Fecha de operación. Se consigna la misma que
3976+ expedición. TODO. Fecha del uso del bien.
3977+ 117-121 Tipo impositivo
3978+ 122-135 Base imponible
3979+ 136-149 Cuota del impuesto
3980+ 150-163 Importe total de la factura
3981+ 164-177 Base imponible a coste. TODO de momento 0.
3982+ 178-217 Identificación de la factura
3983+ 218-235 Número de registro
3984+ 236-238 Prorrata anual definitiva
3985+ 239-252 Regularización anual de la deducción TODO
3986+ 253-292 Identificación de la entrega
3987+ 293-306 Regularización anual de la deducción efectuada TODO
3988+ 307-314 Fecha de inicio de la utilización
3989+ 315-331 Identificación del bien
3990+ 332-500 BLANCO
3991+
3992+ """
3993+ text = ''
3994+ for tax_line in invoice_investment.tax_line_ids:
3995+ # Tipo de Registro
3996+ text += '2'
3997+ # Modelo Declaración
3998+ text += '340'
3999+ # Ejercicio
4000+ text += self._formatString(report.fiscalyear_id.code, 4)
4001+ # NIF del declarante
4002+ text += self._formatString(report.company_vat, 9)
4003+ # NIF del declarado
4004+ if invoice_investment.partner_country_code == 'ES':
4005+ text += self._formatString(invoice_investment.partner_vat, 9)
4006+ else: text += self._formatString(' ', 9)
4007+ # NIF del representante legal
4008+ text += self._formatString(invoice_investment.representative_vat, 9)
4009+ # Apellidos y nombre, razón social o denominación del declarado
4010+ text += self._formatString(invoice_investment.partner_id.name, 40)
4011+ # Código país
4012+ text += self._formatString(invoice_investment.partner_country_code, 2)
4013+ # Clave de identificación en el país de residencia
4014+ text += self._formatNumber(invoice_investment.partner_id.vat_type, 1)
4015+ # Número de identificación fiscal en el país de residencia.
4016+ if invoice_investment.partner_country_code != 'ES':
4017+ text += self._formatString(invoice_investment.partner_country_code, 2)
4018+ text += self._formatString(invoice_investment.partner_vat, 15)
4019+ else: text += 17 * ' '
4020+ # Blancos
4021+ text += 3 * ' '
4022+ # Clave tipo de libro. 'I' o 'J' (IGIC), según impuesto.
4023+ text += self._formatString(invoice_investment.ledger_key, 1)
4024+ # Clave de operación
4025+ if len(invoice_investment.tax_line_ids) > 1 and invoice_investment.operation_key not in ('P','I'): text += 'C'
4026+ else: text += self._formatString(invoice_investment.operation_key, 1)
4027+
4028+ text += self._formatDate(invoice_investment.invoice_id.date_invoice)
4029+ text += self._formatDate(invoice_investment.invoice_id.date_invoice)
4030+ #Tipo impositivo
4031+ text += self._formatNumber(tax_line.tax_percentage * 100, 3, 2)
4032+ # Base imponible
4033+ text += self._formatNumber(tax_line.base_amount, 11, 2, True)
4034+ # Cuota del impuesto
4035+ text += self._formatNumber(tax_line.tax_amount, 11, 2, True)
4036+ # Importe total de la factura
4037+ text += self._formatNumber(tax_line.tax_amount+
4038+ tax_line.base_amount, 11, 2, True)
4039+ # Base imponible a coste.
4040+ text += ' '+self._formatNumber(0, 11, 2)
4041+ # Identificación de la factura
4042+ text += self._formatString(invoice_investment.invoice_id.number, 40)
4043+ # Número de registro
4044+ sequence_obj = self.pool.get('ir.sequence')
4045+ text += self._formatString(sequence_obj.get(cr, uid, 'mod340'), 18)
4046+ #Prorrata anual definitiva
4047+ text += self._formatNumber(invoice_investment.prorata, 3, 0)
4048+ #Regularización anual de la deducción TODO
4049+ text += ' ' + '0'*13
4050+ #Identificación de la entrega
4051+# Se consignarán la identificación de la factura que
4052+# corresponde en el LIBRO REGISTRO DE FACTURAS
4053+# EXPEDIDAS que recoge la entrega.
4054+# Esto qué es? la referencia del proveedor??
4055+ text += self._formatString(invoice_investment.invoice_id.reference, 40)
4056+ #Regularización de la deducción efectuada (transmisiones) TODO
4057+ text += ' ' + '0'*13
4058+ #Fecha de inicio de la utilización
4059+ text += self._formatDate(invoice_investment.use_date)
4060+ #Identificación del bien
4061+ text += self._formatString(tax_line.goods_identification, 17)
4062+ #Blancos
4063+ text += ' '*169
4064+ text += '\r\n'
4065+ assert len(text) == 502 * len(invoice_investment.tax_line_ids), _("The type 2 issued record must be 500 characters long for each Vat registry")
4066+ return text
4067+
4068+
4069+
4070
4071 def _get_formatted_other_records(self, cr, uid, report,context=None):
4072 file_contents = ''
4073@@ -413,10 +538,19 @@
4074 for invoice_issued in report.issued:
4075 file_contents += self._get_formatted_invoice_issued(cr,uid,report,
4076 invoice_issued)
4077-
4078+
4079 for invoice_received in report.received:
4080 file_contents += self._get_formatted_invoice_received(cr,uid,
4081 report, invoice_received)
4082+
4083+ if report.investment_goods_prorating:
4084+ for invoice_investment in report.investment:
4085+ file_contents += self._get_formatted_invoice_investment(cr,uid,
4086+ report, invoice_investment)
4087+ else:
4088+ for invoice_investment in report.investment:
4089+ file_contents += self._get_formatted_invoice_received(cr,uid,
4090+ report, invoice_investment)
4091
4092 return file_contents
4093