public FileContentResult DlsInvoiceExcel(Guid invoiceId, Boolean mockData = false)
        {
            var model = invoiceReportService
                        .GetOrCreateReport(invoiceId, InvoiceFormatType.DLS)
                        as DlsInvoiceModel;

            var excelGenerator = new ExportInvoiceReportToExcel();

            var fileBytes = excelGenerator.GenerateDlsInvoiceReport(model);

            var reportFileName = String.Format("DlsInvoiceReport.xlsx");

            return(File(fileBytes, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", reportFileName));
        }
        public FileContentResult UnloadingInvoiceExcel(Guid invoiceId, Boolean mockData = false)
        {
            var invoiceReportModel = invoiceReportService
                                     .GetOrCreateReport(invoiceId, InvoiceFormatType.Unloading)
                                     as UnloadingInvoiceModel;

            invoiceReportModel.AllWorkOrdersInfo = invoiceRepository.FindById(invoiceId).InvoiceLineItem.Select(i => unloadingWorkOrderQueries.FindOverviewById(i.WorkOrder.Id)).OrderBy(i => i.Start.Value);

            var excelGenerator = new ExportInvoiceReportToExcel();

            var fileBytes = excelGenerator.GenerateUnloadingInvoiceReport(invoiceReportModel);

            var reportFileName = String.Format("UnloadingInvoiceReport.xlsx");

            return(File(fileBytes, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", reportFileName));
        }