#resolved by performing a change package instead (which unprovisions) and
#later cancelling
if ( !$options{nobill} && !$date && $conf->exists('bill_usage_on_cancel') ) {
+ my $copy = $self->new({$self->hash});
my $error =
- $self->cust_main->bill( pkg_list => [ $self ], cancel => 1 );
+ $copy->cust_main->bill( pkg_list => [ $copy ], cancel => 1 );
warn "Error billing during cancel, custnum ".
#$self->cust_main->custnum. ": $error"
": $error"
if ( $num > $max_same_services ) {
push @labels, "$label ($num)";
} else {
- push @labels, map { "$label: $_" } @values;
+ if ( $conf->exists('cust_bill-consolidate_services') ) {
+ # push @labels, "$label: ". join(', ', @values);
+ while ( @values ) {
+ my $detail = "$label: ";
+ $detail .= shift(@values). ', '
+ while @values && length($detail.$values[0]) < 78;
+ $detail =~ s/, $//;
+ push @labels, $detail;
+ }
+ } else {
+ push @labels, map { "$label: $_" } @values;
+ }
}
}
"cust_main.agentnum = $1";
}
+ ##
+ # parse custnum
+ ##
+
+ if ( $params->{'custnum'} =~ /^(\d+)$/ and $1 ) {
+ push @where,
+ "cust_pkg.custnum = $1";
+ }
+
##
# parse status
##