@dhyasama/totem-models 7.2.2 → 7.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/Financials.js +2 -1
- package/package.json +1 -1
package/lib/Financials.js
CHANGED
|
@@ -12,6 +12,7 @@ module.exports = function(mongoose, config) {
|
|
|
12
12
|
var Schema = mongoose.Schema;
|
|
13
13
|
var async = require('async');
|
|
14
14
|
var _ = require('underscore');
|
|
15
|
+
var moment = require('moment');
|
|
15
16
|
|
|
16
17
|
// scheduled
|
|
17
18
|
// not scheduled (skipped)
|
|
@@ -387,7 +388,7 @@ module.exports = function(mongoose, config) {
|
|
|
387
388
|
else if(snapshot.notifications.company.initial.sendOn) {
|
|
388
389
|
|
|
389
390
|
var isScheduled = moment().isBefore(moment(snapshot.notifications.company.initial.sendOn));
|
|
390
|
-
var isOverdue = moment().subtract(30, 'd').isAfter(snapshot.notifications.company.reminder.sendOn || snapshot.notifications.company.initial.sendOn);
|
|
391
|
+
var isOverdue = moment().subtract(30, 'd').isAfter(moment(snapshot.notifications.company.reminder.sendOn || snapshot.notifications.company.initial.sendOn));
|
|
391
392
|
|
|
392
393
|
if(isScheduled) snapshot.status = 'Scheduled';
|
|
393
394
|
else if(isOverdue) snapshot.status = 'Overdue';
|