Пример #1
0
 def startElement(self, tag, attrs):
     if (tag == 'cfdi:Comprobante'):
         Base32Handler.transform_comprobante(self, tag, attrs)
     elif (tag == 'cfdi:Emisor'):
         self._start_emisor = True
         Base32Handler.transform_emisor(self, tag, attrs)
     elif (tag == 'cfdi:RegimenFiscal' and self._start_emisor):
         Base32Handler.transform_regimen_fiscal(self, tag, attrs)
     elif (tag == 'cfdi:Receptor'):
         Base32Handler.transform_receptor(self, tag, attrs)
     elif (tag == 'cfdi:Concepto'):
         self._start_concept = True
         self.__transform_conceptos(tag, attrs)
     elif (tag == 'cfdi:Impuestos' and self._start_concept == False):
         self.__transform_impuestos(tag, attrs)
     elif (tag == 'cfdi:Traslado' and self._start_concept == False):
         self.__transform_impuestos_traslados(tag, attrs)
     elif (tag == 'cfdi:Retencion' and self._start_concept == False):
         self.__transform_impuestos_retenciones(tag, attrs)
     elif (tag == 'cfdi:Complemento'):
         self._start_complement = True
     elif (tag == 'tfd:TimbreFiscalDigital'):
         self._complement_profundity += 1
         Base32Handler.transform_tfd(self, tag, attrs)
     elif (tag == 'implocal:ImpuestosLocales'):
         self._complement_profundity += 1
         self.__transform_imploc(tag, attrs)
     elif (self._start_complement):
         self._complement_profundity += 1
Пример #2
0
 def startElement(self, tag, attrs):
     if (tag == 'cfdi:Comprobante'):
         if ('Version' in attrs):
             Base33Handler.transform_comprobante(self, tag, attrs)
         elif ('version' in attrs):
             Base32Handler.transform_comprobante(self, tag, attrs)
     elif (tag == 'cfdi:Emisor'):
         if (self._version == '3.3'):
             Base33Handler.transform_emisor(self, tag, attrs)
         else:
             self._start_emisor = True
             Base32Handler.transform_emisor(self, tag, attrs)
     elif (tag == 'cfdi:Receptor'):
         if (self._version == '3.3'):
             Base33Handler.transform_receptor(self, tag, attrs)
         else:
             Base32Handler.transform_receptor(self, tag, attrs)
     elif (tag == 'cfdi:RegimenFiscal' and self._start_emisor
           and self._version == '3.2'):
         Base32Handler.transform_regimen_fiscal(self, tag, attrs)
     elif (tag == 'tfd:TimbreFiscalDigital'):
         if (self._version == '3.3'):
             Base33Handler.transform_tfd(self, tag, attrs)
         else:
             Base32Handler.transform_tfd(self, tag, attrs)
     elif (tag == 'pago10:Pago'):
         self.__transform_pago(tag, attrs)
     elif (tag == 'pago10:DoctoRelacionado'):
         self.__transform_docto_relacionado(tag, attrs)
Пример #3
0
 def startElement(self, tag, attrs):
     if (tag == 'cfdi:Comprobante'):
         Base32Handler.transform_comprobante(self, tag, attrs)
     elif (tag == 'cfdi:Emisor'):
         Base32Handler.transform_emisor(self, tag, attrs)
     elif (tag == 'cfdi:Receptor'):
         Base32Handler.transform_receptor(self, tag, attrs)
     elif (tag == 'cfdi:Concepto'):
         self._position_concept += 1
         self.__transform_conceptos(tag, attrs)
     elif (tag == 'tfd:TimbreFiscalDigital'):
         Base32Handler.transform_tfd(self, tag, attrs)
Пример #4
0
 def startElement(self, tag, attrs):
     if (tag == 'cfdi:Comprobante'):
         if ('Version' in attrs):
             Base33Handler.transform_comprobante(self, tag, attrs)
         elif ('version' in attrs):
             Base32Handler.transform_comprobante(self, tag, attrs)
     elif (tag == 'cfdi:Emisor'):
         if (self._version == '3.3'):
             Base33Handler.transform_emisor(self, tag, attrs)
         else:
             self._start_emisor = True
             Base32Handler.transform_emisor(self, tag, attrs)
     elif (tag == 'cfdi:Receptor'):
         if (self._version == '3.3'):
             Base33Handler.transform_receptor(self, tag, attrs)
         else:
             Base32Handler.transform_receptor(self, tag, attrs)
     elif (tag == 'cfdi:RegimenFiscal' and self._start_emisor
           and self._version == '3.2'):
         Base32Handler.transform_regimen_fiscal(self, tag, attrs)
     elif (tag == 'tfd:TimbreFiscalDigital'):
         if (self._version == '3.3'):
             Base33Handler.transform_tfd(self, tag, attrs)
         else:
             Base32Handler.transform_tfd(self, tag, attrs)
     elif (tag == 'nomina12:Nomina'):
         self.__transform_nomina12(tag, attrs)
     elif (tag == 'nomina12:Emisor'):
         self.__transform_nomina12_emisor(tag, attrs)
     elif (tag == 'nomina12:Receptor'):
         self.__transform_nomina12_receptor(tag, attrs)
     elif (tag == 'nomina12:Percepciones'):
         self.__transform_nomina12_percepciones(tag, attrs)
     elif (tag == 'nomina12:Percepcion'):
         self.__transform_nomina12_percepcion(tag, attrs)
     elif (tag == 'nomina12:HorasExtra'):
         self.__transform_horas_extra(tag, attrs)
     elif (tag == 'nomina12:JubilacionPensionRetiro'):
         self.__transform_jubilacion_pension_retiro(tag, attrs)
     elif (tag == 'nomina12:Deducciones'):
         self.__transform_nomina12_deducciones(tag, attrs)
     elif (tag == 'nomina12:Deduccion'):
         self.__transform_nomina12_deduccion(tag, attrs)
     elif (tag == 'nomina12:Incapacidad'):
         self.__transform_incapacidad(tag, attrs)
     elif (tag == 'nomina12:OtroPago'):
         self.__transform_otro_pago(tag, attrs)
     elif (tag == 'nomina12:SubsidioAlEmpleo'):
         self.__transform_subsidio_causado(tag, attrs)
     elif (tag == 'nomina12:CompensacionSaldosAFavor'):
         self.__transform_compensaciones_saldos_a_favor(tag, attrs)