Skip to content

Commit

Permalink
resetting of the excel stream to avoid old data persistent in stream (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ysg410 authored Sep 14, 2016
1 parent 94d57da commit 3895044
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion common/models/container.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,11 @@ module.exports = function(Container) {

return StoreMappingModel.find({})
.then(function(storeMappings){
orders = [];
excelRows.forEach(function (row) {
var storeName = findMapping(row.CustomerNumber, storeMappings);
var orderType = row.CustomerPONumber ? 'NewItems' : 'WeeklyOrder';
if (!(orderExists(row.SalesOrderNumber, orders)) && storeName != false) {
if (storeName && (!(orderExists(row.SalesOrderNumber, orders)))) {
orders.push({
storeName: storeName,
supplierName: 'CSC',
Expand Down Expand Up @@ -177,6 +178,7 @@ module.exports = function(Container) {


.then(function () {
excelRows = [];
console.log("done!");
next();
});
Expand Down

0 comments on commit 3895044

Please sign in to comment.