Account balance inaccuracy

My default currency is USD and all my customer accounts use the defauly currency with the exception of one - The gasoline station.

The gas station is in MXN and we pre-pay large amounts of gasoline and then each time we go and take gas we reduce the amount from the customer account. You can see this happening in the screenshot below:

As you can see, today the account is at exactly zero. So surely this should be 0 MXN and 0 USD (zero is zero).


When I use {ENTITY BALANCE:Customer} or {REPORT ENTITY DETAILS} the balance is listed as 1.85 USD… Any ideas why this might be?

OK, so looking at the Accounts table in SQL it seems that when I put the 20,0000 MXN in the account this was 1104.9724 USD (in the Debit column). The total sum of all the USD figures in the Credit column (in SQL, not in the screenshot above) adds up to 1106.8258 - Hence the 1.85 difference.

So how should I handle this difference? In MXN and in the account screens this balance will always show correctly, but it seems it will not show correctly when using Report tags.

Any tips?

Increase your Decimal places? I use 6 …

Or possibly use a Javascript Round function in your Report in an [expression] ?

You think that’s it and not the exchange rate changing over time?

I suppose it could be the XR during the time the Transaction is posted as opposed to the XR being used during Reporting.

It seems to me that the reports are going off the USD figures (debit and credit columns) and the account screen is going off the MXN figures (exchange column) exchange.

Do you think SambaPOS should handle this better, or should I just have to create SQL report tags and ignroe all the default report tags?

Your assumption is correct. The Account Screens use the Exchange column.

Hard to say, maybe. I suppose it would be nice for things like {ACCOUNT BALANCE}, {ENTITY BALANCE:X} to be using the Exchange column as well and/or be currency-aware.

I wouldn’t wait for this though. You might just want to build the Report in SQL, because I don’t think that type of change will happen soon, given Emre’s absence.

EDIT: come to think of it, none of the Report Tags are currency-aware. They all use Credit/Debit columns, AFAIK.

1 Like