Skip to content

Commit e741faf

Browse files
committed
#1584 changed 'total owed' to 'currently owed' and fixed owed amount to be the currently owed amount
1 parent ba58ae6 commit e741faf

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

src/frontend/src/pages/FinancePage/RefundsSection.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,11 @@ const Refunds = ({ userReimbursementRequests, allReimbursementRequests }: Refund
7676
(accumulator: number, currentVal: Reimbursement) => accumulator + currentVal.amount,
7777
0
7878
);
79-
const totalOwed = displayedReimbursementRequests.reduce(
80-
(accumulator: number, currentVal: ReimbursementRequest) => accumulator + currentVal.totalCost,
81-
0
82-
);
79+
const totalOwed =
80+
displayedReimbursementRequests.reduce(
81+
(accumulator: number, currentVal: ReimbursementRequest) => accumulator + currentVal.totalCost,
82+
0
83+
) - totalReceived;
8384
const percentRefunded = (totalReceived / totalOwed) * 100;
8485

8586
const tabs = [{ label: 'My Refunds', value: 0 }];
@@ -98,7 +99,7 @@ const Refunds = ({ userReimbursementRequests, allReimbursementRequests }: Refund
9899
>
99100
<Box sx={{ display: 'flex', flexDirection: 'horizontal', justifyContent: 'space-between', paddingX: '30px' }}>
100101
<RefundHeader header="Total Received" data={`$${centsToDollar(totalReceived)}`} />
101-
<RefundHeader header="Total Owed" data={`$${centsToDollar(totalOwed)}`} />
102+
<RefundHeader header="Currently Owed" data={`$${centsToDollar(totalOwed)}`} />
102103
</Box>
103104
<NERProgressBar sx={{ margin: '20px' }} variant="determinate" value={percentRefunded} />
104105
<TableContainer component={Paper}>

0 commit comments

Comments
 (0)