@@ -5,7 +5,11 @@ import { useAllReimbursementRequests } from '../../hooks/finance.hooks';
55import { useSingleProject } from '../../hooks/projects.hooks' ;
66import { WbsNumber , ReimbursementRequest , WBSElementData , equalsWbsNumber , ReimbursementStatusType } from 'shared' ;
77import LoadingIndicator from '../../components/LoadingIndicator' ;
8- import { createReimbursementRequestRowData , cleanReimbursementRequestStatus } from '../../utils/reimbursement-request.utils' ;
8+ import {
9+ createReimbursementRequestRowData ,
10+ cleanReimbursementRequestStatus ,
11+ getCurrentReimbursementStatus
12+ } from '../../utils/reimbursement-request.utils' ;
913import NERDataGrid , { MapRowResult } from '../../components/NERDataGrid' ;
1014import { routes } from '../../utils/routes' ;
1115import { fullNamePipe , centsToDollar , datePipe } from '../../utils/pipes' ;
@@ -49,8 +53,9 @@ const ProjectSpendingHistory: React.FC<ProjectSpendingHistoryProps> = ({ wbsNum
4953
5054 const reimbursementRequests = useMemo ( ( ) => {
5155 if ( ! allReimbursementRequests || ! project ) return [ ] ;
52- return allReimbursementRequests . filter ( ( rr ) =>
53- rr . reimbursementProducts . some ( ( product ) => {
56+ return allReimbursementRequests . filter ( ( rr ) => {
57+ if ( getCurrentReimbursementStatus ( rr . reimbursementStatuses ) . type == 'DENIED' ) return false ; // exclude denied requests
58+ return rr . reimbursementProducts . some ( ( product ) => {
5459 const reason = product . reimbursementProductReason ;
5560 if ( ( reason as WBSElementData ) . wbsNum ) {
5661 return equalsWbsNumber (
@@ -59,8 +64,8 @@ const ProjectSpendingHistory: React.FC<ProjectSpendingHistoryProps> = ({ wbsNum
5964 ) ;
6065 }
6166 return false ;
62- } )
63- ) ;
67+ } ) ;
68+ } ) ;
6469 } , [ allReimbursementRequests , project , wbsNum ] ) ;
6570
6671 const budgetInfo = useMemo ( ( ) => {
0 commit comments