From 12af08e945ac5c1f593d2bf9cf2d6df09f35228c Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 23 Mar 2009 17:03:03 +0000 Subject: [PATCH] add name (svc_acct.finger) to bulk billing detail, RT#3519 --- FS/FS/part_pkg/bulk.pm | 2 +- FS/FS/svc_Common.pm | 5 +++++ 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 63d344d6d..809559509 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 da1cfe135..869ab5831 100644 --- a/FS/FS/svc_Common.pm +++ b/FS/FS/svc_Common.pm @@ -151,6 +151,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 57ef615f9..fcd73ac3c 100644 --- a/FS/FS/svc_acct.pm +++ b/FS/FS/svc_acct.pm @@ -256,7 +256,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', @@ -446,8 +446,23 @@ sub label { $self->email(@_); } +=item label_long [ END_TIMESTAMP [ START_TIMESTAMP ] ] + +Returns a longer string label for this acccount ("Real Name " +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, -- 2.11.0