webERP Forum

Full Version: Sales Graphs - Meaning of Budget - SOLVED
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

The graph generates a Budget Bar based upon the budgetoractual field in salesanalysis table but as far as I can see it has no correlation with GL budgets.

Is this correct? It seems then the Budget Bar will only show if budgetoractual field in salesanalysis table is set to "0" using Credit_Invoice.php?

Perhaps I don't understand how the Sales Graph is used?

Any help is greatly appreciated!

Below is SQL:
SELECT salesanalysis.periodno,
SUM(CASE WHEN budgetoractual=1 THEN amt ELSE 0 END) AS sales,
SUM(CASE WHEN budgetoractual=0 THEN amt ELSE 0 END) AS budget
FROM salesanalysis
INNER JOIN periods
ON salesanalysis.periodno=periods.periodno
WHERE salesanalysis.periodno>='1'
AND salesanalysis.periodno <= '14'
GROUP BY salesanalysis.periodno, periods.lastdate_in_period
ORDER BY salesanalysis.periodno
I believe I have found some explanation in the manual in that we must import this data into the DB manually, which makes sense given the granularity of the report versus that of the GL COA.

I will insert some data to test in the morning...

Okay... My OCD would not allow me to let it go so I tested it and it works as expected.

This is a VERY powerful and VERY useful webERP feature in my opinion.
Reference URL's