Skip to content

Commit

Permalink
added task status
Browse files Browse the repository at this point in the history
  • Loading branch information
tareq89 committed Feb 23, 2017
1 parent 5da169d commit 79c95e3
Showing 1 changed file with 36 additions and 28 deletions.
64 changes: 36 additions & 28 deletions excelCreator.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ module.exports = {

var workbook = excelbuilder.createWorkbook(directoryName, workbookName);
var sheet1 = workbook.createSheet('sheet1', 56, report.length + 1);


sheet1.set(1, 1, 'trackingNumber');
sheet1.set(2, 1, 'DeliveryType');
Expand Down Expand Up @@ -174,50 +175,57 @@ module.exports = {
workbook: workbook
}
},

getDetailsSummaryReport: function (report) {
var excelbuilder = require('msexcel-builder');
var directoryName = __dirname + "/excel/";
var workbookName = Date.now().toString() + 'details.xlsx';
var reportFileName = directoryName + workbookName;

var workbook = excelbuilder.createWorkbook(directoryName, workbookName);
var sheet1 = workbook.createSheet('sheet1', 16, report.length + 1);

var sheet1 = workbook.createSheet('sheet1', 17, report.length + 1);
function returnTaskStatus(report) {
return "Pickup: " + report.PickupStatus + ", Completion Date: " + report.PickupCompleteDate + "\n" +
"Delivery: " + report.DeliveryStatus + ", Completion Date: " + report.DeliveryCompleteDate + "\n" +
"CashDelivery: " + report.CashDeliveryStatus + ", Completion Date: " + report.CashDeliveryCompleteDate;
}
sheet1.set(1, 1, 'TrackingNumber');
sheet1.set(2, 1, 'VendorInvoiceNo');
sheet1.set(3, 1, 'Status');
sheet1.set(4, 1, 'DeliveryType');
sheet1.set(5, 1, 'OrderingDate');
sheet1.set(6, 1, 'CompleteDate');
sheet1.set(7, 1, 'UserName');
sheet1.set(8, 1, 'PickupAddress');
sheet1.set(9, 1, 'DeliveryAddress');
sheet1.set(10, 1, 'Product');
sheet1.set(11, 1, 'Weight');
sheet1.set(12, 1, 'DeliveryCharge');
sheet1.set(13, 1, 'Commission');
sheet1.set(14, 1, 'TotalProductPrice');
sheet1.set(15, 1, 'Total');
sheet1.set(16, 1, 'PaymentStatus');
sheet1.set(4, 1, 'Task Status');
sheet1.set(5, 1, 'DeliveryType');
sheet1.set(6, 1, 'OrderingDate');
sheet1.set(7, 1, 'CompleteDate');
sheet1.set(8, 1, 'UserName');
sheet1.set(9, 1, 'PickupAddress');
sheet1.set(10, 1, 'DeliveryAddress');
sheet1.set(11, 1, 'Product');
sheet1.set(12, 1, 'Weight');
sheet1.set(13, 1, 'DeliveryCharge');
sheet1.set(14, 1, 'Commission');
sheet1.set(15, 1, 'TotalProductPrice');
sheet1.set(16, 1, 'Total');
sheet1.set(17, 1, 'PaymentStatus');
for (var row = 2; row <= (report.length+1); row++) {
var e = report[row-2];
console.log(row-2);
sheet1.set(1, row, e.trackingNumber);
sheet1.set(2, row, e.VendorInvoiceNo);
sheet1.set(3, row, e.Status);
sheet1.set(4, row, e.DeliveryType);
sheet1.set(5, row, e.OrderingDate);
sheet1.set(6, row, e.CompleteDate);
sheet1.set(7, row, e.UserName);
sheet1.set(8, row, e.PickupAddress);
sheet1.set(9, row, e.DeliveryAddress);
sheet1.set(10, row, e.Product);
sheet1.set(11, row, e.Weight);
sheet1.set(12, row, e.DeliveryCharge);
sheet1.set(13, row, e.Commission);
sheet1.set(14, row, e.TotalProductPrice);
sheet1.set(15, row, e.Total);
sheet1.set(16, row, e.PaymentStatus);
sheet1.set(4, row, returnTaskStatus(e));
sheet1.set(5, row, e.DeliveryType);
sheet1.set(6, row, e.OrderingDate);
sheet1.set(7, row, e.CompleteDate);
sheet1.set(8, row, e.UserName);
sheet1.set(9, row, e.PickupAddress);
sheet1.set(10, row, e.DeliveryAddress);
sheet1.set(11, row, e.Product);
sheet1.set(12, row, e.Weight);
sheet1.set(13, row, e.DeliveryCharge);
sheet1.set(14, row, e.Commission);
sheet1.set(15, row, e.TotalProductPrice);
sheet1.set(16, row, e.Total);
sheet1.set(17, row, e.PaymentStatus);
}

return {
Expand Down

0 comments on commit 79c95e3

Please sign in to comment.