コード例 #1
0
        public virtual void Init(ContabilidadConfig config)
        {
            _config = config;
            SetConditions(config.Conditions);

            _accounting_entry = Convert.ToInt64(_config.AsientoInicial);

            if (!_config.RutaSalida.EndsWith("\\"))
            {
                _config.RutaSalida += "\\";
            }

            if (!Directory.Exists(_config.RutaSalida))
            {
                Directory.CreateDirectory(_config.RutaSalida);
            }

            _ayudas        = AyudaList.GetList(false);
            _taxes         = ImpuestoList.GetList(false);
            _families      = FamiliaList.GetList(false, true);
            _bank_accounts = BankAccountList.GetList(false);
            _expense_types = TipoGastoList.GetList(false);

            _registry                  = Registro.New(ETipoRegistro.Contabilidad);
            _registry.Nombre           = Resources.Labels.REGISTRO_CONTABILIDAD;
            _registry.ETipoExportacion = config.TipoExportacion;
            _registry.Observaciones    = GetConditions();
        }
コード例 #2
0
        public void UpdateSaldo()
        {
            if (Items.Count == 0)
            {
                return;
            }

            BankAccountList cuentas = BankAccountList.GetList(false);
            BankAccountInfo cuenta;

            foreach (BankAccountInfo item in cuentas)
            {
                item.SaldoParcial = item.SaldoInicial;
            }

            foreach (BankLineInfo item in Items.Reverse())
            {
                if (item.EEstado == EEstado.Anulado)
                {
                    item.Saldo = 0;
                }
                else
                {
                    cuenta = cuentas.GetItem(item.OidCuenta);
                    if (cuenta != null)
                    {
                        cuenta.SaldoParcial += item.Importe;
                    }
                    item.Saldo = (cuenta != null) ? cuenta.SaldoParcial : item.Importe;
                }
            }
        }
コード例 #3
0
        public override void UpdateList()
        {
            switch (_current_action)
            {
            case molAction.Add:
            case molAction.Copy:
                if (_entity == null)
                {
                    return;
                }
                List.AddItem(_entity.GetInfo(false));
                if (FilterType == IFilterType.Filter)
                {
                    BankAccountList listA = BankAccountList.GetList(_filter_results);
                    listA.AddItem(_entity.GetInfo(false));
                    _filter_results = listA.GetSortedList();
                }
                break;

            case molAction.Edit:
            case molAction.Lock:
            case molAction.Unlock:
            case molAction.ChangeStateAnulado:
                if (_entity == null)
                {
                    return;
                }
                if (_entity.Oid != ActiveItem.Oid)
                {
                    ActiveItem.CopyFrom(_entity.CuentasAsociadas.GetItem(ActiveItem.Oid));
                }
                else
                {
                    ActiveItem.CopyFrom(_entity);
                }
                break;

            case molAction.Delete:
                if (ActiveItem == null)
                {
                    return;
                }
                List.RemoveItem(ActiveOID);
                if (FilterType == IFilterType.Filter)
                {
                    BankAccountList listD = BankAccountList.GetList(_filter_results);
                    listD.RemoveItem(ActiveOID);
                    _filter_results = listD.GetSortedList();
                }
                break;
            }

            RefreshSources();
            if (_entity != null)
            {
                Select(_entity.Oid);
            }
            _entity = null;
        }
コード例 #4
0
        protected override void EditAccountAction()
        {
            BankAccountSelectForm form = new BankAccountSelectForm(this, BankAccountList.GetList(ETipoCuenta.CuentaCorriente, EEstado.Active, false));

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                BankAccountInfo cuenta = form.Selected as BankAccountInfo;
                Cuenta_TB.Text         = cuenta.Valor;
                _entity.CuentaBancaria = cuenta.Valor;
            }
        }
コード例 #5
0
        protected virtual void SelectCuentaAction()
        {
            ETipoCuenta           tipo = _entity.ETipoMovimientoBanco == EBankLineType.Manual ? ETipoCuenta.CuentaCorriente : ETipoCuenta.FondoInversion;
            BankAccountSelectForm form = new BankAccountSelectForm(this, BankAccountList.GetList(tipo, EEstado.Active, false));

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                BankAccountInfo cuenta = form.Selected as BankAccountInfo;
                SetCuentaBancaria(cuenta);
            }
        }
コード例 #6
0
        private void CuentaAsociada_BT_Click(object sender, EventArgs e)
        {
            BankAccountSelectForm form = new BankAccountSelectForm(this, BankAccountList.GetList(ETipoCuenta.CuentaCorriente, moleQule.Base.EEstado.Active, false));

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                BankAccountInfo item = form.Selected as BankAccountInfo;

                _entity.OidCuentaBAsociada = item.Oid;
                _entity.CuentaAsociada     = item.Valor;
            }
        }
コード例 #7
0
        private void Cuenta_BT_Click(object sender, EventArgs e)
        {
            BankAccountSelectForm form = new BankAccountSelectForm(this, BankAccountList.GetList(ETipoCuenta.CuentaCorriente, EEstado.Active, false));

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                BankAccountInfo cuenta = form.Selected as BankAccountInfo;

                _entity.OidCuentaBancaria = cuenta.Oid;
                _entity.CuentaBancaria    = cuenta.Valor;
                CuentaBancaria_TB.Text    = cuenta.Valor;
            }
        }
コード例 #8
0
        protected virtual void SetBankAccountAction()
        {
            BankAccountSelectForm form = new BankAccountSelectForm(this, BankAccountList.GetList(EEstado.Active, false));

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                BankAccountInfo cuenta = form.Selected as BankAccountInfo;

                _entity.OidCuentaBancaria = cuenta.Oid;
                _entity.CuentaBancaria    = cuenta.Valor;
                Cuenta_TB.Text            = _entity.CuentaBancaria;
            }
        }
コード例 #9
0
        protected override void RefreshMainData()
        {
            PgMng.Grow(string.Empty, "CuentaBancaria");

            long oid = ActiveOID;

            switch (DataType)
            {
            case EntityMngFormTypeData.Default:
                List = BankAccountList.GetList(false);
                break;

            case EntityMngFormTypeData.ByParameter:
                _sorted_list = List.GetSortedList();
                break;
            }
            PgMng.Grow(string.Empty, "Lista de CuentaBancarias");
        }
コード例 #10
0
        protected virtual void SetBankAccountAction()
        {
            BankAccountSelectForm form;

            if (_entity.EMedioPago == EMedioPago.ComercioExterior)
            {
                form = new BankAccountSelectForm(this, BankAccountList.GetList(ETipoCuenta.ComercioExterior, moleQule.Base.EEstado.Active, false));
            }
            else
            {
                form = new BankAccountSelectForm(this, BankAccountList.GetNoAsociadasList(moleQule.Base.EEstado.Active, false));
            }

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                BankAccountInfo cuenta = form.Selected as BankAccountInfo;

                _entity.OidCuentaBancaria = cuenta.Oid;
                _entity.CuentaBancaria    = cuenta.Valor;
                Cuenta_TB.Text            = _entity.CuentaBancaria;
            }
        }
コード例 #11
0
 public BankAccountSelectForm(Form parent)
     : this(parent, BankAccountList.GetList(EEstado.Active, false))
 {
 }
コード例 #12
0
        protected override void RefreshMainData()
        {
            PgMng.Message = Resources.Messages.RETRIEVING_NOTIFICATIONS;

            if (List == null)
            {
                List = new NotifyEntityList();
            }
            else
            {
                List.Clear();
            }

            List = new NotifyEntityList();
            DateTime fecha;

            FechaApuntes_TI.Text = _fecha_apuntes.ToShortDateString();

            if (Library.Store.ModulePrincipal.GetNotifyFacturasRecibidas())
            {
                fecha = DateTime.Today.AddDays((double)Library.Store.ModulePrincipal.GetNotifyPlazoFacturasRecibidas());

                FacturaRecibidaList = Library.Store.ModuleController.GetFacturasRecibidasPendientes();
                List.Add(new NotifyEntity(ETipoNotificacion.GastoPendiente
                                          , ETipoEntidad.FacturaRecibida
                                          , FacturaRecibidaList.Count
                                          , FacturaRecibidaList.TotalPendiente()
                                          , String.Format(Store.Resources.Messages.NOFITY_FACTURAS_RECIBIDAS_PENDIENTES, fecha.ToShortDateString())
                                          , FacturaRecibidaList));
            }
            PgMng.Grow();

            if (Library.Store.ModulePrincipal.GetNotifyPagos())
            {
                BankAccountList cuentas = BankAccountList.GetList(EEstado.Active, false);
                PagosBancosList.Clear();

                foreach (BankAccountInfo item in cuentas)
                {
                    fecha = DateTime.Today.AddDays((double)Library.Store.ModulePrincipal.GetNotifyPlazoPagos());

                    PaymentList pagos_banco = Library.Store.ModuleController.GetPagosPendientesVencimiento(item);
                    PagosBancosList.Add(pagos_banco);

                    List.Add(new NotifyEntity(ETipoNotificacion.PagoBancoPendiente
                                              , ETipoEntidad.Pago
                                              , pagos_banco.Count
                                              , pagos_banco.Total()
                                              , item.Entidad
                                              , pagos_banco));
                }
            }
            PgMng.Grow();

            if (Library.Store.ModulePrincipal.GetNotifyGastos())
            {
                fecha = DateTime.Today.AddDays((double)Library.Store.ModulePrincipal.GetNotifyPlazoGastos());

                GastoList = Library.Store.ModuleController.GetGastosPendientes();
                List.Add(new NotifyEntity(ETipoNotificacion.GastoPendiente
                                          , ETipoEntidad.Gasto
                                          , GastoList.Count
                                          , GastoList.TotalPendiente()
                                          , String.Format(Store.Resources.Messages.NOFITY_GASTOS_PENDIENTES, fecha.ToShortDateString())
                                          , GastoList));
            }
            PgMng.Grow();

            if (Library.Invoice.ModulePrincipal.GetNotifyFacturasEmitidas())
            {
                fecha = DateTime.Today.AddDays((double)Library.Invoice.ModulePrincipal.GetNotifyPlazoFacturasEmitidas());

                FacturaList = Library.Invoice.ModuleController.GetFacturasPendientes();
                List.Add(new NotifyEntity(ETipoNotificacion.IngresoPendiente
                                          , ETipoEntidad.FacturaEmitida
                                          , FacturaList.Count
                                          , FacturaList.TotalPendiente()
                                          , String.Format(Invoice.Resources.Messages.NOFITY_FACTURAS_EMITIDAS_PENDIENTES, fecha.ToShortDateString())
                                          , FacturaList));
            }
            PgMng.Grow();

            if (Library.Invoice.ModulePrincipal.GetNotifyCobros())
            {
                fecha = DateTime.Today.AddDays((double)Library.Invoice.ModulePrincipal.GetNotifyPlazoCobros());

                CobroList = Library.Invoice.ModuleController.GetCobrosPendientes();
                List.Add(new NotifyEntity(ETipoNotificacion.IngresoPendiente
                                          , ETipoEntidad.Cobro
                                          , CobroList.Count
                                          , CobroList.Total()
                                          , String.Format(Invoice.Resources.Messages.NOFITY_COBROS_PENDIENTES, fecha.ToShortDateString())
                                          , CobroList));
            }
            PgMng.Grow();

            PagosVencidosList = Library.Store.ModuleController.GetPagosVencidosSinApunte(_fecha_apuntes);
            List.Add(new NotifyEntity(ETipoNotificacion.PagoVencido
                                      , ETipoEntidad.Pago
                                      , PagosVencidosList.Count
                                      , PagosVencidosList.Total()
                                      , String.Format(Store.Resources.Messages.NOTIFY_PAGOS_VENCIDOS, _fecha_apuntes.ToShortDateString())
                                      , PagosVencidosList));
            PgMng.Grow();


            CreditCardList tarjetas = CreditCardList.GetList(ETipoTarjeta.Credito, false);

            PagosTarjetasList.Clear();

            foreach (CreditCardInfo item in tarjetas)
            {
                PaymentList pagos_tarjetas = Library.Store.ModuleController.GetPagosTarjetaVencidosSinApunte(_fecha_apuntes, item);
                PagosTarjetasList.Add(pagos_tarjetas);

                List.Add(new NotifyEntity(ETipoNotificacion.PagoTarjetaVencido
                                          , ETipoEntidad.Pago
                                          , pagos_tarjetas.Count
                                          , pagos_tarjetas.Total()
                                          , item.Nombre
                                          , pagos_tarjetas));
            }
            PgMng.Grow();

            CobrosVencidosList = Library.Invoice.ModuleController.GetCobrosVencidosSinApunte(_fecha_apuntes);
            List.Add(new NotifyEntity(ETipoNotificacion.CobroVencido
                                      , ETipoEntidad.Cobro
                                      , CobrosVencidosList.Count
                                      , CobrosVencidosList.Total()
                                      , String.Format(Invoice.Resources.Messages.NOTIFY_COBROS_VENCIDOS, _fecha_apuntes.ToShortDateString())
                                      , CobrosVencidosList));
            PgMng.Grow();

            if (Library.Quality.ModulePrincipal.GetNotifyAuditorias())
            {
                //Auditorías con Plazo Máximo de Generación de Informe de Auditorías próximo a vencer
                //AuditoriaList auditorias = Library.Quality.ModuleControler.GetAvisoGeneracionInforme();
                //foreach (AuditoriaInfo item in auditorias)
                //{
                //    List.Add(new NotifyEntity(ETipoNotificacion.InformeNoGenerado
                //                    , ETipoEntidad.Auditoria
                //                    , item.Referencia));
                //}

                //Auditorías con Plazo Máximo de Notificación de Discrepancias próximo a vencer

                //Auditorías con Plazo Máximo de Notificación de Fin de Auditoría próximo a vencer

                //Auditorías con Plazo Máximo de Respuesta de Solicitud de Ampliación próximo a vencer

                //Auditorías con Discrepancias abiertas próximas a cumplir fecha de cierre
                AuditoriaList auditorias = Library.Quality.ModuleController.GetAvisoDiscrepanciasAbiertas();
                foreach (AuditoriaInfo item in auditorias)
                {
                    List.Add(new NotifyEntity(ETipoNotificacion.DiscrepanciaAbierta
                                              , ETipoEntidad.Auditoria
                                              , item.Referencia));
                }
            }
        }