NAME FS::cust_pkg - Object methods for cust_pkg objects SYNOPSIS use FS::cust_pkg; $record = create FS::cust_pkg \%hash; $record = create 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; $error = FS::cust_pkg::order( $custnum, \@pkgparts ); $error = FS::cust_pkg::order( $custnum, \@pkgparts, \@remove_pkgnums ] ); DESCRIPTION An FS::cust_pkg object represents a customer billing item. FS::cust_pkg inherits from FS::Record. The following fields are currently supported: pkgnum - primary key (assigned automatically for new billing items) custnum - Customer (see the FS::cust_main manpage) pkgpart - Billing item definition (see the FS::part_pkg manpage) setup - date bill - date susp - date expire - date cancel - date otaker - order taker (assigned automatically if null, see the FS::UID manpage) Note: setup, bill, susp, expire and cancel are specified as UNIX timestamps; see the section on "time" in the perlfunc manpage. Also see the Time::Local manpage and the Date::Parse manpage for conversion functions. METHODS create HASHREF Create a new billing item. To add the item to the database, see the section on "insert". insert Adds this billing item to the database ("Orders" the item). If there is an error, returns the error, otherwise returns false. delete 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. sub delete { return "Can't delete cust_pkg records!"; } replace OLD_RECORD Replaces the OLD_RECORD with this one in the database. If there is an error, returns the error, otherwise returns false. Currently, custnum, setup, bill, susp, expire, and cancel may be changed. pkgpart may not be changed, but 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). check 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 replace methods. cancel Cancels and removes all services (see the FS::cust_svc manpage and the FS::part_svc manpage) 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. suspend Suspends all services (see the FS::cust_svc manpage and the FS::part_svc manpage) in this package, then suspends the package itself (sets the susp field to now). If there is an error, returns the error, otherwise returns false. unsuspend Unsuspends all services (see the FS::cust_svc manpage and the FS::part_svc manpage) in this package, then unsuspends the package itself (clears the susp field). If there is an error, returns the error, otherwise returns false. part_pkg Returns the definition for this billing item, as an FS::part_pkg object (see Lagent_type->type_pkgs in &order ivan@sisd.com 98-mar-7 pod ivan@sisd.com 98-sep-21 $Log: cust_pkg.txt,v $ Revision 1.2 1998-11-13 09:56:40 ivan change configuration file layout to support multiple distinct databases (with own set of config files, export, etc.) Revision 1.2 1998/11/12 03:42:45 ivan added label method