Exemplo n.º 1
0
        /// <summary>
        /// Devuelve el documento a reimprimir para el recibo
        /// correspondiente
        /// </summary>
        /// <param name="unRecibo">Recibo</param>
        /// <returns>Documento a imprimir</returns>
        private static ReportDocument GetReporteReciboRe(Recibo unRecibo)
        {
            try {
                // Inserta el Header del recibo. Crea una instancia de la
                // tabla Factura que se encuentra en el componente DSInforme
                var ds = new DSInformes();

                // Carga los datos del recibo en la tabla. Esta se
                // utilizará para completar el informe.
                ds.Recibo.AddReciboRow(
                    unRecibo.Numero,
                    unRecibo.Concepto.Nombre,
                    unRecibo.Importe,
                    string.Format("{0}. {1}", unRecibo.Pago.Tipo.Nombre, unRecibo.Descripcion),
                    unRecibo.Fecha,
                    string.Format("{0} (Cód.:{1})", unRecibo.Pago.Cuenta.Titular.Nombre, unRecibo.Pago.Cuenta.Codigo),
                    unRecibo.Pago.Cuenta.Codigo,
                    Numalet.ToString(unRecibo.Importe),
                    1,
                    unRecibo.Pago.Cuenta.Entidad.Nombre);
                // Crea el reporte
                var reporte = new RReciboRe();
                reporte.SetDataSource(ds);
                return reporte;
            } catch (Exception e) {
                Sistema.Controlador.logear("ERROR-IMPRIMIR-RECIBO", ENivelMensaje.ERROR, e.ToString());
                throw;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Devuelve el documento a reimprimir de la factura
        /// dependiendo de la letra correspondiente, pasada
        /// como parámetro.
        /// </summary>
        /// <param name="unRecibo">Instancia de Recibo del
        /// tipo factura</param>
        /// <param name="letra">Letra correspondiente al tipo
        /// de factura</param>
        /// <returns>Factura</returns>
        private static ReportDocument GetReporteFacturaRe(Recibo unRecibo, String letra)
        {
            try {
                // Establece la dirección para la factura
                Contacto cto = unRecibo.Pago.Cuenta.Titular.getContactoPrincipal();
                string direccion = cto.Calle
                                   + (cto.Puerta != null
                                          ? "Nº " + cto.Puerta
                                          : "S/N")
                                   + (cto.PisoDepto != null
                                          ? "Po/Dto: " + cto.PisoDepto
                                          : "");
                string localidad = cto.Localidad.Nombre
                                   + ", " + cto.Provincia.Nombre
                                   + "(" + cto.Cp + ")";

                // Inserta el Header del recibo. Crea una instancia de la
                // tabla Factura que se encuentra en el componente DSInforme
                var ds = new DSInformes();

                ds.Factura.AddFacturaRow(
                    unRecibo.Numero,
                    unRecibo.Fecha,
                    string.Format("{0} (Cód.:{1})", unRecibo.Pago.Cuenta.Titular.Nombre, unRecibo.Pago.Cuenta.Codigo),
                    direccion,
                    localidad,
                    unRecibo.Pago.Cuenta.Titular.TipoIVA.Nombre,
                    unRecibo.Pago.Cuenta.Titular.Cuit,
                    unRecibo.Pago.FormaPago.Nombre,
                    unRecibo.getSubTotal(),
                    0,
                    unRecibo.getSubTotal(),
                    unRecibo.getMontoIva(),
                    unRecibo.Importe,
                    unRecibo.Pago.Cuenta.Entidad.Nombre);

                // Genera las líneas
                ds.Lineas.AddLineasRow(
                    ds.Factura[0],
                    1,
                    1,
                    unRecibo.Concepto.Nombre,
                    (unRecibo.Tipo.Clave != "TIPOFACTURA.A")
                        ? 0
                        : unRecibo.Importe,
                    unRecibo.Importe);

                // Crea el reporte
                //ReportDocument reporte = (letra == "A") ? new RFactura() : new RFactura();
                var reporte = new RFacturaRe();
                reporte.SetDataSource(ds);
                return reporte;
            } catch (Exception e) {
                Sistema.Controlador.logear("ERROR-IMPRIMIR-RECIBO", ENivelMensaje.ERROR, e.ToString());
                throw;
            }
        }