voxlinesystems CDRs and quantity bs
[freeside.git] / httemplate / view / svc_phone.cgi
1 <% include('elements/svc_Common.html',
2               'table'     => 'svc_phone',
3               'fields'    => [qw( countrycode phonenum pin )],
4               'labels'    => {
5                                'countrycode' => 'Country code',
6                                'phonenum'    => 'Phone number',
7                                'pin'         => 'PIN',
8                              },
9               'html_foot' => $html_foot,
10           )
11 %>
12 <%init>
13
14 my $html_foot = sub {
15   my $svc_phone = shift;
16
17   tie my %what, 'Tie::IxHash',
18     'pending' => 'NULL',
19     'billed'  => 'done',
20   ;
21
22   #XXX src & charged party (& default prefix) as per voip_cdr.pm
23   #XXX handle toll free too
24
25   my $number = $svc_phone->phonenum;
26
27   #my @links = map {
28   #  qq(<A HREF="${p}search/cdr.html?src=$number;freesidestatus=$what{$_}">).
29   #  "View $_ CDRs</A>";
30   #} keys(%what);
31   my @links = map {
32     qq(<A HREF="${p}search/cdr.html?charged_party=$number;freesidestatus=$what{$_}">).
33     "View $_ CDRs</A>";
34   } keys(%what);
35
36   join(' | ', @links). '<BR>';
37
38 };
39
40 </%init>