Пример #1
0
        private PdfPTable GetSignatureSection(OutputShippingViewModel model, int timeoffset)
        {
            PdfPTable table = new PdfPTable(3)
            {
                WidthPercentage = 100
            };

            float[] widths = new float[] { 1f, 1f, 1f };
            table.SetWidths(widths);
            PdfPCell cell = new PdfPCell()
            {
                Border = Rectangle.NO_BORDER,
                HorizontalAlignment = Element.ALIGN_CENTER,
                VerticalAlignment   = Element.ALIGN_MIDDLE,
            };

            //cell.Phrase = new Phrase("Mengetahui", TEXT_FONT);
            //table.AddCell(cell);
            cell.Phrase = new Phrase("", TEXT_FONT);
            table.AddCell(cell);
            cell.Phrase = new Phrase("", TEXT_FONT);
            table.AddCell(cell);
            cell.Phrase = new Phrase($"Sukoharjo, {model.CreatedUtc.AddHours(timeoffset).ToString("dd MMMM yyyy")}", TEXT_FONT);
            table.AddCell(cell);

            //cell.Phrase = new Phrase("Kasubsie Gudang Dyeing Printing", TEXT_FONT);
            //table.AddCell(cell);
            cell.Phrase = new Phrase("Audit", TEXT_FONT);
            table.AddCell(cell);
            cell.Phrase = new Phrase("Ekspedisi", TEXT_FONT);
            table.AddCell(cell);
            cell.Phrase = new Phrase("Gudang Dyeing Printing", TEXT_FONT);
            table.AddCell(cell);

            for (var i = 0; i < 11; i++)
            {
                //cell.Phrase = new Phrase("", TEXT_FONT);
                //table.AddCell(cell);
                cell.Phrase = new Phrase("", TEXT_FONT);
                table.AddCell(cell);
                cell.Phrase = new Phrase("", TEXT_FONT);
                table.AddCell(cell);
                cell.Phrase = new Phrase("", TEXT_FONT);
                table.AddCell(cell);
            }

            //cell.Phrase = new Phrase("(                        )", TEXT_FONT);
            //table.AddCell(cell);
            cell.Phrase = new Phrase("(                        )", TEXT_FONT);
            table.AddCell(cell);
            cell.Phrase = new Phrase("(                        )", TEXT_FONT);
            table.AddCell(cell);
            cell.Phrase = new Phrase($"({model.CreatedBy})", TEXT_FONT);
            table.AddCell(cell);



            return(table);
        }
Пример #2
0
 public OutputShippingPdfTemplate(OutputShippingViewModel model, int timeoffset)
 {
     Title            = GetTitle();
     AddressTitle     = GetAddressTitle();
     DocumentTitle    = GetDocumentTitle();
     DocumentISO      = GetISO();
     DocumentInfo     = GetBuyerInfo(model, timeoffset);
     GroupDetailInfo  = GetGroupDetailInfo(model);
     DetailInfo       = GetDetailInfo(model);
     NettoSection     = GetNettoSection();
     SignatureSection = GetSignatureSection(model, timeoffset);
 }
Пример #3
0
        private PdfPTable GetGroupDetailInfo(OutputShippingViewModel model)
        {
            PdfPTable container = new PdfPTable(2)
            {
                WidthPercentage = 100
            };

            float[] widths = new float[] { 1f, 1f };
            container.SetWidths(widths);

            PdfPCell cellContainer = new PdfPCell()
            {
                Border = Rectangle.NO_BORDER
            };

            PdfPTable table = new PdfPTable(3)
            {
                WidthPercentage = 100,
            };

            float[] tableWidths = new float[] { 1f, 5f, 2f };
            table.SetWidths(tableWidths);

            PdfPCell cellHeader = new PdfPCell()
            {
                HorizontalAlignment = Element.ALIGN_CENTER,
                VerticalAlignment   = Element.ALIGN_MIDDLE,
            };

            PdfPCell cellRight = new PdfPCell()
            {
                HorizontalAlignment = Element.ALIGN_RIGHT,
                VerticalAlignment   = Element.ALIGN_MIDDLE,
            };


            foreach (var column in groupTableColumns)
            {
                cellHeader.Phrase = new Phrase(column, TEXT_FONT_BOLD);
                table.AddCell(cellHeader);
            }

            double lengthTotal = 0;
            int    index       = 1;
            var    detailGroup = model.ShippingProductionOrders.GroupBy(s => s.Construction);

            foreach (var detail in detailGroup)
            {
                cellHeader.Phrase = new Phrase(index++.ToString(), TEXT_FONT);
                table.AddCell(cellHeader);

                cellHeader.Phrase = new Phrase(detail.Key, TEXT_FONT);
                table.AddCell(cellHeader);

                cellRight.Phrase = new Phrase(detail.Sum(s => s.Qty).ToString("N2", CultureInfo.InvariantCulture), TEXT_FONT);
                table.AddCell(cellRight);
                lengthTotal += detail.Sum(s => s.Qty);
            }

            cellHeader.Phrase = new Phrase("Total", TEXT_FONT);
            table.AddCell(cellHeader);

            cellHeader.Phrase = new Phrase("", TEXT_FONT);
            table.AddCell(cellHeader);

            cellRight.Phrase = new Phrase(lengthTotal.ToString("N2", CultureInfo.InvariantCulture), TEXT_FONT);
            table.AddCell(cellRight);

            //cellContainer.AddElement(table);

            container.AddCell(table);

            cellContainer.Phrase = new Phrase("", TEXT_FONT);
            container.AddCell(cellContainer);

            cellContainer.Phrase = new Phrase("", TEXT_FONT);
            container.AddCell(cellContainer);

            cellContainer.Phrase = new Phrase("", TEXT_FONT);
            container.AddCell(cellContainer);

            cellContainer.Phrase = new Phrase("", TEXT_FONT);
            container.AddCell(cellContainer);

            cellContainer.Phrase = new Phrase("", TEXT_FONT);
            container.AddCell(cellContainer);

            cellContainer.Phrase = new Phrase("", TEXT_FONT);
            container.AddCell(cellContainer);

            cellContainer.Phrase = new Phrase("", TEXT_FONT);
            container.AddCell(cellContainer);

            return(container);
        }
Пример #4
0
        private PdfPTable GetDetailInfo(OutputShippingViewModel model)
        {
            PdfPTable container = new PdfPTable(1)
            {
                WidthPercentage = 100
            };

            float[] containerWidths = new float[] { 1f };
            container.SetWidths(containerWidths);

            PdfPCell cellContainer = new PdfPCell()
            {
                Border = Rectangle.NO_BORDER
            };

            PdfPTable table = new PdfPTable(bodyTableColumns.Count)
            {
                WidthPercentage = 100
            };

            float[] widths = new float[] { 1f, 3f, 2f, 2f, 2f, 2f, 2f, 2f, 2f, 2f, 2f, 2f, 2f };
            table.SetWidths(widths);
            PdfPCell cellHeader = new PdfPCell()
            {
                HorizontalAlignment = Element.ALIGN_CENTER,
                VerticalAlignment   = Element.ALIGN_MIDDLE,
            };

            PdfPCell cellRight = new PdfPCell()
            {
                HorizontalAlignment = Element.ALIGN_RIGHT,
                VerticalAlignment   = Element.ALIGN_MIDDLE,
            };

            PdfPCell cellLeft = new PdfPCell()
            {
                HorizontalAlignment = Element.ALIGN_LEFT,
                VerticalAlignment   = Element.ALIGN_MIDDLE,
            };

            foreach (var column in bodyTableColumns)
            {
                cellHeader.Phrase = new Phrase(column, TEXT_FONT_BOLD);
                table.AddCell(cellHeader);
            }

            decimal quantityTotal   = 0;
            double  lengthTotal     = 0;
            double  yardLengthTotal = 0;
            double  weightTotal     = 0;
            int     index           = 1;

            foreach (var detail in model.ShippingProductionOrders)
            {
                cellRight.Phrase = new Phrase(index++.ToString(), TEXT_FONT);
                table.AddCell(cellRight);

                cellHeader.Phrase = new Phrase(detail.Construction, TEXT_FONT);
                table.AddCell(cellHeader);

                cellHeader.Phrase = new Phrase(detail.Motif, TEXT_FONT);
                table.AddCell(cellHeader);

                //Ket
                cellHeader.Phrase = new Phrase(detail.ShippingRemark, TEXT_FONT);
                table.AddCell(cellHeader);

                cellHeader.Phrase = new Phrase(detail.Grade, TEXT_FONT);
                table.AddCell(cellHeader);

                //Grade 2
                cellHeader.Phrase = new Phrase(detail.ShippingGrade, TEXT_FONT);
                table.AddCell(cellHeader);

                cellHeader.Phrase = new Phrase(detail.ProductionOrder.No, TEXT_FONT);
                table.AddCell(cellHeader);

                cellHeader.Phrase = new Phrase(detail.Color, TEXT_FONT);
                table.AddCell(cellHeader);

                cellRight.Phrase = new Phrase(detail.QtyPacking.ToString("N2", CultureInfo.InvariantCulture), TEXT_FONT);
                table.AddCell(cellRight);
                quantityTotal += detail.QtyPacking;

                cellHeader.Phrase = new Phrase(detail.Packing, TEXT_FONT);
                table.AddCell(cellHeader);

                var yardLength = 1.093613298 * detail.Qty;
                cellRight.Phrase = new Phrase(yardLength.ToString("N2", CultureInfo.InvariantCulture), TEXT_FONT);
                table.AddCell(cellRight);
                yardLengthTotal += yardLength;

                cellRight.Phrase = new Phrase(detail.Qty.ToString("N2", CultureInfo.InvariantCulture), TEXT_FONT);
                table.AddCell(cellRight);
                lengthTotal += detail.Qty;

                // KG
                //cellRight.Phrase = new Phrase((packingReceiptItem.Quantity * packingReceiptItem.Weight).ToString("N2", CultureInfo.InvariantCulture), TEXT_FONT);
                cellRight.Phrase = new Phrase(detail.Weight.ToString("N2", CultureInfo.InvariantCulture), TEXT_FONT);
                table.AddCell(cellRight);
                weightTotal += detail.Weight;
            }

            //PdfPCell cellColspan = new PdfPCell()
            //{
            //    Colspan = 5,
            //    HorizontalAlignment = Element.ALIGN_CENTER,
            //    VerticalAlignment = Element.ALIGN_MIDDLE,
            //};

            //cellColspan.Phrase = new Phrase("Total", TEXT_FONT);
            //table.AddCell(cellColspan);

            cellRight.Phrase = new Phrase("", TEXT_FONT);
            table.AddCell(cellRight);

            cellRight.Phrase = new Phrase("", TEXT_FONT);
            table.AddCell(cellRight);

            cellRight.Phrase = new Phrase("", TEXT_FONT);
            table.AddCell(cellRight);

            cellRight.Phrase = new Phrase("", TEXT_FONT);
            table.AddCell(cellRight);

            cellRight.Phrase = new Phrase("", TEXT_FONT);
            table.AddCell(cellRight);

            cellRight.Phrase = new Phrase("", TEXT_FONT);
            table.AddCell(cellRight);

            cellRight.Phrase = new Phrase("", TEXT_FONT);
            table.AddCell(cellRight);

            cellRight.Phrase = new Phrase("", TEXT_FONT);
            table.AddCell(cellRight);

            cellRight.Phrase = new Phrase(quantityTotal == 0 ? "" : quantityTotal.ToString("N2", CultureInfo.InvariantCulture), TEXT_FONT);
            table.AddCell(cellRight);

            cellRight.Phrase = new Phrase("", TEXT_FONT);
            table.AddCell(cellRight);

            cellRight.Phrase = new Phrase(yardLengthTotal == 0 ? "" : yardLengthTotal.ToString("N2", CultureInfo.InvariantCulture), TEXT_FONT);
            table.AddCell(cellRight);

            cellRight.Phrase = new Phrase(lengthTotal == 0 ? "" : lengthTotal.ToString("N2", CultureInfo.InvariantCulture), TEXT_FONT);
            table.AddCell(cellRight);

            cellRight.Phrase = new Phrase(weightTotal == 0 ? "" : weightTotal.ToString("N2", CultureInfo.InvariantCulture), TEXT_FONT);
            table.AddCell(cellRight);

            container.AddCell(table);

            cellContainer.Phrase = new Phrase("", TEXT_FONT);
            container.AddCell(cellContainer);
            cellContainer.Phrase = new Phrase("", TEXT_FONT);
            container.AddCell(cellContainer);
            cellContainer.Phrase = new Phrase("", TEXT_FONT);
            container.AddCell(cellContainer);
            cellContainer.Phrase = new Phrase("", TEXT_FONT);
            container.AddCell(cellContainer);

            return(container);
        }
Пример #5
0
        private PdfPTable GetBuyerInfo(OutputShippingViewModel model, int timeoffset)
        {
            PdfPTable table = new PdfPTable(3)
            {
                WidthPercentage = 100
            };

            float[] widths = new float[] { 1f, 1f, 1f };
            table.SetWidths(widths);
            PdfPCell cell = new PdfPCell()
            {
                Border = Rectangle.NO_BORDER,
                HorizontalAlignment = Element.ALIGN_LEFT,
                VerticalAlignment   = Element.ALIGN_MIDDLE,
                PaddingBottom       = 2f
            };


            cell.Phrase = new Phrase("Kepada Yth. Bagian Penjualan", TEXT_FONT);
            table.AddCell(cell);

            cell.Phrase = new Phrase("", TEXT_FONT);
            table.AddCell(cell);

            cell.Phrase = new Phrase($"NO. : {model.BonNo}", TEXT_FONT);
            table.AddCell(cell);

            string buyerName = model.ShippingProductionOrders.FirstOrDefault()?.Buyer;

            cell.Phrase = new Phrase($"U/ dikirim kepada: {buyerName}", TEXT_FONT);
            table.AddCell(cell);

            cell.Phrase = new Phrase("", TEXT_FONT);
            table.AddCell(cell);

            cell.Phrase = new Phrase($"Sesuai DO. NO. : {model.DeliveryOrder.No}", TEXT_FONT);
            table.AddCell(cell);

            cell.Phrase = new Phrase("Keterangan : Di Ball / Lose Packing / Karton", TEXT_FONT);
            table.AddCell(cell);

            cell.Phrase = new Phrase("", TEXT_FONT);
            table.AddCell(cell);

            //cell.Phrase = new Phrase($"Tanggal : { model.Date.AddHours(timeoffset).ToString("dd MMMM yyyy")}", TEXT_FONT);
            cell.Phrase = new Phrase("", TEXT_FONT);
            table.AddCell(cell);

            cell.Phrase = new Phrase("Netto: ...... Kg Bruto: ......Kg", TEXT_FONT);
            table.AddCell(cell);

            cell.Phrase = new Phrase("", TEXT_FONT);
            table.AddCell(cell);

            //cell.Phrase = new Phrase($"Jumlah Baris : { model.ShippingProductionOrders.Count }", TEXT_FONT);
            cell.Phrase = new Phrase("", TEXT_FONT);
            table.AddCell(cell);

            cell.Phrase = new Phrase("", TEXT_FONT);
            table.AddCell(cell);
            cell.Phrase = new Phrase("", TEXT_FONT);
            table.AddCell(cell);
            cell.Phrase = new Phrase("", TEXT_FONT);
            table.AddCell(cell);
            cell.Phrase = new Phrase("", TEXT_FONT);
            table.AddCell(cell);
            cell.Phrase = new Phrase("", TEXT_FONT);
            table.AddCell(cell);
            cell.Phrase = new Phrase("", TEXT_FONT);
            table.AddCell(cell);
            cell.Phrase = new Phrase("", TEXT_FONT);
            table.AddCell(cell);
            cell.Phrase = new Phrase("", TEXT_FONT);
            table.AddCell(cell);
            cell.Phrase = new Phrase("", TEXT_FONT);
            table.AddCell(cell);

            return(table);
        }