diff options
author | Christopher Burger <burgerc@freeside.biz> | 2019-05-22 12:58:05 -0400 |
---|---|---|
committer | Christopher Burger <burgerc@freeside.biz> | 2019-05-23 07:46:10 -0400 |
commit | a11b765362c56117c4b944096184e3e3e55bffac (patch) | |
tree | 2a89d27c156ee191e9b97842cf332b56df37f5b1 /FS/FS/UI | |
parent | 788f8cf0e36811291a9ce0e1cfab833caa4c4cf5 (diff) |
RT 77532 - added contact phone numbers to advanced customer report
Conflicts:
FS/FS/ConfDefaults.pm
FS/FS/cust_main.pm
Diffstat (limited to 'FS/FS/UI')
-rw-r--r-- | FS/FS/UI/Web.pm | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/FS/FS/UI/Web.pm b/FS/FS/UI/Web.pm index 158a855..edd3ca8 100644 --- a/FS/FS/UI/Web.pm +++ b/FS/FS/UI/Web.pm @@ -7,7 +7,7 @@ use Carp qw( confess ); use HTML::Entities; use FS::Conf; use FS::Misc::DateTime qw( parse_datetime day_end ); -use FS::Record qw(dbdef); +use FS::Record qw(dbdef qsearch); use FS::cust_main; # are sql_balance and sql_date_balance in the right module? #use vars qw(@ISA); @@ -354,6 +354,25 @@ sub cust_header { $header2method{'Cust#'} = 'display_custnum' if $conf->exists('cust_main-default_agent_custid'); +foreach my $phone_type ( qsearch({table=>'phone_type', order_by=>'weight'}) ) { + $header2method{'Contact '.$phone_type->typename.' phone(s)'} = sub { + my $self = shift; + my $num = $phone_type->phonetypenum; + + my @phones; + foreach ($self->contact_list_name_phones) { + my $data = [ + { + 'data' => $_->first.' '.$_->last.' '.FS::contact_phone::phonenum_pretty($_), + }, + ]; + push @phones, $data if $_->phonetypenum eq $phone_type->phonetypenum; + } + return \@phones; + }; + +} + my %header2colormethod = ( 'Cust. Status' => 'cust_statuscolor', ); |