Пример #1
0
        protected void CreateAssociatedExpenses()
        {
            TipoGastoList tipos = TipoGastoList.GetList(false, true);

            Expense       gasto = Gastos.NewItem(this, ECategoriaGasto.SeguroSocial);
            TipoGastoInfo tipo  = tipos.GetItem(ModulePrincipal.GetDefaultSegurosSetting());

            if (tipo.Oid == 0)
            {
                throw new iQException(Resources.Messages.NO_TIPOGASTO_SEGUROS, iQExceptionCode.INVALID_OBJECT);
            }

            gasto.OidTipo       = tipo.Oid;
            gasto.PrevisionPago = Common.EnumFunctions.GetPrevisionPago(tipo.EFormaPago, Fecha, tipo.DiasPago);

            gasto = Gastos.NewItem(this, ECategoriaGasto.Impuesto);
            tipo  = tipos.GetItem(ModulePrincipal.GetDefaultIRPFSetting());

            if (tipo.Oid == 0)
            {
                throw new iQException(Resources.Messages.NO_TIPOGASTO_IRPF, iQExceptionCode.INVALID_OBJECT);
            }

            gasto.OidTipo       = tipo.Oid;
            gasto.PrevisionPago = Common.EnumFunctions.GetPrevisionPago(tipo.EFormaPago, Fecha, tipo.DiasPago);

            InsertStaff();

            CalculateTotal();
        }
Пример #2
0
        protected void UpdateAssociatedExpenses()
        {
            if (Gastos.Count == 0)
            {
                return;
            }

            EmployeeList empleados = EmployeeList.GetList(false, true);

            TipoGastoList tipos = TipoGastoList.GetList(false, true);

            foreach (Payroll item in Nominas)
            {
                if (empleados.GetItem(item.OidEmpleado) == null)
                {
                    Cache.Instance.Remove(typeof(EmployeeList));
                    empleados = EmployeeList.GetList(false, true);
                }

                item.Fecha         = Fecha;
                item.PrevisionPago = PrevisionPago;
                item.Descripcion   = String.Format(Resources.Messages.GASTO_NOMINA, empleados.GetItem(item.OidEmpleado).NombreCompleto.ToUpper());
                item.Observaciones = Descripcion;
            }

            foreach (Expense item in Gastos)
            {
                if (item.EEstado == EEstado.Baja)
                {
                    return;
                }

                item.Observaciones = String.Format(Resources.Messages.GASTO_ASOCIADO, Descripcion);

                switch (item.ECategoriaGasto)
                {
                case ECategoriaGasto.SeguroSocial:
                {
                    TipoGastoInfo tipo = tipos.GetItem(ModulePrincipal.GetDefaultSegurosSetting());
                    item.Fecha         = Fecha;
                    item.PrevisionPago = Common.EnumFunctions.GetPrevisionPago(tipo.EFormaPago, Fecha, tipo.DiasPago);
                    item.Total         = Seguro;
                    item.Descripcion   = tipo.Nombre + " " + item.Fecha.ToString("MMMM") + " " + item.Fecha.ToString("yyyy");
                }
                break;

                case ECategoriaGasto.Impuesto:
                {
                    TipoGastoInfo tipo = tipos.GetItem(ModulePrincipal.GetDefaultIRPFSetting());
                    item.Fecha         = Fecha;
                    item.PrevisionPago = Common.EnumFunctions.GetPrevisionPago(tipo.EFormaPago, Fecha, tipo.DiasPago);
                    item.Total         = IRPF;
                    item.Descripcion   = tipo.Nombre + " " + GetPeriod(item.Fecha) + " " + item.Fecha.ToString("yyyy");
                }
                break;
                }
            }
        }
        /// <summary>
        /// Copia los atributos del objeto
        /// </summary>
        /// <param name="source">Objeto origen</param>
        protected void CopyValues(TipoGastoInfo source)
        {
            if (source == null)
            {
                return;
            }

            _base.CopyValues(source);
        }
Пример #4
0
        internal void CopyValues(TipoGastoInfo source)
        {
            if (source == null)
            {
                return;
            }

            _record.CopyValues(source.Base.Record);

            _cuenta_asociada = source.CuentaAsociada;
        }