public CobroREAListRpt GetCobroREAListReport(ChargeList list, CobroREAList c_reas)
        {
            if (list == null)
            {
                return(null);
            }

            CobroREAListRpt doc = new CobroREAListRpt();

            List <CobroPrint> pList = new List <CobroPrint>();

            foreach (ChargeInfo cobro in list)
            {
                if (c_reas != null && ShowQRCode)
                {
                    cobro.LoadChilds(c_reas.GetSubList(new FCriteria <long>("OidCobro", cobro.Oid, Operation.Equal)));
                }

                pList.Add(CobroPrint.New(cobro, ShowQRCode));
            }

            doc.SetDataSource(pList);

            FormatHeader(doc);

            return(doc);
        }
        public ChargeListRpt GetListReport(ChargeList list, CobroFacturaList c_facturas)
        {
            if (list == null)
            {
                return(null);
            }

            ChargeListRpt doc = new ChargeListRpt();

            List <ChargeInfo> pList = new List <ChargeInfo>();

            foreach (ChargeInfo cobro in list)
            {
                if (ShowQRCode)
                {
                    cobro.LoadChilds(c_facturas.GetSubList(new FCriteria <long>("OidCobro", cobro.Oid, Operation.Equal)));
                }

                pList.Add(CobroPrint.New(cobro, ShowQRCode));
            }

            doc.SetDataSource(pList);

            FormatHeader(doc);

            doc.QRCodeSection.SectionFormat.EnableSuppress = !ShowQRCode;

            return(doc);
        }
        public static ChargeList GetCobrosPendientes()
        {
            DateTime   f_fin = DateTime.Today.AddDays((double)Library.Invoice.ModulePrincipal.GetNotifyPlazoCobros());
            ChargeList list  = ChargeList.GetListPendientes(ETipoCobro.Todos, DateTime.MinValue, f_fin, false);

            return(list);
        }
        public static ChargeList GetCobrosVencidosSinApunte(DateTime fecha)
        {
            QueryConditions conditions = new QueryConditions
            {
                FechaAuxFin = fecha
            };
            ChargeList list = ChargeList.GetListByVencimientoSinApunte(conditions, false);

            return(list);
        }
示例#5
0
        public new static IAgenteHipatiaList GetAgentes(EntidadInfo entidad)
        {
            IAgenteHipatiaList lista = new IAgenteHipatiaList(new List <IAgenteHipatia>());

            if (entidad.Tipo == typeof(Cliente).Name)
            {
                ClienteList list = ClienteList.GetList(false);

                foreach (ClienteInfo obj in list)
                {
                    if (entidad.Agentes.GetItemByProperty("Oid", obj.Oid) == null)
                    {
                        lista.Add(obj);
                    }
                }
            }
            else if (entidad.Tipo == typeof(Charge).Name)
            {
                ChargeList list = ChargeList.GetList(false);

                foreach (ChargeInfo obj in list)
                {
                    if (entidad.Agentes.GetItemByProperty("Oid", obj.Oid) == null)
                    {
                        lista.Add(obj);
                    }
                }
            }
            else if (entidad.Tipo == typeof(OutputInvoice).Name)
            {
                OutputInvoiceList list = OutputInvoiceList.GetList(false);

                foreach (OutputInvoiceInfo 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(ChargeList cobros)
        {
            //MovimientoBancoList movs = MovimientoBancoList.GetList(DateTime.Today, false);
            List <ChargeInfo> list = new List <ChargeInfo>();

            foreach (ChargeInfo item in cobros)
            {
                if (!Common.EnumFunctions.NeedsCuentaBancaria(item.EMedioPago))
                {
                    continue;
                }

                //if (movs.GetItemByOperacion(item.Oid, item.ETipoMovimientoBanco) != null) continue;

                //Apunte bancario del pagaré, talón, etc..
                BankLine.InsertItem(item, true);

                list.Add(item);
            }

            Charge.UpdateCobradoFromList(list, true);
        }
        public virtual void ExportCharges()
        {
            Charges charges2 = null;

            try
            {
                _invoice_conditions.Orders.Clear();
                _invoice_conditions.Orders.NewOrder("Vencimiento", System.ComponentModel.ListSortDirection.Ascending, typeof(Charge));

                ChargeList cobros = ChargeList.GetList(_invoice_conditions, true);
                //Hacen falta todas porque un cobro puede estar asociado a una factura que no este en las condiciones del filtro
                _invoices = OutputInvoiceList.GetList(false);
                _clients  = (_clients == null) ? ClienteList.GetList(false) : _clients;

                _expedients = ExpedienteList.GetList(false);

                foreach (ChargeInfo item in cobros)
                {
                    if (item.EEstado == EEstado.Anulado)
                    {
                        continue;
                    }

                    LineaRegistro lr = _registry.LineaRegistros.NewItem(_registry, item);

                    switch (item.ETipoCobro)
                    {
                    case ETipoCobro.Cliente:
                    {
                        BuildChargeAccountingEntry(item, lr);
                        BuildFinalcialCashBookChargeAccountingEntry(item);
                    }
                    break;

                    case ETipoCobro.REA:
                    {
                        BuildREAChargeAccountingEntry(item, lr);
                    }
                    break;
                    }

                    _accounting_entry++;
                }

                //Cambiamos el estado de las cobros contabilizados
                charges2 = Charges.GetList(_invoice_conditions, false);
                FinancialCashList efectos = FinancialCashList.GetList(false);

                foreach (Charge item in charges2)
                {
                    if (item.EEstado == EEstado.Anulado)
                    {
                        continue;
                    }

                    if (item.EEstado != EEstado.Exportado)
                    {
                        if (item.EEstadoCobro == EEstado.Charged)
                        {
                            if (item.EMedioPago != EMedioPago.Cheque &&
                                item.EMedioPago != EMedioPago.Pagare)
                            {
                                item.EEstado = EEstado.Exportado;
                            }
                            else
                            {
                                FinancialCashInfo efecto = efectos.GetItemByCobro(item.Oid);
                                if (efecto != null && efecto.EEstadoCobro == EEstado.Charged)
                                {
                                    item.EEstado = EEstado.Exportado;
                                }
                            }
                        }
                    }
                }

                charges2.Save();
            }
            catch (iQException ex)
            {
                _registry = null;
                throw ex;
            }
            catch (Exception ex)
            {
                _registry = null;
                throw ex;
            }
            finally
            {
                if (charges2 != null)
                {
                    charges2.CloseSession();
                }
            }
        }