public static MemoryStream CreateExcelDispositionReport(List <KeyValuePair <DataTable, string> > dtSourceList, DateTimeOffset startDate, DateTimeOffset endDate, int timezoneOffset, GarmentPurchasingExpeditionPosition position, bool styling = false)
        {
            ExcelPackage package = new ExcelPackage();

            foreach (KeyValuePair <DataTable, string> item in dtSourceList)
            {
                var sheet = package.Workbook.Worksheets.Add(item.Value);

                sheet.Cells["A1"].Value = "PT.Dan Liris";

                sheet.Cells["A2"].Value = "LAPORAN EKSPEDISI BUKTI PEMBAYARAN DISPOSISI";

                var positionDescription = "SEMUA POSISI";
                if (position > GarmentPurchasingExpeditionPosition.Invalid)
                {
                    positionDescription = position.ToDescriptionString();
                }

                sheet.Cells["A3"].Value = $"{positionDescription}";

                sheet.Cells["A4"].Value = $"PERIODE : {startDate.AddHours(timezoneOffset).ToString("dd/MM/yyyy")} sampai dengan {endDate.AddHours(timezoneOffset).ToString("dd/MM/yyyy")}";

                sheet.Cells["A5"].LoadFromDataTable(item.Key, true, (styling == true) ? OfficeOpenXml.Table.TableStyles.Light16 : OfficeOpenXml.Table.TableStyles.None);
                sheet.Cells[sheet.Dimension.Address].AutoFitColumns();
            }
            MemoryStream stream = new MemoryStream();

            package.SaveAs(stream);
            return(stream);
        }
Пример #2
0
 public GarmentDispositionPaymentReportDto(int dispositionId, string dispositionNoteNo, DateTimeOffset dispositionNoteDate, DateTimeOffset dispositionNoteDueDate, string proformaNo, int supplierId, string supplierCode, string supplierName, int currencyId, string currencyCode, double currencyRate, double dPPAmount, double currencyDPPAmount, double vATAmount, double currencyVATAmount, double incomeTaxAmount, double currencyIncomeTaxAmount, double othersExpenditureAmount, double totalAmount, int categoryId, string categoryCode, string categoryName, GarmentPurchasingExpeditionPosition position, string sendToPurchasingRemark, DateTimeOffset?sendToVerificationDate, DateTimeOffset?verificationAcceptedDate, string verifiedBy, DateTimeOffset?cashierAcceptedDate, string bankExpenditureNoteDate, string bankExpenditureNoteNo, string paidAmount, int externalPurchaseOrderId, string externalPurchaseOrderNo, double dispositionQuantity, int deliveryOrderId, string deliveryOrderNo, double deliveryOrderQuantity, string paymentBillsNo, string billsNo, int customsNoteId, string customsNoteNo, DateTimeOffset?customsNoteDate, int unitReceiptNoteId, string unitReceiptNoteNo, int internalNoteId, string internalNoteNo, DateTimeOffset?internalNoteDate, string sendToVerificationBy, DateTimeOffset?verifiedDate, string remark, string purchaseBy)
 {
     DispositionId          = dispositionId;
     DispositionNoteNo      = dispositionNoteNo;
     DispositionNoteDate    = dispositionNoteDate;
     DispositionNoteDueDate = dispositionNoteDueDate;
     ProformaNo             = proformaNo;
     SupplierId             = supplierId;
     SupplierCode           = supplierCode;
     SupplierName           = supplierName;
     CurrencyId             = currencyId;
     CurrencyCode           = currencyCode;
     CurrencyRate           = currencyRate;
     DPPAmount               = dPPAmount;
     CurrencyDPPAmount       = currencyDPPAmount;
     VATAmount               = vATAmount;
     CurrencyVATAmount       = currencyVATAmount;
     IncomeTaxAmount         = incomeTaxAmount;
     CurrencyIncomeTaxAmount = currencyIncomeTaxAmount;
     OthersExpenditureAmount = othersExpenditureAmount;
     TotalAmount             = totalAmount;
     CategoryId              = categoryId;
     CategoryCode            = categoryCode;
     CategoryName            = categoryName;
     Position                 = position;
     PositionDescription      = position.ToDescriptionString();
     SendToPurchasingRemark   = sendToPurchasingRemark;
     SendToVerificationDate   = sendToVerificationDate;
     VerificationAcceptedDate = verificationAcceptedDate;
     VerifiedBy               = verifiedBy;
     VerifiedDate             = verifiedDate;
     CashierAcceptedDate      = cashierAcceptedDate;
     BankExpenditureNoteDate  = bankExpenditureNoteDate;
     BankExpenditureNoteNo    = bankExpenditureNoteNo;
     PaidAmount               = paidAmount;
     ExternalPurchaseOrderId  = externalPurchaseOrderId;
     ExternalPurchaseOrderNo  = externalPurchaseOrderNo;
     DispositionQuantity      = dispositionQuantity;
     DeliveryOrderId          = deliveryOrderId;
     DeliveryOrderNo          = deliveryOrderNo;
     DeliveryOrderQuantity    = deliveryOrderQuantity;
     PaymentBillsNo           = paymentBillsNo;
     BillsNo              = billsNo;
     CustomsNoteId        = customsNoteId;
     CustomsNoteNo        = customsNoteNo;
     CustomsNoteDate      = customsNoteDate;
     UnitReceiptNoteId    = unitReceiptNoteId;
     UnitReceiptNoteNo    = unitReceiptNoteNo;
     InternalNoteId       = internalNoteId;
     InternalNoteNo       = internalNoteNo;
     InternalNoteDate     = internalNoteDate;
     SendToVerificationby = sendToVerificationBy;
     Remark     = remark;
     PurchaseBy = purchaseBy;
 }
Пример #3
0
 public IndexDto(int id, string internalNoteNo, DateTimeOffset internalNoteDate, DateTimeOffset internalNoteDueDate, string supplierName, double amount, string currencyCode, string remark, GarmentPurchasingExpeditionPosition position)
 {
     Id                  = id;
     InternalNoteNo      = internalNoteNo;
     InternalNoteDate    = internalNoteDate;
     InternalNoteDueDate = internalNoteDueDate;
     SupplierName        = supplierName;
     Amount              = amount;
     CurrencyCode        = currencyCode;
     Remark              = remark;
     Status              = position.ToDescriptionString();
 }
Пример #4
0
 public IndexDto(int id, string dispositionNoteNo, DateTimeOffset dispositionNoteDate, int dispositionNoteId, string supplierName, GarmentPurchasingExpeditionPosition position, double totalPaid, string currencyCode, string remark, DateTimeOffset createdDate)
 {
     Id = id;
     DispositionNoteNo   = dispositionNoteNo;
     DispositionNoteDate = dispositionNoteDate;
     DispositionNoteId   = dispositionNoteId;
     SupplierName        = supplierName;
     TotalPaid           = totalPaid;
     CurrencyCode        = currencyCode;
     Remark      = remark;
     Status      = position.ToDescriptionString();
     CreatedDate = createdDate;
 }
        public static MemoryStream CreateExcelDispositionReport(List <KeyValuePair <DataTable, string> > dtSourceList, DateTimeOffset startDate, DateTimeOffset endDate, int timezoneOffset, GarmentPurchasingExpeditionPosition position, bool styling = false)
        {
            ExcelPackage package = new ExcelPackage();

            foreach (KeyValuePair <DataTable, string> item in dtSourceList)
            {
                var sheet = package.Workbook.Worksheets.Add(item.Value);

                sheet.Cells["A1"].Value = "PT.Dan Liris";

                sheet.Cells["A2"].Value = "LAPORAN EKSPEDISI BUKTI PEMBAYARAN DISPOSISI";

                var positionDescription = "SEMUA POSISI";
                if (position > GarmentPurchasingExpeditionPosition.Invalid)
                {
                    positionDescription = position.ToDescriptionString();
                }

                sheet.Cells["A3"].Value = $"{positionDescription}";

                sheet.Cells["A4"].Value = $"PERIODE : {startDate.AddHours(timezoneOffset).ToString("dd/MM/yyyy")} sampai dengan {endDate.AddHours(timezoneOffset).ToString("dd/MM/yyyy")}";

                sheet.Cells["A7"].LoadFromDataTable(item.Key, true);
                FixColumnCustom(sheet, item.Key);
                //sheet.Cells[sheet.Dimension.Address].AutoFitColumns();
                var startRow   = 6;
                var startCol   = 1;
                var maxROw     = 7 + item.Key.Rows.Count;
                var maxColumnt = item.Key.Columns.Count;
                sheet.Cells[startRow, startCol, maxROw, maxColumnt].AutoFitColumns();
                sheet.Cells[startRow, startCol, maxROw, maxColumnt].Style.Border.Top.Style    = ExcelBorderStyle.Thin;
                sheet.Cells[startRow, startCol, maxROw, maxColumnt].Style.Border.Left.Style   = ExcelBorderStyle.Thin;
                sheet.Cells[startRow, startCol, maxROw, maxColumnt].Style.Border.Right.Style  = ExcelBorderStyle.Thin;
                sheet.Cells[startRow, startCol, maxROw, maxColumnt].Style.Border.Bottom.Style = ExcelBorderStyle.Thin;
            }
            MemoryStream stream = new MemoryStream();

            package.SaveAs(stream);
            return(stream);
        }
Пример #6
0
 public PositionOption(GarmentPurchasingExpeditionPosition position)
 {
     Value = position;
     Label = position.ToDescriptionString();
 }