[freeside-commits] branch FREESIDE_3_BRANCH updated. 94739c7dd905cab3951418da8c6c2ceaf171a412

Ivan ivan at 420.am
Wed Dec 11 12:52:03 PST 2013


The branch, FREESIDE_3_BRANCH has been updated
       via  94739c7dd905cab3951418da8c6c2ceaf171a412 (commit)
      from  c847496da20e68be23c37d56b78fdfe33f0dfd33 (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 94739c7dd905cab3951418da8c6c2ceaf171a412
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed Dec 11 12:52:02 2013 -0800

    optimize customer view (esp. with lots of commission credits), RT#26416

diff --git a/httemplate/view/cust_main/payment_history.html b/httemplate/view/cust_main/payment_history.html
index 73082ce..95e34a1 100644
--- a/httemplate/view/cust_main/payment_history.html
+++ b/httemplate/view/cust_main/payment_history.html
@@ -396,12 +396,34 @@ my %status = (
 my @history = ();
 
 my %opt = (
+
+  #config
   ( map { $_ => scalar($conf->config($_)) }
         qw( card_refund-days date_format )
   ),
   ( map { $_ => $conf->exists($_) } 
-        qw( deleteinvoices deletepayments deleterefunds pkg-balances )
-  )
+        qw( deleteinvoices deletepayments deleterefunds pkg-balances
+            cust_credit_bill_pkg-manual cust_bill_pay_pkg-manual
+          )
+  ),
+  'money_char             ' => $money_char,
+
+  #rights
+  ( map { $_ => $curuser->access_right($_) }
+      (
+        'View invoices', 'Void invoices', 'Unvoid invoices', 'Delete invoices',
+        'Apply payment', 'Refund credit card payment', 'Refund Echeck payment',
+        'Credit card void', 'Echeck void', 'Void payments', 'Unvoid payments',
+        'Delete payment', 'Unapply payment',
+        'Apply credit', 'Delete Credit', 'Unapply credit',
+        'Delete refund',
+        'Billing event reports', 'View customer billing events',
+      )
+  ),
+
+  #customer information
+  'total_owed'              => $cust_main->total_owed,
+  'total_unapplied_refunds' => $cust_main->total_unapplied_refunds,
 );
 
 $opt{'date_format'} ||= '%m/%d/%Y';
diff --git a/httemplate/view/cust_main/payment_history/credit.html b/httemplate/view/cust_main/payment_history/credit.html
index 6dd8970..ec5041b 100644
--- a/httemplate/view/cust_main/payment_history/credit.html
+++ b/httemplate/view/cust_main/payment_history/credit.html
@@ -6,10 +6,6 @@ my( $cust_credit, %opt ) = @_;
 
 my $date_format = $opt{'date_format'} || '%m/%d/%Y';
 
-my $conf = new FS::Conf;
-my $money_char = $conf->config('money_char') || '$';
-my $curuser = $FS::CurrentUser::CurrentUser;
-
 my @cust_credit_bill = $cust_credit->cust_credit_bill;
 my @cust_credit_refund = $cust_credit->cust_credit_refund;
 
@@ -21,7 +17,7 @@ if ( $opt{'pkg-balances'} && $cust_credit->pkgnum ) {
 
 my %cust_credit_bill_width = ('width' => 392);
 my %cust_credit_bill_height = ();
-if ($conf->exists('cust_credit_bill_pkg-manual')) {
+if ( $opt{'cust_credit_bill_pkg-manual'} ) {
   %cust_credit_bill_width = ('width' => 592);
   %cust_credit_bill_height = ('height' => 436);
 }
@@ -34,8 +30,8 @@ if (    scalar(@cust_credit_bill)   == 0
   $credit = '<B><FONT COLOR="#FF0000">'
         . emt("Unapplied Credit by [_1]", $cust_credit->otaker )
         . '</FONT></B>';
-  if ( $curuser->access_right('Apply credit') ) {
-    if ( $cust_credit->cust_main->total_owed > 0 ) {
+  if ( $opt{'Apply credit'} ) {
+    if ( $opt{total_owed} > 0 ) {
       $apply = ' ('.
                include( '/elements/popup_link.html',
                           'label'    => emt('apply'),
@@ -47,7 +43,7 @@ if (    scalar(@cust_credit_bill)   == 0
                       ).
                 ')';
     }
-    if ( $cust_credit->cust_main->total_unapplied_refunds > 0 ) {
+    if ( $opt{total_unapplied_refunds} > 0 ) {
       $apply.= ' ('.
                include( '/elements/popup_link.html',
                           'label'    => emt('apply to refund'),
@@ -75,22 +71,22 @@ if (    scalar(@cust_credit_bill)   == 0
   foreach my $app ( sort { $a->_date <=> $b->_date }
                          ( @cust_credit_bill, @cust_credit_refund ) ) {
     if ( $app->isa('FS::cust_credit_bill') ) {
-      $desc .= '  ' . $money_char . $app->amount . ' '
+      $desc .= '  ' . $opt{money_char} . $app->amount . ' '
                     . $app->applied_to_invoice . '<BR>';
     } elsif ( $app->isa('FS::cust_credit_refund') ) {
       $desc .= '  ' .
-               emt("[_1][_2] refunded on [_3]", $money_char, $app->amount,
+               emt("[_1][_2] refunded on [_3]", $opt{money_char}, $app->amount,
                     time2str($date_format, $app->_date) ) . '<BR>';
     } else {
       die "$app is not a FS::cust_credit_bill or a FS::cust_credit_refund";
     }
   }
   if ( $cust_credit->credited > 0 ) {
-    $desc .= '  <B><FONT COLOR="#FF0000">' .
-              emt("[_1][_2] unapplied", $money_char, $cust_credit->credited) .
+    $desc .= '  <B><FONT COLOR="#FF0000">'.
+              emt("[_1][_2] unapplied",$opt{money_char},$cust_credit->credited).
               '</FONT></B>';
-    if ( $curuser->access_right('Apply credit') ) {
-      if ( $cust_credit->cust_main->total_owed > 0 ) {
+    if ( $opt{'Apply credit'} ) {
+      if ( $opt{total_owed} > 0 ) {
         $apply = ' ('.
                  include( '/elements/popup_link.html',
                             'label'       => emt('apply'),
@@ -102,7 +98,7 @@ if (    scalar(@cust_credit_bill)   == 0
                         ).
                  ')';
       }
-      if ( $cust_credit->cust_main->total_unapplied_refunds > 0 ) {
+      if ( $opt{total_unapplied_refunds} > 0 ) {
         $apply.= ' ('.
                  include( '/elements/popup_link.html',
                             'label'       => emt('apply to refund'),
@@ -124,7 +120,8 @@ $delete = areyousure_link("${p}misc/delete-cust_credit.cgi?".$cust_credit->credn
                             '',
                             emt('delete')
                           )
-if ( $cust_credit->closed !~ /^Y/i && $curuser->access_right('Delete credit') );
+  if $cust_credit->closed !~ /^Y/i
+  && $opt{'Delete credit'};
 
 my $unapply = '';
 $unapply = areyousure_link("${p}misc/unapply-cust_credit.cgi?".$cust_credit->crednum,
@@ -132,12 +129,12 @@ $unapply = areyousure_link("${p}misc/unapply-cust_credit.cgi?".$cust_credit->cre
                             '',
                             emt('unapply')
                           )
-if ( $cust_credit->closed !~ /^Y/i && scalar(@cust_credit_bill)
-     && $curuser->access_right('Unapply credit') );
+  if $cust_credit->closed !~ /^Y/i
+  && scalar(@cust_credit_bill)
+  && $opt{'Unapply credit'};
 
-my $reason = $cust_credit->reason
-               ? ' ('. $cust_credit->reason. ')'
-               : '';
+my $reason = $cust_credit->reason;
+$reason = $reason ? " ($reason)" : '';
 
 </%init>
 
diff --git a/httemplate/view/cust_main/payment_history/invoice.html b/httemplate/view/cust_main/payment_history/invoice.html
index 96a9f54..acb1d69 100644
--- a/httemplate/view/cust_main/payment_history/invoice.html
+++ b/httemplate/view/cust_main/payment_history/invoice.html
@@ -3,10 +3,6 @@
 
 my( $cust_bill, %opt ) = @_;
 
-my $conf = new FS::Conf;
-
-my $curuser = $FS::CurrentUser::CurrentUser;
-
 my $invoice = emt("Invoice #[_1] (Balance [_2])",$cust_bill->display_invnum,$cust_bill->owed);
 
 my $under = '';
@@ -22,12 +18,12 @@ if ( $cust_bill->owed > 0 ) {
 
 my $invnum = $cust_bill->invnum;
 
-my $link = $curuser->access_right('View invoices')
+my $link = $opt{'View invoices'}
              ? qq!<A HREF="${p}view/cust_bill.cgi?$invnum">!
              : '';
 
 my $void = '';
-if ( $cust_bill->closed !~ /^Y/i && $curuser->access_right('Void invoices') ) {
+if ( $cust_bill->closed !~ /^Y/i && $opt{'Void invoices'} ) {
   $void =
     ' ('. include('/elements/popup_link.html',
                     'label'     => emt('void'),
@@ -44,15 +40,13 @@ $delete = areyousure_link("${p}misc/delete-cust_bill.html?$invnum",
                             emt('Delete this invoice from the database completely'),
                             emt('delete')
                         )
-    if ( $opt{'deleteinvoices'} && $curuser->access_right('Delete invoices') );
+    if ( $opt{'deleteinvoices'} && $opt{'Delete invoices'} );
 
 my $events = '';
-#1.9
 if ( $cust_bill->num_cust_event
-     && (    $curuser->access_right('Billing event reports')
-          || $curuser->access_right('View customer billing events')
-        )
-   ) {
+     && ($opt{'Billing event reports'} || $opt{'View customer billing events'})
+   )
+{
   $under .=
     qq!<BR><A HREF="${p}search/cust_event.html?invnum=$invnum">( !.
       emt('View invoice events').' )</A>';
diff --git a/httemplate/view/cust_main/payment_history/payment.html b/httemplate/view/cust_main/payment_history/payment.html
index ff269bf..b71d73f 100644
--- a/httemplate/view/cust_main/payment_history/payment.html
+++ b/httemplate/view/cust_main/payment_history/payment.html
@@ -6,10 +6,6 @@ my( $cust_pay, %opt ) = @_;
 
 my $date_format = $opt{'date_format'} || '%m/%d/%Y';
 
-my $conf = new FS::Conf;
-my $money_char = $conf->config('money_char') || '$';
-my $curuser = $FS::CurrentUser::CurrentUser;
-
 my @cust_bill_pay = $cust_pay->cust_bill_pay;
 my @cust_pay_refund = $cust_pay->cust_pay_refund;
 
@@ -26,7 +22,7 @@ if ( $opt{'pkg-balances'} && $cust_pay->pkgnum ) {
 
 my %cust_bill_pay_width = ('width' => 392);
 my %cust_bill_pay_height = ();
-if ($conf->exists('cust_bill_pay_pkg-manual')) {
+if ( $opt{'cust_bill_pay_pkg-manual'} ) {
   %cust_bill_pay_width = ('width' => 592);
   %cust_bill_pay_height = ('height' => 436);
 }
@@ -53,8 +49,8 @@ if (    scalar(@cust_bill_pay)   == 0
   $payment = emt("Unapplied Payment by [_1]",$otaker);
   $payment =~ s/$otaker/<i>$otaker<\/i>/ if $italicize_otaker;
   $payment = '<B><FONT COLOR="#FF0000">'.$payment.'</FONT></B>';
-  if ( $curuser->access_right('Apply payment') ) {
-    if ( $cust_pay->cust_main->total_owed > 0 ) {
+  if ( $opt{'Apply payment'} ) {
+    if ( $opt{total_owed} > 0 ) {
       $apply = ' ('.
                include( '/elements/popup_link.html',
                           'label'       => emt('apply'),
@@ -66,7 +62,7 @@ if (    scalar(@cust_bill_pay)   == 0
                       ).
                 ')';
     }
-    if ( $cust_pay->cust_main->total_unapplied_refunds > 0 ) {
+    if ( $opt{total_unapplied_refunds} > 0 ) {
       $apply.= ' ('.
                include( '/elements/popup_link.html',
                           'label'       => emt('apply to refund'),
@@ -94,11 +90,11 @@ if (    scalar(@cust_bill_pay)   == 0
   foreach my $app ( sort { $a->_date <=> $b->_date }
                          ( @cust_bill_pay, @cust_pay_refund ) ) {
     if ( $app->isa('FS::cust_bill_pay') ) {
-      $desc .= '  ' . $money_char . $app->amount . ' ' .
+      $desc .= '  ' . $opt{money_char} . $app->amount . ' ' .
                 $app->applied_to_invoice . '<BR>';
     } elsif ( $app->isa('FS::cust_pay_refund') ) {
       $desc .= '  ' .
-               emt("[_1][_2] refunded on [_3]", $money_char, $app->amount,
+               emt("[_1][_2] refunded on [_3]", $opt{money_char}, $app->amount,
                         time2str($date_format, $app->_date) ) . '<BR>';
     } else {
       die "$app is not a FS::cust_bill_pay or FS::cust_pay_refund";
@@ -106,11 +102,11 @@ if (    scalar(@cust_bill_pay)   == 0
   }
   if ( $cust_pay->unapplied > 0 ) {
     $desc .= '  '.
-             '<B><FONT COLOR="#FF0000">' .
-             emt("[_1][_2] unapplied", $money_char, $cust_pay->unapplied) .
+             '<B><FONT COLOR="#FF0000">'.
+             emt("[_1][_2] unapplied", $opt{money_char}, $cust_pay->unapplied).
              '</FONT></B>';
-    if ( $curuser->access_right('Apply payment') ) {
-      if ( $cust_pay->cust_main->total_owed > 0 ) {
+    if ( $opt{'Apply payment'} ) {
+      if ( $opt{total_owed} > 0 ) {
         $apply = ' ('.
                  include( '/elements/popup_link.html',
                             'label'      => emt('apply'),
@@ -122,7 +118,7 @@ if (    scalar(@cust_bill_pay)   == 0
                         ).
                  ')';
       }
-      if ( $cust_pay->cust_main->total_unapplied_refunds > 0 ) {
+      if ( $opt{total_unapplied_refunds} > 0 ) {
         $apply.= ' ('.
                  include( '/elements/popup_link.html',
                             'label'      => emt('apply to refund'),
@@ -149,14 +145,14 @@ my $view =
 
 my $refund = '';
 my $refund_days = $opt{'card_refund-days'} || 120;
-my @rights = ('Refund payment');
-push @rights, 'Refund credit card payment' if $payby eq 'CARD';
-push @rights, 'Refund Echeck payment' if $payby eq 'CHEK';
+my $refund_right = '';
+$refund_right = 'Refund credit card payment' if $payby eq 'CARD';
+$refund_right = 'Refund Echeck payment'      if $payby eq 'CHEK';
 if (    $cust_pay->closed !~ /^Y/i
      && $cust_pay->payby =~ /^(CARD|CHEK)$/
      && time-$cust_pay->_date < $refund_days*86400
      && $cust_pay->unrefunded > 0
-     && $curuser->access_right(\@rights)
+     && $opt{$refund_right}
 ) {
   $refund = qq! (<A HREF="${p}edit/cust_refund.cgi?payby=$1;!.
             qq!paynum=!. $cust_pay->paynum. '"'.
@@ -173,18 +169,11 @@ $void = areyousure_link("${p}misc/void-cust_pay.cgi?".$cust_pay->paynum,
                         emt('Void this payment from the database') . $voidmsg,
                         emt('void')
                        )
-    if (    $cust_pay->closed !~ /^Y/i
-     && (    ( $cust_pay->payby eq 'CARD'
-               && $curuser->access_right('Credit card void')
-             )
-          || ( $cust_pay->payby eq 'CHEK'
-               && $curuser->access_right('Echeck void')
-             )
-          || ( $cust_pay->payby !~ /^(CARD|CHEK)$/
-               && $curuser->access_right('Void payments')
-             )
-        )
-   );
+  if $cust_pay->closed !~ /^Y/i
+  && (    ( $cust_pay->payby eq 'CARD'          && $opt{'Credit card void'} )
+       || ( $cust_pay->payby eq 'CHEK'          && $opt{'Echeck void'}      )
+       || ( $cust_pay->payby !~ /^(CARD|CHEK)$/ && $opt{'Void payments'}    )
+     );
 
 my $delete = '';
 $delete = areyousure_link("${p}misc/delete-cust_pay.cgi?".$cust_pay->paynum,
@@ -192,8 +181,9 @@ $delete = areyousure_link("${p}misc/delete-cust_pay.cgi?".$cust_pay->paynum,
                             emt('Delete this payment from the database completely - not recommended'),
                             emt('delete')
                          )
-    if ( $cust_pay->closed !~ /^Y/i && $opt{'deletepayments'}
-                                 && $curuser->access_right('Delete payment') );
+  if $cust_pay->closed !~ /^Y/i
+  && $opt{'deletepayments'}
+  && $opt{'Delete payment'};
 
 my $unapply = '';
 $unapply = areyousure_link("${p}misc/unapply-cust_pay.cgi?".$cust_pay->paynum,
@@ -201,7 +191,8 @@ $unapply = areyousure_link("${p}misc/unapply-cust_pay.cgi?".$cust_pay->paynum,
                             emt('Keep this payment, but dissociate it from the invoices it is currently applied against'),
                             emt('unapply')
                           )
-    if ( $cust_pay->closed !~ /^Y/i && scalar(@cust_bill_pay)           
-                                && $curuser->access_right('Unapply payment') );
+  if $cust_pay->closed !~ /^Y/i
+  && scalar(@cust_bill_pay)           
+  && $opt{'Unapply payment'};
 
 </%init>
diff --git a/httemplate/view/cust_main/payment_history/pending_payment.html b/httemplate/view/cust_main/payment_history/pending_payment.html
index 113022d..3114923 100644
--- a/httemplate/view/cust_main/payment_history/pending_payment.html
+++ b/httemplate/view/cust_main/payment_history/pending_payment.html
@@ -3,10 +3,6 @@
 
 my( $cust_pay_pending, %opt ) = @_;
 
-my $conf = new FS::Conf;
-
-my $curuser = $FS::CurrentUser::CurrentUser;
-
 my ($payby, $payinfo) = translate_payinfo($cust_pay_pending);
 my $target = "$payby$payinfo";
 $payby = translate_payby($payby,$payinfo);
diff --git a/httemplate/view/cust_main/payment_history/refund.html b/httemplate/view/cust_main/payment_history/refund.html
index f14713c..fc2a5cc 100644
--- a/httemplate/view/cust_main/payment_history/refund.html
+++ b/httemplate/view/cust_main/payment_history/refund.html
@@ -5,8 +5,6 @@
 
 my( $cust_refund, %opt ) = @_;
 
-my $curuser = $FS::CurrentUser::CurrentUser;
-
 my $payby = $cust_refund->payby;
 my $payinfo = $payby eq 'CARD'
                 ? $cust_refund->paymask
@@ -34,8 +32,9 @@ $delete = areyousure_link("${p}misc/delete-cust_refund.cgi?".$cust_refund->refun
                            emt('Delete this refund from the database completely - not recommended'),
                            emt('delete')
                           ) 
-    if ( $cust_refund->closed !~ /^Y/i && $opt{'deleterefunds'} 
-                                && $curuser->access_right('Delete refund') );
+  if $cust_refund->closed !~ /^Y/i
+  && $opt{'deleterefunds'} 
+  && $opt{'Delete refund'};
 
 </%init>
 
diff --git a/httemplate/view/cust_main/payment_history/statement.html b/httemplate/view/cust_main/payment_history/statement.html
index dedec9b..1517fd5 100644
--- a/httemplate/view/cust_main/payment_history/statement.html
+++ b/httemplate/view/cust_main/payment_history/statement.html
@@ -5,8 +5,6 @@
 
 my( $cust_statement, %opt ) = @_;
 
-my $curuser = $FS::CurrentUser::CurrentUser;
-
 my($pre, $post) = ('', '');
 #if ( $cust_statement->owed > 0 ) {
 #  $pre = '<B><FONT SIZE="+1" COLOR="#FF0000">Open ';
@@ -15,16 +13,14 @@ my($pre, $post) = ('', '');
 
 my $statementnum = $cust_statement->statementnum;
 
-my $link = $curuser->access_right('View invoices')
+my $link = $opt{'View invoices'}
              ? qq!<A HREF="${p}view/cust_statement.html?$statementnum">!
              : '';
 
 my $events = '';
 
 #if ( $cust_statement->num_cust_event
-#     && (    $curuser->access_right('Billing event reports')
-#          || $curuser->access_right('View customer billing events')
-#        )
+#     && ($opt{'Billing event reports'} || $opt{'View customer billing events'})
 #   ) {
 #  $events =
 #    qq!<BR><FONT SIZE="-1"><A HREF="${p}search/cust_event.html?statementnum=!.
diff --git a/httemplate/view/cust_main/payment_history/voided_credit.html b/httemplate/view/cust_main/payment_history/voided_credit.html
index 0723a72..9ff4c1b 100644
--- a/httemplate/view/cust_main/payment_history/voided_credit.html
+++ b/httemplate/view/cust_main/payment_history/voided_credit.html
@@ -14,8 +14,6 @@ my( $cust_credit_void, %opt ) = @_;
 
 my $date_format = $opt{'date_format'} || '%m/%d/%Y';
 
-my $curuser = $FS::CurrentUser::CurrentUser;
-
 #my $unvoid = ''; # not yet available
 my $reason = $cust_credit_void->reason;
 $reason = " ($reason)" if $reason;
diff --git a/httemplate/view/cust_main/payment_history/voided_invoice.html b/httemplate/view/cust_main/payment_history/voided_invoice.html
index 15393cb..f9ff307 100644
--- a/httemplate/view/cust_main/payment_history/voided_invoice.html
+++ b/httemplate/view/cust_main/payment_history/voided_invoice.html
@@ -11,17 +11,13 @@ my( $cust_bill_void, %opt ) = @_;
 
 my $date_format = $opt{'date_format'} || '%m/%d/%Y';
 
-my $conf = new FS::Conf;
-
-my $curuser = $FS::CurrentUser::CurrentUser;
-
 my $invoice = emt("Invoice #[_1] (Balance [_2])",$cust_bill_void->display_invnum, $cust_bill_void->charged);
 
 my $under = '';
 
 my $invnum = $cust_bill_void->invnum;
 
-my $link = $curuser->access_right('View invoices')
+my $link = $opt{'View invoices'}
              ? qq!<A HREF="${p}view/cust_bill_void.html?$invnum">!
              : '';
 
@@ -31,7 +27,7 @@ $unvoid = areyousure_link("${p}misc/unvoid-cust_bill_void.html?invnum=". $cust_b
                             emt('Unvoid this invoice'),
                             emt('unvoid')
                          )
-  if $cust_bill_void->closed !~ /^Y/ && $curuser->access_right('Unvoid invoices');
+  if $cust_bill_void->closed !~ /^Y/ && $opt{'Unvoid invoices'};
 
 my $delete = '';
 $delete = areyousure_link("${p}misc/delete-cust_bill.html?$invnum",
@@ -39,15 +35,13 @@ $delete = areyousure_link("${p}misc/delete-cust_bill.html?$invnum",
                             emt('Delete this invoice from the database completely'),
                             emt('delete')
                         )
-    if ( $opt{'deleteinvoices'} && $curuser->access_right('Delete invoices') );
+    if $opt{'deleteinvoices'} && $opt{'Delete invoices'};
 
 my $events = '';
-#1.9
 if ( $cust_bill_void->num_cust_event
-     && (    $curuser->access_right('Billing event reports')
-          || $curuser->access_right('View customer billing events')
-        )
-   ) {
+     && ($opt{'Billing event reports'} || $opt{'View customer billing events'})
+   )
+{
   $under .=
     qq!<BR><A HREF="${p}search/cust_event.html?invnum=$invnum">( !.
       emt('View invoice events').' )</A>';
diff --git a/httemplate/view/cust_main/payment_history/voided_payment.html b/httemplate/view/cust_main/payment_history/voided_payment.html
index 88b5e0a..a8194a7 100644
--- a/httemplate/view/cust_main/payment_history/voided_payment.html
+++ b/httemplate/view/cust_main/payment_history/voided_payment.html
@@ -11,8 +11,6 @@ my( $cust_pay_void, %opt ) = @_;
 
 my $date_format = $opt{'date_format'} || '%m/%d/%Y';
 
-my $curuser = $FS::CurrentUser::CurrentUser;
-
 my ($payby,$payinfo) = translate_payinfo($cust_pay_void);
 $payby = translate_payby($payby,$payinfo);
 my $info = $payby ? "($payby$payinfo)" : '';
@@ -31,6 +29,6 @@ $unvoid = areyousure_link("${p}misc/unvoid-cust_pay_void.cgi?".$cust_pay_void->p
                             emt('Unvoid this payment from the database') . $unvoidmsg,
                             emt('unvoid')
                          )
-    if ( $cust_pay_void->closed !~ /^Y/i && $curuser->access_right('Unvoid payments') );
+  if $cust_pay_void->closed !~ /^Y/i && $opt{'Unvoid payments'};
 
 </%init>

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

Summary of changes:
 httemplate/view/cust_main/payment_history.html     |   26 ++++++++-
 .../view/cust_main/payment_history/credit.html     |   39 ++++++-------
 .../view/cust_main/payment_history/invoice.html    |   18 ++----
 .../view/cust_main/payment_history/payment.html    |   61 ++++++++-----------
 .../cust_main/payment_history/pending_payment.html |    4 -
 .../view/cust_main/payment_history/refund.html     |    7 +-
 .../view/cust_main/payment_history/statement.html  |    8 +--
 .../cust_main/payment_history/voided_credit.html   |    2 -
 .../cust_main/payment_history/voided_invoice.html  |   18 ++----
 .../cust_main/payment_history/voided_payment.html  |    4 +-
 10 files changed, 86 insertions(+), 101 deletions(-)




More information about the freeside-commits mailing list