+foreach my $phone_type ( FS::phone_type->get_phone_types() ) {
+ $header2method{'Contact '.$phone_type->typename.' phone(s)'} = sub {
+ my $self = shift;
+ my $num = $phone_type->phonetypenum;
+
+ my @phones;
+ foreach (FS::cust_main::contact_list_name_phones($self)) {
+ my $data = [
+ {
+ 'data' => $_->first.' '.$_->last.' '.FS::contact_phone::phonenum_pretty($_),
+ },
+ ];
+ push @phones, $data if $_->phonetypenum eq $phone_type->phonetypenum;
+ }
+ return \@phones;
+ };
+}
+