@dhyasama/totem-models 9.25.0 → 9.25.1
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 +14 -1
- package/package.json +1 -1
package/lib/Financials.js
CHANGED
|
@@ -301,6 +301,7 @@ module.exports = function(mongoose, config) {
|
|
|
301
301
|
let query = self.find({});
|
|
302
302
|
|
|
303
303
|
query.populate('organization', 'name logoUrl');
|
|
304
|
+
query.populate('customer', 'name customer');
|
|
304
305
|
|
|
305
306
|
query.exec(cb);
|
|
306
307
|
|
|
@@ -748,6 +749,8 @@ module.exports = function(mongoose, config) {
|
|
|
748
749
|
|
|
749
750
|
Financials.statics.upsert = function upsert(financials, cb) {
|
|
750
751
|
|
|
752
|
+
console.log('Financials upsert');
|
|
753
|
+
|
|
751
754
|
if (!financials) { return cb(new Error('financials is required'), null); }
|
|
752
755
|
|
|
753
756
|
// Required for mixed types
|
|
@@ -764,6 +767,8 @@ module.exports = function(mongoose, config) {
|
|
|
764
767
|
financials.markModified('investingActivities.breakdown');
|
|
765
768
|
financials.markModified('financingActivities.breakdown');
|
|
766
769
|
|
|
770
|
+
console.log('Financials about to save...');
|
|
771
|
+
|
|
767
772
|
financials.save(cb);
|
|
768
773
|
|
|
769
774
|
};
|
|
@@ -777,7 +782,11 @@ module.exports = function(mongoose, config) {
|
|
|
777
782
|
|
|
778
783
|
const updateStatus = function updateStatus(self) {
|
|
779
784
|
|
|
780
|
-
|
|
785
|
+
console.log('Financials updateStatus start');
|
|
786
|
+
|
|
787
|
+
_.each(self.snapshots, function(snapshot, index) {
|
|
788
|
+
|
|
789
|
+
console.log('Financials updateStatus index:', index);
|
|
781
790
|
|
|
782
791
|
if(!snapshot) return;
|
|
783
792
|
|
|
@@ -806,6 +815,8 @@ module.exports = function(mongoose, config) {
|
|
|
806
815
|
|
|
807
816
|
});
|
|
808
817
|
|
|
818
|
+
console.log('Financials updateStatus end');
|
|
819
|
+
|
|
809
820
|
};
|
|
810
821
|
|
|
811
822
|
Financials.pre('init', function(next) {
|
|
@@ -819,6 +830,8 @@ module.exports = function(mongoose, config) {
|
|
|
819
830
|
|
|
820
831
|
Financials.pre('save', function(next) {
|
|
821
832
|
|
|
833
|
+
console.log('Financials pre-save');
|
|
834
|
+
|
|
822
835
|
const self = this;
|
|
823
836
|
|
|
824
837
|
updateStatus(self);
|