Sales Graphs - Meaning of Budget - SOLVED
SalesGraph.php
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,
periods.lastdate_in_period,
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
https://www.linkedin.com/in/eclipsepaulbecker
|