[freeside-commits] branch master updated. 469f31f261476205bc9cf2d59335b8c30aa5e016

Ivan ivan at 420.am
Thu Dec 20 21:53:06 PST 2012


The branch, master has been updated
       via  469f31f261476205bc9cf2d59335b8c30aa5e016 (commit)
      from  94ff30dbfd8bcdd47170b3a93f8112dd2da68aa9 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 469f31f261476205bc9cf2d59335b8c30aa5e016
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Thu Dec 20 21:53:02 2012 -0800

    add pkgnum/pkgpart to line item report< RT#18676

diff --git a/httemplate/search/cust_bill_pkg.cgi b/httemplate/search/cust_bill_pkg.cgi
index 5f02588..11a5095 100644
--- a/httemplate/search/cust_bill_pkg.cgi
+++ b/httemplate/search/cust_bill_pkg.cgi
@@ -5,6 +5,8 @@
                  'count_query' => $count_query,
                  'count_addl'  => \@total_desc,
                  'header'      => [
+                   @pkgnum_header,
+                   emt('Pkg Def'),
                    emt('Description'),
                    @post_desc_header,
                    @peritem_desc,
@@ -15,9 +17,16 @@
                    FS::UI::Web::cust_header(),
                  ],
                  'fields'      => [
+                   @pkgnum,
                    sub { $_[0]->pkgnum > 0
-                           ? $_[0]->get('pkg')      # possibly use override.pkg
-                           : $_[0]->get('itemdesc') # but i think this correct
+                           # possibly use override.pkg but i think this correct
+                           ? $_[0]->get('pkgpart')
+                           : ''
+                       },
+                   sub { $_[0]->pkgnum > 0
+                           # possibly use override.pkg but i think this correct
+                           ? $_[0]->get('pkg')     
+                           : $_[0]->get('itemdesc')
                        },
                    @post_desc,
                    #strikethrough or "N/A ($amount)" or something these when
@@ -30,6 +39,8 @@
                    \&FS::UI::Web::cust_fields,
                  ],
                  'sort_fields' => [
+                   @pkgnum_null,
+                   '',
                    '',
                    @post_desc_null,
                    @peritem,
@@ -39,7 +50,8 @@
                    #'credit_amount',
                  ],
                  'links'       => [
-                   #'',
+                   @pkgnum_null,
+                   '',
                    '',
                    @post_desc_null,
                    @peritem_null,
@@ -52,13 +64,15 @@
                    ),
                  ],
                  #'align' => 'rlrrrc'.FS::UI::Web::cust_aligns(),
-                 'align' => 'l'.
+                 'align' => $pkgnum_align.
+                            'rl'.
                             $post_desc_align.
                             $peritem_align.
                             'rcrr'.
                             FS::UI::Web::cust_aligns(),
                  'color' => [ 
-                              #'',
+                              @pkgnum_null,
+                              '',
                               '',
                               @post_desc_null,
                               @peritem_null,
@@ -69,7 +83,8 @@
                               FS::UI::Web::cust_colors(),
                             ],
                  'style' => [ 
-                              #'',
+                              @pkgnum_null,
+                              '',
                               '',
                               @post_desc_null,
                               @peritem_null,
@@ -165,8 +180,9 @@ Filtering parameters:
 </%doc>
 <%init>
 
-die "access denied"
-  unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');
+my $curuser = $FS::CurrentUser::CurrentUser;
+
+die "access denied" unless $curuser->access_right('Financial reports');
 
 my $conf = new FS::Conf;
 my $money_char = $conf->config('money_char') || '$';
@@ -178,6 +194,18 @@ my @total_desc = ( '%d line items', $money_char.'%.2f total' ); # sprintf string
 my @peritem = ( 'setup', 'recur' );
 my @peritem_desc = ( 'Setup charge', 'Recurring charge' );
 
+my @pkgnum_header = ();
+my @pkgnum = ();
+my @pkgnum_null;
+my $pkgnum_align = '';
+if ( $curuser->option('show_pkgnum') ) {
+  push @select, 'cust_bill_pkg.pkgnum';
+  push @pkgnum_header, 'Pkg Num';
+  push @pkgnum, sub { $_[0]->pkgnum > 0 ? $_[0]->pkgnum : '' };
+  push @pkgnum_null, '';
+  $pkgnum_align .= 'r';
+}
+
 my @post_desc_header = ();
 my @post_desc = ();
 my @post_desc_null = ();
@@ -249,7 +277,7 @@ if ( $cgi->param('use_override') ) {
   )";
   $part_pkg = 'override';
 }
-push @select, 'part_pkg.pkg'; # or should this use override?
+push @select, 'part_pkg.pkgpart', 'part_pkg.pkg'; # or should this use override?
 
 # the non-tax case
 if ( $cgi->param('nottax') ) {
@@ -644,4 +672,5 @@ my $credit_link = [ "${p}search/cust_credit_bill_pkg.html?billpkgnum=", 'billpkg
 
 warn "\n\nQUERY:\n".Dumper($query)."\n\nCOUNT_QUERY:\n$count_query\n\n"
   if $cgi->param('debug');
+
 </%init>

-----------------------------------------------------------------------

Summary of changes:
 httemplate/search/cust_bill_pkg.cgi |   47 ++++++++++++++++++++++++++++------
 1 files changed, 38 insertions(+), 9 deletions(-)




More information about the freeside-commits mailing list