Freeside:4:Documentation:Developer/FS/h cust pkg
From Freeside
Contents
NAME
FS::h_cust_pkg - Historical record of customer package changes
SYNOPSIS
DESCRIPTION
An FS::h_cust_pkg object represents historical changes to packages. FS::h_cust_pkg inherits from FS::h_Common and FS::cust_pkg.
CLASS METHODS
- search HASHREF
- Like FS::cust_pkg::search, but adapted for searching historical records. Takes the additional parameter "date", which is the timestamp to perform the search "as of" (i.e. search the most recent insert or replace_new record for each pkgnum that is not later than that date).
- churn_fromwhere_sql STATUS, START, END
- Returns SQL fragments to do queries related to "package churn". STATUS is one of "active", "setup", "cancel", "susp", or "unsusp". These do NOT correspond directly to package statuses. START and END define a date range.
- - active: limit to packages that were active on START. END is ignored. - setup: limit to packages that were set up between START and END, except those created by package changes. - cancel: limit to packages that were canceled between START and END, except those changed into other packages. - susp: limit to packages that were suspended between START and END. - unsusp: limit to packages that were unsuspended between START and END.
- The logic of these may change in the future, especially with respect to package changes. Watch this space.
- Returns a list of: - a fragment usable as a FROM clause (without the keyword FROM), in which the package table is named or aliased to 'cust_pkg' - one or more conditions to include in the WHERE clause
as_of_sql DATE
Returns a qsearch hash for the instantaneous state of the cust_pkg table on DATE.
Currently accepts no restrictions; use it in a subquery if you want to limit or sort the output. (Restricting within the query is problematic.)
- status_query DATE
- Returns a statement for determining the status of packages on a particular past date.
BUGS
churn_fromwhere_sql and as_of_sql fail on MySQL.
SEE ALSO
FS::cust_pkg, FS::h_Common, FS::Record, schema.html from the base documentation.
POD ERRORS
Hey! The above document had some coding errors, which are explained below:
- Around line 180:
- You forgot a '=back' before '=head1'
- Around line 200:
- '=item' outside of any '=over'
- Around line 228:
- You forgot a '=back' before '=head1'