コード例 #1
0
        private void Submit_TI_Click(object sender, EventArgs e)
        {
            try
            {
                if (ProgressInfoMng.ShowQuestion("A continuación se generarán los apuntes bancarios asociados") == DialogResult.No)
                {
                    return;
                }

                RefreshAction();

                PgMng.Reset(5, 1, "Creando apuntes bancarios...", this);

                if (Apuntes_TV.TopNode.Nodes[PAGOS_PENDIENTES].Checked)
                {
                    PgMng.Grow("Creando apuntes bancarios de pagos");
                    Library.Invoice.ModuleController.CreateApuntesBancarios(CobrosVencidosList);
                }

                if (Apuntes_TV.TopNode.Nodes[COBROS_PENDIENTES].Checked)
                {
                    PgMng.Grow("Creando apuntes bancarios de pagos");
                    Library.Invoice.ModuleController.CreateApuntesBancarios(PagosVencidosList);
                }

                PgMng.Grow("Creando apuntes bancarios de pagos por tarjeta de crédito");
                foreach (PaymentList list in PagosTarjetasList)
                {
                    if (Apuntes_TV.TopNode.Nodes[PAGOS_TARJETA_PENDIENTES].Nodes[PagosTarjetasList.IndexOf(list)].Checked)
                    {
                        Library.Invoice.ModuleController.CreateApuntesBancarios(list);
                    }
                }

                PgMng.FillUp();

                RefreshAction();
            }
            catch (Exception ex)
            {
                PgMng.FillUp();
                throw ex;
            }
        }
コード例 #2
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));
                }
            }
        }