示例#1
0
 def nom_comptador(self):
     """Retorna el número de comptador"""
     return get_rec_attr(
         self.factura,
         'Medidas.Aparato.NumeroSerie.text',
         ''
     )
示例#2
0
文件: A3.py 项目: gisce/switching
 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
文件: A3.py 项目: gisce/switching
 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
文件: C2.py 项目: gisce/switching
 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
文件: M1.py 项目: gisce/switching
 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
文件: C2.py 项目: gisce/switching
 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
文件: M1.py 项目: gisce/switching
 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
文件: C2.py 项目: gisce/switching
 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
文件: F1.py 项目: kailIII/switching
 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
文件: F1.py 项目: gisce/switching
 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
文件: Q1.py 项目: kailIII/switching
 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
文件: F1.py 项目: gisce/switching
 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
文件: F1.py 项目: kailIII/switching
 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
文件: F1.py 项目: gisce/switching
 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
文件: F1.py 项目: gisce/switching
 def base(self):
     return float(
         get_rec_attr(self.iva, 'BaseImponible.text', 0)
     )
示例#25
0
文件: F1.py 项目: gisce/switching
 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
文件: Q1.py 项目: gisce/switching
 def te_ajust(self):
     res = get_rec_attr(self.lectura, 'Ajuste', default={})
     return len(res) > 0
示例#28
0
文件: F1.py 项目: gisce/switching
 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')