user balance function
Hello, i have a question about calculation user's current balance. There is a function getBalance in UserBL.java source file:
public BigDecimal getBalance(Integer userId) {
return new InvoiceDAS().findTotalBalanceByUser(userId).subtract(
new PaymentDAS().findTotalBalanceByUser(userId));
}
As i can see it calculates invoices sum, payments sum (minus refunds) and then returns (InvoicesSum - PaymentsSum).
So if some user paid more then invoices sum it returns negative value. But balance should be positive, shouldn't it? Please help me to figure it out, thanks!
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by Musaddique on 14 Nov, 2014 04:35 AM
user balance in jbilling is the amount that user need to pay. think from company point of view. so iif user paid extra amount so it will return the amount in negative value.
thanks
2 Posted by eugene.k on 14 Nov, 2014 08:22 AM
Thanks a lot!
Support Staff 3 Posted by Technical Suppo... on 08 Jan, 2015 05:39 AM
Hello eugene.k
Please let us know if you face this issue again .
Thank you,
Technical Support Team.
Technical Support closed this discussion on 08 Jan, 2015 05:39 AM.