File tree Expand file tree Collapse file tree
src/app/loans/loans-view/loan-account-actions/update-discount Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919 >
2020 </ mifosx-input-amount >
2121
22+ < mat-form-field >
23+ < mat-label > {{ 'labels.inputs.Transaction Date' | translate }}</ mat-label >
24+ < input matInput [value] ="disbursementDate | dateFormat " readonly />
25+ </ mat-form-field >
26+
2227 < mat-form-field >
2328 < mat-label > {{ 'labels.inputs.External Id' | translate }}</ mat-label >
2429 < input matInput formControlName ="externalId " />
Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ export class UpdateDiscountComponent extends LoanAccountActionsBaseComponent imp
4848
4949 currency : Currency | null = null ;
5050 disbursementTransactionId : number = 0 ;
51+ disbursementDate : number [ ] | string | null = null ;
5152
5253 constructor ( ) {
5354 super ( ) ;
@@ -58,10 +59,13 @@ export class UpdateDiscountComponent extends LoanAccountActionsBaseComponent imp
5859 isSubmitting = false ;
5960
6061 ngOnInit ( ) : void {
61- if ( this . dataObject ?. content && this . dataObject ?. content . length > 0 ) {
62- const disburseTransaction = this . dataObject ?. content [ 0 ] ;
62+ const disburseTransaction = this . dataObject ?. content ?. find (
63+ ( transaction : any ) => transaction . type ?. disbursement && ! transaction . reversed
64+ ) ;
65+ if ( disburseTransaction ) {
6366 this . currency = disburseTransaction . currency ;
6467 this . disbursementTransactionId = disburseTransaction . id ;
68+ this . disbursementDate = disburseTransaction . transactionDate ;
6569 }
6670 this . updateDiscountForm = this . formBuilder . group ( {
6771 transactionAmount : [
You can’t perform that action at this time.
0 commit comments