public PagoAcreedorDetailRpt GetPagoAcreedorDetailReport(PaymentSummary item, Payments pagos)
        {
            if (item == null)
            {
                return(null);
            }

            PagoAcreedorDetailRpt doc = new PagoAcreedorDetailRpt();

            List <PaymentPrint>   pagosList = new List <PaymentPrint>();
            List <PaymentSummary> pList     = new List <PaymentSummary>();

            foreach (Payment pago in pagos)
            {
                pagosList.Add(PaymentPrint.New(pago.GetInfo(true), null, false));
            }

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

            pList.Add(item);

            doc.SetDataSource(pList);
            doc.Subreports["Cuerpo"].SetDataSource(pagosList);

            FormatHeader(doc);

            return(doc);
        }
        public PaymentRpt GetDetailReport(Payment item,
                                          IAcreedor acreedor,
                                          InputInvoiceList facturas)
        {
            if (item == null)
            {
                return(null);
            }

            PaymentRpt doc = new PaymentRpt();

            List <PaymentPrint>            pList     = new List <PaymentPrint>();
            List <TransactionPaymentPrint> pagosList = new List <TransactionPaymentPrint>();

            foreach (TransactionPayment pagoFactura in item.Operations)
            {
                pagosList.Add(TransactionPaymentPrint.New(pagoFactura.GetInfo(), facturas.GetItem(pagoFactura.OidOperation)));
            }

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

            pList.Add(PaymentPrint.New(item.GetInfo(false), acreedor, false));

            doc.SetDataSource(pList);
            doc.Subreports["Cuerpo"].SetDataSource(pagosList);
            doc.SetParameterValue("Empresa", Schema.Name);

            return(doc);
        }
        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 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 moleQule.Common.Structs.ETipoEntidad.FacturaRecibida:
            {
                InputInvoicePrint item = (InputInvoicePrint)source;

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

                txtEncodeData += "<p>"
                                 + item.Codigo + "|"
                                 + item.NSerie + "|"
                                 + item.Fecha.ToShortDateString() + "|"
                                 + item.VatNumber + "|"
                                 + item.NumeroAcreedor + "|"
                                 + item.Acreedor + "|"
                                 + item.BaseImponible.ToString() + "|"
                                 + item.ImporteIgic.ToString() + "|"
                                 + item.Total.ToString() + "|"
                                 + "</p>";
            }
            break;

            case moleQule.Common.Structs.ETipoEntidad.Pago:
            {
                PaymentPrint item = (PaymentPrint)source;

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

                txtEncodeData += "<p>"
                                 + item.Codigo + "|"
                                 + item.Fecha.ToShortDateString() + "|"
                                 + item.IDPagoS + "|"
                                 + item.EMedioPagoPrintLabel + "|"
                                 + item.CodigoAgente + "|"
                                 + item.Agente + "|"
                                 + item.Importe + "|"
                                 + item.CuentaBancaria + "|"
                                 + "</p>";

                if (item.Operations != null)
                {
                    txtEncodeData += "<sl t=" + ((long)moleQule.Common.Structs.ETipoEntidad.PagoFactura).ToString() + ">";

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

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

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