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 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 CobroClienteDetailRpt GetCobroClienteDetailReport(ClienteInfo item, ChargeSummary resumen)
        {
            if (item == null)
            {
                return(null);
            }

            CobroClienteDetailRpt doc = new CobroClienteDetailRpt();

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

            foreach (ChargeInfo cobro in item.Cobros)
            {
                if ((cobro.EEstado != Common.EEstado.Anulado))
                {
                    cobros.Add(CobroPrint.New(cobro, ShowQRCode));
                }
            }

            //Si no existen conceptos, no tiene sentido un informe detallado. Además, falla en Crystal Reports
            if (cobros.Count <= 0)
            {
                return(null);
            }

            pList.Add(ClientePrint.New(item, resumen));
            doc.SetDataSource(pList);
            doc.Subreports["Cuerpo"].SetDataSource(cobros);

            FormatHeader(doc);

            return(doc);
        }
        public CobroREADetailRpt GetDetallesCobroREAIndividualReport(ChargeInfo item, FacREAList expedientes)
        {
            if (item == null)
            {
                return(null);
            }

            CobroREADetailRpt doc = new CobroREADetailRpt();

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

            ChargeInfo cob;

            if (item.CobroFacturas == null)
            {
                cob = ChargeInfo.Get(item.Oid, true);
            }
            else
            {
                cob = item;
            }

            foreach (FacREAInfo frea in expedientes)
            {
                cobros.Add(frea);
            }

            //Si no existen conceptos, no tiene sentido un informe detallado. Además, falla en Crystal Reports
            if (cobros.Count <= 0)
            {
                return(null);
            }

            pList.Add(CobroPrint.New(item, ShowQRCode));
            doc.Subreports["Cuerpo"].SetDataSource(cobros);

            doc.SetDataSource(pList);
            doc.SetParameterValue("Empresa", Schema.Name);

            return(doc);
        }
        public string Encode(QREncodeVersion version, ETipoEntidad tipo, object source)
        {
            String txtEncodeData = string.Empty;

            txtEncodeData = "<l v=" + ((long)version).ToString() + " t=" + ((long)tipo).ToString() + " oid=OID_ITEM>";

            switch (tipo)
            {
            case ETipoEntidad.FacturaEmitida:
            {
                OutputInvoicePrint item = (OutputInvoicePrint)source;

                txtEncodeData = txtEncodeData.Replace("OID_ITEM", item.Oid.ToString());

                txtEncodeData += "<p>"
                                 + item.NumeroSerie + "|"
                                 + item.Fecha.ToShortDateString() + "|"
                                 + item.VatNumber + "|"
                                 + item.Codigo + "|"
                                 + item.Cliente + "|"
                                 + item.BaseImponible.ToString() + "|"
                                 + item.Impuestos.ToString() + "|"
                                 + item.Total.ToString() + "|"
                                 + "</p>";
            }
            break;

            case ETipoEntidad.Cobro:
            {
                CobroPrint item = (CobroPrint)source;

                txtEncodeData = txtEncodeData.Replace("OID_ITEM", item.Oid.ToString());

                txtEncodeData += "<p>"
                                 + item.Codigo + "|"
                                 + item.Fecha.ToShortDateString() + "|"
                                 + item.IDCobroS + "|"
                                 + item.EMedioPagoPrintLabel + "|"
                                 + item.NCliente + "|"
                                 + item.Cliente + "|"
                                 + item.Importe + "|"
                                 + item.CuentaBancaria + "|"
                                 + "</p>";

                if (item.CobroFacturas != null)
                {
                    txtEncodeData += "<sl t=" + ((long)ETipoEntidad.CobroFactura).ToString() + ">";

                    foreach (CobroFacturaInfo cf in item.CobroFacturas)
                    {
                        txtEncodeData += "<p>"
                                         + cf.CodigoFactura + "|"
                                         + cf.Cantidad + "|"
                                         + "</p>";
                    }

                    txtEncodeData += "</sl>";
                }
            }
            break;
            }

            txtEncodeData += "</l>";
            return(txtEncodeData);
        }