Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dashboard showing false amounts owed
04-24-2015, 11:01 AM,
Dashboard showing false amounts owed
Have just finished completely transitioning one of our companies over to webERP. Love the system.

Ran into a slight problem on the dashboard -- random invoices (purchases and sales) are registering as being not yet paid *only on the dashboard* and cluttering the outstanding payables/receivables sections.

When I dug into the database, everything is paid and allocated correctly, as I expected, but it looks like there is a problem with certain orders that have long decimals (something like 1.258568809). When these are subtracted from each other, the decimal handling results in a tiny 'overdue' amount (0.0000000759).

QUESTION: Is there something (either an overlooked/misunderstood setting OR a mis-entry of the invoices, etc) that I'm overlooking that is causing this, or is it a known quirk? (I didn't see this particular problem mentioned on the forum)

POSSIBLE ANSWER: I wrapped all the SUM commands in the SQL queries in Dashboard.php in TRUNCATE(SUM(...),2) so that any irrelevant calculation-induced trailing decimal places were just cut off. This fixed the dashboard.

QUESTION 2: Can anybody see any problem with this approach?

Thank you all!

Timothy Snowden
Solid Rock Design Co.
04-24-2015, 11:27 PM,
RE: Dashboard showing false amounts owed
I don't see any issues with your approach. Where are you seeing or entering that many decimal places? What are you system settings for number of decimal places by currency?
Not sure if the problem has to do with you owing one amount with many decimals and paying another not quite exact amount or with this issue outlined at the link below on float precision:

Either way the dashboard already is doing some editing (like looking for > .004 instead of > 0) in some queries and also not displaying unless the locale format <> 0. So you are just doing the same thing in a different way.
However, if you plan on using more that 2 decimal places for some currencies you may wish consider another method.
Example (From A/R header section, shoudl be copied down to detail display section):
$DisplayDue = locale_number_format($AgedAnalysis['due']-$AgedAnalysis['overdue1'],$CurrDecimalPlaces);
$DisplayCurrent = locale_number_format($AgedAnalysis['balance']-$AgedAnalysis['due'],$CurrDecimalPlaces);
$DisplayBalance = locale_number_format($AgedAnalysis['balance'],$CurrDecimalPlaces);
$DisplayOverdue1 = locale_number_format($AgedAnalysis['overdue1']-$AgedAnalysis['overdue2'],$CurrDecimalPlaces);
$DisplayOverdue2 = locale_number_format($AgedAnalysis['overdue2'],$CurrDecimalPlaces);
if ($DisplayDue <> 0 OR $DisplayOverdue1 <> 0 OR $DisplayOverdue2 <> 0)
05-23-2015, 03:09 PM,
RE: Dashboard showing false amounts owed
Thank you for the reply and I apologize for the delay in responding.

I checked the currency settings - USD - and it is set to 2 decimal places.

I assumed the dashboard was doing editing, but like I said, it was showing ridiculously small amounts owed (0.000000007 and the like), until I applied this fix. If this isn't a problem for anyone else, I'm puzzled, but content with this solution for now.

If this is a problem, I'd be happy to forward the file for critique / review / inclusion if it would be of any help.

Thanks again!
Timothy Snowden
[i][url=]Solid Rock Design Co.[/url][/i]
09-26-2016, 11:19 PM,
RE: Dashboard showing false amounts owed
dear i need some help: in dashboard page Overdue Customer Balances is showing all 0 where i done many transaction.

But Supplier Invoices Due within 1 Month, Outstanding Orders all are showing transaction report.
09-27-2016, 12:07 PM,
RE: Dashboard showing false amounts owed
Not sure. More info would be needed.
Timothy Snowden
[i][url=]Solid Rock Design Co.[/url][/i]
09-28-2016, 01:24 AM,
RE: Dashboard showing false amounts owed
I ran into the same issue what I found is that it is due to sales taxes I assume you are in the US, what I found is that the sales tax was rounding to two decimal for the sales taxes you can look at table debtortrans alloc column should = ovamount+ovgst+ovfreight+ovdiscount.
I made several changes to resolve the issue I would need to look back at my notes to see all what I did.
I know it had to do with the sales taxes.
We are only using English for currency to correct all the settled transaction I ran an update script to fix the alloc amounts.

Forum Jump:

Users browsing this thread: 1 Guest(s)