Beispiel #1
0
    public void CreateHeader()
    {
        // ROWS
        Row   containerRow = TableContainer.AddRow();
        Table tableInside  = containerRow.Cells[0].Elements.AddTable();

        tableInside.AddColumn(500);
        string pathImage = HttpContext.Current.Server.MapPath("~/css/images/");
        var    row       = tableInside.AddRow();
        var    parrImg   = row.Cells[0].AddParagraph();

        parrImg.Format.Alignment = ParagraphAlignment.Center;
        Image image = parrImg.AddImage(pathImage + "/logo.png");

        image.Height = 100;

        row = tableInside.AddRow();
        var parr = row.Cells[0].AddParagraph("Rut: " + config.rut);

        parr.Style = "Head";
        row        = tableInside.AddRow();
        parr       = row.Cells[0].AddParagraph("Dirección: " + config.direccion);
        parr.Style = "Head";
        row        = tableInside.AddRow();
        parr       = row.Cells[0].AddParagraph("Giro: " + config.giro);
        parr.Style = "Head";
        row        = tableInside.AddRow();
        parr       = row.Cells[0].AddParagraph("Teléfono: " + config.telefono);
        parr.Style = "Head";
        row        = tableInside.AddRow();
        parr       = row.Cells[0].AddParagraph("Cel: " + config.cel);
        parr.Style = "Head";
    }
Beispiel #2
0
    public void CreateIT()
    {
        Row containerRow = TableContainer.AddRow();
        var table        = containerRow.Cells[0].Elements.AddTable();

        table.AddColumn(500);
        var row  = table.AddRow();
        var parr = row.Cells[0].AddParagraph(string.Format("COTIZACIÓN N° {0}", Cotizacion.IT));

        parr.Style = "Title";
    }
Beispiel #3
0
    public void CreateFoot()
    {
        Row containerRow = TableContainer.AddRow();
        var table        = containerRow.Cells[0].Elements.AddTable();
        var column       = table.AddColumn(500);
        var row          = table.AddRow();

        // Transferencia
        //row.HeightRule = RowHeightRule.Exactly;
        row.Height                        = 60;
        row.TopPadding                    = 3;
        row.BottomPadding                 = 3;
        row.Borders.Bottom.Visible        = true;
        row.Borders.Top.Visible           = false;
        row.Cells[0].Borders.Left.Visible = false;
        var parr = row.Cells[0].AddParagraph("DATOS TRANSFERENCIA O DEPÓSITO (NO RETIRAMOS CHEQUES)");

        parr.Style                 = "DatosTransfer";
        parr.Format.Font.Bold      = true;
        parr.Format.Font.Italic    = false;
        parr.Format.Font.Underline = Underline.Single;
        parr       = row.Cells[0].AddParagraph(config.datos_transferencia_nombre);
        parr.Style = "DatosTransfer";

        parr       = row.Cells[0].AddParagraph(config.datos_transferencia_banco);
        parr.Style = "DatosTransfer";

        parr       = row.Cells[0].AddParagraph(config.datos_transferencia_cta);
        parr.Style = "DatosTransfer";

        parr       = row.Cells[0].AddParagraph(config.datos_transferencia_rut);
        parr.Style = "DatosTransfer";

        parr       = row.Cells[0].AddParagraph(config.datos_transferencia_email);
        parr.Style = "DatosTransfer";
        parr       = row.Cells[0].AddParagraph("Obs: También existe la opción de pagar con tarjetas bancarias");
        parr.Style = "DatosTransfer";
        parr       = row.Cells[0].AddParagraph(config.webPage);
        parr.Style = "ParrafoFooter";
        parr       = row.Cells[0].AddParagraph(config.email_contacto);
        parr.Style = "ParrafoFooter";
        parr       = row.Cells[0].AddParagraph(config.telefono);
        parr.Style = "ParrafoFooter";
    }
Beispiel #4
0
    public void CreateHeader()
    {
        // ROWS
        Row   containerRow = TableContainer.AddRow();
        Table tableInside  = containerRow.Cells[0].Elements.AddTable();

        tableInside.AddColumn(250);
        tableInside.AddColumn(250);
        var row  = tableInside.AddRow();
        var parr = row.Cells[0].AddParagraph(config.nombre);

        parr.Style = "Head";
        row        = tableInside.AddRow();
        parr       = row.Cells[0].AddParagraph(config.nombre_largo);
        parr.Style = "Head";

        string pathImage = HttpContext.Current.Server.MapPath("~/css/images/");
        var    parrImg   = row.Cells[1].AddParagraph();

        row.Cells[1].MergeDown   = 4;
        parrImg.Format.Alignment = ParagraphAlignment.Center;
        Image image = parrImg.AddImage(pathImage + "/logo.png");

        image.Width = 220;

        row        = tableInside.AddRow();
        parr       = row.Cells[0].AddParagraph("Rut: " + config.rut);
        parr.Style = "Head";
        row        = tableInside.AddRow();
        parr       = row.Cells[0].AddParagraph("Dirección: " + config.direccion);
        parr.Style = "Head";
        row        = tableInside.AddRow();
        parr       = row.Cells[0].AddParagraph("Giro: " + config.giro);
        parr.Style = "Head";
        row        = tableInside.AddRow();
        parr       = row.Cells[0].AddParagraph("Teléfono: " + config.telefono);
        parr.Style = "Head";
        row        = tableInside.AddRow();
        parr       = row.Cells[0].AddParagraph("Cel: " + config.cel);
        parr.Style = "Head";
        row        = tableInside.AddRow();
        parr       = row.Cells[0].AddParagraph(config.fecha_entrada_vigencia);
        parr.Style = "Head-small";
    }
Beispiel #5
0
    public void CreateFoot()
    {
        Row containerRow = TableContainer.AddRow();
        var table        = containerRow.Cells[0].Elements.AddTable();
        var column       = table.AddColumn(150);

        column = table.AddColumn(200);
        column = table.AddColumn(150);
        var row  = table.AddRow();
        var parr = row.Cells[0].AddParagraph(config.telefono);

        parr.Style             = "ParrafoFooter";
        parr                   = row.Cells[1].AddParagraph(config.webPage);
        parr.Style             = "ParrafoFooter";
        parr                   = row.Cells[2].AddParagraph(config.direccion);
        row.Cells[2].MergeDown = 1;
        parr.Style             = "ParrafoFooter";

        row        = table.AddRow();
        parr       = row.Cells[0].AddParagraph(config.cel);
        parr.Style = "ParrafoFooter";
        parr       = row.Cells[1].AddParagraph(config.email_contacto);
        parr.Style = "ParrafoFooter";
    }
Beispiel #6
0
    public void CreateDetalle(int page, double total, int limit)
    {
        if (page > 1)
        {
            section.AddPageBreak();
            CreateTable();
        }
        else
        {
            CreateIT();
        }
        Row containerRow = TableContainer.AddRow();
        var table        = containerRow.Cells[0].Elements.AddTable();

        table.AddColumn(20);
        table.AddColumn(271);
        table.AddColumn(30);
        table.AddColumn(20);

        table.AddColumn(45);
        table.AddColumn(45);
        table.AddColumn(65);
        table.Borders.Visible    = true;
        table.Borders.Width      = 0.1;
        table.Format.SpaceBefore = 10;
        var row  = table.AddRow();
        var parr = row.Cells[0].AddParagraph("Item");

        parr.Style = "EncabezadoDetalle";
        row.Borders.Top.Visible = false;
        parr       = row.Cells[1].AddParagraph("Detalle");
        parr.Style = "EncabezadoDetalle";
        row.Borders.Left.Visible = false;
        parr       = row.Cells[2].AddParagraph("Cantidad");
        parr.Style = "EncabezadoDetalle";

        parr       = row.Cells[3].AddParagraph("U/M");
        parr.Style = "EncabezadoDetalle";

        parr       = row.Cells[4].AddParagraph("Valor Unitario.");
        parr.Style = "EncabezadoDetalle";

        parr       = row.Cells[5].AddParagraph("Total");
        parr.Style = "EncabezadoDetalle";

        parr       = row.Cells[6].AddParagraph("Entrega");
        parr.Style = "EncabezadoDetalle";



        var index         = (page - 1) * limit;
        var maxHeightItem = 370;
        var hasNota       = !string.IsNullOrEmpty(Cotizacion.Nota);
        var items         = Cotizacion.ItemCotizacion.Skip((page - 1) * limit).Take(limit);
        var itemsLength   = items.Count() + (Cotizacion.GastoOperacional.Any() && page == total ? 1 : 0) + (hasNota && page == total ? 3 : 0);
        var height        = page == total ? (maxHeightItem / (itemsLength + 2)) : (maxHeightItem / itemsLength);

        //row = table.AddRow();
        //row.HeightRule = RowHeightRule.Exactly;
        //row.Height = 30;
        //row.TopPadding = 10;
        //row.BottomPadding = 10;
        //row.Borders.Bottom.Visible = false;
        //parr = row.Cells[0].AddParagraph(string.Empty);
        //parr.Style = "DetalleRigth";
        //parr = row.Cells[1].AddParagraph(string.Empty);
        //parr.Style = "DetalleRigth";
        //parr = row.Cells[2].AddParagraph(string.Empty);
        //parr.Style = "Detalle";
        //parr.Format.Alignment = ParagraphAlignment.Center;
        //parr = row.Cells[3].AddParagraph("SERVICIO DE INSPECCIÓN, REVISIÓN DE LA INSTALACIÓN Y FUNCIONAMIENTO PARA:");
        //parr.Style = "Detalle";
        //parr = row.Cells[4].AddParagraph(string.Empty);
        //parr.Style = "DetalleCenter";
        //parr = row.Cells[5].AddParagraph(string.Empty);
        //parr.Style = "DetalleRigth";
        //parr = row.Cells[6].AddParagraph(string.Empty);
        //parr.Style = "DetalleRigth";
        //row.Cells[0].Borders.Left.Visible = false;
        //row.Cells[6].Borders.Right.Visible = false;
        foreach (var item in items)
        {
            index++;

            row                        = table.AddRow();
            row.HeightRule             = RowHeightRule.Exactly;
            row.Height                 = height;
            row.TopPadding             = 10;
            row.BottomPadding          = 10;
            row.Borders.Bottom.Visible = true;
            parr                       = row.Cells[0].AddParagraph(index.ToString());
            parr.Style                 = "DetalleRigth";
            parr                       = row.Cells[1].AddParagraph(item.DescripcionEditada);
            parr.Style                 = "Detalle";
            parr                       = row.Cells[2].AddParagraph(item.Cantidad.ToString());
            parr.Style                 = "DetalleRigth";
            parr                       = row.Cells[3].AddParagraph(config.unidad_medida);
            parr.Style                 = "Detalle";
            parr.Format.Alignment      = ParagraphAlignment.Center;

            parr       = row.Cells[4].AddParagraph(string.Format(format, item.Unitario));
            parr.Style = "DetalleRigth";

            parr       = row.Cells[5].AddParagraph(string.Format(format, (item.Unitario * item.Cantidad)));
            parr.Style = "DetalleRigth";

            parr       = row.Cells[6].AddParagraph(index == 1 ? config.fecha_entrega.ToUpper() : string.Empty);
            parr.Style = "DetalleCenter";


            row.Cells[0].Borders.Left.Visible  = false;
            row.Cells[6].Borders.Right.Visible = false;
        }

        if (page < total)
        {
            return;
        }
        // COSTOS LOGISTICOS
        if (Cotizacion.GastoOperacional.Any())
        {
            index++;
            row = table.AddRow();
            //row.HeightRule = RowHeightRule.Exactly;
            row.Height                 = height;
            row.TopPadding             = 10;
            row.BottomPadding          = 10;
            row.Borders.Bottom.Visible = false;
            parr       = row.Cells[0].AddParagraph(index.ToString());
            parr.Style = "DetalleRigth";
            parr       = row.Cells[1].AddParagraph("COSTOS LOGÍSTICOS");
            parr.Style = "Detalle";

            parr                  = row.Cells[2].AddParagraph(string.Empty);
            parr.Style            = "DetalleRigth";
            parr                  = row.Cells[3].AddParagraph(string.Empty);
            parr.Style            = "Detalle";
            parr.Format.Alignment = ParagraphAlignment.Center;

            parr       = row.Cells[4].AddParagraph(string.Empty);
            parr.Style = "Detalle";
            parr       = row.Cells[5].AddParagraph(string.Format(format, Cotizacion.GastoOperacional.Sum(s => s.Valor * s.Cantidad)));
            parr.Style = "DetalleRigth";
            parr       = row.Cells[6].AddParagraph(string.Empty);
            parr.Style = "DetalleRigth";

            row.Cells[0].Borders.Left.Visible  = false;
            row.Cells[6].Borders.Right.Visible = false;
            row.Borders.Bottom.Visible         = true;
            row.Borders.Bottom.Width           = 0.5;
        }

        // NOTA:

        //if (!string.IsNullOrEmpty(Cotizacion.Nota))
        //{
        //    row = table.AddRow();
        //    //row.HeightRule = RowHeightRule.Exactly;
        //    row.Height = height * 3;
        //    row.TopPadding = 10;
        //    row.BottomPadding = 10;
        //    row.Borders.Bottom.Visible = false;
        //    row.Borders.Top.Visible = false;
        //    row.Cells[0].Borders.Left.Visible = false;
        //    row.Cells[6].Borders.Right.Visible = false;
        //    parr = row.Cells[3].AddParagraph("NOTA: " + Cotizacion.Nota.ToUpper());
        //    parr.Style = "Nota";
        //}

        // Foot


        row = table.AddRow();
        row.BottomPadding          = 5;
        row.TopPadding             = 5;
        row.Borders.Bottom.Visible = false;
        row.Borders.Left.Visible   = false;
        row.Borders.Top.Visible    = true;
        row.Cells[0].MergeRight    = 3;
        var table2 = row.Cells[0].Elements.AddTable();

        table2.Borders.Visible = false;
        table2.AddColumn(70);
        table2.AddColumn(250);

        var row2  = table2.AddRow();
        var parr2 = row2.Cells[0].AddParagraph("Validez de la oferta:");

        parr2.Style = "DetalleFoot";
        parr2       = row2.Cells[0].AddParagraph("Moneda:");
        parr2.Style = "DetalleFoot";
        parr2       = row2.Cells[0].AddParagraph("Observaciones:");
        parr2.Style = "DetalleFoot";
        parr2       = row2.Cells[1].AddParagraph("HASTA EL " + Cotizacion.FechaValidez.Value.ToLongDateString().ToUpper());
        parr2.Style = "DetalleFoot";
        parr2       = row2.Cells[1].AddParagraph(Cotizacion.Moneda.Descripcion.ToUpper());
        parr2.Style = "DetalleFoot";
        parr2       = row2.Cells[1].AddParagraph(Cotizacion.Observacion == null ? string.Empty : Cotizacion.Observacion.ToUpper());
        parr2.Style = "DetalleFoot";

        parr       = row.Cells[4].AddParagraph(string.Format(format, (Cotizacion.Valor + Cotizacion.Recargo)));
        parr.Style = "DetalleRigthTotal";
        if (Cotizacion.Descuento != null && Cotizacion.Descuento > 0)
        {
            parr       = row.Cells[4].AddParagraph(string.Format(format, Cotizacion.Descuento));
            parr.Style = "DetalleRigthTotal";
        }
        parr       = row.Cells[4].AddParagraph("0");
        parr.Style = "DetalleRigthTotal";
        parr       = row.Cells[4].AddParagraph(string.Format(format, Cotizacion.Total));
        parr.Style = "DetalleRigthTotal";

        parr       = row.Cells[6].AddParagraph("TOTAL NETO");
        parr.Style = "DetalleRigthTotal";
        if (Cotizacion.Descuento != null && Cotizacion.Descuento > 0)
        {
            parr       = row.Cells[6].AddParagraph("DESCUENTO");
            parr.Style = "DetalleRigthTotal";
        }

        parr       = row.Cells[6].AddParagraph("IVA");
        parr.Style = "DetalleRigthTotal";
        parr       = row.Cells[6].AddParagraph("TOTAL EXENTO");
        parr.Style = "DetalleRigthTotal";
        row.Cells[4].MergeRight = 1;
    }
Beispiel #7
0
    public void CreatePrincipal()
    {
        Row containerRow = TableContainer.AddRow();
        var parr         = containerRow.Cells[0].AddParagraph("DATOS CLIENTE");

        parr.Style = "Title";

        containerRow = TableContainer.AddRow();
        var table = containerRow.Cells[0].Elements.AddTable();

        table.AddColumn(90);
        table.AddColumn(5);
        table.AddColumn(180);
        table.AddColumn(80);
        table.AddColumn(5);
        table.AddColumn(135);

        //1
        var row = table.AddRow();

        parr       = row.Cells[0].AddParagraph("Nombre");
        parr.Style = "Principal";
        parr       = row.Cells[1].AddParagraph(":");
        parr.Style = "Principal";
        parr       = row.Cells[2].AddParagraph(Cotizacion.Cliente.Nombre.ToUpper());
        parr.Style = "PrincipalDato";

        //2
        parr       = row.Cells[3].AddParagraph("Atención");
        parr.Style = "Principal";
        parr       = row.Cells[4].AddParagraph(":");
        parr.Style = "Principal";
        parr       = row.Cells[5].AddParagraph(Cotizacion.Cliente.NombreContacto.ToUpper());
        parr.Style = "PrincipalDato";

        //3
        row        = table.AddRow();
        parr       = row.Cells[0].AddParagraph("Referencia");
        parr.Style = "Principal";
        parr       = row.Cells[1].AddParagraph(":");
        parr.Style = "Principal";
        parr       = row.Cells[2].AddParagraph(config.referencia.ToUpper());
        parr.Style = "PrincipalDato";

        //4
        parr       = row.Cells[3].AddParagraph("Rut");
        parr.Style = "Principal";
        parr       = row.Cells[4].AddParagraph(":");
        parr.Style = "Principal";
        parr       = row.Cells[5].AddParagraph(Cotizacion.Cliente.Rut.ToUpper());
        parr.Style = "PrincipalDato";


        //5
        row        = table.AddRow();
        parr       = row.Cells[0].AddParagraph("Teléfono");
        parr.Style = "Principal";
        parr       = row.Cells[1].AddParagraph(":");
        parr.Style = "Principal";
        parr       = row.Cells[2].AddParagraph(Cotizacion.Cliente.TelefonoContacto.ToUpper());
        parr.Style = "PrincipalDato";

        //6
        parr       = row.Cells[3].AddParagraph("Email");
        parr.Style = "Principal";
        parr       = row.Cells[4].AddParagraph(":");
        parr.Style = "Principal";
        parr       = row.Cells[5].AddParagraph(Cotizacion.Cliente.EmailContacto.ToUpper());
        parr.Style = "PrincipalDato";


        //7
        row        = table.AddRow();
        parr       = row.Cells[0].AddParagraph("Fecha");
        parr.Style = "Principal";
        parr       = row.Cells[1].AddParagraph(":");
        parr.Style = "Principal";
        parr       = row.Cells[2].AddParagraph(Cotizacion.FechaCreacion.HasValue ? Cotizacion.FechaCreacion.Value.ToString("dd-MM-yyyy") : string.Empty);
        parr.Style = "PrincipalDato";


        containerRow = TableContainer.AddRow();
        parr         = containerRow.Cells[0].AddParagraph("CERTASC");
        parr.Style   = "Title";



        table = containerRow.Cells[0].Elements.AddTable();
        table.AddColumn(90);
        table.AddColumn(5);
        table.AddColumn(180);
        table.AddColumn(80);
        table.AddColumn(5);
        table.AddColumn(135);

        row = table.AddRow();
        var admCargo = Cotizacion.Usuario == null ? string.Empty : Cotizacion.Usuario1.Cargo;

        parr       = row.Cells[0].AddParagraph(admCargo);
        parr.Style = "Principal";
        parr       = row.Cells[1].AddParagraph(":");
        parr.Style = "Principal";
        var admComercial = Cotizacion.Usuario == null ? string.Empty : (Cotizacion.Usuario1.Nombre + " " + Cotizacion.Usuario1.Apellido).ToUpper();

        parr       = row.Cells[2].AddParagraph(admComercial);
        parr.Style = "PrincipalDato";

        parr       = row.Cells[3].AddParagraph("Teléfono");
        parr.Style = "Principal";
        parr       = row.Cells[4].AddParagraph(":");
        parr.Style = "Principal";
        parr       = row.Cells[5].AddParagraph(Cotizacion.Usuario1.Fono ?? string.Empty);
        parr.Style = "PrincipalDato";

        row        = table.AddRow();
        parr       = row.Cells[0].AddParagraph("Celular");
        parr.Style = "Principal";
        parr       = row.Cells[1].AddParagraph(":");
        parr.Style = "Principal";
        parr       = row.Cells[2].AddParagraph(Cotizacion.Usuario1.Celular ?? string.Empty);
        parr.Style = "PrincipalDato";

        parr       = row.Cells[3].AddParagraph("Email");
        parr.Style = "Principal";
        parr       = row.Cells[4].AddParagraph(":");
        parr.Style = "Principal";
        var email = Cotizacion.Usuario == null ? string.Empty : Cotizacion.Usuario1.Email;

        parr       = row.Cells[5].AddParagraph(email == null ? string.Empty : email.ToUpper());
        parr.Style = "PrincipalDato";

        row        = table.AddRow();
        parr       = row.Cells[0].AddParagraph("Lugar de entrega");
        parr.Style = "Principal";
        parr       = row.Cells[1].AddParagraph(":");
        parr.Style = "Principal";
        parr       = row.Cells[2].AddParagraph(Cotizacion.Ciudad.Descripcion.ToUpper());
        parr.Style = "PrincipalDato";

        parr       = row.Cells[3].AddParagraph("Condiciones de venta");
        parr.Style = "Principal";
        parr       = row.Cells[4].AddParagraph(":");
        parr.Style = "Principal";
        parr       = row.Cells[5].AddParagraph(config.condiciones_de_venta.ToUpper());
        parr.Style = "PrincipalDato";

        row        = table.AddRow();
        parr       = row.Cells[3].AddParagraph("Condiciones de Pago");
        parr.Style = "Principal";
        parr       = row.Cells[4].AddParagraph(":");
        parr.Style = "Principal";
        parr       = row.Cells[5].AddParagraph(Cotizacion.FormaDePagoId == null ? string.Empty : Cotizacion.FormaDePago.Descripcion.ToUpper());
        parr.Style = "PrincipalDato";
    }