@@ -181,7 +181,14 @@ export class NarsV17_2ReportingService {
181181 . groupBy ( "request_type_id" )
182182 . sum ( "disbursed_amount as disbursed_amount" ) ;
183183
184- let ftLoan = otherFunds . find ( ( f ) => f . request_type_id == 4 ) ;
184+ let otherFunds2 = await db ( "sfa.funding_request" )
185+ . where ( { application_id : applicationId , assessment_id : app . id } )
186+ . join ( "sfa.disbursement" , "disbursement.funding_request_id" , "funding_request.id" )
187+ . select ( "request_type_id" )
188+ . groupBy ( "request_type_id" )
189+ . sum ( "disbursed_amount as disbursed_amount" ) ;
190+
191+ let ftLoan = otherFunds2 . find ( ( f ) => f . request_type_id == 4 ) ;
185192 let ftGrant = otherFunds . find ( ( f ) => f . request_type_id == 35 ) ;
186193 let ftDepGrant = otherFunds . find ( ( f ) => f . request_type_id == 32 ) ;
187194 let disGrant = otherFunds . find ( ( f ) => f . request_type_id == 29 ) ;
@@ -275,7 +282,7 @@ export class NarsV17_2ReportingService {
275282 row . push ( new Column ( "app_status" , app_status , " " , 1 ) ) ;
276283
277284 row . push ( new Column ( "assess_date" , moment . utc ( app . assessed_date ) . format ( "YYYYMMDD" ) , " " , 8 ) ) ;
278- row . push ( new Column ( "reasess_indicator" , app . assessment_type_id == 1 ? "0" : "4 " , " " , 1 ) ) ;
285+ row . push ( new Column ( "reasess_indicator" , app . assessment_type_id == 1 ? "0" : "8 " , " " , 1 ) ) ;
279286 row . push ( new Column ( "csl_auth_date" , moment . utc ( app . assessed_date ) . format ( "YYYYMMDD" ) , " " , 8 ) ) ;
280287
281288 row . push ( new Column ( "sin" , app . sin , " " , 9 ) ) ;
0 commit comments