Get_balance_on returns incorrect balance for accounts

I have a python script that uses this “get_balance_on” function to retrieve balances. I just now noticed that this incorrect balance is only returned for accounts. It’s fine for Employees, Suppliers and Customers.

How do I know what the correct balance is?

  • I checked the General Ledger and it holds the correct amount.

Is there a way to fix this? If not, is there a way I can create my own function to get the correct balance>