|
|
|
@ -260,6 +260,17 @@ export class CreateOrUpdateActivityDialog implements OnDestroy {
|
|
|
|
|
this.activityForm.controls['currency'].setValue(currency);
|
|
|
|
|
this.activityForm.controls['currencyOfFee'].setValue(currency);
|
|
|
|
|
this.activityForm.controls['currencyOfUnitPrice'].setValue(currency);
|
|
|
|
|
|
|
|
|
|
if (['FEE', 'INTEREST'].includes(type)) {
|
|
|
|
|
if (this.activityForm.controls['accountId'].value) {
|
|
|
|
|
this.activityForm.controls['updateAccountBalance'].enable();
|
|
|
|
|
} else {
|
|
|
|
|
this.activityForm.controls['updateAccountBalance'].disable();
|
|
|
|
|
this.activityForm.controls['updateAccountBalance'].setValue(
|
|
|
|
|
false
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
@ -374,8 +385,15 @@ export class CreateOrUpdateActivityDialog implements OnDestroy {
|
|
|
|
|
this.activityForm.controls['unitPriceInCustomCurrency'].setValue(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.activityForm.controls['updateAccountBalance'].disable();
|
|
|
|
|
this.activityForm.controls['updateAccountBalance'].setValue(false);
|
|
|
|
|
if (
|
|
|
|
|
['FEE', 'INTEREST'].includes(type) &&
|
|
|
|
|
this.activityForm.controls['accountId'].value
|
|
|
|
|
) {
|
|
|
|
|
this.activityForm.controls['updateAccountBalance'].enable();
|
|
|
|
|
} else {
|
|
|
|
|
this.activityForm.controls['updateAccountBalance'].disable();
|
|
|
|
|
this.activityForm.controls['updateAccountBalance'].setValue(false);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
this.activityForm.controls['accountId'].setValidators(
|
|
|
|
|
Validators.required
|
|
|
|
|