graphs.pl shows how you can easily build graphs (bar,line,pie etc) on your sql-ledger data. The sample graph shows your sales per month in bar graph.
1. Install Perl module GD::Graph through cpan.
2. Download graphs.perl, rename to graphs.pl and copy to ./sql-ledger/bin/mozilla/ folder.
3. Create a gateway script in ./sql-ledger/ folder by copying any existing gateway script. For example:
$ cp gl.pl graphs.pl
4. Create or edit your custom_menu.ini and add the following lines:
[Custom Reports] [Custom Reports--Sales Graph] module=graphs.pl action=sales_search
5. Optionally run 'perl locale.pl' in your language folder if you are not using the default English language.
You are done.
graphs.pl consists of two procedures, 'sales_search' and 'sales_graph'.
sales_search displays a basic criteria form. Here you can specify the customer name to show sales by a particular customer as well as specify date range (if you have more than one year data in your dataset). Click the Continue button and sales_graph will display the actual graph.
To create more reports, just copy these two procedures (sales_search, sales_graph) within the same .pl file and rename them accordingly. Put your SQL statement and make other changes. A new graph should be ready within 5-15 minutes.