- my( $self, $custnum_or_cust_main, $requestors ) = @_;
-
- my( $custnum, $cust_main );
- if ( ref($custnum_or_cust_main) ) {
- $cust_main = $custnum_or_cust_main;
- $custnum = $cust_main->custnum;
- } else {
- $custnum = $custnum_or_cust_main;
- $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } );
+ # my( $self, $custnum_or_cust_main, $requestors ) = @_;
+ # no longer takes $custnum--it must be an object
+ my ( $self, $object, $requestors ) = @_;
+ my $cust_main; # for default requestors
+ if ( $object->isa('FS::cust_main') ) {
+ $cust_main = $object;
+ }
+ elsif ( $object->isa('FS::svc_Common') ) {
+ $object = $object->cust_svc;
+ $cust_main = $object->cust_pkg->cust_main if ( $object->cust_pkg );