Пример #1
0
 def nom_comptador(self):
     """Retorna el número de comptador"""
     return get_rec_attr(
         self.factura,
         'Medidas.Aparato.NumeroSerie.text',
         ''
     )
Пример #2
0
 def sollicitud(self):
     """Retorna l'objecte Sollicitud"""
     tree = 'PasoMRAMLConCambiosRestoTarifa.DatosSolicitud'
     sol = get_rec_attr(self.obj, tree, False)
     if sol:
         return C1.Sollicitud(sol)
     else:
         return False
Пример #3
0
 def client(self):
     """Retorna l'objecte Client"""
     tree = 'PasoMRAMLConCambiosRestoTarifa.Cliente'
     cli = get_rec_attr(self.obj, tree, False)
     if cli:
         return C1.Client(cli)
     else:
         return False
Пример #4
0
 def client(self):
     """Retorna l'objecte Client"""
     tree = 'CambiodeComercializadoraConCambios.Cliente'
     cli = get_rec_attr(self.obj, tree, False)
     if cli:
         return C1.Client(cli)
     else:
         return False
Пример #5
0
 def sollicitud(self):
     """Retorna l'objecte Sollicitud"""
     tree = 'SolicitudReclamacion.DatosSolicitud'
     sol = get_rec_attr(self.obj, tree, False)
     if sol:
         return DatosPasoSollicitud(sol)
     else:
         return False
Пример #6
0
 def sollicitud(self):
     """Retorna l'objecte Sollicitud"""
     tree = 'ModificacionDeATR.DatosSolicitud'
     sol = get_rec_attr(self.obj, tree, False)
     if sol:
         return C1.Sollicitud(sol)
     else:
         return False
Пример #7
0
 def contracte(self):
     """Retorna l'objecte Contracte"""
     tree = '{0}.Contrato'.format(self.header)
     cont = get_rec_attr(self.obj, tree, False)
     if cont:
         return C1.Contracte(cont)
     else:
         return False
Пример #8
0
 def client(self):
     """Retorna l'objecte Client"""
     tree = 'ModificacionDeATR.Cliente'
     cli = get_rec_attr(self.obj, tree, False)
     if cli:
         return C1.Client(cli)
     else:
         return False
Пример #9
0
 def condicions(self):
     """Retorna l'objecte Condicions"""
     tree = 'CondicionesContractuales'
     cond = get_rec_attr(self.contracte, tree, False)
     if cond:
         return Condicions(cond)
     else:
         return False
Пример #10
0
 def sollicitud(self):
     """Retorna l'objecte Sollicitud"""
     tree = 'CambiodeComercializadoraConCambios.DatosSolicitud'
     sol = get_rec_attr(self.obj, tree, False)
     if sol:
         return C1.Sollicitud(sol)
     else:
         return False
Пример #11
0
 def gir_comptador(self):
     num_ruedas = int(get_rec_attr(
         self.factura,
         'Medidas.Aparato.Integrador.NumeroRuedasEnteras.text',
         0
     ))
     if num_ruedas > 0:
         num_ruedas = 10 ** num_ruedas
     return num_ruedas
Пример #12
0
 def contracted_powers(self):
     """Returns the contracted powers"""
     try:
         termino_potencia = get_rec_attr(
             self.factura.Potencia, 'TerminoPotencia'
         )
         return [
             int(aux.PotenciaContratada) for aux in termino_potencia.Periodo
         ]
     except AttributeError:
         return []
Пример #13
0
 def _get_comptadors(self, obj=None):
     """Retorna totes les lectures en una llista de comptadors"""
     if obj is None:
         obj = self.obj
     comptadors = []
     for mesura in get_rec_attr(obj, 'Medidas', []):
         if mesura.CodUnificadoPuntoSuministro.text[:20] == \
                                                 self.get_codi[:20]:
             for aparell in mesura.Aparato:
                 compt = Comptador(aparell)
                 di, df = compt.dates_inici_i_final
                 comptadors.append((di, df, compt))
     return [a[2] for a in sorted(comptadors, lambda x,y: cmp(x[0], y[0]))]
Пример #14
0
 def nom(self):
     if self.es_persona_juridica:
         return get_rec_attr(self.client, 'Nombre.RazonSocial.text', '')
     else:
         return get_rec_attr(self.client, 'Nombre.NombreDePila.text', '')
Пример #15
0
 def preu(self):
     return float(
         get_rec_attr(self.concepte_ieiva, 'ImporteConceptoIEIVA.text', 0)
     )
Пример #16
0
 def tipus_identificacio(self):
     tree = '{}.TipoCIFNIF.text'.format(self.idfield)
     return get_rec_attr(self.client, tree, '')
Пример #17
0
 def codi_identificacio(self):
     tree = '{}.Identificador.text'.format(self.idfield)
     return get_rec_attr(self.client, tree, '')
Пример #18
0
 def has_quantity(self):
     # If the quantity is 0 we will assume it's incorrect
     return bool(get_rec_attr(self.concepte, 'UnidadesConcepto.text', 0))
Пример #19
0
 def codi(self):
     return get_rec_attr(self.concepte_iva, 'Concepto.text')
Пример #20
0
 def total(self):
     return float(
         get_rec_attr(self.concepte, 'ImporteTotalConcepto.text', 0)
     )
Пример #21
0
 def has_price(self):
     # If the price is 0 we will assume it's incorrect
     return bool(
         get_rec_attr(self.concepte, 'ImporteUnidadConcepto.text', 0)
     )
Пример #22
0
 def quantitat(self):
     return float(get_rec_attr(self.concepte, 'UnidadesConcepto.text', 1))
Пример #23
0
 def preu(self):
     return float(
         get_rec_attr(self.concepte, 'ImporteUnidadConcepto.text', 0)
     )
Пример #24
0
 def base(self):
     return float(
         get_rec_attr(self.iva, 'BaseImponible.text', 0)
     )
Пример #25
0
 def percentage(self):
     return float(
         get_rec_attr(self.iva, 'Porcentaje.text', 0)
     )
Пример #26
0
 def check_telefono_contacto(self):
     for var in self.r1.reclamacions:
         if not get_rec_attr(var, "contacto.telf_num", False):
             return False
     return len(self.r1.reclamacions) > 0
Пример #27
0
 def te_ajust(self):
     res = get_rec_attr(self.lectura, 'Ajuste', default={})
     return len(res) > 0
Пример #28
0
 def importe(self):
     return float(
         get_rec_attr(self.iva, 'Importe.text', 0)
     )
Пример #29
0
 def codi(self):
     codi = get_rec_attr(self.concepte_ieiva, 'Concepto.text', 0)
     if not codi:
         return None
     return codi
Пример #30
0
 def codi(self):
     return get_rec_attr(self.concepte, 'TipoConcepto.text')