diff --git a/src/app/products/charges/create-charge/create-charge.component.html b/src/app/products/charges/create-charge/create-charge.component.html index 3bad31816..6c6094d4a 100644 --- a/src/app/products/charges/create-charge/create-charge.component.html +++ b/src/app/products/charges/create-charge/create-charge.component.html @@ -167,14 +167,12 @@ * In saving case: Only for 1. charge time type is "withdrawlfee" or "savings no activity fee" with charge calculation type as "% amount" * In shares case: Only for charge time type: SHARE_PURCHASE and SHARE_REDEEM and with charge calculation type as % amount only --> - + {{"labels.inputs.Minimum Charge Cap" | translate}} - + {{"labels.inputs.Maximum Charge Cap" | translate}} diff --git a/src/app/products/charges/create-charge/create-charge.component.ts b/src/app/products/charges/create-charge/create-charge.component.ts index 98d01bb5c..9008ca9c6 100644 --- a/src/app/products/charges/create-charge/create-charge.component.ts +++ b/src/app/products/charges/create-charge/create-charge.component.ts @@ -138,6 +138,21 @@ export class CreateChargeComponent implements OnInit { }); } + showMinMaxCap(): boolean { + const chargeAppliesTo = this.chargeForm.controls.chargeAppliesTo.value; + const chargeCalculationType = this.chargeForm.controls.chargeCalculationType.value; + const chargeTimeType = this.chargeForm.controls.chargeTimeType.value; + + if (chargeAppliesTo === 1) { + return (chargeCalculationType === 2 || chargeCalculationType === 3 || chargeCalculationType === 4 || chargeCalculationType === 5); + } else if (chargeAppliesTo === 2) { + return (chargeTimeType === 16 || chargeTimeType === 5) && (chargeCalculationType === 2); + } else if (chargeAppliesTo === 4) { + return ((chargeTimeType === 14 || chargeTimeType === 15) && chargeCalculationType === 2); + } + return false; + } + /** * Sets the conditional controls of the user form */