public PaymentListRpt GetListReport(PaymentList list, TransactionPaymentList p_facturas) { if (list == null) { return(null); } PaymentListRpt doc = new PaymentListRpt(); List <PaymentPrint> pList = new List <PaymentPrint>(); foreach (PaymentInfo pago in list) { if (ShowQRCode) { pago.LoadChilds(p_facturas.GetSubList(new FCriteria <long>("OidPago", pago.Oid, Operation.Equal))); } pList.Add(PaymentPrint.New(pago, null, ShowQRCode)); } doc.SetDataSource(pList); FormatHeader(doc); doc.QRCodeSection.SectionFormat.EnableSuppress = !ShowQRCode; return(doc); }
public static void IsPosibleDelete(long oid, ETipoAcreedor providerType) { QueryConditions conditions = new QueryConditions { TipoAcreedor = new ETipoAcreedor[1] { providerType }, Acreedor = ProviderBaseInfo.New(oid, providerType), Estado = EEstado.NoAnulado }; InputDeliveryList albaranes = InputDeliveryList.GetList(conditions, false); if (albaranes.Count > 0) { throw new iQException(Resources.Messages.ALBARANES_ASOCIADOS); } InputInvoiceList facturas = InputInvoiceList.GetList(conditions, false); if (facturas.Count > 0) { throw new iQException(Resources.Messages.FACTURAS_ASOCIADAS); } conditions.PaymentType = ETipoPago.Factura; PaymentList pagos = PaymentList.GetList(conditions, false); if (pagos.Count > 0) { throw new iQException(Resources.Messages.PAGOS_ASOCIADOS); } }
public static PaymentList GetPagosVencidosSinApunte(DateTime fecha) { QueryConditions conditions = new QueryConditions { MedioPago = EMedioPago.NoTarjeta, FechaAuxFin = fecha }; PaymentList list = PaymentList.GetListByVencimientoSinApunte(conditions, false); return(list); }
public static PaymentList GetPagosTarjetaVencidosSinApunte(DateTime fecha, CreditCardInfo tarjeta) { QueryConditions conditions = new QueryConditions { TarjetaCredito = tarjeta, MedioPago = EMedioPago.Tarjeta, FechaAuxFin = fecha }; PaymentList list = PaymentList.GetListByVencimientoSinApunte(conditions, false); return(list); }
public static PaymentList GetPagosComercioExterior(BankAccountInfo account) { DateTime f_fin = DateTime.Today.AddDays((double)Library.Store.ModulePrincipal.GetNotifyPlazoPagos()); QueryConditions conditions = new QueryConditions { CuentaBancaria = account, FechaAuxIni = DateTime.Now, FechaAuxFin = f_fin, }; PaymentList list = PaymentList.GetListByVencimientoPrestamo(conditions, false); return(list); }
public new static IAgenteHipatiaList GetAgentes(EntidadInfo entidad) { IAgenteHipatiaList lista = new IAgenteHipatiaList(new List <IAgenteHipatia>()); if (entidad.Tipo == typeof(Almacen).Name) { StoreList list = StoreList.GetList(false); foreach (StoreInfo obj in list) { if (entidad.Agentes.GetItemByProperty("Oid", obj.Oid) == null) { lista.Add(obj); } } } else if (entidad.Tipo == typeof(Despachante).Name) { DespachanteList list = DespachanteList.GetList(false); foreach (DespachanteInfo obj in list) { if (entidad.Agentes.GetItemByProperty("Oid", obj.Oid) == null) { lista.Add(obj); } } } else if (entidad.Tipo == typeof(Employee).Name) { EmployeeList list = EmployeeList.GetList(false); foreach (EmployeeInfo obj in list) { if (entidad.Agentes.GetItemByProperty("Oid", obj.Oid) == null) { lista.Add(obj); } } } else if (entidad.Tipo == typeof(Expedient).Name) { ExpedienteList list = ExpedienteList.GetList(false); foreach (ExpedientInfo obj in list) { if (entidad.Agentes.GetItemByProperty("Oid", obj.Oid) == null) { lista.Add(obj); } } } else if (entidad.Tipo == typeof(InputInvoice).Name) { InputInvoiceList list = InputInvoiceList.GetList(false); foreach (InputInvoiceInfo obj in list) { if (entidad.Agentes.GetItemByProperty("Oid", obj.Oid) == null) { lista.Add(obj); } } } else if (entidad.Tipo == typeof(LineaFomento).Name) { LineaFomentoList list = LineaFomentoList.GetList(false); foreach (LineaFomentoInfo obj in list) { if (entidad.Agentes.GetItemByProperty("Oid", obj.Oid) == null) { lista.Add(obj); } } } else if (entidad.Tipo == typeof(Naviera).Name) { NavieraList list = NavieraList.GetList(false); foreach (NavieraInfo obj in list) { if (entidad.Agentes.GetItemByProperty("Oid", obj.Oid) == null) { lista.Add(obj); } } } else if (entidad.Tipo == typeof(Payment).Name) { PaymentList list = PaymentList.GetList(false); foreach (PaymentInfo obj in list) { if (entidad.Agentes.GetItemByProperty("Oid", obj.Oid) == null) { lista.Add(obj); } } } else if (entidad.Tipo == typeof(Product).Name) { ProductList list = ProductList.GetList(false); foreach (ProductInfo obj in list) { if (entidad.Agentes.GetItemByProperty("Oid", obj.Oid) == null) { lista.Add(obj); } } } else if (entidad.Tipo == typeof(Proveedor).Name) { ProveedorList list = ProveedorList.GetList(false); foreach (ProveedorInfo obj in list) { if (entidad.Agentes.GetItemByProperty("Oid", obj.Oid) == null) { lista.Add(obj); } } } else if (entidad.Tipo == typeof(Transporter).Name) { TransporterList list = TransporterList.GetList(false); foreach (TransporterInfo obj in list) { if (entidad.Agentes.GetItemByProperty("Oid", obj.Oid) == null) { lista.Add(obj); } } } else { throw new iQException("No se ha encontrado el tipo de entidad " + entidad.Tipo); } return(lista); }
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.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); }