Example #1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            Thread.CurrentThread.CurrentCulture   = new System.Globalization.CultureInfo(Properties.Settings.Default.ConfRegional);
            Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(Properties.Settings.Default.ConfRegional);

            Thread.CurrentThread.CurrentCulture.NumberFormat.CurrencyDecimalSeparator = ".";
            Thread.CurrentThread.CurrentCulture.NumberFormat.CurrencyGroupSeparator   = ",";

            Thread.CurrentThread.CurrentCulture.NumberFormat.NumberDecimalSeparator = ".";
            Thread.CurrentThread.CurrentCulture.NumberFormat.NumberGroupSeparator   = ",";

            Thread.CurrentThread.CurrentCulture.NumberFormat.PercentDecimalSeparator = ".";
            Thread.CurrentThread.CurrentCulture.NumberFormat.PercentGroupSeparator   = ",";

            Thread.CurrentThread.CurrentCulture.DateTimeFormat.ShortDatePattern = "dd/MM/yyyy";
            Thread.CurrentThread.CurrentCulture.DateTimeFormat.LongDatePattern  = "MMMMM dd 'del' yyyy";

            tb_Empresa_Bus   BusEmpresa   = new tb_Empresa_Bus();
            tb_Empresa_Info  InfoEmpresa  = new tb_Empresa_Info();
            tb_Sucursal_Info InfoSucursal = new tb_Sucursal_Info();
            tb_Sucursal_Bus  BusSucursal  = new tb_Sucursal_Bus();

            try
            {
                InfoEmpresa  = BusEmpresa.Get_Info_Empresa(1); //CAMBIAR PARA INICIAR CON LA EMPRESA Q SE DESEE
                InfoSucursal = BusSucursal.Get_Info_Sucursal(InfoEmpresa.IdEmpresa, 1);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error al conectarse a la Base Verifique la cadena de conexion APP..\n\n\n\n" + ex.Message, "Conexion", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            Core.Erp.Business.General.cl_parametrosGenerales_Bus param = Core.Erp.Business.General.cl_parametrosGenerales_Bus.Instance;
            param.IdEmpresa     = InfoEmpresa.IdEmpresa;
            param.IdSucursal    = InfoSucursal.IdSucursal;
            param.IdUsuario     = "No_log_sysVZEN";
            param.IdSucursal    = 1;
            param.InfoEmpresa   = InfoEmpresa;
            param.InfoSucursal  = InfoSucursal;
            param.IdInstitucion = 1;
            param.em_Email      = InfoEmpresa.em_Email;

            Application.Run(new FrmMain());
        }
Example #2
0
        public rdep setInfoXML(List <ro_Rdep_Info> info, string ruc, int idPeriodo)
        {
            try
            {
                //CAMBIAR LA CULTURA REGIONAL PARA SETEAR EL PUNTO DECIMAL
                System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.CreateSpecificCulture("en-US");

                //DATOS DE LA EMPRESA
                rdep oRdep = new rdep();
                oRdep.anio   = idPeriodo.ToString();
                oRdep.numRuc = ruc;

                oRdep.retRelDep = new List <rdepRetRelDepDatRetRelDep>();


                foreach (ro_Rdep_Info item in info)
                {
                    rdepRetRelDepDatRetRelDep detalleRDEP = new rdepRetRelDepDatRetRelDep();

                    detalleRDEP.empleado = new List <rdepRetRelDepDatRetRelDepEmpleado>();
                    rdepRetRelDepDatRetRelDepEmpleado datosEmpleado = new rdepRetRelDepDatRetRelDepEmpleado();


                    //CONSULTAR DATOS DEL EMPLEADO
                    ro_Empleado_Info ro_Empleado_Info = new ro_Empleado_Info();
                    ro_Empleado_Info = oRo_Empleado_Bus.Get_Info_Empleado(item.IdEmpresa, item.IdEmpleado);

                    #region Empleado

                    //Tipo de identificación del trabajador
                    switch (ro_Empleado_Info.InfoPersona.IdTipoDocumento)
                    {
                    case "CED":
                        datosEmpleado.tipIdRet = "C";

                        break;

                    case "PAS":
                        datosEmpleado.tipIdRet = "P";
                        break;

                    default:
                        //Identificación Tributaria del Exterior
                        datosEmpleado.tipIdRet = "E";
                        break;
                    }

                    //Número de identificación del trabajador
                    datosEmpleado.idRet = ro_Empleado_Info.InfoPersona.pe_cedulaRuc;

                    //Apellidos del trabajador
                    datosEmpleado.apellidoTrab = ro_Empleado_Info.InfoPersona.pe_apellido;

                    //Nombres del trabajador
                    datosEmpleado.nombreTrab = ro_Empleado_Info.InfoPersona.pe_nombre;

                    //Código del establecimiento
                    tb_Sucursal_Bus  oTb_Sucursal_Bus  = new tb_Sucursal_Bus();
                    tb_Sucursal_Info oTb_Sucursal_Info = new Info.General.tb_Sucursal_Info();
                    oTb_Sucursal_Info   = oTb_Sucursal_Bus.Get_Info_Sucursal(param.IdEmpresa, param.IdSucursal);
                    datosEmpleado.estab = oTb_Sucursal_Info.Su_CodigoEstablecimiento;

                    //Residencia del trabajador
                    datosEmpleado.residenciaTrab = pu_Right(ro_Empleado_Info.IdTipoResidenciaSRI, 2);

                    //País de residencia del trabajador
                    datosEmpleado.paisResidencia = "593";

                    //Aplica convenio para evitar doble imposición
                    datosEmpleado.aplicaConvenio = pu_Right(ro_Empleado_Info.IdAplicaConvenioDobleImposicionSRI, 2);

                    //Condición del trabajador respecto a discapacidades
                    //if (item.em_empEspecial == "S") {datosEmpleado.tipoTrabajDiscap = "02"; } else {datosEmpleado.tipoTrabajDiscap = "01"; }
                    datosEmpleado.tipoTrabajDiscap = "NO";//= pu_Right(ro_Empleado_Info.IdCondicionDiscapacidadSRI, 2);

                    //Porcentaje de discapacidad
                    datosEmpleado.porcentajeDiscap = ro_Empleado_Info.por_discapacidad.ToString();

                    //Tipo de identificación de la persona con discapacidad a quien sustituye o representa
                    datosEmpleado.tipIdDiscap = pu_Right(ro_Empleado_Info.IdTipoIdentDiscapacitadoSustitutoSRI, 1);

                    //Número de identificación de la persona con discapacidad a quien sustituye o representa
                    datosEmpleado.idDiscap = ro_Empleado_Info.IdentDiscapacitadoSustitutoSRI;

                    //AGREGAR DATOS DEL DETALLE DE EMPLEADOS
                    detalleRDEP.empleado.Add(datosEmpleado);


                    #endregion

                    #region detalle

                    //Sueldos y salarios
                    detalleRDEP.suelSal = item.suelSal;

                    //Sobresueldos, comisiones, bonos y otros ingresos gravados
                    detalleRDEP.sobSuelComRemu = item.sobSuelComRemu;

                    //Participación de utilidades
                    detalleRDEP.partUtil = item.partUtil;

                    //Ingresos gravados generados con otros empleadores
                    detalleRDEP.intGrabGen = item.intGrabGen;

                    //Impuesto a la renta asumido por este empleador
                    detalleRDEP.impRentEmpl = item.impRentEmpl;

                    //Décimo tercer sueldo
                    detalleRDEP.decimTer = item.decimTer;

                    //Décimo cuarto sueldo
                    detalleRDEP.decimCuar = item.decimCuar;

                    //Fondo de reserva
                    detalleRDEP.fondoReserva = item.fondoReserva;

                    //Compensación Económica Salario Digno
                    detalleRDEP.salarioDigno = item.salarioDigno;

                    //Otros ingresos en relación de dependencia que no constituyen renta gravada
                    detalleRDEP.otrosIngRenGrav = item.otrosIngRenGrav;

                    //Ingresos gravados con este empleador (Informativo)
                    detalleRDEP.ingGravConEsteEmpl = item.ingGravConEsteEmpl;

                    //Sistema de salario neto
                    detalleRDEP.sisSalNet = item.sisSalNet;

                    //Aporte personal al IESS con este empleador (únicamente pagado por el trabajador)
                    detalleRDEP.apoPerIess = item.apoPerIess;

                    //Aporte personal al IESS con otros empleadores (únicamente pagado por el trabajador)
                    detalleRDEP.aporPerIessConOtrosEmpls = item.aporPerIessConOtrosEmpls;


                    //*****************DEDUCCION POR GASTOS PERSONALES***********************

                    //Deducción de gastos personales por Vivienda
                    detalleRDEP.deducVivienda = item.deducVivienda;

                    //Deducción de gastos personales por Salud
                    detalleRDEP.deducSalud = item.deducSalud;

                    //Deducción de gastos personales por Educación
                    detalleRDEP.deducEduca = item.deducEduca;

                    //Deducción de gastos personales por Alimentación
                    detalleRDEP.deducAliement = item.deducAliement;

                    //Deducción de gastos personales por Vestimenta
                    //detalleRDEP. = "0.00";

                    //*************************************************************************


                    //Exoneración por Discapacidad
                    detalleRDEP.exoDiscap = item.exoDiscap;

                    //Exoneración por Tercera Edad
                    detalleRDEP.exoTerEd = item.exoTerEd;

                    //Base imponible gravada
                    detalleRDEP.basImp = item.basImp;

                    //Impuesto a la renta causado
                    detalleRDEP.impRentCaus = item.impRentCaus;

                    //Valor del impuesto retenido y asumido por otros empleadores durante el período declarado
                    detalleRDEP.valRetAsuOtrosEmpls = item.valRetAsuOtrosEmpls;

                    //Valor del impuesto asumido por este empleador
                    detalleRDEP.valImpAsuEsteEmpl = item.valImpAsuEsteEmpl;

                    //Valor del impuesto retenido al trabajador por este empleador
                    detalleRDEP.valRet = item.valRet;

                    #endregion

                    oRdep.retRelDep.Add(detalleRDEP);
                }

                return(oRdep);
            }
            catch (Exception ex)
            {
                Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message);
                throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "setInfoXML", ex.Message), ex)
                      {
                          EntityType = typeof(ro_Rdep_Bus)
                      };
            }
        }