Skip to content

Commit

Permalink
sage 300 fix (#939)
Browse files Browse the repository at this point in the history
  • Loading branch information
DhaaraniCIT authored Sep 3, 2024
1 parent 86f134f commit 6c2d7b2
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -225,24 +225,28 @@ export class ConfigurationImportFieldComponent implements OnInit {
}

removeFilter(expenseField: AbstractControl) {
if ((expenseField as FormGroup).controls.import_to_fyle.value) {
this.onImportToFyleToggleChange({checked: false}, (expenseField as FormGroup).controls.destination_field.value);
}
(expenseField as FormGroup).controls.source_field.patchValue('');
(expenseField as FormGroup).controls.import_to_fyle.patchValue(false);
(expenseField as FormGroup).controls.import_to_fyle.enable();
this.onImportToFyleToggleChange({checked: false}, (expenseField as FormGroup).controls.destination_field.value);
event?.stopPropagation();
this.isXeroProjectMapped = false;
this.xeroProjectMapping.emit(this.isXeroProjectMapped);
}

onSwitchChanged(event: any, formGroup: AbstractControl): void {
this.onShowWarningForDependentFields(event, formGroup);
this.onImportToFyleToggleChange(event, formGroup?.get('destination_field')?.value);
if (event.checked && this.appName === AppName.SAGE300 && formGroup.get('source_field')?.value === 'PROJECT') {
this.form.controls.isDependentImportEnabled.setValue(true);
}
if (!event.checked && this.appName === AppName.SAGE300) {
formGroup?.get('import_code')?.clearValidators();
}
if (this.appName === AppName.SAGE300 && formGroup.get('source_field')?.value) {
this.onImportToFyleToggleChange(event, formGroup?.get('destination_field')?.value);
}
}

onImportToFyleToggleChange(event: any, destinationField: string): void {
Expand Down

0 comments on commit 6c2d7b2

Please sign in to comment.