@dhyasama/totem-models 9.45.1 → 9.45.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 +7 -7
- package/package.json +1 -1
package/lib/Financials.js
CHANGED
|
@@ -835,15 +835,15 @@ module.exports = function(mongoose, config) {
|
|
|
835
835
|
|
|
836
836
|
const updateStatus = function updateStatus(self) {
|
|
837
837
|
|
|
838
|
-
console.log('Financials update status
|
|
838
|
+
console.log('Financials update status begin');
|
|
839
839
|
|
|
840
840
|
_.each(self.snapshots, function(snapshot, index) {
|
|
841
841
|
|
|
842
|
-
console.log('Financials update status
|
|
842
|
+
console.log('Financials update status snapshot index ' + index.toString());
|
|
843
843
|
|
|
844
844
|
if (!snapshot) return;
|
|
845
845
|
|
|
846
|
-
console.log('Financials update status
|
|
846
|
+
console.log('Financials update status snapshot index ' + index.toString() + ' - 1');
|
|
847
847
|
|
|
848
848
|
var needsReview = snapshot.review;
|
|
849
849
|
var isSubmitted = snapshot.submittedOn;
|
|
@@ -852,7 +852,7 @@ module.exports = function(mongoose, config) {
|
|
|
852
852
|
var isArchived = snapshot.archivedOn;
|
|
853
853
|
var isOverdue = snapshot.dueOn ? moment(new Date()).isAfter(moment(snapshot.dueOn)) : false;
|
|
854
854
|
|
|
855
|
-
console.log('Financials update status
|
|
855
|
+
console.log('Financials update status snapshot index ' + index.toString() + ' - 2');
|
|
856
856
|
|
|
857
857
|
var isOpened = false;
|
|
858
858
|
var isDelivered = false;
|
|
@@ -861,7 +861,7 @@ module.exports = function(mongoose, config) {
|
|
|
861
861
|
isDelivered = snapshot.notifications.company.initial.sentOn;
|
|
862
862
|
}
|
|
863
863
|
|
|
864
|
-
console.log('Financials update status
|
|
864
|
+
console.log('Financials update status snapshot index ' + index.toString() + ' - 3');
|
|
865
865
|
|
|
866
866
|
if(!snapshot.uuid) snapshot.status = 'Completed'; // no uuid means the snapshot was created from the google sheet and should always be completed
|
|
867
867
|
else if(needsReview && isApproved) snapshot.status = 'Completed';
|
|
@@ -874,11 +874,11 @@ module.exports = function(mongoose, config) {
|
|
|
874
874
|
else if(isDelivered) snapshot.status = 'Delivered';
|
|
875
875
|
else snapshot.status = 'Upcoming'; // Upcoming is set when a snapshot is created to be sent to an org, typically within a minute or so
|
|
876
876
|
|
|
877
|
-
console.log('Financials update status
|
|
877
|
+
console.log('Financials update status snapshot index ' + index.toString() + ' - 4');
|
|
878
878
|
|
|
879
879
|
});
|
|
880
880
|
|
|
881
|
-
console.log('Financials update status
|
|
881
|
+
console.log('Financials update status end');
|
|
882
882
|
|
|
883
883
|
};
|
|
884
884
|
|