X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_main.pm;h=83487e40352e52782975abb527cef9c74cdd7bdf;hb=45c6b7021b30c49742b578a2f3ba13fb35f5222c;hp=4973f690da2ffa50e018f45a5787a268dc0a4648;hpb=cf49d3c860a2000cfc23a0e0db472a7d6fc58935;p=freeside.git diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index 4973f690d..83487e403 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -1955,6 +1955,28 @@ sub cust_location { qsearch('cust_location', { 'custnum' => $self->custnum } ); } +=item location_label_short + +Returns the short label of the service location (see analog in L) for this customer. + +=cut + +# false laziness with FS::cust_location::line_short + +sub location_label_short { + my $self = shift; + my $cydefault = FS::conf->new->config('countrydefault') || 'US'; + + my $line = $self->address1; + #$line .= ', '. $self->address2 if $self->address2; + $line .= ', '. $self->city; + $line .= ', '. $self->state if $self->state; + $line .= ' '. $self->zip if $self->zip; + $line .= ' '. code2country($self->country) if $self->country ne $cydefault; + + $line; +} + =item ncancelled_pkgs [ EXTRA_QSEARCH_PARAMS_HASHREF ] Returns all non-cancelled packages (see L) for this customer. @@ -2016,6 +2038,9 @@ sub _cust_pkg { # This should be generalized to use config options to determine order. sub sort_packages { + my $locationsort = $a->locationnum <=> $b->locationnum; + return $locationsort if $locationsort; + if ( $a->get('cancel') xor $b->get('cancel') ) { return -1 if $b->get('cancel'); return 1 if $a->get('cancel'); @@ -2357,9 +2382,11 @@ sub classname { =item bill_and_collect Cancels and suspends any packages due, generates bills, applies payments and -cred +credits, and applies collection events to run cards, send bills and notices, +etc. -Warns on errors (Does not currently: If there is an error, returns the error, otherwise returns false.) +By default, warns on errors and continues with the next operation (but see the +"fatal" flag below). Options are passed as name-value pairs. Currently available options are: @@ -2385,6 +2412,12 @@ Used in conjunction with the I