Esempio n. 1
0
        public async Task <IActionResult> AplicarConciliacionManual([FromBody] DatosAplicacionManualDto datosAplicacionDto)
        {
            _logger.LogInfo("Metodo aplicar conciliacion manual");

            var conciliacionResult = await _conciliacionService.AplicarConciliacionManual(datosAplicacionDto);

            if (conciliacionResult.Resultado == 1)
            {
                conciliacionResult.Mensaje = "El proceso termino con exito.";
            }

            //Agregado 16/07/2018
            try
            {
                DatosNotificacionDto datosNotificacionDto = new DatosNotificacionDto();
                datosNotificacionDto.IndPlanilla = 0;
                datosNotificacionDto.Planilla    = "0";
                datosNotificacionDto.Usuario     = datosAplicacionDto.Usuario.ToString(); //Agregado 16/07/2018

                var res = await _planillaService.NotificarPlanillaConciliada(datosNotificacionDto);
            }
            catch (Exception ex)
            {
                _logger.LogDebug(ex.Message);
                _logger.LogDebug(ex.StackTrace);
            }

            return(Ok(conciliacionResult));
        }
Esempio n. 2
0
        public async Task <IActionResult> AplicarConciliacionAutomatica([FromBody] DatosAplicaConciliacionDto datosAplicacionDto)
        {
            _logger.LogInfo("Metodo aplicar conciliacion automatica");

            var conciliacionResult = await _conciliacionService.AplicarConciliacionAutomatica(datosAplicacionDto);

            if (conciliacionResult.Resultado == 1)
            {
                conciliacionResult.Mensaje = "La conciliación automática se realizó correctamente.";
            }

            try
            {
                DatosNotificacionDto datosNotificacionDto = new DatosNotificacionDto();
                datosNotificacionDto.IndPlanilla = 0;
                datosNotificacionDto.Planilla    = "0";
                datosNotificacionDto.Usuario     = datosAplicacionDto.Usuario.ToString(); //Agregado 16/07/2018

                var res = await _planillaService.NotificarPlanillaConciliada(datosNotificacionDto);
            }
            catch (Exception ex)
            {
                _logger.LogDebug(ex.Message);
                _logger.LogDebug(ex.StackTrace);
            }

            return(Ok(conciliacionResult));
        }
        public async Task <IActionResult> NotificarPlanillaNoLiquidada(DatosNotificacionDto datosNotificacionDto)
        {
            //DatosNotificacionDto datosNotificacionDto = new DatosNotificacionDto();
            //datosNotificacionDto.IndPlanilla = 0;
            //datosNotificacionDto.Planilla = "";

            var notificacionResult = await _PlanillaService.NotificarPlanillaNoLiquidada(datosNotificacionDto);

            return(Ok(notificacionResult));
        }
        public async Task <IActionResult> NotificarPlanillaConciliada(DatosNotificacionDto datosNotificacionDto)
        {
            //DatosNotificacionDto datosNotificacionDto = new DatosNotificacionDto();
            //datosNotificacionDto.IndPlanilla = 1;
            //datosNotificacionDto.Planilla = "184";
            //datosNotificacionDto.Usuario = "UsrConci";

            var notificacionResult = await _PlanillaService.NotificarPlanillaConciliada(datosNotificacionDto);

            return(Ok(notificacionResult));
        }
Esempio n. 5
0
        public async Task <string> NotificarPlanillaConciliada(DatosNotificacionDto datosNotificacionDto)
        {
            DatosNotificacionDto           datosNotificacion_aux       = null;
            List <DetallePlanillaCobroDto> planillaCertificadoList     = new List <DetallePlanillaCobroDto>();
            List <DetallePlanillaCobroDto> planillaCertificadoList_aux = new List <DetallePlanillaCobroDto>();
            PlanillaEstadoDto _planillaEstado = null;

            var _response = string.Empty;

            try
            {
                var datosNotificacionEntity = _mapper.Map <DatosNotificacion>(datosNotificacionDto);

                if (datosNotificacionEntity.IndPlanilla == 0)
                {
                    datosNotificacion_aux             = new DatosNotificacionDto();
                    datosNotificacion_aux.Planilla    = string.Empty;
                    datosNotificacion_aux.IndPlanilla = 0;
                    datosNotificacion_aux.Usuario     = datosNotificacionEntity.Usuario.ToString(); //Agregado 16/07/2018

                    var _entity = _mapper.Map <DatosNotificacion>(datosNotificacion_aux);

                    var _result = await _planillaRepository.ListarPlanillasConciliadas(_entity);

                    planillaCertificadoList_aux = _mapper.Map <List <DetallePlanillaCobroDto> >(_result);

                    foreach (DetallePlanillaCobroDto d in planillaCertificadoList_aux)
                    {
                        planillaCertificadoList.Add(d);
                    }
                }
                else if (datosNotificacionEntity.IndPlanilla == 1)
                {
                    string[] planillas = datosNotificacionEntity.Planilla.Split(",");

                    for (int i = 0; i <= planillas.Length - 1; i++)
                    {
                        datosNotificacion_aux             = new DatosNotificacionDto();
                        datosNotificacion_aux.Planilla    = planillas[i].ToString();
                        datosNotificacion_aux.IndPlanilla = 1;
                        datosNotificacion_aux.Usuario     = datosNotificacionEntity.Usuario.ToString(); //Agregado 16/07/2018

                        var _entity = _mapper.Map <DatosNotificacion>(datosNotificacion_aux);

                        var _result = await _planillaRepository.ListarPlanillasConciliadas(_entity);

                        planillaCertificadoList_aux = _mapper.Map <List <DetallePlanillaCobroDto> >(_result);

                        foreach (DetallePlanillaCobroDto d in planillaCertificadoList_aux)
                        {
                            planillaCertificadoList.Add(d);
                        }
                    }
                }

                foreach (DetallePlanillaCobroDto p in planillaCertificadoList)
                {
                    var _planillaCertificadoEntity = _mapper.Map <DetallePlanillaCobro>(p);

                    _planillaCertificadoEntity.IndicaComprobante     = 1;
                    _planillaCertificadoEntity.IndicaComision        = 1;
                    _planillaCertificadoEntity.IddgEstadoDetPlanilla = "1105";                         //Enviado a generar comprobante
                    _planillaCertificadoEntity.VcUsuariocreacion     = p.VcUsuariocreacion.ToString(); //Agregado 16/07/2018

                    var _operacion = await _planillaRepository.RegistrarComprobantePendiente(_planillaCertificadoEntity);

                    if (_operacion == "1")
                    {
                        //Registra estado de envio a generar comprobante
                        _planillaEstado                    = new PlanillaEstadoDto();
                        _planillaEstado.IdPlanilla         = p.IdPlanilla;
                        _planillaEstado.IddgEstadoplanilla = 1105; //Enviado a generar comprobante
                        _planillaEstado.IddgEstado         = 1001; //Registro activo
                        _planillaEstado.VcUsuariocreacion  = p.VcUsuariocreacion;

                        var _estado = _mapper.Map <PlanillaEstado>(_planillaEstado);

                        await _planillaRepository.RegistrarEstadoPlanilla(_estado);

                        _response = "1";
                    }
                    else
                    {
                        _response = "0";
                    }
                }
            }
            catch (Exception ex)
            {
                _logger.LogError(ex.InnerException.ToString());
            }

            return(_response);
        }