@optimiser/common 1.0.334 → 1.0.336
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/dist/lib/utility.js +10 -4
- package/package.json +1 -1
package/dist/lib/utility.js
CHANGED
|
@@ -3829,7 +3829,15 @@ function SyncUserLicenceConsumedCount(msp_d, db, dbMaster) {
|
|
|
3829
3829
|
case 3:
|
|
3830
3830
|
comLicenceInUserLicence = _a.sent();
|
|
3831
3831
|
if (comLicenceInUserLicence && comLicenceInUserLicence.length) {
|
|
3832
|
-
bulkLicenceOps = [
|
|
3832
|
+
bulkLicenceOps = [{
|
|
3833
|
+
updateMany: {
|
|
3834
|
+
filter: { 'CompanyID': new mongodb_1.ObjectId(msp_d.ci), 'LicenceType': { $ne: 'Domain' }, IsActive: true },
|
|
3835
|
+
update: [
|
|
3836
|
+
{ $set: { 'NoOfLicenceConsumed': 0 } },
|
|
3837
|
+
{ $set: { 'NoOfRemainingLicence': "$NoOfLicence" } }
|
|
3838
|
+
]
|
|
3839
|
+
}
|
|
3840
|
+
}];
|
|
3833
3841
|
for (u = 0; u < comLicenceInUserLicence.length; u++) {
|
|
3834
3842
|
licenceID = comLicenceInUserLicence[u]._id['CompanyLicenceID'];
|
|
3835
3843
|
licenceTotal = comLicenceInUserLicence[u].Total;
|
|
@@ -3845,9 +3853,7 @@ function SyncUserLicenceConsumedCount(msp_d, db, dbMaster) {
|
|
|
3845
3853
|
});
|
|
3846
3854
|
}
|
|
3847
3855
|
}
|
|
3848
|
-
|
|
3849
|
-
dbMaster.collection('CompanyLicence').bulkWrite(bulkLicenceOps);
|
|
3850
|
-
}
|
|
3856
|
+
dbMaster.collection('CompanyLicence').bulkWrite(bulkLicenceOps);
|
|
3851
3857
|
}
|
|
3852
3858
|
else {
|
|
3853
3859
|
console.log('In company (' + msp_d.ci + '), copmany licence data not found in user licence while syncing user licence consumed count.');
|