Skip to content

Commit

Permalink
fix: balance was reset if sold >= paid
Browse files Browse the repository at this point in the history
  • Loading branch information
RoinujNosde committed Sep 18, 2022
1 parent cc0ec9c commit f0ed4f7
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,11 @@ public void decrease(BigDecimal sold, BigDecimal received)
}

if (received.doubleValue() >= totalPaid.doubleValue()) {
totalPurchased = new BigDecimal(0);
totalPaid = new BigDecimal(0);
} else {
totalPurchased = totalPurchased.subtract(sold);
totalPaid = totalPaid.subtract(received);
}
totalPurchased = totalPurchased.subtract(sold);
}

/**
Expand Down

0 comments on commit f0ed4f7

Please sign in to comment.