Redesigned the querying for the sale duplicates screen to use aggregation; Finished the styling of the sale duplicate screen; Tested the functionality of sale duplicates; Added a way to show hidden (ignored) duplicates.

This commit is contained in:
Wynne Crisman
2017-05-26 11:17:32 -07:00
parent e1b0b19589
commit 210517a5c2
42 changed files with 15153 additions and 8505 deletions

View File

@@ -0,0 +1,24 @@
Meteor.methods({
"checkDuplicateSales": function() {
try {
let sales = Sales.find({}).fetch();
let duplicateCount = 0;
for(let i = 0; i < sales.length; i++) {
let next = missingData[i];
let count = Sales.find({date: next.date, measureId: next.measureId, productId: next.productId, venueId: next.venueId, price: next.price, amount: next.amount}).count();
if(count > 1) {
console.log("This sale has a duplicate:");
console.log(next);
}
}
console.log("Total Duplicate Count: " + duplicateCount);
console.log("Finished Checking Duplicates");
Meteor.log.info("xxx");
} catch(err) {
console.log(err);
}
}
});