diff --git a/alcs-frontend/src/app/features/admin/decision-condition-types/decision-condition-types-dialog/decision-condition-types-dialog.component.ts b/alcs-frontend/src/app/features/admin/decision-condition-types/decision-condition-types-dialog/decision-condition-types-dialog.component.ts index 1830a2e6f..98f872545 100644 --- a/alcs-frontend/src/app/features/admin/decision-condition-types/decision-condition-types-dialog/decision-condition-types-dialog.component.ts +++ b/alcs-frontend/src/app/features/admin/decision-condition-types/decision-condition-types-dialog/decision-condition-types-dialog.component.ts @@ -202,12 +202,12 @@ export class DecisionConditionTypesDialogComponent { hasAdminFee( conditions: Partial[] | Partial[], ): boolean { - return conditions.map((c) => c.administrativeFee).filter((f) => f !== null).length > 0; + return conditions.map((c) => c.administrativeFee).filter((f) => f !== null && f !== undefined && f > 0).length > 0; } hasSecurityAmount( conditions: Partial[] | Partial[], ): boolean { - return conditions.map((c) => c.securityAmount).filter((f) => f !== null).length > 0; + return conditions.map((c) => c.securityAmount).filter((f) => f !== null && f !== undefined && f > 0).length > 0; } } diff --git a/alcs-frontend/src/app/features/admin/decision-condition-types/decision-condition-types.component.ts b/alcs-frontend/src/app/features/admin/decision-condition-types/decision-condition-types.component.ts index c6e10de47..569ffd63a 100644 --- a/alcs-frontend/src/app/features/admin/decision-condition-types/decision-condition-types.component.ts +++ b/alcs-frontend/src/app/features/admin/decision-condition-types/decision-condition-types.component.ts @@ -80,7 +80,7 @@ export class DecisionConditionTypesComponent implements OnInit { conditionService: this.conditionService, content: dto, existingCodes: this.decisionConditionTypeCodeDtos, - existingDescriptions: this.decisionConditionTypeDescriptionDtos, + existingDescriptions: this.decisionConditionTypeDescriptionDtos.filter((d) => d !== dto.description), }, }); dialog.beforeClosed().subscribe(async (result) => {