@optimiser/common 1.0.328 → 1.0.330

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.
@@ -203,6 +203,26 @@ declare function CheckCaptcha(token: string, captcha: string, redisClient: Redis
203
203
  declare function IsStringValue(val: any): boolean;
204
204
  declare function ValidateSanitizeUserInput(inputFields: AnyObjectInterface, pageData: AnyObjectInterface): Promise<AnyObjectInterface[] | undefined>;
205
205
  declare function ValidateUserInput(options: AnyObjectInterface): Promise<string | undefined>;
206
+ /**
207
+ * TODO: Check conditional field criteria with user inputs
208
+ *
209
+ * @param {object} field Contains shcema
210
+ * @param {object} record contains user inputs
211
+ * @param {string} action shows add or update
212
+ * @return message in string
213
+ */
214
+ declare function CheckConditionalField(field: any, record: any, action: string): string;
215
+ /**
216
+ * TODO: Check expression on date field
217
+ *
218
+ * @param {object} record Contains user inputs
219
+ * @param {string} fieldName name
220
+ * @param {string} range like 'Custom', 'today', yesterday etc.
221
+ * @param {string} startDate in case of custom range
222
+ * @param {string} endDate in case of custom range
223
+ * @return true or false
224
+ */
225
+ declare function CheckExpressionOnDateField(record: any, fieldName: string, range: string, startDate: string, endDate: string): boolean;
206
226
  /**
207
227
  * TODO: Create lookup of fields of list schema for Vat Setting data
208
228
  *
@@ -243,4 +263,4 @@ declare function InvitationMailReplyContent(fromUser: string, fromEmail: string)
243
263
  * @return boolean
244
264
  */
245
265
  declare function HasFiscalOperator(filter: any): boolean;
246
- export { CheckForWhiteListedDomain, ReturnJsonResponse, ConvertFileByteSize, GetObjectByKeyValueFromList, IsEqualArrays, IsEqualValue, CheckUserProfileField, GetPageFieldData, GetPageObjectSchema, GetFieldDetail, UpdateRecentViewObject, UpdateRecentViewFields, SyncChildObjectData, SyncParentObjectData, DeleteFieldInOtherCollection, SyncFieldInSameCollection, SyncFieldInSameCollectionByObjectID, SyncFieldInSameCollectionByObjectIDWithPromise, SyncFieldInOtherCollection, SyncUserInOtherCollection, GetObjectByString, BuildLookupDataField, CheckDataBeforeAdd, CheckDataBeforeUpdate, BuildGridFieldProjection, BuildFieldProjection, BuildLookupFieldProjection, FilterConditions, GirdHeaderFilters, FieldsGridHeaderFilters, AddLog, CheckFilterFieldsProjection, VerifyEmailPassword, GetMyTeamUsers, ExtractChildUsersTree, GetMaxKeyValueListSchema, VerifyAWSEmailConfig, GenerateId, SyncUserDetailsWithMasterDB, SignoutUserFromAllDevices, SignoutUsersWithPromise, SignoutMultipleUsersFromAllDevices, UserLicenseConsumeCalculate, sendMailWithUserAccount, GetEmailClientConfigs, GetCompanyEncryptionKey, ExecuteDynamicDMLQuery, ExecuteDynamicDQLQuery, GetUserProfilePermissions, MakeUserPasswordInvalid, ConvertJsonToXLXS, SendResetPasswordMail, SendMailToSupport, MailTemplateStructure, SendMailToCustomer, parseMSPCookie, GetIPDetailsFromReq, isEmptyObj, SyncListSchemaFieldInOtherCollection, UpdateTagCountAfterDelete, SyncTagCountAfterUpdate, ReactivateFieldInOtherCollection, SyncUserLicenceConsumedCount, BroadCastEventToAllCompanyUsers, CheckDataPermission, SyncCompanyLicenceInMasterCompanyAfterAdd, NextServiceDateForDashboard, CheckDateNotInPast, GetWeekDayByDayAndOccurance, GetInterValFromOccurance, GetWeekDayInfoInMonth, GetDayIndex, RemoveFieldsFromFilters, GetUserProfile, CheckPageAuthentication, ErrorHandlerForServices, CheckCaptcha, IsStringValue, ValidateSanitizeUserInput, ValidateUserInput, AddDaysToDate, CreateBanquetingVATSettingsData, CheckReportFolderAccess, GetMailFromString, InvitationMailReplyContent, HasFiscalOperator };
266
+ export { CheckForWhiteListedDomain, ReturnJsonResponse, ConvertFileByteSize, GetObjectByKeyValueFromList, IsEqualArrays, IsEqualValue, CheckUserProfileField, GetPageFieldData, GetPageObjectSchema, GetFieldDetail, UpdateRecentViewObject, UpdateRecentViewFields, SyncChildObjectData, SyncParentObjectData, DeleteFieldInOtherCollection, SyncFieldInSameCollection, SyncFieldInSameCollectionByObjectID, SyncFieldInSameCollectionByObjectIDWithPromise, SyncFieldInOtherCollection, SyncUserInOtherCollection, GetObjectByString, BuildLookupDataField, CheckDataBeforeAdd, CheckDataBeforeUpdate, BuildGridFieldProjection, BuildFieldProjection, BuildLookupFieldProjection, FilterConditions, GirdHeaderFilters, FieldsGridHeaderFilters, AddLog, CheckFilterFieldsProjection, VerifyEmailPassword, GetMyTeamUsers, ExtractChildUsersTree, GetMaxKeyValueListSchema, VerifyAWSEmailConfig, GenerateId, SyncUserDetailsWithMasterDB, SignoutUserFromAllDevices, SignoutUsersWithPromise, SignoutMultipleUsersFromAllDevices, UserLicenseConsumeCalculate, sendMailWithUserAccount, GetEmailClientConfigs, GetCompanyEncryptionKey, ExecuteDynamicDMLQuery, ExecuteDynamicDQLQuery, GetUserProfilePermissions, MakeUserPasswordInvalid, ConvertJsonToXLXS, SendResetPasswordMail, SendMailToSupport, MailTemplateStructure, SendMailToCustomer, parseMSPCookie, GetIPDetailsFromReq, isEmptyObj, SyncListSchemaFieldInOtherCollection, UpdateTagCountAfterDelete, SyncTagCountAfterUpdate, ReactivateFieldInOtherCollection, SyncUserLicenceConsumedCount, BroadCastEventToAllCompanyUsers, CheckDataPermission, SyncCompanyLicenceInMasterCompanyAfterAdd, NextServiceDateForDashboard, CheckDateNotInPast, GetWeekDayByDayAndOccurance, GetInterValFromOccurance, GetWeekDayInfoInMonth, GetDayIndex, RemoveFieldsFromFilters, GetUserProfile, CheckPageAuthentication, ErrorHandlerForServices, CheckCaptcha, IsStringValue, ValidateSanitizeUserInput, ValidateUserInput, CheckConditionalField, CheckExpressionOnDateField, AddDaysToDate, CreateBanquetingVATSettingsData, CheckReportFolderAccess, GetMailFromString, InvitationMailReplyContent, HasFiscalOperator };
@@ -80,7 +80,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
80
80
  return (mod && mod.__esModule) ? mod : { "default": mod };
81
81
  };
82
82
  Object.defineProperty(exports, "__esModule", { value: true });
83
- exports.HasFiscalOperator = exports.InvitationMailReplyContent = exports.GetMailFromString = exports.CheckReportFolderAccess = exports.CreateBanquetingVATSettingsData = exports.AddDaysToDate = exports.ValidateUserInput = exports.ValidateSanitizeUserInput = exports.IsStringValue = exports.CheckCaptcha = exports.ErrorHandlerForServices = exports.CheckPageAuthentication = exports.GetUserProfile = exports.RemoveFieldsFromFilters = exports.GetDayIndex = exports.GetWeekDayInfoInMonth = exports.GetInterValFromOccurance = exports.GetWeekDayByDayAndOccurance = exports.CheckDateNotInPast = exports.NextServiceDateForDashboard = exports.SyncCompanyLicenceInMasterCompanyAfterAdd = exports.CheckDataPermission = exports.BroadCastEventToAllCompanyUsers = exports.SyncUserLicenceConsumedCount = exports.ReactivateFieldInOtherCollection = exports.SyncTagCountAfterUpdate = exports.UpdateTagCountAfterDelete = exports.SyncListSchemaFieldInOtherCollection = exports.isEmptyObj = exports.GetIPDetailsFromReq = exports.parseMSPCookie = exports.SendMailToCustomer = exports.MailTemplateStructure = exports.SendMailToSupport = exports.SendResetPasswordMail = exports.ConvertJsonToXLXS = exports.MakeUserPasswordInvalid = exports.GetUserProfilePermissions = exports.ExecuteDynamicDQLQuery = exports.ExecuteDynamicDMLQuery = exports.GetCompanyEncryptionKey = exports.GetEmailClientConfigs = exports.sendMailWithUserAccount = exports.UserLicenseConsumeCalculate = exports.SignoutMultipleUsersFromAllDevices = exports.SignoutUsersWithPromise = exports.SignoutUserFromAllDevices = exports.SyncUserDetailsWithMasterDB = exports.GenerateId = exports.VerifyAWSEmailConfig = exports.GetMaxKeyValueListSchema = exports.ExtractChildUsersTree = exports.GetMyTeamUsers = exports.VerifyEmailPassword = exports.CheckFilterFieldsProjection = exports.AddLog = exports.FieldsGridHeaderFilters = exports.GirdHeaderFilters = exports.FilterConditions = exports.BuildLookupFieldProjection = exports.BuildFieldProjection = exports.BuildGridFieldProjection = exports.CheckDataBeforeUpdate = exports.CheckDataBeforeAdd = exports.BuildLookupDataField = exports.GetObjectByString = exports.SyncUserInOtherCollection = exports.SyncFieldInOtherCollection = exports.SyncFieldInSameCollectionByObjectIDWithPromise = exports.SyncFieldInSameCollectionByObjectID = exports.SyncFieldInSameCollection = exports.DeleteFieldInOtherCollection = exports.SyncParentObjectData = exports.SyncChildObjectData = exports.UpdateRecentViewFields = exports.UpdateRecentViewObject = exports.GetFieldDetail = exports.GetPageObjectSchema = exports.GetPageFieldData = exports.CheckUserProfileField = exports.IsEqualValue = exports.IsEqualArrays = exports.GetObjectByKeyValueFromList = exports.ConvertFileByteSize = exports.ReturnJsonResponse = exports.CheckForWhiteListedDomain = void 0;
83
+ exports.HasFiscalOperator = exports.InvitationMailReplyContent = exports.GetMailFromString = exports.CheckReportFolderAccess = exports.CreateBanquetingVATSettingsData = exports.AddDaysToDate = exports.CheckExpressionOnDateField = exports.CheckConditionalField = exports.ValidateUserInput = exports.ValidateSanitizeUserInput = exports.IsStringValue = exports.CheckCaptcha = exports.ErrorHandlerForServices = exports.CheckPageAuthentication = exports.GetUserProfile = exports.RemoveFieldsFromFilters = exports.GetDayIndex = exports.GetWeekDayInfoInMonth = exports.GetInterValFromOccurance = exports.GetWeekDayByDayAndOccurance = exports.CheckDateNotInPast = exports.NextServiceDateForDashboard = exports.SyncCompanyLicenceInMasterCompanyAfterAdd = exports.CheckDataPermission = exports.BroadCastEventToAllCompanyUsers = exports.SyncUserLicenceConsumedCount = exports.ReactivateFieldInOtherCollection = exports.SyncTagCountAfterUpdate = exports.UpdateTagCountAfterDelete = exports.SyncListSchemaFieldInOtherCollection = exports.isEmptyObj = exports.GetIPDetailsFromReq = exports.parseMSPCookie = exports.SendMailToCustomer = exports.MailTemplateStructure = exports.SendMailToSupport = exports.SendResetPasswordMail = exports.ConvertJsonToXLXS = exports.MakeUserPasswordInvalid = exports.GetUserProfilePermissions = exports.ExecuteDynamicDQLQuery = exports.ExecuteDynamicDMLQuery = exports.GetCompanyEncryptionKey = exports.GetEmailClientConfigs = exports.sendMailWithUserAccount = exports.UserLicenseConsumeCalculate = exports.SignoutMultipleUsersFromAllDevices = exports.SignoutUsersWithPromise = exports.SignoutUserFromAllDevices = exports.SyncUserDetailsWithMasterDB = exports.GenerateId = exports.VerifyAWSEmailConfig = exports.GetMaxKeyValueListSchema = exports.ExtractChildUsersTree = exports.GetMyTeamUsers = exports.VerifyEmailPassword = exports.CheckFilterFieldsProjection = exports.AddLog = exports.FieldsGridHeaderFilters = exports.GirdHeaderFilters = exports.FilterConditions = exports.BuildLookupFieldProjection = exports.BuildFieldProjection = exports.BuildGridFieldProjection = exports.CheckDataBeforeUpdate = exports.CheckDataBeforeAdd = exports.BuildLookupDataField = exports.GetObjectByString = exports.SyncUserInOtherCollection = exports.SyncFieldInOtherCollection = exports.SyncFieldInSameCollectionByObjectIDWithPromise = exports.SyncFieldInSameCollectionByObjectID = exports.SyncFieldInSameCollection = exports.DeleteFieldInOtherCollection = exports.SyncParentObjectData = exports.SyncChildObjectData = exports.UpdateRecentViewFields = exports.UpdateRecentViewObject = exports.GetFieldDetail = exports.GetPageObjectSchema = exports.GetPageFieldData = exports.CheckUserProfileField = exports.IsEqualValue = exports.IsEqualArrays = exports.GetObjectByKeyValueFromList = exports.ConvertFileByteSize = exports.ReturnJsonResponse = exports.CheckForWhiteListedDomain = void 0;
84
84
  var moment_1 = __importDefault(require("moment"));
85
85
  var nodemailer_1 = __importDefault(require("nodemailer"));
86
86
  var mongodb_1 = require("mongodb");
@@ -99,6 +99,7 @@ require("moment-timezone");
99
99
  var helper_1 = require("./helper");
100
100
  var sanitize = require('mongo-sanitize');
101
101
  var phoneUtil = require("google-libphonenumber").PhoneNumberUtil.getInstance();
102
+ var _settingData = {};
102
103
  function GetObjectByKeyValueFromList(list, key, val) {
103
104
  if (list && list.length > 0) {
104
105
  for (var i = 0; i < list.length; i++) {
@@ -4568,17 +4569,24 @@ function IsAnotherObjectField(pageData, fieldName) {
4568
4569
  * example: if there is no issue found it return "" else return error message - "FirstName is required!"
4569
4570
  */
4570
4571
  function ValidateUserInput(options) {
4572
+ var _a, _b, _c;
4571
4573
  return __awaiter(this, void 0, void 0, function () {
4572
- var inputFields, fieldsJsonData, pageData, documentID, db, action, objectSchema, objectName, pageFields, schemaFields, inputField, msg, _loop_18, _i, inputField_1, name_1, state_1, _loop_19, isValid, isValid, validateResp, _a, pageFields_1, pageField, state_2, countryData, err_3;
4573
- return __generator(this, function (_b) {
4574
- switch (_b.label) {
4574
+ var inputFields, fieldsJsonData, pageData, documentID, db, fiscalSettingData, action, objectSchema, objectName, pageFields, schemaFields, inputField, msg, _loop_18, _i, inputField_1, name_1, state_1, _loop_19, isValid, isValid, validateResp, _d, pageFields_1, pageField, state_2, countryData, err_3;
4575
+ return __generator(this, function (_e) {
4576
+ switch (_e.label) {
4575
4577
  case 0:
4576
- _b.trys.push([0, 7, , 8]);
4578
+ _e.trys.push([0, 8, , 9]);
4577
4579
  inputFields = options.userInput;
4578
4580
  fieldsJsonData = bson_1.EJSON.parse(JSON.stringify(inputFields));
4579
4581
  pageData = options.pageData;
4580
4582
  documentID = options.objectID;
4581
4583
  db = options.db;
4584
+ return [4 /*yield*/, db.collection('Company').findOne({ IsActive: true }, { projection: { "Setting.FiscalFrom": 1, "Setting.FiscalMonth": 1, "Setting.DateFormat": 1 } })];
4585
+ case 1:
4586
+ fiscalSettingData = _e.sent();
4587
+ _settingData['FiscalMonth'] = ((_a = fiscalSettingData === null || fiscalSettingData === void 0 ? void 0 : fiscalSettingData.Setting) === null || _a === void 0 ? void 0 : _a.FiscalMonth) || 'Jan';
4588
+ _settingData['FiscalFrom'] = ((_b = fiscalSettingData === null || fiscalSettingData === void 0 ? void 0 : fiscalSettingData.Setting) === null || _b === void 0 ? void 0 : _b.FiscalFrom) || 'Start';
4589
+ _settingData['DateFormat'] = ((_c = fiscalSettingData === null || fiscalSettingData === void 0 ? void 0 : fiscalSettingData.Setting) === null || _c === void 0 ? void 0 : _c.DateFormat) || 'DD-MMM-YYYY';
4582
4590
  action = (documentID) ? "update" : "add";
4583
4591
  objectSchema = pageData.ObjectSchema;
4584
4592
  objectName = objectSchema.Name;
@@ -5006,41 +5014,41 @@ function ValidateUserInput(options) {
5006
5014
  }
5007
5015
  });
5008
5016
  };
5009
- _a = 0, pageFields_1 = pageFields;
5010
- _b.label = 1;
5011
- case 1:
5012
- if (!(_a < pageFields_1.length)) return [3 /*break*/, 4];
5013
- pageField = pageFields_1[_a];
5014
- return [5 /*yield**/, _loop_19(pageField)];
5017
+ _d = 0, pageFields_1 = pageFields;
5018
+ _e.label = 2;
5015
5019
  case 2:
5016
- state_2 = _b.sent();
5017
- if (state_2 === "break")
5018
- return [3 /*break*/, 4];
5019
- _b.label = 3;
5020
+ if (!(_d < pageFields_1.length)) return [3 /*break*/, 5];
5021
+ pageField = pageFields_1[_d];
5022
+ return [5 /*yield**/, _loop_19(pageField)];
5020
5023
  case 3:
5021
- _a++;
5022
- return [3 /*break*/, 1];
5024
+ state_2 = _e.sent();
5025
+ if (state_2 === "break")
5026
+ return [3 /*break*/, 5];
5027
+ _e.label = 4;
5023
5028
  case 4:
5029
+ _d++;
5030
+ return [3 /*break*/, 2];
5031
+ case 5:
5024
5032
  if (msg != "") {
5025
5033
  return [2 /*return*/, msg];
5026
5034
  }
5027
- if (!(objectName == 'City')) return [3 /*break*/, 6];
5035
+ if (!(objectName == 'City')) return [3 /*break*/, 7];
5028
5036
  return [4 /*yield*/, db.collection("Country").findOne({ '_id': inputFields.CountryID, 'IsActive': true })];
5029
- case 5:
5030
- countryData = _b.sent();
5037
+ case 6:
5038
+ countryData = _e.sent();
5031
5039
  if (countryData) {
5032
5040
  inputFields.CountryName = countryData.Name;
5033
5041
  }
5034
5042
  else {
5035
5043
  msg = "Invalid country code!";
5036
5044
  }
5037
- _b.label = 6;
5038
- case 6: return [2 /*return*/, msg];
5039
- case 7:
5040
- err_3 = _b.sent();
5045
+ _e.label = 7;
5046
+ case 7: return [2 /*return*/, msg];
5047
+ case 8:
5048
+ err_3 = _e.sent();
5041
5049
  console.log("Error in ValidateUserInput", err_3);
5042
- return [3 /*break*/, 8];
5043
- case 8: return [2 /*return*/];
5050
+ return [3 /*break*/, 9];
5051
+ case 9: return [2 /*return*/];
5044
5052
  }
5045
5053
  });
5046
5054
  });
@@ -5055,40 +5063,73 @@ exports.ValidateUserInput = ValidateUserInput;
5055
5063
  * @return message in string
5056
5064
  */
5057
5065
  function CheckConditionalField(field, record, action) {
5058
- var msg = '';
5059
- var fieldData = record[field.Name];
5060
- if (field.Schema.ConditionalAction == 'enabled' && field.IsRequired == true) {
5061
- if (field.Schema.UIDataType != 'autoincrement' && (fieldData === '' || fieldData === null || (fieldData === undefined && action == "add"))) {
5062
- msg = ((field.DisplayName || field.Schema.DisplayName) || field.Name) + ' is required!';
5066
+ try {
5067
+ var msg = '';
5068
+ var fieldData = record[field.Name];
5069
+ if (field.Schema.ConditionalAction == 'enabled' && field.IsRequired == true) {
5070
+ if (field.Schema.UIDataType != 'autoincrement' && (fieldData === '' || fieldData === null || (fieldData === undefined && action == "add"))) {
5071
+ msg = ((field.DisplayName || field.Schema.DisplayName) || field.Name) + ' is required!';
5072
+ }
5063
5073
  }
5064
- }
5065
- else if (record != undefined && eval(field.Schema.ConditionalExpression) == true) {
5066
- switch (field.Schema.ConditionalAction) {
5067
- case "mandatory":
5068
- case "enabled-mandatory":
5069
- case "show-enabled-mandatory":
5070
- case "show-disabled-mandatory":
5071
- if (field.Schema.UIDataType != 'autoincrement' && (fieldData === '' || fieldData === null || (fieldData === undefined && action == "add"))) {
5072
- msg = ((field.DisplayName || field.Schema.DisplayName) || field.Name) + ' is conditionally required!';
5073
- }
5074
- break;
5074
+ else if (record != undefined && eval(field.Schema.ConditionalExpression) == true) {
5075
+ switch (field.Schema.ConditionalAction) {
5076
+ case "mandatory":
5077
+ case "enabled-mandatory":
5078
+ case "show-enabled-mandatory":
5079
+ case "show-disabled-mandatory":
5080
+ if (field.Schema.UIDataType != 'autoincrement' && (fieldData === '' || fieldData === null || (fieldData === undefined && action == "add"))) {
5081
+ msg = ((field.DisplayName || field.Schema.DisplayName) || field.Name) + ' is conditionally required!';
5082
+ }
5083
+ break;
5084
+ }
5085
+ }
5086
+ else {
5087
+ switch (field.Schema.ConditionalAction) {
5088
+ case "show-disabled-mandatory":
5089
+ case "show-disabled-nonmandatory":
5090
+ break;
5091
+ case "show-enabled-mandatory":
5092
+ case "show-enabled-nonmandatory":
5093
+ if (fieldData) {
5094
+ msg = ((field.DisplayName || field.Schema.DisplayName) || field.Name) + ' is a hidden field and should not contain value.';
5095
+ }
5096
+ break;
5097
+ }
5075
5098
  }
5099
+ return msg;
5076
5100
  }
5077
- else {
5078
- switch (field.Schema.ConditionalAction) {
5079
- case "show-disabled-mandatory":
5080
- case "show-disabled-nonmandatory":
5081
- break;
5082
- case "show-enabled-mandatory":
5083
- case "show-enabled-nonmandatory":
5084
- if (fieldData) {
5085
- msg = ((field.DisplayName || field.Schema.DisplayName) || field.Name) + ' is a hidden field and should not contain value.';
5086
- }
5087
- break;
5101
+ catch (error) {
5102
+ console.error("Internal Error in CheckConditionalField Function : ", error);
5103
+ return '';
5104
+ }
5105
+ }
5106
+ exports.CheckConditionalField = CheckConditionalField;
5107
+ /**
5108
+ * TODO: Check expression on date field
5109
+ *
5110
+ * @param {object} record Contains user inputs
5111
+ * @param {string} fieldName name
5112
+ * @param {string} range like 'Custom', 'today', yesterday etc.
5113
+ * @param {string} startDate in case of custom range
5114
+ * @param {string} endDate in case of custom range
5115
+ * @return true or false
5116
+ */
5117
+ function CheckExpressionOnDateField(record, fieldName, range, startDate, endDate) {
5118
+ try {
5119
+ if (range == 'Custom') {
5120
+ return (record[fieldName] && (moment_1.default(record[fieldName]).isBetween(moment_1.default(startDate, _settingData.DateFormat).startOf('day'), moment_1.default(endDate, _settingData.DateFormat).endOf('day')) || moment_1.default(record[fieldName]).isSame(moment_1.default(startDate, _settingData.DateFormat).startOf('day')) || moment_1.default(record[fieldName]).isSame(moment_1.default(endDate, _settingData.DateFormat).endOf('day')))) ? true : false;
5088
5121
  }
5122
+ else {
5123
+ var _a = helper_1.GetDateRangeFromOperatorValue(range, _settingData.FiscalMonth, _settingData.FiscalFrom), startDate_1 = _a.startDate, endDate_1 = _a.endDate;
5124
+ return (record[fieldName] && (moment_1.default(record[fieldName]).isBetween(moment_1.default(startDate_1, _settingData.DateFormat).startOf('day'), moment_1.default(endDate_1, _settingData.DateFormat).endOf('day')) || moment_1.default(record[fieldName]).isSame(moment_1.default(startDate_1, _settingData.DateFormat).startOf('day')) || moment_1.default(record[fieldName]).isSame(moment_1.default(endDate_1, _settingData.DateFormat).endOf('day')))) ? true : false;
5125
+ }
5126
+ }
5127
+ catch (error) {
5128
+ console.error("Internal Error in CheckExpressionOnDateField Function : ", error);
5129
+ return false;
5089
5130
  }
5090
- return msg;
5091
5131
  }
5132
+ exports.CheckExpressionOnDateField = CheckExpressionOnDateField;
5092
5133
  /**
5093
5134
  * TODO: Create lookup of fields of list schema for Vat Setting data
5094
5135
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optimiser/common",
3
- "version": "1.0.328",
3
+ "version": "1.0.330",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {