X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fbrowse%2Fpart_svc.cgi;h=222433db3705c37150e24330c40a1b6a330d4324;hb=a218049cc9560b1bfc98f5803fba18f9f804e11b;hp=88f8d8d197ef1600760182488c5acf03d245413e;hpb=2b2dd969f3c18751afc583ad1e836ab8e6f73b5d;p=freeside.git
diff --git a/httemplate/browse/part_svc.cgi b/httemplate/browse/part_svc.cgi
index 88f8d8d19..222433db3 100755
--- a/httemplate/browse/part_svc.cgi
+++ b/httemplate/browse/part_svc.cgi
@@ -112,16 +112,36 @@ function part_export_areyousure(href) {
% }
-
CLASS="grid" BGCOLOR="<% $bgcolor %>">
- <% $part_svc->svc %> |
+ CLASS="grid" BGCOLOR="<% $bgcolor %>">
+
+ <% $part_svc->svc %>
+
+% # any alternate names of the service
+% my %msgcat = map { $_->locale => $_ } $part_svc->part_svc_msgcat;
+% my %labels = map { $_ => FS::Locales->description($_) } keys %msgcat;
+% my @locales = sort { $labels{$a} cmp $labels{$b} } keys %msgcat;
+% if ( @locales ) {
+
+
+% foreach my $locale (@locales) {
+ <% $labels{$locale} %>: <% $msgcat{$locale}->get('svc') %>
+
+% }
+
+% }
+ |
CLASS="grid" BGCOLOR="<% $bgcolor %>">
<% $svcdb %> |
CLASS="grid" BGCOLOR="<% $bgcolor %>">
- <% $num_active_cust_svc{$part_svc->svcpart} %> <% $num_active_cust_svc{$part_svc->svcpart} ? svc_url( 'ahref' => 1, 'm' => $m, 'action' => 'search', 'part_svc' => $part_svc, 'query' => "svcpart=". $part_svc->svcpart ) : '' %>active
-
-% if ( $num_active_cust_svc{$part_svc->svcpart} ) {
+% my $svcurl_active = svc_url( 'ahref' => 1, 'm' => $m, 'action' => 'search', 'part_svc' => $part_svc, 'query' => "svcpart=". $part_svc->svcpart . "&cancelled=0");
+% my $svcurl_cancel = svc_url( 'ahref' => 1, 'm' => $m, 'action' => 'search', 'part_svc' => $part_svc, 'query' => "svcpart=". $part_svc->svcpart . "&cancelled=1");
+ <% $num_cust_svc_active{$part_svc->svcpart} %> <% $num_cust_svc_active{$part_svc->svcpart} ? $svcurl_active : '' %>active<% $num_cust_svc_active{$part_svc->svcpart} ? '' : '' %>
+% if ( $num_cust_svc_cancelled{$part_svc->svcpart} ) {
+ <% $num_cust_svc_cancelled{$part_svc->svcpart} %> <% $svcurl_cancel %>cancelled
+% }
+% if ( $num_cust_svc{$part_svc->svcpart} ) {
[ change ]
% }
@@ -231,6 +251,7 @@ my %flag = (
'A' => 'Automatically filled in from inventory',
'H' => 'Selected from hardware class',
'X' => 'Excluded',
+ 'P' => 'From package 477 information',
);
my %search;
@@ -245,11 +266,25 @@ my @part_svc =
qsearch('part_svc', \%search );
my $total = scalar(@part_svc);
-my %num_active_cust_svc = map { $_->svcpart => $_->num_cust_svc } @part_svc;
+## The Active/Cancelled distinction is a bit awkward,
+## active currently includes unattached and suspended services,
+## but we've previously referred to EVERY existing cust_svc as "Active",
+## and we don't really want to know numbers by individual package status,
+## so for now the UI will distinguish these as "Active" and "Cancelled",
+## but please let's not go so far as to introduce the idea of "Service Status"
+
+my %num_cust_svc_active;
+my %num_cust_svc_cancelled;
+my %num_cust_svc;
+foreach my $part_svc (@part_svc) {
+ $num_cust_svc{$part_svc->svcpart} = $part_svc->num_cust_svc;
+ $num_cust_svc_cancelled{$part_svc->svcpart} = $part_svc->num_cust_svc_cancelled;
+ $num_cust_svc_active{$part_svc->svcpart} = $num_cust_svc{$part_svc->svcpart} - $num_cust_svc_cancelled{$part_svc->svcpart};
+}
if ( $cgi->param('orderby') eq 'active' ) {
- @part_svc = sort { $num_active_cust_svc{$b->svcpart} <=>
- $num_active_cust_svc{$a->svcpart} } @part_svc;
+ @part_svc = sort { $num_cust_svc{$b->svcpart} <=>
+ $num_cust_svc{$a->svcpart} } @part_svc;
} elsif ( $cgi->param('orderby') eq 'svc' ) {
@part_svc = sort { lc($a->svc) cmp lc($b->svc) } @part_svc;
}
|