X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=htdocs%2Fdocs%2Fman%2FFS%2Fcust_pkg.html;fp=htdocs%2Fdocs%2Fman%2FFS%2Fcust_pkg.html;h=19c8ff8423b5245a71658170605285b6d910f883;hp=d7659f0ceb989b4641d622fd2803aec16551567b;hb=f3235d39d083518d47f21cd5585e5f9a13070763;hpb=ece31063b782031e21ba1f57476afab555af5363 diff --git a/htdocs/docs/man/FS/cust_pkg.html b/htdocs/docs/man/FS/cust_pkg.html index d7659f0ce..19c8ff842 100644 --- a/htdocs/docs/man/FS/cust_pkg.html +++ b/htdocs/docs/man/FS/cust_pkg.html @@ -1,253 +1,204 @@
-
-FS::cust_pkg - Object methods for cust_pkg objects - +
FS::cust_pkg - Object methods for cust_pkg objects
-
use FS::cust_pkg; --
-
$record = new FS::cust_pkg \%hash; - $record = new FS::cust_pkg { 'column' => 'value' }; --
-
$error = $record->insert; --
-
$error = $new_record->replace($old_record); --
-
$error = $record->delete; --
-
$error = $record->check; --
-
$error = $record->cancel; --
-
$error = $record->suspend; --
-
$error = $record->unsuspend; --
-
$part_pkg = $record->part_pkg; --
-
@labels = $record->labels; --
-
$error = FS::cust_pkg::order( $custnum, \@pkgparts ); - $error = FS::cust_pkg::order( $custnum, \@pkgparts, \@remove_pkgnums ] ); -+
+ use FS::cust_pkg;+
+ $record = new FS::cust_pkg \%hash; + $record = new FS::cust_pkg { 'column' => 'value' };+
+ $error = $record->insert;+
+ $error = $new_record->replace($old_record);+
+ $error = $record->delete;+
+ $error = $record->check;+
+ $error = $record->cancel;+
+ $error = $record->suspend;+
+ $error = $record->unsuspend;+
+ $part_pkg = $record->part_pkg;+
+ @labels = $record->labels;+
+ $error = FS::cust_pkg::order( $custnum, \@pkgparts ); + $error = FS::cust_pkg::order( $custnum, \@pkgparts, \@remove_pkgnums ] );
-An FS::cust_pkg object represents a customer billing item. FS::cust_pkg -inherits from FS::Record. The following fields are currently supported: - +
An FS::cust_pkg object represents a customer billing item. FS::cust_pkg +inherits from FS::Record. The following fields are currently supported:
-Note: setup, bill, susp, expire and cancel are specified as UNIX -timestamps; see perlfunc. Also see Time::Local and Date::Parse for conversion functions. - +
Note: setup, bill, susp, expire and cancel are specified as UNIX timestamps; +see perlfunc/``time''. Also see the Time::Local manpage and the Date::Parse manpage for +conversion functions.
-Create a new billing item. To add the item to the database, see insert. - -
-Adds this billing item to the database (``Orders'' the item). If there is -an error, returns the error, otherwise returns false. - -
-sub insert { my $self
= shift;
-
-
-
# custnum might not have have been defined in sub check (for one-shot new - # customers), so check it here instead --
-
my $error = $self->ut_number('custnum'); - return $error if $error --
-
return "Unknown customer" - unless qsearchs( 'cust_main', { 'custnum' => $self->custnum } ); --
-
$self->SUPER::insert; --
-} - -
-Currently unimplemented. You don't want to delete billing items, because -there would then be no record the customer ever purchased the item. -Instead, see the cancel method. - -
-Replaces the OLD_RECORD with this one in the database. If there is an +
-Currently, custnum, setup, bill, susp, expire, and cancel may be changed. - -
-Changing pkgpart may have disasterous effects. See the order subroutine. - -
-setup and bill are normally updated by calling the bill method of a -customer object (see FS::cust_main). - -
-suspend is normally updated by the suspend and unsuspend methods. - -
-cancel is normally updated by the cancel method (and also the order -subroutine in some cases). - -
-Checks all fields to make sure this is a valid billing item. If there is an -error, returns the error, otherwise returns false. Called by the insert and +
sub insert { + my $self = shift;
++ # custnum might not have have been defined in sub check (for one-shot new + # customers), so check it here instead+
+ my $error = $self->ut_number('custnum'); + return $error if $error+
+ return "Unknown customer" + unless qsearchs( 'cust_main', { 'custnum' => $self->custnum } );+
+ $self->SUPER::insert;+
}
+ +Currently, custnum, setup, bill, susp, expire, and cancel may be changed.
+Changing pkgpart may have disasterous effects. See the order subroutine.
+setup and bill are normally updated by calling the bill method of a customer +object (see the FS::cust_main manpage).
+suspend is normally updated by the suspend and unsuspend methods.
+cancel is normally updated by the cancel method (and also the order subroutine +in some cases).
+ +-Cancels and removes all services (see FS::cust_svc and FS::part_svc) in this package, then cancels the package itself (sets the cancel field -to now). - -
-If there is an error, returns the error, otherwise returns false. - -
-Suspends all services (see FS::cust_svc and FS::part_svc) in this package, then suspends the package itself (sets the susp field to +
+-If there is an error, returns the error, otherwise returns false. - -
-Unsuspends all services (see FS::cust_svc and FS::part_svc) in this package, then unsuspends the package itself (clears the susp -field). - -
-If there is an error, returns the error, otherwise returns false. - -
-Returns the definition for this billing item, as an FS::part_pkg object -(see -FS::part_pkg). - -
-Returns a list of lists, calling the label method for all services (see FS::cust_svc) of this billing item. - -
If there is an error, returns the error, otherwise returns false.
+ +If there is an error, returns the error, otherwise returns false.
+ +If there is an error, returns the error, otherwise returns false.
+ +
-CUSTNUM is a customer (see FS::cust_main) - -
-PKGPARTS is a list of pkgparts specifying the the billing item definitions -(see -FS::part_pkg) to order for this customer. Duplicates are of course permitted. - -
-REMOVE_PKGNUMS is an optional list of pkgnums specifying the billing items -to remove for this customer. The services (see FS::cust_svc) are moved to the new billing items. An error is returned if this is not -possible (see -FS::pkg_svc). - -
PKGPARTS is a list of pkgparts specifying the the billing item definitions (see +the FS::part_pkg manpage) to order for this customer. Duplicates are of course +permitted.
+REMOVE_PKGNUMS is an optional list of pkgnums specifying the billing items to +remove for this customer. The services (see the FS::cust_svc manpage) are moved to the +new billing items. An error is returned if this is not possible (see +the FS::pkg_svc manpage).
+
-$Id: cust_pkg.html,v 1.2 2000-03-03 18:22:43 ivan Exp $ - +
$Id: cust_pkg.html,v 1.3 2001-04-23 12:40:31 ivan Exp $
-sub order is not OO. Perhaps it should be moved to FS::cust_main and made -so? - -
-In sub order, the @pkgparts
array (passed by reference) is
-clobbered.
-
-
-Also in sub order, no money is adjusted. Once FS::part_pkg defines a -standard method to pass dates to the recur_prog expression, it should do -so. - -
-FS::svc_acct, FS::svc_acct_sm, and FS::svc_domain are loaded via 'use' at +
sub order is not OO. Perhaps it should be moved to FS::cust_main and made so?
+In sub order, the @pkgparts array (passed by reference) is clobbered.
+Also in sub order, no money is adjusted. Once FS::part_pkg defines a standard +method to pass dates to the recur_prog expression, it should do so.
+FS::svc_acct, FS::svc_acct_sm, and FS::svc_domain are loaded via 'use' at compile time, rather than via 'require' in sub { setup, suspend, unsuspend, cancel } because they use %FS::UID::callback to load configuration values. Probably need a subroutine which decides what to do based on whether or not -we've fetched the user yet, rather than a hash. See FS::UID and the TODO. - +we've fetched the user yet, rather than a hash. See FS::UID and the TODO.
-FS::Record, FS::cust_main, FS::part_pkg, FS::cust_svc -, FS::pkg_svc, schema.html from the base documentation +
the FS::Record manpage, the FS::cust_main manpage, the FS::part_pkg manpage, the FS::cust_svc manpage +, the FS::pkg_svc manpage, schema.html from the base documentation