diff --git a/src/app/core/models/netsuite/netsuite-configuration/netsuite-advanced-settings.model.ts b/src/app/core/models/netsuite/netsuite-configuration/netsuite-advanced-settings.model.ts index 7dbcbfb69..99ec7f324 100644 --- a/src/app/core/models/netsuite/netsuite-configuration/netsuite-advanced-settings.model.ts +++ b/src/app/core/models/netsuite/netsuite-configuration/netsuite-advanced-settings.model.ts @@ -1,7 +1,7 @@ import { FormControl, FormGroup } from "@angular/forms"; import { EmailOption, SelectFormOption } from "../../common/select-form-option.model"; import { DefaultDestinationAttribute } from "../../db/destination-attribute.model"; -import { NetsuiteDefaultLevelOptions, NetsuitePaymentSyncDirection, QBOPaymentSyncDirection } from "../../enum/enum.model"; +import { NetsuiteDefaultLevelOptions, NetsuitePaymentSyncDirection, PaymentSyncDirection } from "../../enum/enum.model"; import { AdvancedSettingValidatorRule, AdvancedSettingsModel } from "../../common/advanced-settings.model"; import { HelperUtility } from "../../common/helper.model"; import { brandingConfig } from "src/app/branding/branding-config"; @@ -101,7 +101,7 @@ export class NetsuiteAdvancedSettingModel extends HelperUtility { static getValidators(): AdvancedSettingValidatorRule { return { - paymentSync: 'billPaymentAccount', + paymentSync: 'paymentAccount', exportSchedule: 'exportScheduleFrequency' }; } @@ -112,7 +112,7 @@ export class NetsuiteAdvancedSettingModel extends HelperUtility { Object.values(validatorRule).forEach((value, index) => { form.controls[keys[index]].valueChanges.subscribe((selectedValue) => { - if (selectedValue) { + if (selectedValue && ((keys[index] === 'paymentSync' && selectedValue === NetsuitePaymentSyncDirection.FYLE_TO_NETSUITE) || (keys[index] !== 'paymentSync'))) { this.markControllerAsRequired(form, value); } else { this.clearValidatorAndResetValue(form, value); diff --git a/src/app/core/models/qbo/qbo-configuration/qbo-advanced-setting.model.ts b/src/app/core/models/qbo/qbo-configuration/qbo-advanced-setting.model.ts index 5e1248b47..4298b21e1 100644 --- a/src/app/core/models/qbo/qbo-configuration/qbo-advanced-setting.model.ts +++ b/src/app/core/models/qbo/qbo-configuration/qbo-advanced-setting.model.ts @@ -83,7 +83,7 @@ export class QBOAdvancedSettingModel extends HelperUtility { Object.values(validatorRule).forEach((value, index) => { form.controls[keys[index]].valueChanges.subscribe((selectedValue) => { - if (selectedValue) { + if (selectedValue && ((keys[index] === 'paymentSync' && selectedValue === QBOPaymentSyncDirection.FYLE_TO_QBO) || (keys[index] !== 'paymentSync'))) { this.markControllerAsRequired(form, value); } else { this.clearValidatorAndResetValue(form, value); diff --git a/src/app/integrations/netsuite/netsuite-shared/netsuite-advanced-settings/netsuite-advanced-settings.component.html b/src/app/integrations/netsuite/netsuite-shared/netsuite-advanced-settings/netsuite-advanced-settings.component.html index 2d7170667..721f4dd75 100644 --- a/src/app/integrations/netsuite/netsuite-shared/netsuite-advanced-settings/netsuite-advanced-settings.component.html +++ b/src/app/integrations/netsuite/netsuite-shared/netsuite-advanced-settings/netsuite-advanced-settings.component.html @@ -60,6 +60,8 @@