X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fbrowse%2Fpart_pkg.cgi;h=d9b90cf84d6ba27dd8182d9bf828c0697d60339f;hb=9f0a2d6b88789a9eb940ff2a1d6b121ccb8083bc;hp=886c6c8491ac82eb852a2a9d099c14304dfff7b0;hpb=9832f4d4086970d7612ff2a6facd797fa85d7814;p=freeside.git diff --git a/httemplate/browse/part_pkg.cgi b/httemplate/browse/part_pkg.cgi index 886c6c849..d9b90cf84 100755 --- a/httemplate/browse/part_pkg.cgi +++ b/httemplate/browse/part_pkg.cgi @@ -4,11 +4,11 @@ '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' => \%hash, @@ -57,7 +57,7 @@ my @where = (); if ( $cgi->param('recurring') ) { $hash{'freq'} = { op=>'!=', value=>'0' }; - $extra_count = ' freq != 0 '; + $extra_count = " freq != '0' "; } my $classnum = ''; @@ -96,8 +96,15 @@ $select = " *, ( $count_cust_pkg + AND ( setup IS NULL OR cancel = 0 ) AND ( cancel IS NULL OR cancel = 0 ) - AND ( susp IS NULL OR susp = 0 ) + AND ( susp IS NULL OR susp = 0 ) + ) AS num_not_yet_billed, + + ( $count_cust_pkg + AND setup IS NOT NULL AND setup != 0 + AND ( cancel IS NULL OR cancel = 0 ) + AND ( susp IS NULL OR susp = 0 ) ) AS num_active, ( $count_cust_pkg @@ -152,14 +159,24 @@ my $html_posttotal = ). ' )'; +my $recur_toggle = $cgi->param('recurring') ? 'show' : 'hide'; +$cgi->param('recurring', $cgi->param('recurring') ^ 1 ); + +$html_posttotal .= + '( '. "$recur_toggle one-time charges )"; + +$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{ ''.$_[0]->custom.'' } + ); +my $align = 'rllc'; +my @links = ( $link, $link, '', '' ); unless ( 0 ) { #already showing only one class or something? push @header, 'Class'; @@ -273,6 +290,8 @@ if ( $acl_edit_global ) { 'cancelled' => 'FF0000', #'one-time charge' => '000000', 'charge' => '000000', + #'not yet billed' => '000000', + 'not yet billed' => '000000', ); my $cust_pkg_link = $p. 'search/cust_pkg.cgi?pkgpart='; push @fields, sub { my $part_pkg = shift; @@ -284,6 +303,8 @@ if ( $acl_edit_global ) { $magic = 'inactive'; #$label = 'one-time charge', $label = 'charge', + } else { + $label =~ s/_/ /g; } [ @@ -309,7 +330,7 @@ if ( $acl_edit_global ) { ), }, ], - } (qw( active suspended cancelled )) + } qw(not_yet_billed active suspended cancelled) ]; }; $align .= 'r'; #}