[freeside-commits] branch FREESIDE_4_BRANCH updated. dc3c29ad94942345b3316d23e23f6dc8303de566

Jonathan Prykop jonathan at 420.am
Mon Aug 29 15:05:53 PDT 2016


The branch, FREESIDE_4_BRANCH has been updated
       via  dc3c29ad94942345b3316d23e23f6dc8303de566 (commit)
      from  b941e602f1362b232845cd21279600f3b9793dc0 (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 dc3c29ad94942345b3316d23e23f6dc8303de566
Author: Jonathan Prykop <jonathan at freeside.biz>
Date:   Mon Jul 25 22:01:03 2016 -0500

    RT#71049: Add order_number to payment reports [show_order_number checkboxes]

diff --git a/httemplate/search/cust_bill_pay_pkg.html b/httemplate/search/cust_bill_pay_pkg.html
index 7c231a6..e2ffd12 100644
--- a/httemplate/search/cust_bill_pay_pkg.html
+++ b/httemplate/search/cust_bill_pay_pkg.html
@@ -14,7 +14,7 @@
 
                    #payment
                    'Date',
-                   'Order Number',
+                   @on_header,
                    'By',
 
                    #application
@@ -44,7 +44,7 @@
                            ? cardtype($cust_pay->paymask) : '';
                        },
                    sub { time2str('%b %d %Y', shift->get('cust_pay_date') ) },
-                   sub { shift->cust_bill_pay->cust_pay->order_number },
+                   @on_field,
                    sub { shift->cust_bill_pay->cust_pay->otaker },
 
                    sub { sprintf($money_char.'%.2f', shift->amount ) },
@@ -66,7 +66,7 @@
                    '', #payinfo/paymask
                    '', #cardtype
                    'cust_pay_date',
-                   '', #order_number
+                   @on_null, #order_number
                    '', #'otaker',
                    '', #amount
                    '', #line item description
@@ -83,7 +83,7 @@
                    '',
                    '',
                    '',
-                   '',
+                   @on_null,
                    '',
                    '',
                    '',
@@ -96,10 +96,9 @@
                          FS::UI::Web::cust_header()
                    ),
                ],
-               'align' => 'rcrlrrlrlll',
-#original value before cardtype & package were added
-#why are there 13 cols?
-#'rcrrlrlllrrcl'.
+               'align' => 'rcrlr'.
+                          $on_align.
+                          'lrlll'.
                           $post_desc_align.
                           'rr'.
                           FS::UI::Web::cust_aligns(),
@@ -109,7 +108,7 @@
                               '',
                               '',
                               '',
-                              '',
+                              @on_null,
                               '',
                               '',
                               '',
@@ -126,7 +125,7 @@
                               '',
                               '',
                               '',
-                              '',
+                              @on_null,
                               '',
                               '',
                               '',
@@ -148,6 +147,17 @@
 die "access denied"
   unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');
 
+my @on_header = ();
+my @on_field  = ();
+my @on_null   = ();
+my $on_align  = '';
+if ($cgi->param('show_order_number')) {
+  @on_header = ('Order Number');
+  @on_field = (sub { shift->cust_bill_pay->cust_pay->order_number });
+  @on_null  = ('');
+  $on_align = 'r';
+}
+
 my $conf = new FS::Conf;
 
 my %payby = FS::payby->payby2shortname;
diff --git a/httemplate/search/cust_pay.html b/httemplate/search/cust_pay.html
index 536ab29..e466f6a 100755
--- a/httemplate/search/cust_pay.html
+++ b/httemplate/search/cust_pay.html
@@ -4,5 +4,4 @@
                 'name_singular' => emt('payment'),
                 'name_verb'     => emt('paid'),
                 'show_card_type' => 1,
-                'show_order_number' => 1,
 &>
diff --git a/httemplate/search/elements/cust_pay_or_refund.html b/httemplate/search/elements/cust_pay_or_refund.html
index 5ff5d2a..7979fdd 100755
--- a/httemplate/search/elements/cust_pay_or_refund.html
+++ b/httemplate/search/elements/cust_pay_or_refund.html
@@ -231,7 +231,7 @@ push @links, '';
 push @fields, sub { time2str('%b %d %Y', shift->_date ) };
 push @sort_fields, '_date';
 
-if ($opt{'show_order_number'}) {
+if ($cgi->param('show_order_number')) {
   push @header, emt('Order Number');
   $align .= 'r';
   push @links, '';
diff --git a/httemplate/search/elements/report_cust_pay_or_refund.html b/httemplate/search/elements/report_cust_pay_or_refund.html
index 730db68..806746a 100644
--- a/httemplate/search/elements/report_cust_pay_or_refund.html
+++ b/httemplate/search/elements/report_cust_pay_or_refund.html
@@ -151,6 +151,12 @@ Examples:
                 'value' => 1,
   &>
 
+  <& /elements/tr-checkbox.html,
+                'label' => emt('Include order number'),
+                'field' => 'show_order_number',
+                'value' => 1,
+  &>
+
 </TABLE>
 
 % }
diff --git a/httemplate/search/report_cust_bill_pay_pkg.html b/httemplate/search/report_cust_bill_pay_pkg.html
index 2347bab..bdcd154 100644
--- a/httemplate/search/report_cust_bill_pay_pkg.html
+++ b/httemplate/search/report_cust_bill_pay_pkg.html
@@ -41,6 +41,13 @@
      field   => 'paid',
 &>
 
+  <& /elements/tr-checkbox.html,
+                'label' => emt('Display order number'),
+                'field' => 'show_order_number',
+                'value' => 1,
+                'cell_style' => 'font-weight: normal', #for consistency
+  &>
+
 <!--
 <TR>
   <TD ALIGN="right"><INPUT TYPE="checkbox" NAME="nottax" VALUE="Y" onClick="nottax_changed(this)" onChange="nottax_change(thid)"></TD>

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

Summary of changes:
 httemplate/search/cust_bill_pay_pkg.html           |   30 +++++++++++++-------
 httemplate/search/cust_pay.html                    |    1 -
 httemplate/search/elements/cust_pay_or_refund.html |    2 +-
 .../search/elements/report_cust_pay_or_refund.html |    6 ++++
 httemplate/search/report_cust_bill_pay_pkg.html    |    7 +++++
 5 files changed, 34 insertions(+), 12 deletions(-)




More information about the freeside-commits mailing list