diff options
-rw-r--r-- | FS/FS/part_pkg/bulk.pm | 2 | ||||
-rw-r--r-- | FS/FS/svc_Common.pm | 5 | ||||
-rw-r--r-- | FS/FS/svc_acct.pm | 17 |
3 files changed, 22 insertions, 2 deletions
diff --git a/FS/FS/part_pkg/bulk.pm b/FS/FS/part_pkg/bulk.pm index 44645b7..749f054 100644 --- a/FS/FS/part_pkg/bulk.pm +++ b/FS/FS/part_pkg/bulk.pm @@ -54,7 +54,7 @@ sub calc_recur { # END START foreach my $h_svc ( $cust_pkg->h_cust_svc( $$sdate, $last_bill ) ) { - my @label = $h_svc->label( $$sdate, $last_bill ); + my @label = $h_svc->label_long( $$sdate, $last_bill ); die "fatal: no historical label found, wtf?" unless scalar(@label); #? #my $svc_details = $label[0].': '. $label[1]. ': '; my $svc_details = $label[1]. ': '; diff --git a/FS/FS/svc_Common.pm b/FS/FS/svc_Common.pm index 87c2500..f8a8581 100644 --- a/FS/FS/svc_Common.pm +++ b/FS/FS/svc_Common.pm @@ -150,6 +150,11 @@ sub label { $self->svcnum; } +sub label_long { + my $self = shift; + $self->label(@_); +} + =item check Checks the validity of fields in this record. diff --git a/FS/FS/svc_acct.pm b/FS/FS/svc_acct.pm index 564f356..1a9e8f2 100644 --- a/FS/FS/svc_acct.pm +++ b/FS/FS/svc_acct.pm @@ -269,7 +269,7 @@ sub table_info { disable_inventory => 1, disable_select => 1, }, - 'finger' => 'Real name (GECOS)', + 'finger' => 'Real name', # (GECOS)', 'domsvc' => { label => 'Domain', #def_label => 'svcnum from svc_domain', @@ -448,8 +448,23 @@ sub label { $self->email(@_); } +=item label_long [ END_TIMESTAMP [ START_TIMESTAMP ] ] + +Returns a longer string label for this acccount ("Real Name <username@domain>" +if available, or "username@domain"). + +END_TIMESTAMP and START_TIMESTAMP can optionally be passed when dealing with +history records. + =cut +sub label_long { + my $self = shift; + ( $self->finger =~ /\S/ ) + ? $self->finger. ' <'.$self->label(@_).'>' + : $self->label(@_); +} + =item insert [ , OPTION => VALUE ... ] Adds this account to the database. If there is an error, returns the error, |