Skip to content

Commit

Permalink
Remove the field recalculationCompountFrequenceyDate from loan produc…
Browse files Browse the repository at this point in the history
…t request
  • Loading branch information
Jose Alberto Hernandez authored and Jose Alberto Hernandez committed Jul 19, 2022
1 parent 4a40b5e commit 2ee81f2
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,6 @@ export class CreateLoansAccountComponent implements OnInit {
loansAccountData.recalculationRestFrequencyDate = this.dateUtils.formatDate(this.loansAccount.recalculationRestFrequencyDate, dateFormat);
}

if (this.loansAccountProductTemplate.isInterestRecalculationEnabled) {
if (loansAccountData.recalculationCompoundingFrequencyDate !== null) {
loansAccountData.recalculationCompoundingFrequencyDate = this.dateUtils.formatDate(this.loansAccount.recalculationCompoundingFrequencyDate, dateFormat);
}
} else {
delete loansAccountData.recalculationCompoundingFrequencyDate;
}

if (loansAccountData.interestCalculationPeriodType === 0) {
loansAccountData.allowPartialPeriodInterestCalcualtion = false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,6 @@ export class EditLoansAccountComponent implements OnInit {
loansAccountData.recalculationRestFrequencyDate = this.dateUtils.formatDate(this.loansAccount.recalculationRestFrequencyDate, dateFormat);
}

if (this.loansAccountProductTemplate.isInterestRecalculationEnabled) {
if (loansAccountData.recalculationCompoundingFrequencyDate !== null) {
loansAccountData.recalculationCompoundingFrequencyDate = this.dateUtils.formatDate(this.loansAccount.recalculationCompoundingFrequencyDate, dateFormat);
}
} else {
delete loansAccountData.recalculationCompoundingFrequencyDate;
}

if (loansAccountData.interestCalculationPeriodType === 0) {
loansAccountData.allowPartialPeriodInterestCalcualtion = false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,18 +253,6 @@ <h4 fxFlex="98%" class="mat-h4">Moratorium</h4>
</mat-select>
</mat-form-field>

<mat-form-field fxFlex="48%" (click)="recalculationCompoundingFrequencyDatePicker.open()"
*ngIf="loansAccountProductTemplate.isInterestRecalculationEnabled && loansAccountProductTemplate.interestRecalculationData.interestRecalculationCompoundingType.id != 0 && loansAccountProductTemplate.interestRecalculationData.recalculationCompoundingFrequencyType.id != 1">
<mat-label>Frequency Date for recalculation</mat-label>
<input matInput [min]="minDate" [max]="maxDate" [matDatepicker]="recalculationCompoundingFrequencyDatePicker"
formControlName="recalculationCompoundingFrequencyDate">
<mat-datepicker-toggle matSuffix [for]="recalculationCompoundingFrequencyDatePicker"></mat-datepicker-toggle>
<mat-datepicker #recalculationCompoundingFrequencyDatePicker></mat-datepicker>
<mat-error *ngIf="loansAccountTermsForm.controls.recalculationCompoundingFrequencyDate.hasError('required')">
Frequency Data for recalculation is <strong>required</strong>
</mat-error>
</mat-form-field>

</ng-container>

<mat-divider fxFlex="98%"></mat-divider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,6 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges {
'repaymentsStartingFromDate': this.loansAccountTemplate.expectedFirstRepaymentOnDate && new Date(this.loansAccountTemplate.expectedFirstRepaymentOnDate)
});
}

if (this.loansAccountTemplate.isInterestRecalculationEnabled) {
this.loansAccountTermsForm.patchValue({
'recalculationCompoundingFrequencyDate': ''
});
}
}
this.createloansAccountTermsForm();
this.setCustomValidators();
Expand Down
2 changes: 1 addition & 1 deletion src/app/loans/loans.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ export class LoansService {
.set('staffInSelectedOfficeOnly', 'true');
httpParams = productId ? httpParams.set('productId', productId) : httpParams;
httpParams = isGroup ? httpParams.set('groupId', entityId)
.set('templateType', 'group') :
.set('templateType', 'group') :
httpParams.set('clientId', entityId)
.set('templateType', 'individual');
return this.http.get('/loans/template', { params: httpParams });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ export class LoanProductChargesStepComponent implements OnInit {

ngOnInit() {
this.chargeData = this.loanProductsTemplate.chargeOptions;
this.overdueChargeData = this.loanProductsTemplate.penaltyOptions.filter((penalty: any) => penalty.chargeTimeType.code === 'chargeTimeType.overdueInstallment');
this.overdueChargeData = this.loanProductsTemplate.penaltyOptions ?
this.loanProductsTemplate.penaltyOptions.filter((penalty: any) => penalty.chargeTimeType.code === 'chargeTimeType.overdueInstallment') :
[];

this.chargesDataSource = this.loanProductsTemplate.charges || [];
this.pristine = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,10 +387,6 @@ <h3 class="mat-h3" fxFlexFill>Interest Recalculation</h3>
<div fxFlexFill *ngIf="loanProduct.recalculationCompoundingFrequencyType !== 1" fxLayout="row wrap" fxLayout.lt-md="column">
<span fxFlex="40%">Frequency Interval for compounding:</span>
<span fxFlex="60%">{{ loanProduct.recalculationCompoundingFrequencyInterval }}</span>
<div fxFlexFill *ngIf="loanProduct.recalculationCompoundingFrequencyDate">
<span fxFlex="40%">Compounding Frequency Date:</span>
<span fxFlex="60%">{{ loanProduct.recalculationCompoundingFrequencyDate }}</span>
</div>
</div>
</div>
<div fxFlexFill fxLayout="row wrap" fxLayout.lt-md="column">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,10 +400,6 @@ <h3 class="mat-h3" fxFlexFill>Interest Recalculation</h3>
<div fxFlexFill *ngIf="loanProduct.interestRecalculationData.recalculationCompoundingFrequencyType.id !== 1" fxLayout="row wrap" fxLayout.lt-md="column">
<span fxFlex="40%">Frequency Interval for compounding:</span>
<span fxFlex="60%">{{ loanProduct.interestRecalculationData.recalculationCompoundingFrequencyInterval }}</span>
<div fxFlexFill *ngIf="loanProduct.recalculationCompoundingFrequencyDate">
<span fxFlex="40%">Compounding Frequency Date:</span>
<span fxFlex="60%">{{ loanProduct.interestRecalculationData.recalculationCompoundingFrequencyDate }}</span>
</div>
</div>
</div>
<div fxFlexFill fxLayout="row wrap" fxLayout.lt-md="column">
Expand Down

0 comments on commit 2ee81f2

Please sign in to comment.