Difference between revisions of "Freeside:3:Documentation:Developer/FS/Report/Table"

From Freeside
Jump to: navigation, search
m (Edit via perl MediaWiki framework (1.13))
 
m (Edit via perl MediaWiki framework (1.13))
Line 12: Line 12:
 
This returns a scalar value for foo, over the period from $startdate to $enddate, limited to agent $agentnum, subject to options in %opt.
 
This returns a scalar value for foo, over the period from $startdate to $enddate, limited to agent $agentnum, subject to options in %opt.
  
; signups: The number of customers signed up. Options are "refnum" (limit by advertising source) and "indirect" (boolean, tells us to limit to customers that have a referral_custnum that matches the advertising source).; invoiced: The total amount charged on all invoices.; netsales: invoiced - netcredits; cashflow: payments - refunds; netcashflow: payments - netrefunds; payments: The sum of payments received in the period.; credits: The sum of credits issued in the period.; refunds: The sum of refunds paid in the period.; netcredits: The sum of credit applications to invoices in the period.; receipts: The sum of payment applications to invoices in the period.; netrefunds: The sum of refund applications to credits in the period.; cust_pkg_setup_cost: The total setup costs of packages setup in the period
+
; signups: The number of customers signed up. Options are:
 +
:- cust_classnum: limit to this customer class - pkg_classnum: limit to customers with a package of this class. If this is an arrayref, it's an ANY match. - refnum: limit to this advertising source - indirect: boolean; limit to customers that have a referral_custnum that matches the advertising source
 +
; invoiced: The total amount charged on all invoices.; netsales: invoiced - netcredits; cashflow: payments - refunds; netcashflow: payments - netrefunds; payments: The sum of payments received in the period.; credits: The sum of credits issued in the period.; refunds: The sum of refunds paid in the period.; netcredits: The sum of credit applications to invoices in the period.; receipts: The sum of payment applications to invoices in the period.; netrefunds: The sum of refund applications to credits in the period.; cust_pkg_setup_cost: The total setup costs of packages setup in the period
 
:'classnum': limit to this package class.
 
:'classnum': limit to this package class.
 
; cust_pkg_recur_cust: the total recur costs of packages in the period
 
; cust_pkg_recur_cust: the total recur costs of packages in the period
Line 22: Line 24:
  
 
:'use_override': for line items generated by an add-on package, use the class of the add-on rather than the base package.
 
:'use_override': for line items generated by an add-on package, use the class of the add-on rather than the base package.
 
:'freq': limit to packages with this frequency. Currently uses the part_pkg frequency, so term discounted packages may give odd results.
 
  
 
:'distribute': for non-monthly recurring charges, ignore the invoice date. Instead, consider the line item's starting/ending dates. Determine the fraction of the line item duration that falls within the specified interval and return that fraction of the recurring charges. This is somewhat experimental.
 
:'distribute': for non-monthly recurring charges, ignore the invoice date. Instead, consider the line item's starting/ending dates. Determine the fraction of the line item duration that falls within the specified interval and return that fraction of the recurring charges. This is somewhat experimental.
Line 48: Line 48:
 
Hey! '''The above document had some coding errors, which are explained below:'''
 
Hey! '''The above document had some coding errors, which are explained below:'''
  
; Around line 793:
+
; Around line 942:
 
:You forgot a '=back' before '=head1'
 
:You forgot a '=back' before '=head1'

Revision as of 14:45, 27 June 2014

NAME

FS::Report::Table - Tables of report data

SYNOPSIS

See the more specific report objects, currently only FS::Report::Table::Monthly and FS::Report::Table::Daily.

OBSERVABLES

The common interface for an observable named 'foo' is:

$report->foo($startdate, $enddate, $agentnum, %options)

This returns a scalar value for foo, over the period from $startdate to $enddate, limited to agent $agentnum, subject to options in %opt.

signups: The number of customers signed up. Options are:
- cust_classnum: limit to this customer class - pkg_classnum: limit to customers with a package of this class. If this is an arrayref, it's an ANY match. - refnum: limit to this advertising source - indirect: boolean; limit to customers that have a referral_custnum that matches the advertising source
invoiced: The total amount charged on all invoices.; netsales: invoiced - netcredits; cashflow: payments - refunds; netcashflow: payments - netrefunds; payments: The sum of payments received in the period.; credits: The sum of credits issued in the period.; refunds: The sum of refunds paid in the period.; netcredits: The sum of credit applications to invoices in the period.; receipts: The sum of payment applications to invoices in the period.; netrefunds: The sum of refund applications to credits in the period.; cust_pkg_setup_cost: The total setup costs of packages setup in the period
'classnum': limit to this package class.
cust_pkg_recur_cust: the total recur costs of packages in the period
'classnum': limit to this package class.
cust_bill_pkg: the total package charges on invoice line items.
'charges': limit the type of charges included (setup, recur, usage). Should be a string containing one or more of 'S', 'R', or 'U'; if unspecified, defaults to all three.
'classnum': limit to this package class.
'use_override': for line items generated by an add-on package, use the class of the add-on rather than the base package.
'distribute': for non-monthly recurring charges, ignore the invoice date. Instead, consider the line item's starting/ending dates. Determine the fraction of the line item duration that falls within the specified interval and return that fraction of the recurring charges. This is somewhat experimental.
'project': enable if this is a projected period. This is very experimental.
cust_bill_pkg_detail: the total usage charges in detail lines.
Arguments as for cust_bill_pkg, plus:
'usageclass': limit to this usage class number.

METHODS

init_projection
Sets up for future projection of all observables on the report. Currently this is limited to 'cust_bill_pkg'.
extend_projection START END
Generates data for the next period of projection. This will be called for sequential periods where the END of one equals the START of the next (with no gaps).

BUGS

Documentation.

SEE ALSO

FS::Report::Table::Monthly, reports in the web interface.

POD ERRORS

Hey! The above document had some coding errors, which are explained below:

Around line 942:
You forgot a '=back' before '=head1'