@dhyasama/totem-models 9.19.1 → 9.19.2
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 +9 -1
- package/package.json +1 -1
package/lib/Financials.js
CHANGED
|
@@ -750,7 +750,7 @@ module.exports = function(mongoose, config) {
|
|
|
750
750
|
const self = this;
|
|
751
751
|
|
|
752
752
|
const query = self.find({
|
|
753
|
-
'snapshots.status': { $nin: ['Completed', 'Archived'] },
|
|
753
|
+
'snapshots.status': { $nin: ['Completed', 'Archived', 'Overdue'] },
|
|
754
754
|
'snapshots.dueOn': { $lte: new Date() }
|
|
755
755
|
});
|
|
756
756
|
|
|
@@ -758,6 +758,14 @@ module.exports = function(mongoose, config) {
|
|
|
758
758
|
|
|
759
759
|
};
|
|
760
760
|
|
|
761
|
+
Financials.statics.markAsOverdue = function markAsOverdue(financials, cb) {
|
|
762
|
+
|
|
763
|
+
if (!financials) { return cb(new Error('financials is required'), null); }
|
|
764
|
+
|
|
765
|
+
financials.save(cb);
|
|
766
|
+
|
|
767
|
+
};
|
|
768
|
+
|
|
761
769
|
Financials.statics.removeCustomerFinancials = function removeCustomerFinancials(customerId, cb) {
|
|
762
770
|
|
|
763
771
|
// this is only used to wipe out financials created by the google sheet import process
|