X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=FS%2FFS%2Fcust_main.pm;h=57d598a74428da36d6821ddb912a6ccd340c4e48;hb=02d73ef84103d6bdaf49e6a179a0ad46f9719d25;hp=10433ed95eec1dcd0ca2e782dcb298c6aeb9a261;hpb=01776c9e52c63662403dcb19155ffe3bc8a035ee;p=freeside.git diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index 10433ed95..57d598a74 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -3175,6 +3175,32 @@ sub contact_list_email_destinations { }); } +=item contact_list_name_phones + +Returns a list of contact phone numbers. +{ phonetypenum => '1', phonenum => 'xxxxxxxxxx', first => 'firstname', last => 'lastname', countrycode => '1' } + +=cut + +sub contact_list_name_phones { + my $self = shift; + my $phone_type = shift; + + warn "$me contact_list_phones" if $DEBUG; + + return () if !$self->custnum; # not yet inserted + return map { $_ } + qsearch({ + table => 'cust_contact', + select => 'phonetypenum, phonenum, first, last, countrycode', + addl_from => ' JOIN contact USING (contactnum) '. + ' JOIN contact_phone USING (contactnum)', + hashref => { 'custnum' => $self->custnum, 'phonetypenum' => $phone_type, }, + order_by => 'ORDER BY custcontactnum DESC', + extra_sql => '', + }); +} + =item contact_list_emailonly Returns an array of hashes containing the emails. Used for displaying contact email field in advanced customer reports.