54 lines
1.4 KiB
JavaScript
54 lines
1.4 KiB
JavaScript
|
|
import './Reports.html';
|
|
|
|
let PREFIX = "reports.";
|
|
|
|
//let SalesTotals = new Meteor.Collection("salesTotals");
|
|
//
|
|
//Meteor.subscribe("venues");
|
|
//Meteor.subscribe("productTags");
|
|
|
|
let salesTotalsSubscription;
|
|
|
|
|
|
Template.Reports.onCreated(function() {
|
|
//let template = Template.instance();
|
|
|
|
//Tracker.autorun(function() {
|
|
// salesTotalsSubscription = template.subscribe("salesTotals", Session.get(PREFIX + "time"), Session.get(PREFIX + "options"));
|
|
//});
|
|
});
|
|
Template.Reports.onRendered(function() {
|
|
//Template.instance()
|
|
//Tracker.autorun(function() {
|
|
// if(salesTotalsSubscription.ready()) {
|
|
//
|
|
// }
|
|
//});
|
|
});
|
|
//Template.Reports.helpers({
|
|
// sales: function() {
|
|
// let sort = [];
|
|
//
|
|
// sort.push(['year', 'asc']);// year = 1;
|
|
// if(Session.get(PREFIX + "time") === 'weekly') sort.push(['week', 'asc']); // .week = 1;
|
|
// if(Session.get(PREFIX + "time") === 'monthly') sort.push(['month', 'asc']); // .month = 1;
|
|
// if(Session.get(PREFIX + "options") === 'markets') sort.push(['venue', 'asc']); // .month = 1;
|
|
//
|
|
// return SalesTotals.find({}, {sort: sort});
|
|
// },
|
|
// showTime: function(time) {
|
|
// return Session.get(PREFIX + "time") === time;
|
|
// },
|
|
// showOption: function(option) {
|
|
// return Session.get(PREFIX + "options") === option;
|
|
// },
|
|
// formatTotal: function(total) {
|
|
// return "$" + total.toFixed(2);
|
|
// }
|
|
//});
|
|
//Template.Reports.events({
|
|
// 'click annualNumbers': function(event, template) {
|
|
//
|
|
// }
|
|
//});
|