1 <SELECT NAME="<% $opt{'field_name'} %>" ID="<% $opt{'field_name'} %>">
3 <OPTION VALUE="" selected="selected">Select a phone number
5 % foreach $p (@$phone_types) {
6 <OPTION VALUE="<% $phones_formatted{$p} %>"><% $p |h%> (<% $cust_phones->$p |h %>)
14 my $cust_num = $opt{'cust_num'};
15 my $phone_types = $opt{'phone_types'};
16 my $format = $opt{'format'};
18 my $cust_phones = qsearchs('cust_main', { 'custnum' => $cust_num })
19 or die 'unknown custnum' . $cust_num;
21 my %phones_formatted = map {
22 $_ => format_phone_number($cust_phones->$_, $format)
25 sub format_phone_number {
27 if ($f eq 'xxxxxxxxxx') { $n =~ s/-//g; }