@@ -92,7 +92,8 @@ export class MakeRepaymentComponent implements OnInit {
9292 ] ,
9393 externalId : '' ,
9494 paymentTypeId : '' ,
95- note : ''
95+ note : '' ,
96+ skipInterestRefund : [ false ]
9697 } ) ;
9798
9899 if ( this . isCapitalizedIncome ( ) ) {
@@ -157,6 +158,11 @@ export class MakeRepaymentComponent implements OnInit {
157158 ] . includes ( this . command ) ;
158159 }
159160
161+ showInterestRefundCheckbox ( ) : boolean {
162+ const code = this . dataObject ?. type ?. code ?. toLowerCase ( ) || '' ;
163+ return code . includes ( 'merchantissuedrefund' ) || code . includes ( 'payoutrefund' ) ;
164+ }
165+
160166 /** Submits the repayment form */
161167 submit ( ) {
162168 const repaymentLoanFormData = this . repaymentLoanForm . value ;
@@ -166,12 +172,16 @@ export class MakeRepaymentComponent implements OnInit {
166172 if ( repaymentLoanFormData . transactionDate instanceof Date ) {
167173 repaymentLoanFormData . transactionDate = this . dateUtils . formatDate ( prevTransactionDate , dateFormat ) ;
168174 }
169- const data = {
175+ const data : any = {
170176 ...repaymentLoanFormData ,
171177 dateFormat,
172178 locale
173179 } ;
174180 data [ 'transactionAmount' ] = data [ 'transactionAmount' ] * 1 ;
181+ if ( repaymentLoanFormData . skipInterestRefund ) {
182+ data . interestRefundCalculation = false ;
183+ }
184+ delete data . skipInterestRefund ;
175185 this . loanService . submitLoanActionButton ( this . loanId , data , this . command ) . subscribe ( ( response : any ) => {
176186 this . router . navigate ( [ '../../transactions' ] , { relativeTo : this . route } ) ;
177187 } ) ;
0 commit comments