Exemplo n.º 1
0
 def __init__(self, invoice):
     self.invoice = invoice
     refactor_decimals(self.invoice)
     tipo_rectificativa = invoice.rectificative_type
     rectificativa_sustitucion_opcion_1 = tipo_rectificativa == 'RA'
     rectificativa_sustitucion_opcion_2 = tipo_rectificativa == 'R'
     if invoice.type.startswith('in'):
         self.invoice_model = invoices_record.SuministroFacturasRecibidas()
         self.invoice_dict = get_factura_recibida_dict(
             invoice=self.invoice,
             rect_sust_opc1=rectificativa_sustitucion_opcion_1,
             rect_sust_opc2=rectificativa_sustitucion_opcion_2
         )
     elif invoice.type.startswith('out'):
         self.invoice_model = invoices_record.SuministroFacturasEmitidas()
         self.invoice_dict = get_factura_emitida_dict(
             invoice=self.invoice,
             rect_sust_opc1=rectificativa_sustitucion_opcion_1,
             rect_sust_opc2=rectificativa_sustitucion_opcion_2
         )
     else:
         raise AttributeError(
             'Valor desconocido en el tipo de factura: {}'.format(
                 invoice.type
             )
         )
Exemplo n.º 2
0
 def __init__(self, invoice):
     self.invoice = invoice
     refactor_nifs(self.invoice)
     rectificativa = invoice.rectificative_type == 'R'
     if invoice.type.startswith('in'):
         self.invoice_model = invoices_record.SuministroFacturasRecibidas()
         self.invoice_dict = get_factura_recibida_dict(
             self.invoice, rectificativa=rectificativa)
     elif invoice.type.startswith('out'):
         self.invoice_model = invoices_record.SuministroFacturasEmitidas()
         self.invoice_dict = get_factura_emitida_dict(
             self.invoice, rectificativa=rectificativa)
     else:
         raise AttributeError('Unknown value in invoice.type')
Exemplo n.º 3
0
 def __init__(self, invoice):
     self.invoice = invoice
     refactor_nifs(self.invoice)
     rectificativa = invoice.rectificative_type == 'R'
     if invoice.type.startswith('in'):
         self.invoice_model = invoices_record.SuministroFacturasRecibidas()
         self.invoice_dict = get_factura_recibida_dict(
             self.invoice, rectificativa=rectificativa)
     elif invoice.type.startswith('out'):
         self.invoice_model = invoices_record.SuministroFacturasEmitidas()
         self.invoice_dict = get_factura_emitida_dict(
             self.invoice, rectificativa=rectificativa)
     else:
         raise AttributeError(
             'Valor desconocido en el tipo de factura: {}'.format(
                 invoice.type))