~aluengo/openerp-spain/hr_holidays_extended

« back to all changes in this revision

Viewing changes to l10n_es_aeat_mod349/wizard/export_mod349_to_boe.py

  • Committer: Albert Cervera i Areny
  • Date: 2011-09-20 06:50:10 UTC
  • Revision ID: albert@nan-tic.com-20110920065010-amy1o4sy9t6i0vg4
[FIX] l10n_es_aeat_mod349: Only use the first four digits of fiscal year's code to determine fiscal year's number and also give a decent message to the user if it's not a number instead of simply crashing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
218
218
 
219
219
        text += '2'                                                             # Tipo de registro
220
220
        text += '349'                                                           # Modelo de declaración
221
 
        text += self._formatNumber(report.fiscalyear_id.code, 4)                # Ejercicio
 
221
        text += self._formatNumber(report.fiscalyear_id.code[:4], 4)                # Ejercicio
222
222
        text += self._formatString(report.company_vat, 9)                       # NIF del declarante
223
223
        text += 58*' '                                                          # Blancos        
224
224
        text += self._formatString(refund_record.partner_id.vat, 17)            # NIF del operador intracomunitario
225
225
        text += self._formatString(refund_record.partner_id.name, 40)           # Apellidos y nombre o razón social del operador intracomunitario
226
226
        text += self._formatString(refund_record.operation_key, 1)              # Clave de operación
227
227
        text += 13*' '                                                          # Blancos
228
 
        text += self._formatNumber(refund_record.fiscalyear_id.code, 4)         # Ejercicio (de la rectificación)
 
228
        text += self._formatNumber(refund_record.fiscalyear_id.code[:4], 4)         # Ejercicio (de la rectificación)
229
229
        text += self._formatString(period, 2)                                   # Periodo (de la rectificación)
230
230
        text += self._formatNumber(refund_record.total_operation_amount, 11, 2) # Base imponible de la rectificación
231
231
        text += self._formatNumber(refund_record.total_origin_amount, 11, 2)    # Base imponible declarada anteriormente