public static void CreateCreditCardStatementsPayments() { Payments statement_payments = Payments.GetCreditCardStatementsList(0, false); CreditCardList credit_cards = CreditCardList.GetList(false); foreach (Payment payment in statement_payments) { //Payment Transactions payment.LoadChilds(typeof(TransactionPayment), false); CreditCardInfo card = credit_cards.GetItem(payment.OidTarjetaCredito); if (card.ETipoTarjeta != ETipoTarjeta.Credito) { continue; } //Extractos if (card.Statements == null) { card.LoadChilds(typeof(CreditCardStatement), false); } foreach (CreditCardStatementInfo statement in card.Statements) { if (statement.Amount == payment.Importe && statement.DueDate == payment.Vencimiento) { TransactionPayment operation = payment.Operations.NewItem(payment, statement, ETipoPago.ExtractoTarjeta); operation.Cantidad = payment.Importe; } } } statement_payments.Save(); }
public static void CreateCreditCardStatements() { QueryConditions conditions = new QueryConditions { MedioPago = EMedioPago.Tarjeta }; Payments payments = Payments.GetList(conditions, false); CreditCardList credit_cards = CreditCardList.GetList(false); string message = string.Empty; foreach (Payment payment in payments) { if (payment.EEstado == EEstado.Anulado) { continue; } CreditCardInfo card = credit_cards.GetItem(payment.OidTarjetaCredito); if (card.ETipoTarjeta != ETipoTarjeta.Credito) { continue; } payment.MarkItemDirty(); } payments.Save(); }
protected override void RefreshMainData() { PgMng.Message = Resources.Messages.RETRIEVING_EXTRACTOS; CreditCards = CreditCardList.GetList(ETipoTarjeta.Credito, false); PgMng.Grow(); if (List == null) { List = new NotifyEntityList(); } else { List.Clear(); } List = new NotifyEntityList(); Date_TI.Text = _fecha.ToShortDateString(); PgMng.Grow(); foreach (CreditCardInfo item in CreditCards) { //Extractos item.LoadChilds(typeof(CreditCardStatement), false); } PgMng.Grow(); base.RefreshMainData(); }
protected override void RefreshMainData() { PgMng.Message = Resources.Messages.RETRIEVING_EXTRACTOS; if (List == null) { List = new NotifyEntityList(); } else { List.Clear(); } List = new NotifyEntityList(); Date_TI.Text = _fecha.ToShortDateString(); TarjetasList = CreditCardList.GetList(ETipoTarjeta.Credito, false); MovimientosList.Clear(); PagosList.Clear(); PaymentList pagos; foreach (CreditCardInfo item in TarjetasList) { //Extractos item.LoadChilds(typeof(CreditCardStatement), false); //Extracto Pendiente pagos = PaymentList.GetListByVencimientoTarjeta(DateTime.MinValue, _fecha, item, false); PagosList.Add(pagos); //Extractos cobrados BankLineList movimientos = BankLineList.GetByCreditCardList(item, _fecha, false); MovimientosList.Add(movimientos); foreach (BankLineInfo mov in movimientos) { pagos = PaymentList.GetListByMovimiento(mov, false); PagosList.Add(pagos); } } PgMng.Grow(); base.RefreshMainData(); }
public static void CreateApuntesBancarios(PaymentList pagos) { List <PaymentInfo> list = new List <PaymentInfo>(); CreditCardList tarjetas = CreditCardList.GetList(); Payments pagos_tarjeta = Payments.NewList(); foreach (PaymentInfo item in pagos) { if (!Common.EnumFunctions.NeedsCuentaBancaria(item.EMedioPago)) { continue; } if (item.Vencimiento > DateTime.Today) { continue; } if (item.EMedioPago != EMedioPago.Tarjeta) { //Apunte bancario del pagaré, talón, etc.. BankLine.InsertItem(item, true); list.Add(item); } else { Payment pago_tarjeta = pagos_tarjeta.GetItemByTarjetaCredito(item.OidTarjetaCredito, item.Vencimiento); if (pago_tarjeta == null) { pago_tarjeta = pagos_tarjeta.NewItem(item, ETipoPago.ExtractoTarjeta); TransactionPayment pf = pago_tarjeta.Operations.NewItem(pago_tarjeta, item, item.ETipoPago); pf.Cantidad = item.Total; pago_tarjeta.EEstadoPago = EEstado.Pagado; } else { pago_tarjeta.Importe += item.Importe; pago_tarjeta.GastosBancarios += item.GastosBancarios; TransactionPayment pf = pago_tarjeta.Operations.NewItem(pago_tarjeta, item, item.ETipoPago); pf.Cantidad = item.Total; } list.Add(item); } } Payments pagos_fraccionados = Payments.NewList(); pagos_fraccionados.OpenNewSession(); //Apunte bancario de la tarjeta foreach (Payment item in pagos_tarjeta) { Payment root = pagos_fraccionados.NewItem(item.GetInfo(false), ETipoPago.FraccionadoTarjeta); root.Pagos.AddItem(item); //if (item.Importe != 0) // MovimientoBanco.InsertItemTarjeta(item, tarjetas.GetItem(item.OidTarjetaCredito)); } pagos_fraccionados.BeginTransaction(); pagos_fraccionados.Save(); Payment.UpdatePagadoFromList(list, true); }
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)); } } }
protected override void GetFormSourceData() { _list = CreditCardList.GetList(); }