X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=site_perl%2Fcust_pkg.pm;h=5640e24b6bf4a011e92aef982748f2a68579bf08;hb=d02ed4f82fa0394ee74ec92954524655ad605c8f;hp=7dc5aa7ecd994f960e1ad4aeed1c079cadb5f43b;hpb=693939e7879f77a52b9e482a0f6bf2e80f8f7020;p=freeside.git diff --git a/site_perl/cust_pkg.pm b/site_perl/cust_pkg.pm index 7dc5aa7ec..5640e24b6 100644 --- a/site_perl/cust_pkg.pm +++ b/site_perl/cust_pkg.pm @@ -6,6 +6,8 @@ use Exporter; use FS::UID qw(getotaker); use FS::Record qw(fields qsearch qsearchs); use FS::cust_svc; +use FS::part_pkg; +use FS::cust_main; @ISA = qw(FS::Record Exporter); @@ -34,6 +36,8 @@ FS::cust_pkg - Object methods for cust_pkg objects $error = $record->unsuspend; + $part_pkg = $record->part_pkg; + $error = FS::cust_pkg::order( $custnum, \@pkgparts ); $error = FS::cust_pkg::order( $custnum, \@pkgparts, \@remove_pkgnums ] ); @@ -121,7 +125,7 @@ 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. +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 L). @@ -138,8 +142,8 @@ sub replace { return "(Old) Not a cust_pkg record!" if $old->table ne "cust_pkg"; return "Can't change pkgnum!" if $old->getfield('pkgnum') ne $new->getfield('pkgnum'); - return "Can't (yet?) change pkgpart!" - if $old->getfield('pkgpart') ne $new->getfield('pkgpart'); + #return "Can't (yet?) change pkgpart!" + # if $old->getfield('pkgpart') ne $new->getfield('pkgpart'); return "Can't change otaker!" if $old->getfield('otaker') ne $new->getfield('otaker'); return "Can't change setup once it exists!" @@ -356,6 +360,18 @@ sub unsuspend { ''; #no errors } +=item part_pkg + +Returns the definition for this billing item, as an FS::part_pkg object (see +L $self->pkgpart }); +} + =back =head1 SUBROUTINES @@ -477,6 +493,10 @@ sub order { =back +=head1 VERSION + +$Id: cust_pkg.pm,v 1.3 1998-11-15 13:01:35 ivan Exp $ + =head1 BUGS It doesn't properly override FS::Record yet. @@ -501,6 +521,14 @@ fixed for new agent->agent_type->type_pkgs in &order ivan@sisd.com 98-mar-7 pod ivan@sisd.com 98-sep-21 +$Log: cust_pkg.pm,v $ +Revision 1.3 1998-11-15 13:01:35 ivan +allow pkgpart changing (for per-customer custom pricing). warn about it in doc + +Revision 1.2 1998/11/12 03:42:45 ivan +added label method + + =cut 1;