NAME
Business::ISP::Reports - Reporting system for the Business::ISP:: system.
VERSION
SYNOPSIS
# instantiate a new Report object
my $report = Business::ISP::Reports->new();
DESCRIPTION
This module contains the structure and function for most all reporting that happens within the Business::ISP:: System.
METHODS
income_by_payment_type({ type => TYPE, date => DATE })
Retrieves the data used for displaying financial reports aggregated by payment type.
TYPE is an optional parameter, where the valid values are uledger (for user ledger), and gledger (for general ledger). If not supplied, defaults to gledger.
DATE is an optional parameter, the day you want the data for, in the form YYYY-MM-DD. If not specified, yesterday's date will be used by default.
The parameters must be passed in within a hash reference if supplied.
Returns an array ref of hash references, each hash reference containing a single text field (payment_method) along with an array reference (entries), which contains a hash reference. Perfectly suitable for a nested TMPL_LOOP in the templating system.
income_by_item({ date => DATE, item => ITEM })
Sorts total revenue based on items.
DATE is an optional string scalar parameter in the form YYYY, YYYY-MM or YYYY-MM-DD. This is the timeframe that the aggregated totals will be for. If not passed in, yesterday's date will be used.
ITEM is an optional string scalar parameter. If supplied, only the total for this item will be included in the report data.
Returns an array reference that contains hash references, ideal for passing along into a template TMPL_LOOP.
unused_services({ hours => BOOL, error => ERROR, count => INT })
Reports on how many months or hours that the clients have purchased, but have not yet used.
If wanting a report on the clients who purchase blocks of hours, both the 'hours' and 'error' parameters are mandatory, passed in within a hash reference. BOOL must be set to a true value, and ERROR is an Business::ISP::Error object.
Otherwise, if reporting on the number of months outstanding to monthly clients, no parameters are necessary.
The 'count' parameter is mainly for testing. INT is an integer that represents the number of lines you want in the report.
In both cases, the return is an array reference, which contains two array references, each of those contain a single hash reference. This allows for easy integration into the templating system.
AUTHOR
Steve Bertrand, <steveb at cpan.org>
BUGS
Report bugs to <steveb at cpan.org>
. I will be notified, and will report back to you with any updates.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Business::ISP::Reports
COPYRIGHT & LICENSE
Copyright 2012 Steve Bertrand, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.