コード例 #1
0
class A3(C2):
    """Clase que implementa A3."""

    steps = [
        DeadLine('01', Workdays(5)),
        DeadLine('02', Workdays(1)),
        DeadLine('03', Naturaldays(30)),
        DeadLine('05', Workdays(1)),
        DeadLine('06', Workdays(5)),
    ]
コード例 #2
0
class W1(C1):
    """Classe que implementa W1."""

    steps = [
        DeadLine('01', Workdays(5)),
    ]

    @property
    def datos_solicitud_aportacion_lectura(self):
        tree = 'DatosSolicitudAportacionLectura'
        data = get_rec_attr(self.obj, tree, False)
        if data not in [None, False]:
            return DatosSolicitudAportacionLectura(data)
        else:
            return False

    @property
    def lecturas_aportadas(self):
        data = []
        for i in self.obj.LecturaAportada:
            data.append(LecturaAportada(i))
        return data

    # Datos Paso 2 aceptacion
    @property
    def datos_aceptacion_lectura(self):
        tree = 'DatosAceptacionLectura'.format(self._header)
        data = get_rec_attr(self.obj, tree, False)
        if data not in [None, False]:
            return DatosAceptacionLectura(data)
        else:
            return False
コード例 #3
0
ファイル: M1.py プロジェクト: gisce/gestionatr
class M1(C2):
    """Classe que implementa M1."""

    steps_T = [
        DeadLine('01', Workdays(5)),
        DeadLine('02', Workdays(1)),
        DeadLine('03', Naturaldays(30)),
        DeadLine('05', Workdays(1)),
        DeadLine('06', Workdays(5)),
    ]

    steps_S = [
        DeadLine('01', Workdays(5)),
        DeadLine('02', Workdays(5)),
        DeadLine('06', Workdays(5)),
    ]
    steps_A = steps_S
    steps_C = steps_S

    steps_P = steps_T

    steps = steps_T

    # Datos paso 01
    @property
    def datos_solicitud(self):
        tree = '{0}.DatosSolicitud'.format(self._header)
        sol = get_rec_attr(self.obj, tree, False)
        if sol not in [None, False]:
            return DatosSolicitud(sol)
        else:
            return False
コード例 #4
0
ファイル: C1.py プロジェクト: gisce/gestionatr
class C1(Message, ProcessDeadline):
    """Clase que implementa C1."""

    steps = [
        DeadLine('01', Workdays(5)),
        DeadLine('02', Workdays(1)),
        DeadLine('05', Workdays(1)),
        DeadLine('06', Workdays(1)),
        DeadLine('08', Workdays(5)),
    ]

    # Datos paso 01
    @property
    def datos_solicitud(self):
        tree = '{0}.DatosSolicitud'.format(self._header)
        sol = get_rec_attr(self.obj, tree, False)
        if sol not in [None, False]:
            return DatosSolicitud(sol)
        else:
            return False

    @property
    def cliente(self):
        tree = '{0}.Cliente'.format(self._header)
        cli = get_rec_attr(self.obj, tree, False)
        if cli not in [None, False]:
            return Cliente(cli)
        else:
            return False

    @property
    def comentarios(self):
        tree = '{0}.Comentarios'.format(self._header)
        com = get_rec_attr(self.obj, tree, False)
        if com:
            return com.text
        else:
            return False

    @property
    def registros_documento(self):
        data = []
        obj = get_rec_attr(self.obj, self._header, False)
        if not hasattr(obj, 'RegistrosDocumento'):
            obj = get_rec_attr(self.obj, 'Rechazos', False)
        if (hasattr(obj, 'RegistrosDocumento')
                and hasattr(obj.RegistrosDocumento, 'RegistroDoc')):
            for d in obj.RegistrosDocumento.RegistroDoc:
                data.append(RegistroDoc(d))
        return data

    # Datos paso 02 aceptacion
    @property
    def datos_aceptacion(self):
        tree = '{0}.DatosAceptacion'.format(self._header)
        data = get_rec_attr(self.obj, tree, False)
        if data not in [None, False]:
            return DatosAceptacion(data)
        else:
            return False

    @property
    def contrato(self):
        tree = '{0}.Contrato'.format(self._header)
        data = get_rec_attr(self.obj, tree, False)
        if data not in [None, False]:
            return Contrato(data)
        else:
            return False

    # Datos paso 02 rechazo y paso 04
    @property
    def rechazos(self):
        obj = getattr(self.obj, 'Rechazos')
        data = []
        if obj not in [None, False]:
            for i in obj.Rechazo:
                data.append(Rechazo(i))
            return data
        return data

    @property
    def fecha_rechazo(self):
        tree = '{0}.FechaRechazo'.format(self._header)
        data = get_rec_attr(self.obj, tree, False)
        if data:
            return data.text
        else:
            return False

    # Datos paso 05
    @property
    def datos_activacion(self):
        tree = '{0}.DatosActivacion'.format(self._header)
        data = get_rec_attr(self.obj, tree, False)
        if data not in [None, False]:
            return DatosActivacion(data)
        else:
            return False

    @property
    def puntos_medida(self):
        data = []
        obj = get_rec_attr(self.obj, self._header, False)
        if (hasattr(obj, 'PuntosDeMedida')
                and hasattr(obj.PuntosDeMedida, 'PuntoDeMedida')):
            for d in obj.PuntosDeMedida.PuntoDeMedida:
                data.append(PuntoDeMedida(d))
        return data

    # Datos paso 06
    @property
    def datos_notificacion(self):
        tree = '{0}.DatosNotificacion'.format(self._header)
        data = get_rec_attr(self.obj, tree, False)
        if data not in [None, False]:
            return DatosNotificacion(data)
        else:
            return False

    # Datos paso 09 i 10
    @property
    def fecha_aceptacion(self):
        tree = '{0}.FechaAceptacion'.format(self._header)
        data = get_rec_attr(self.obj, tree, False)
        if data:
            return data.text
        else:
            return False

    # Datos paso 11
    @property
    def ind_bono_social(self):
        tree = '{0}.IndBonoSocial'.format(self._header)
        data = get_rec_attr(self.obj, tree, False)
        if data:
            return data.text
        else:
            return False

    @property
    def fecha_activacion_prevista(self):
        tree = '{0}.FechaActivacionPrevista'.format(self._header)
        data = get_rec_attr(self.obj, tree, False)
        if data:
            return data.text
        else:
            return False
コード例 #5
0
ファイル: R1.py プロジェクト: aruaibrahim/gestionatr
class R1(C2):
    """Clase que implementa R1."""

    steps = [
        DeadLine('01', Workdays(5)),
        DeadLine('02', Workdays(15)),
        DeadLine('03', Naturaldays(20)),
    ]

    # Datos paso 01
    @property
    def datos_solicitud(self):
        tree = '{0}.DatosSolicitud'.format(self._header)
        sol = get_rec_attr(self.obj, tree, False)
        if sol not in [None, False]:
            return DatosSolicitud(sol)
        else:
            return False

    @property
    def variables_detalle_reclamacion(self):
        tree = '{0}.VariablesDetalleReclamacion'.format(self._header)
        obj = get_rec_attr(self.obj, tree, False)
        data = []
        if obj not in [None, False] and hasattr(obj, "VariableDetalleReclamacion"):
            for i in obj.VariableDetalleReclamacion:
                data.append(VariableDetalleReclamacion(i))
            return data
        return data

    @property
    def tipo_reclamante(self):
        tree = '{0}.TipoReclamante'.format(self._header)
        data = get_rec_attr(self.obj, tree, False)
        if data:
            return data.text
        else:
            return False

    @property
    def reclamante(self):
        tree = '{0}.Reclamante'.format(self._header)
        cli = get_rec_attr(self.obj, tree, False)
        if cli not in [None, False]:
            return Reclamante(cli)
        else:
            return False

    # Datos paso 02 aceptacion
    @property
    def datos_aceptacion(self):
        tree = '{0}.DatosAceptacion'.format(self._header)
        data = get_rec_attr(self.obj, tree, False)
        if data not in [None, False]:
            return DatosAceptacion(data)
        else:
            return False

    # Datos paso 03
    @property
    def datos_informacion(self):
        tree = '{0}.DatosInformacion'.format(self._header)
        data = get_rec_attr(self.obj, tree, False)
        if data not in [None, False]:
            return DatosInformacion(data)
        else:
            return False

    @property
    def informacion_intermedia(self):
        tree = '{0}.InformacionIntermedia'.format(self._header)
        data = get_rec_attr(self.obj, tree, False)
        if data not in [None, False]:
            return InformacionIntermedia(data)
        else:
            return False

    @property
    def retipificacion(self):
        tree = '{0}.Retipificacion'.format(self._header)
        data = get_rec_attr(self.obj, tree, False)
        if data not in [None, False]:
            return Retipificacion(data)
        else:
            return False

    @property
    def solicitudes_informacion_adicional(self):
        data = []
        tree = '{0}.SolicitudesInformacionAdicional'.format(self._header)
        obj = get_rec_attr(self.obj, tree, False)
        if obj:
            sol = get_rec_attr(obj, 'SolicitudInformacionAdicional', False)
            if sol:
                for d in sol:
                    data.append(SolicitudInformacionAdicional(d))
        return data

    @property
    def solicitud_informacion_adicional_para_retipificacion(self):
        tree = '{0}.SolicitudesInformacionAdicional.SolicitudInformacionAdicionalParaRetipificacion'.format(self._header)
        data = get_rec_attr(self.obj, tree, False)
        if data not in [None, False]:
            return SolicitudInformacionAdicionalParaRetipificacion(data)
        else:
            return False

    # Datos paso 04
    @property
    def datos_envio_informacion(self):
        tree = '{0}.DatosEnvioInformacion'.format(self._header)
        data = get_rec_attr(self.obj, tree, False)
        if data not in [None, False]:
            return DatosEnvioInformacion(data)
        else:
            return False

    @property
    def variables_aportacion_informacion(self):
        data = []
        tree = '{0}.VariablesAportacionInformacion'.format(self._header)
        obj = get_rec_attr(self.obj, tree, False)
        if obj:
            for d in obj.VariableAportacionInformacion:
                data.append(VariableAportacionInformacion(d))
        return data

    @property
    def variables_aportacion_informacion_para_retipificacion(self):
        data = []
        tree = '{0}.VariablesAportacionInformacionParaRetipificacion'.format(self._header)
        obj = get_rec_attr(self.obj, tree, False)
        if obj:
            for d in obj.VariableAportacionInformacionParaRetipificacion:
                data.append(VariableDetalleReclamacion(d))
        return data

    # Datos paso 5
    @property
    def datos_cierre(self):
        tree = '{0}.DatosCierre'.format(self._header)
        sol = get_rec_attr(self.obj, tree, False)
        if sol not in [None, False]:
            return DatosCierre(sol)
        else:
            return False

    @property
    def cod_contrato(self):
        tree = '{0}.CodContrato'.format(self._header)
        sol = get_rec_attr(self.obj, tree, False)
        if sol:
            return sol.text
        else:
            return False

    # Campos Minimos
    def get_subtypes(self):
        r1_type = self.datos_solicitud.tipo
        return [x['code'] for x in SUBTYPES_R101 if x['type'] == r1_type]

    def get_type_from_subtype(self):
        r1_subtype = self.datos_solicitud.subtipo
        for x in SUBTYPES_R101:
            if x['code'] == r1_subtype:
                return x['type']
        return []

    def get_minimum_fields(self):
        subtype = self.datos_solicitud.subtipo
        for x in SUBTYPES_R101:
            if x['code'] == subtype:
                return x['min_fields']
        return []

    def check_minimum_fields(self):
        checker = MinimumFieldsChecker(self)
        return checker.check()
コード例 #6
0
ファイル: C2.py プロジェクト: aruaibrahim/gestionatr
class C2(C1):
    """Clase que implementa C2."""

    steps = [
        DeadLine('01', Workdays(5)),
        DeadLine('02', Workdays(1)),
        DeadLine('03', Naturaldays(30)),
        DeadLine('05', Workdays(1)),
        DeadLine('06', Workdays(1)),
        DeadLine('08', Workdays(5))
    ]

    # Datos paso 01
    @property
    def datos_solicitud(self):
        tree = '{0}.DatosSolicitud'.format(self._header)
        sol = get_rec_attr(self.obj, tree, False)
        if sol not in [None, False]:
            return DatosSolicitud(sol)
        return False

    @property
    def cliente(self):
        tree = '{0}.Cliente'.format(self._header)
        cli = get_rec_attr(self.obj, tree, False)
        if cli not in [None, False]:
            return Cliente(cli)
        else:
            return False

    @property
    def contrato(self):
        tree = '{0}.Contrato'.format(self._header)
        data = get_rec_attr(self.obj, tree, False)
        if data not in [None, False]:
            return Contrato(data)
        else:
            return False

    @property
    def medida(self):
        tree = '{0}.Medida'.format(self._header)
        data = get_rec_attr(self.obj, tree, False)
        if data not in [None, False]:
            return Medida(data)
        else:
            return False

    @property
    def doc_tecnica(self):
        tree = '{0}.DocTecnica'.format(self._header)
        data = get_rec_attr(self.obj, tree, False)
        if data not in [None, False]:
            return DocTecnica(data)
        else:
            return False

    # Datos Paso 03
    @property
    def fecha_prevista_accion(self):
        tree = '{0}.FechaPrevistaAccion'.format(self._header)
        data = get_rec_attr(self.obj, tree, False)
        if data:
            return data.text
        else:
            return False

    @property
    def fecha_incidencia(self):
        tree = '{0}.FechaIncidencia'.format(self._header)
        data = get_rec_attr(self.obj, tree, False)
        if data:
            return data.text
        else:
            return False

    @property
    def incidencias(self):
        tree = '{0}.Incidencia'.format(self._header)
        obj = get_rec_attr(self.obj, tree, False)
        data = []
        if obj not in [None, False]:
            for i in obj:
                data.append(Incidencia(i))
            return data
        return data
コード例 #7
0
class B1(C2):
    """Classe que implementa B1."""

    steps_01 = [
        DeadLine('00', Workdays(-5)),
        DeadLine('01', Workdays(5)),
        DeadLine('02', Workdays(1)),
        DeadLine('03', Workdays(5)),
        DeadLine('05', Workdays(1)),
    ]

    steps_02 = [
        DeadLine('00', Workdays(-15)),
        DeadLine('01', Workdays(5)),
        DeadLine('02', Workdays(1)),
        DeadLine('03', Workdays(5)),
        DeadLine('05', Workdays(1)),
    ]

    steps_03 = [
        DeadLine('02', Naturaldays(60)),
        DeadLine('03', Workdays(1)),
        DeadLine('05', Naturaldays(60)),
    ]

    steps_04 = steps_01

    steps = steps_01

    # Datos paso 01
    @property
    def datos_solicitud(self):
        tree = '{0}.DatosSolicitud'.format(self._header)
        sol = get_rec_attr(self.obj, tree, False)
        if sol not in [None, False]:
            return DatosSolicitud(sol)
        else:
            return False

    @property
    def iban(self):
        tree = '{0}.IBAN'.format(self._header)
        data = get_rec_attr(self.obj, tree, False)
        if data:
            return data.text
        else:
            return False

    @property
    def contacto(self):
        tree = '{0}.Contacto'.format(self._header)
        cli = get_rec_attr(self.obj, tree, False)
        if cli not in [None, False]:
            return Contacto(cli)
        else:
            return False

    # Datos paso 02
    @property
    def datos_aceptacion(self):
        tree = '{0}.DatosAceptacion'.format(self._header)
        sol = get_rec_attr(self.obj, tree, False)
        if sol not in [None, False]:
            return DatosAceptacion(sol)
        else:
            return False

    # Datos paso 04
    @property
    def hora_aceptacion(self):
        tree = '{0}.HoraAceptacion'.format(self._header)
        data = get_rec_attr(self.obj, tree, False)
        if data:
            return data.text
        else:
            return False

    # Datos paso 05
    @property
    def datos_activacion_baja(self):
        tree = '{0}.DatosActivacionBaja'.format(self._header)
        sol = get_rec_attr(self.obj, tree, False)
        if sol not in [None, False]:
            return DatosActivacionBaja(sol)
        else:
            return False