public InformeCobrosRpt GetInformeCobrosReport(CobroFacturaList list, OutputInvoiceList facturas)
        {
            InformeCobrosRpt doc = new InformeCobrosRpt();

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

            foreach (CobroFacturaInfo item in list)
            {
                pList.Add(CobroFacturaPrint.New(item, null, facturas.GetItem(item.OidFactura)));
            }

            if (pList.Count == 0)
            {
                return(null);
            }

            doc.SetDataSource(pList);

            FormatHeader(doc);

            return(doc);
        }
        private void GetFacturas(ClienteInfo cliente,
                                 QueryConditions conditions,
                                 FormatConfCarteraClientesReport conf,
                                 List <CarteraClientesPrint> pList,
                                 List <CobroFacturaPrint> pCobroList)
        {
            OutputInvoiceList facturas;

            conditions.Cliente = cliente;

            switch (conf.tipo)
            {
            case ETipoFacturas.Cobradas:
            {
                facturas = OutputInvoiceList.GetCobradasList(conditions, false);

                if (facturas.Count > 0)
                {
                    foreach (OutputInvoiceInfo f in facturas)
                    {
                        f.LoadChilds(typeof(CobroFacturaInfo), false);

                        pList.Add(cliente.GetCarteraPrintObject(f));

                        foreach (CobroFacturaInfo cobro in f.CobroFacturas)
                        {
                            pCobroList.Add(CobroFacturaPrint.New(cobro));
                        }
                    }
                }
            } break;

            case ETipoFacturas.Pendientes:
            {
                facturas = OutputInvoiceList.GetNoCobradasList(conditions, false);

                if (facturas.Count > 0)
                {
                    foreach (OutputInvoiceInfo f in facturas)
                    {
                        f.LoadChilds(typeof(CobroFacturaInfo), false);

                        pList.Add(cliente.GetCarteraPrintObject(f));

                        foreach (CobroFacturaInfo cobro in f.CobroFacturas)
                        {
                            pCobroList.Add(CobroFacturaPrint.New(cobro));
                        }
                    }
                }
            }
            break;

            case ETipoFacturas.Todas:
            {
                facturas = OutputInvoiceList.GetList(conditions, false);

                if (facturas.Count == 0)
                {
                    pList.Add(cliente.GetCarteraPrintObject(null));
                }
                else
                {
                    foreach (OutputInvoiceInfo f in facturas)
                    {
                        f.LoadChilds(typeof(CobroFacturaInfo), false);

                        if (f.CobroFacturas.Count > 0)
                        {
                            pList.Add(cliente.GetCarteraPrintObject(f));

                            foreach (CobroFacturaInfo cobro in f.CobroFacturas)
                            {
                                pCobroList.Add(CobroFacturaPrint.New(cobro));
                            }
                        }
                        else
                        {
                            pList.Add(cliente.GetCarteraPrintObject(f));
                        }
                    }
                }
            }
            break;
            }
        }