From 9345ef0c1dee1e29114e5c3c21db8b9fe39d456b Mon Sep 17 00:00:00 2001 From: Harry Linrui XU <xulr0820@hotmail.com> Date: Mon, 17 Apr 2023 11:20:47 +0200 Subject: [PATCH] Updated method for calculating balance --- .../no/ntnu/idatt1002/demo/data/Economics/Overview.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/no/ntnu/idatt1002/demo/data/Economics/Overview.java b/src/main/java/no/ntnu/idatt1002/demo/data/Economics/Overview.java index b6737378..e9433046 100644 --- a/src/main/java/no/ntnu/idatt1002/demo/data/Economics/Overview.java +++ b/src/main/java/no/ntnu/idatt1002/demo/data/Economics/Overview.java @@ -77,12 +77,12 @@ public class Overview { } /** - * Method for updating the total revenue - * by taking the total sum of the income register + * Method for updating the total balance + * by taking the max amount of the budget * minus the total sum of the expense register. */ public void updateBalance(){ - balance = incomeRegister.getTotalSum() - expenseRegister.getTotalSum(); + balance = budget.getMaxAmount() - expenseRegister.getTotalSum(); } /** -- GitLab