summaryrefslogtreecommitdiff
path: root/httemplate/browse
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/browse')
-rwxr-xr-xhttemplate/browse/agent.cgi22
-rwxr-xr-xhttemplate/browse/agent_type.cgi4
-rwxr-xr-xhttemplate/browse/cust_main_county.cgi47
-rw-r--r--httemplate/browse/part_device.html27
-rwxr-xr-xhttemplate/browse/part_pkg.cgi98
-rw-r--r--httemplate/browse/part_pkg_report_option.html28
-rw-r--r--httemplate/browse/part_pkg_taxclass.html27
-rwxr-xr-xhttemplate/browse/part_svc.cgi27
-rw-r--r--httemplate/browse/payment_gateway.html4
-rw-r--r--httemplate/browse/pkg_category.html6
-rw-r--r--httemplate/browse/rate_region.html59
-rwxr-xr-xhttemplate/browse/svc_acct_pop.cgi1
12 files changed, 296 insertions, 54 deletions
diff --git a/httemplate/browse/agent.cgi b/httemplate/browse/agent.cgi
index 0a516ed..1c06f1b 100755
--- a/httemplate/browse/agent.cgi
+++ b/httemplate/browse/agent.cgi
@@ -20,8 +20,6 @@ full offerings (via their type).<BR><BR>
% my $bgcolor1 = '#eeeeee';
% my $bgcolor2 = '#ffffff';
% my $bgcolor = '';
-%
-
<TR>
<TH CLASS="grid" BGCOLOR="#cccccc" COLSPAN=<% ( $cgi->param('showdisabled') || !dbdef->table('agent')->column('disabled') ) ? 2 : 3 %>>Agent</TH>
@@ -34,18 +32,17 @@ full offerings (via their type).<BR><BR>
<TH CLASS="grid" BGCOLOR="#cccccc">Reports</TH>
<TH CLASS="grid" BGCOLOR="#cccccc"><FONT SIZE=-1>Registration<BR>codes</FONT></TH>
<TH CLASS="grid" BGCOLOR="#cccccc">Prepaid cards</TH>
-% if ( $conf->config('ticket_system') ) {
+% if ( $conf->config('ticket_system') ) {
<TH CLASS="grid" BGCOLOR="#cccccc">Ticketing</TH>
% }
<TH CLASS="grid" BGCOLOR="#cccccc"><FONT SIZE=-1>Payment Gateway Overrides</FONT></TH>
<TH CLASS="grid" BGCOLOR="#cccccc"><FONT SIZE=-1>Configuration Overrides</FONT></TH>
</TR>
-%
+
%# <TH><FONT SIZE=-1>Agent #</FONT></TH>
%# <TH>Agent</TH>
-%
%foreach my $agent ( sort {
% #$a->getfield('agentnum') <=> $b->getfield('agentnum')
% $a->getfield('agent') cmp $b->getfield('agent')
@@ -61,9 +58,6 @@ full offerings (via their type).<BR><BR>
% } else {
% $bgcolor = $bgcolor1;
% }
-%
-%
-
<TR>
@@ -366,7 +360,7 @@ Unused
? ' for '. $override->taxclass. ' only'
: ''
%>
- <FONT SIZE=-1><A HREF="<%$p%>misc/delete-agent_payment_gateway.cgi?<% $override->agentgatewaynum %>">(delete)</A></FONT>
+ <FONT SIZE=-1><A HREF="javascript:areyousure('delete this payment gateway override', '<%$p%>misc/delete-agent_payment_gateway.cgi?<% $override->agentgatewaynum %>')">(delete)</A></FONT>
</TD>
</TR>
% }
@@ -386,7 +380,7 @@ Unused
<TR>
<TD>
- <% $override->name %>&nbsp;<FONT SIZE=-1><A HREF="<%$p%>config/config-delete.cgi?<% $override->confnum %>">(delete)</A></FONT>
+ <% $override->name %>&nbsp;<FONT SIZE=-1><A HREF="javascript:areyousure('delete this configuration override', '<%$p%>config/config-delete.cgi?confnum=<% $override->confnum %>')">(delete)</A></FONT>
</TD>
</TR>
% }
@@ -402,6 +396,14 @@ Unused
</TABLE>
+
+<SCRIPT TYPE="text/javascript">
+ function areyousure(what, href) {
+ if ( confirm("Are you sure you want to " + what + "?") == true )
+ window.location.href = href;
+ }
+</SCRIPT>
+
</BODY>
</HTML>
<%init>
diff --git a/httemplate/browse/agent_type.cgi b/httemplate/browse/agent_type.cgi
index d64ff18..f07a651 100755
--- a/httemplate/browse/agent_type.cgi
+++ b/httemplate/browse/agent_type.cgi
@@ -44,7 +44,9 @@ my $agent_type = shift;
[
{
#'data' => $part_pkg->pkg. ' - '. $part_pkg->comment,
- 'data' => $type_pkgs->pkg. ' - '. $type_pkgs->comment,
+ 'data' => $type_pkgs->pkg. ' - '.
+ ( $type_pkgs->custom ? '(CUSTOM) ' : '' ).
+ $type_pkgs->comment,
'align' => 'left',
'link' => $p. 'edit/part_pkg.cgi?'. $type_pkgs->pkgpart,
},
diff --git a/httemplate/browse/cust_main_county.cgi b/httemplate/browse/cust_main_county.cgi
index 736d7fd..232e688 100755
--- a/httemplate/browse/cust_main_county.cgi
+++ b/httemplate/browse/cust_main_county.cgi
@@ -23,10 +23,6 @@
'link_onclicks' => \@link_onclicks,
)
%>
-%
-% # <FONT SIZE=-1><A HREF="<% $p %>edit/process/cust_main_county-collapse.cgi?<% $hashref->{taxnum} %>">collapse state</A></FONT>
-% # % }
-%
<%once>
my $conf = new FS::Conf;
@@ -102,6 +98,17 @@ sub expand_link {
'</FONT>';
}
+sub collapse_link {
+ my %param = @_;
+
+ my $taxnum = $param{'row'}->taxnum;
+ my $url = "${p}edit/process/cust_main_county-collapse.cgi?$taxnum";
+ $url = "javascript:collapse_areyousure('$url')";
+
+ qq(<FONT SIZE="-1"><A HREF="$url">$param{'label'}</A></FONT>);
+}
+
+
sub separate_taxclasses_link {
my( $row ) = @_;
my $taxnum = $row->taxnum;
@@ -110,6 +117,8 @@ sub separate_taxclasses_link {
qq!<FONT SIZE="-1"><A HREF="$url">!;
}
+#un-separate taxclasses too
+
</%once>
<%init>
@@ -122,9 +131,18 @@ my $enable_taxclasses = $conf->exists('enable_taxclasses');
my @menubar;
-my $html_init =
- "Click on <u>add states</u> to specify a country's tax rates by state or province.
- <BR>Click on <u>add counties</u> to specify a state's tax rates by county.";
+my $html_init = <<END;
+ <SCRIPT>
+ function collapse_areyousure(href) {
+ if (confirm("Are you sure you want to remove all county tax rates for this state?") == true)
+ window.location.href = href;
+ }
+ </SCRIPT>
+
+ Click on <u>add states</u> to specify a country's tax rates by state or province.
+ <BR>Click on <u>add counties</u> to specify a state's tax rates by county, or <u>remove counties</u> to remove per-county tax rates.
+END
+
$html_init .= "<BR>Click on <u>separate taxclasses</u> to specify taxes per taxclass."
if $enable_taxclasses;
$html_init .= '<BR><BR>';
@@ -360,11 +378,16 @@ my @fields = (
)
)
},
- sub { $_[0]->county || '(all)&nbsp'.
- expand_link( desc => 'Add Counties',
- row => $_[0],
- label => 'add&nbsp;counties',
- )
+ sub { $_[0]->county
+ ? $_[0]->county. '&nbsp'.
+ collapse_link( label=> 'remove&nbsp;counties',
+ row => $_[0],
+ )
+ : '(all)&nbsp'.
+ expand_link( desc => 'Add Counties',
+ row => $_[0],
+ label => 'add&nbsp;counties',
+ );
},
);
diff --git a/httemplate/browse/part_device.html b/httemplate/browse/part_device.html
new file mode 100644
index 0000000..5c8fde3
--- /dev/null
+++ b/httemplate/browse/part_device.html
@@ -0,0 +1,27 @@
+<% include( 'elements/browse.html',
+ 'title' => 'Phone device types',
+ 'name' => 'phone device types',
+ 'menubar' => [ 'Add a new device type' =>
+ $p.'edit/part_device.html',
+ 'Import device types' =>
+ $p.'misc/part_device-import.html',
+ ],
+ 'query' => { 'table' => 'part_device', },
+ 'count_query' => 'SELECT COUNT(*) FROM part_device',
+ 'header' => [ '#', 'Device type' ],
+ 'fields' => [ 'devicepart',
+ 'devicename',
+ ],
+ 'links' => [ $link,
+ $link,
+ ],
+ )
+%>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
+my $link = [ "${p}edit/part_device.html?", 'devicepart' ];
+
+</%init>
diff --git a/httemplate/browse/part_pkg.cgi b/httemplate/browse/part_pkg.cgi
index 801c09f..c6cbb81 100755
--- a/httemplate/browse/part_pkg.cgi
+++ b/httemplate/browse/part_pkg.cgi
@@ -1,16 +1,17 @@
<% include( 'elements/browse.html',
'title' => 'Package Definitions',
'html_init' => $html_init,
+ 'html_posttotal' => $html_posttotal,
'name' => 'package definitions',
'disableable' => 1,
- 'disabled_statuspos' => 3,
+ 'disabled_statuspos' => 4,
'agent_virt' => 1,
'agent_null_right' => [ $edit, $edit_global ],
'agent_null_right_link' => $edit_global,
- 'agent_pos' => 5,
+ 'agent_pos' => 6,
'query' => { 'select' => $select,
'table' => 'part_pkg',
- 'hashref' => {},
+ 'hashref' => \%hash,
'extra_sql' => $extra_sql,
'order_by' => "ORDER BY $orderby"
},
@@ -41,16 +42,48 @@ my $money_char = $conf->config('money_char') || '$';
my $select = '*';
my $orderby = 'pkgpart';
+my %hash = ();
+my $extra_count = '';
+
if ( $cgi->param('active') ) {
$orderby = 'num_active DESC';
}
-my $extra_sql = '';
+my @where = ();
+
+#if ( $cgi->param('activeONLY') ) {
+# push @where, ' WHERE num_active > 0 '; #XXX doesn't affect count...
+#}
+
+if ( $cgi->param('recurring') ) {
+ $hash{'freq'} = { op=>'!=', value=>'0' };
+ $extra_count = " freq != '0' ";
+}
-unless ( $acl_edit_global ) {
- $extra_sql .= ' WHERE '. FS::part_pkg->curuser_pkgs_sql;
+my $classnum = '';
+if ( $cgi->param('classnum') =~ /^(\d+)$/ ) {
+ $classnum = $1;
+ push @where, $classnum ? "classnum = $classnum"
+ : "classnum IS NULL";
+}
+$cgi->delete('classnum');
+
+if ( $cgi->param('missing_recur_fee') ) {
+ push @where, "0 = ( SELECT COUNT(*) FROM part_pkg_option
+ WHERE optionname = 'recur_fee'
+ AND part_pkg_option.pkgpart = part_pkg.pkgpart
+ AND CAST ( optionvalue AS NUMERIC ) > 0
+ )";
}
+push @where, FS::part_pkg->curuser_pkgs_sql
+ unless $acl_edit_global;
+
+my $extra_sql = scalar(@where)
+ ? ( scalar(keys %hash) ? ' AND ' : ' WHERE ' ).
+ join( 'AND ', @where)
+ : '';
+
my $agentnums = join(',', $curuser->agentnums);
my $count_cust_pkg = "
SELECT COUNT(*) FROM cust_pkg LEFT JOIN cust_main USING ( custnum )
@@ -94,14 +127,49 @@ my $html_init;
!;
#}
+$cgi->param('dummy', 1);
+
+my $filter_change =
+ qq(\n<SCRIPT TYPE="text/javascript">\n).
+ "function filter_change() {".
+ " window.location = '". $cgi->self_url.
+ ";classnum=' + document.getElementById('classnum').options[document.getElementById('classnum').selectedIndex].value".
+ "}".
+ "\n</SCRIPT>\n";
+
+#restore this so pagination works
+$cgi->param('classnum', $classnum) if length($classnum);
+
+my $html_posttotal =
+ "$filter_change\n<BR>( show class: ".
+ include('/elements/select-pkg_class.html',
+ #'curr_value' => $classnum,
+ 'value' => $classnum, #insist on 0 :/
+ 'onchange' => 'filter_change()',
+ 'pre_options' => [ '-1' => 'all',
+ '0' => '(none)', ],
+ 'disable_empty' => 1,
+ ).
+ ' )';
+
+my $recur_toggle = $cgi->param('recurring') ? 'show' : 'hide';
+$cgi->param('recurring', $cgi->param('recurring') ^ 1 );
+
+$html_posttotal .=
+ '( <A HREF="'. $cgi->self_url.'">'. "$recur_toggle one-time charges</A> )";
+
+$cgi->param('recurring', $cgi->param('recurring') ^ 1 ); #put it back
+
# ------
my $link = [ $p.'edit/part_pkg.cgi?', 'pkgpart' ];
-my @header = ( '#', 'Package', 'Comment' );
-my @fields = ( 'pkgpart', 'pkg', 'comment' );
-my $align = 'rll';
-my @links = ( $link, $link, '' );
+my @header = ( '#', 'Package', 'Comment', 'Custom' );
+my @fields = ( 'pkgpart', 'pkg', 'comment',
+ sub{ '<B><FONT COLOR="#0000CC">'.$_[0]->custom.'</FONT></B>' }
+ );
+my $align = 'rllc';
+my @links = ( $link, $link, '', '' );
unless ( 0 ) { #already showing only one class or something?
push @header, 'Class';
@@ -188,9 +256,7 @@ if ( $acl_edit_global ) {
my $typelink = $p. 'edit/agent_type.cgi?';
push @fields, sub { my $part_pkg = shift;
[
- map { warn $_;
- my $agent_type = $_->agent_type;
- warn $agent_type;
+ map { my $agent_type = $_->agent_type;
[
{ 'data' => $agent_type->atype, #escape?
'align' => 'left',
@@ -362,6 +428,10 @@ $align .= 'lrl'; #rr';
# --------
-my $count_query = "SELECT COUNT(*) FROM part_pkg $extra_sql";
+my $count_extra_sql = $extra_sql;
+$count_extra_sql =~ s/^\s*AND /WHERE /i;
+$extra_count = ( $count_extra_sql ? ' AND ' : ' WHERE ' ). $extra_count
+ if $extra_count;
+my $count_query = "SELECT COUNT(*) FROM part_pkg $count_extra_sql $extra_count";
</%init>
diff --git a/httemplate/browse/part_pkg_report_option.html b/httemplate/browse/part_pkg_report_option.html
new file mode 100644
index 0000000..90540bc
--- /dev/null
+++ b/httemplate/browse/part_pkg_report_option.html
@@ -0,0 +1,28 @@
+<% include( 'elements/browse.html',
+ 'title' => 'Package optional report classes',
+ 'html_init' => $html_init,
+ 'name' => 'package optional report classes',
+ 'disableable' => 1,
+ 'disabled_statuspos' => 2,
+ 'query' => { 'table' => 'part_pkg_report_option',
+ 'hashref' => {},
+ 'extra_sql' => 'ORDER BY name',
+ },
+ 'count_query' => 'SELECT COUNT(*) FROM part_pkg_report_option',
+ 'header' => [ '#', 'Class' ],
+ 'fields' => [ 'num', 'name' ],
+ 'links' => [ $link, $link ],
+ )
+%>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
+my $html_init =
+ 'Package optional report classes define groups of packages, for reporting purposes.'.
+ qq!<BR><BR><A HREF="${p}edit/part_pkg_report_option.html"><I>Add a class</I></A><BR><BR>!;
+
+my $link = [ $p.'edit/part_pkg_report_option.html?', 'num' ];
+
+</%init>
diff --git a/httemplate/browse/part_pkg_taxclass.html b/httemplate/browse/part_pkg_taxclass.html
new file mode 100644
index 0000000..04e0e23
--- /dev/null
+++ b/httemplate/browse/part_pkg_taxclass.html
@@ -0,0 +1,27 @@
+<% include( 'elements/browse.html',
+ 'title' => 'Tax Classes',
+ 'name_singular' => 'tax class',
+ 'menubar' => [ 'Add a new tax class' =>
+ $p.'edit/part_pkg_taxclass.html',
+ ],
+ 'query' => { 'table' => 'part_pkg_taxclass', },
+ 'count_query' => 'SELECT COUNT(*) FROM part_pkg_taxclass',
+ 'header' => [ '#', 'Device type' ],
+ 'fields' => [ 'taxclassnum',
+ 'taxclass',
+ ],
+ 'links' => [ $link,
+ $link,
+ ],
+ 'disableable' => 1,
+ 'disabled_statuspos' => 1,
+ )
+%>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
+my $link = [ "${p}edit/part_pkg_taxclass.html?", 'taxclassnum' ];
+
+</%init>
diff --git a/httemplate/browse/part_svc.cgi b/httemplate/browse/part_svc.cgi
index f1b2836..94afdef 100755
--- a/httemplate/browse/part_svc.cgi
+++ b/httemplate/browse/part_svc.cgi
@@ -55,6 +55,8 @@ function part_export_areyousure(href) {
<TH CLASS="grid" BGCOLOR="#cccccc">Field</TH>
+ <TH CLASS="grid" BGCOLOR="#cccccc">Label</TH>
+
<TH COLSPAN=2 CLASS="grid" BGCOLOR="#cccccc">Modifier</TH>
</TR>
@@ -65,8 +67,15 @@ function part_export_areyousure(href) {
% my @dfields = $svc_x->fields;
% push @dfields, 'usergroup' if $svcdb eq 'svc_acct'; #kludge
% my @fields =
-% grep { $svc_x->pvf($_)
-% or $_ ne 'svcnum' && $part_svc->part_svc_column($_)->columnflag }
+% grep { my $col = $part_svc->part_svc_column($_);
+% my $def = FS::part_svc->svc_table_fields($svcdb)->{$_};
+% $svc_x->pvf($_)
+% or $_ ne 'svcnum' && (
+% $col->columnflag || ( $col->columnlabel !~ /^\S*$/
+% && $col->columnlabel ne $def->{'label'}
+% )
+% )
+% }
% @dfields ;
% my $rowspan = scalar(@fields) || 1;
% my $url = "${p}edit/part_svc.cgi?". $part_svc->svcpart;
@@ -128,21 +137,25 @@ function part_export_areyousure(href) {
</TD>
% unless ( @fields ) {
-% for ( 1..3 ) {
+% for ( 1..4 ) {
<TD CLASS="grid" BGCOLOR="<% $bgcolor %>"</TD>
% }
% }
%
% my($n1)='';
% foreach my $field ( @fields ) {
-% my $formatter =
-% FS::part_svc->svc_table_fields($svcdb)->{$field}->{format}
-% || sub { shift };
-% my $flag = $part_svc->part_svc_column($field)->columnflag;
%
+% #a few lines of false laziness w/edit/part_svc.cgi
+% my $def = FS::part_svc->svc_table_fields($svcdb)->{$field};
+% my $formatter = $def->{format} || sub { shift };
+%
+% my $part_svc_column = $part_svc->part_svc_column($field);
+% my $label = $part_svc_column->columnlabel || $def->{'label'};
+% my $flag = $part_svc_column->columnflag;
<% $n1 %>
<TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $field %></TD>
+ <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $label %></TD>
<TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $flag{$flag} %></TD>
<TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
diff --git a/httemplate/browse/payment_gateway.html b/httemplate/browse/payment_gateway.html
index 848c58a..a06e5cf 100644
--- a/httemplate/browse/payment_gateway.html
+++ b/httemplate/browse/payment_gateway.html
@@ -10,17 +10,21 @@
},
'count_query' => $count_query,
'header' => [ '#',
+ 'Type',
'Gateway',
'Username',
'Password',
'Action',
+ 'URL',
'Options',
],
'fields' => [ 'gatewaynum',
+ 'namespace_description',
$gateway_sub,
'gateway_username',
sub { ' - '; },
'gateway_action',
+ 'gateway_callback_url',
$options_sub,
],
)
diff --git a/httemplate/browse/pkg_category.html b/httemplate/browse/pkg_category.html
index 20bf1a8..e85c0dd 100644
--- a/httemplate/browse/pkg_category.html
+++ b/httemplate/browse/pkg_category.html
@@ -9,9 +9,9 @@
'extra_sql' => 'ORDER BY categorynum',
},
'count_query' => $count_query,
- 'header' => [ '#', 'Category' ],
- 'fields' => [ 'categorynum', 'categoryname' ],
- 'links' => [ $link, $link ],
+ 'header' => [ '#', 'Category', 'Weight' ],
+ 'fields' => [ 'categorynum', 'categoryname', 'weight' ],
+ 'links' => [ $link, $link, $link ],
)
%>
diff --git a/httemplate/browse/rate_region.html b/httemplate/browse/rate_region.html
index b454a9e..b7d9589 100644
--- a/httemplate/browse/rate_region.html
+++ b/httemplate/browse/rate_region.html
@@ -12,9 +12,11 @@
'order_by' => 'ORDER BY LOWER(regionname)',
},
'count_query' => $count_query,
- 'header' => [ '#', 'Region', 'Country code', 'Prefixes' ],
- 'fields' => [ 'regionnum', 'regionname', 'ccode', 'prefixes' ],
- 'links' => [ $link, $link, $link, $link ],
+ 'header' => \@header,
+ 'fields' => \@fields,
+ 'links' => \@links,
+ 'align' => \@align,
+ 'xls_format' => \@xls_format,
)
%>
<%once>
@@ -39,12 +41,12 @@ if ( driver_name =~ /^Pg/ ) {
" ELSE npa || '-' || nxx ".
" END";
my $prefixes_sql = "SELECT $prefix_sql $fromwhere AND npa IS NOT NULL";
- $select .= "( SELECT countrycode $fromwhere LIMIT 1 ) AS ccode,
- ARRAY_TO_STRING( ARRAY($prefixes_sql), ',' ) AS prefixes";
+ $select .= "( SELECT '+'||countrycode $fromwhere LIMIT 1 ) AS ccode,
+ ARRAY_TO_STRING( ARRAY($prefixes_sql), ', ' ) AS prefixes";
} elsif ( driver_name =~ /^mysql/i ) {
$join = 'LEFT JOIN rate_prefix USING ( regionnum )';
- $select .= "GROUP_CONCAT( DISTINCT countrycode ) AS ccode,
- GROUP_CONCAT( npa ORDER BY npa ) AS prefixes ";
+ $select .= "'+'||GROUP_CONCAT( DISTINCT countrycode ) AS ccode,
+ GROUP_CONCAT( npa ORDER BY npa SEPARATOR ', ' ) AS prefixes ";
$group_sql = 'GROUP BY regionnum, regionname';
} else {
die 'unknown database '. driver_name;
@@ -52,12 +54,20 @@ if ( driver_name =~ /^Pg/ ) {
my $base_count_sql = 'SELECT COUNT(*) FROM rate_region';
+tie my %granularity, 'Tie::IxHash', FS::rate_detail::granularities();
+
</%once>
<%init>
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+my @header = ( '#', 'Region', 'Country code', 'Prefixes' );
+my @fields = ( 'regionnum', 'regionname', 'ccode', 'prefixes' );
+my @links = ( ($link) x 4 );
+my @align = ( 'right', 'left', 'right', 'left' );
+my @xls_format = ( ({ locked=>1, bg_color=>22 }) x 4 );
+
$cgi->param('dummy', 1);
my $countrycode_filter_change =
"window.location = '".
@@ -76,6 +86,41 @@ if ( $cgi->param('countrycode') =~ /^(\d+)$/ ) {
$count_query .= " WHERE $ccode_sql = '$1'";
}
+sub _rate_detail_factory {
+ my( $rate, $field ) = @_;
+ return sub {
+ my $rate_detail = $rate->dest_detail(shift)
+ || new FS::rate_region { 'min_included' => 0,
+ 'min_charge' => 0,
+ 'sec_granularity' => 0,
+ };
+ my $value = $rate_detail->$field();
+ $field eq 'sec_granularity' ? $granularity{$value} : $value;
+ };
+}
+
+if ( $cgi->param('show_rates') ) {
+ foreach my $rate ( qsearch('rate', {}) ) {
+
+ my $label = $rate->ratenum.': '. $rate->ratename;
+ push @header, "$label: Included minutes/calls",
+ "$label: Charge per minute/call",
+ "$label: Granularity",
+ "$label: Usage class";
+
+ #closure me harder
+ push @fields, _rate_detail_factory($rate, 'min_included'),
+ _rate_detail_factory($rate, 'min_charge'),
+ _rate_detail_factory($rate, 'sec_granularity'),
+ _rate_detail_factory($rate, 'classnum');
+
+ push @links, ( ('') x 4 );
+ push @xls_format, ( ({}) x 4 );
+
+ }
+
+}
+
my $html_posttotal =
'(show country code: '.
qq(<SELECT NAME="countrycode" onChange="$countrycode_filter_change">).
diff --git a/httemplate/browse/svc_acct_pop.cgi b/httemplate/browse/svc_acct_pop.cgi
index c6e615d..501d362 100755
--- a/httemplate/browse/svc_acct_pop.cgi
+++ b/httemplate/browse/svc_acct_pop.cgi
@@ -23,6 +23,7 @@
$num_accounts_sub,
],
'align' => 'rllrrrr',
+ 'links' => [ map { $svc_acct_pop_link } (1..6) ],
)
%>
<%init>