diff --git a/app/ui/LocationCard.tsx b/app/ui/LocationCard.tsx index 68a207c..7e9c613 100644 --- a/app/ui/LocationCard.tsx +++ b/app/ui/LocationCard.tsx @@ -15,7 +15,7 @@ export interface LocationCardProps { export const LocationCard:FC = ({location: { _id, name, yearMonth, bills }}) => { // sum all the billAmounts - const monthlyExpense = bills.reduce((acc, bill) => acc + (bill.payedAmount ?? 0), 0); + const monthlyExpense = bills.reduce((acc, bill) => bill.paid ? acc + (bill.payedAmount ?? 0) : acc, 0); return(