[freeside-commits] branch FREESIDE_3_BRANCH updated. 1694050ffbdb5c4e214bc0d13294d3b262d33129

Jonathan Prykop jonathan at 420.am
Tue Feb 23 07:44:36 PST 2016


The branch, FREESIDE_3_BRANCH has been updated
       via  1694050ffbdb5c4e214bc0d13294d3b262d33129 (commit)
       via  d01e39fb1dfe39717ddf7a7b0870a95ef433af41 (commit)
       via  3c3608637cf9ed1f6368b2f4d17415db903e4b92 (commit)
       via  1ea1290793b5a6edd164906f1fc0ee1fc1e7d217 (commit)
      from  dd72ad399c69875b14703e9086f8cedb88acb518 (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 1694050ffbdb5c4e214bc0d13294d3b262d33129
Author: Jonathan Prykop <jonathan at freeside.biz>
Date:   Tue Feb 23 09:04:46 2016 -0600

    RT#39586 Manual check refunds cannot be unapplied [nbsp]

diff --git a/httemplate/view/cust_main/payment_history/credit.html b/httemplate/view/cust_main/payment_history/credit.html
index 2a41196..4655203 100644
--- a/httemplate/view/cust_main/payment_history/credit.html
+++ b/httemplate/view/cust_main/payment_history/credit.html
@@ -45,7 +45,7 @@ if (    scalar(@cust_credit_bill)   == 0
     if ( $opt{total_unapplied_refunds} > 0 ) {
       $apply.= ' ('.
                include( '/elements/popup_link.html',
-                          'label'    => emt('apply refund'),
+                          'label'    => emt('apply').' '.emt('refund'),
                           'action'   => "${p}edit/cust_credit_refund.cgi?".
                                         $cust_credit->crednum,
                           'actionlabel' => emt('Apply credit to refund'),
@@ -100,7 +100,7 @@ if (    scalar(@cust_credit_bill)   == 0
       if ( $opt{total_unapplied_refunds} > 0 ) {
         $apply.= ' ('.
                  include( '/elements/popup_link.html',
-                            'label'       => emt('apply refund'),
+                            'label'       => emt('apply').' '.emt('refund'),
                             'action'      => "${p}edit/cust_credit_refund.cgi?".
                                              $cust_credit->crednum,
                             'actionlabel' => emt('Apply credit to refund'),
@@ -159,7 +159,7 @@ if ($opt{'Unapply credit'} && !$cust_credit->closed) {
   $unapply .= areyousure_link("${p}misc/unapply-cust_credit_refund.cgi?".$cust_credit->crednum,
                                emt('Are you sure you want to unapply this credit from refunds?'),
                                emt('Keep this credit, but dissociate it from the refunds it is currently applied to'),
-                               emt('unapply refunds')
+                               emt('unapply').' '.emt('refunds')
                              )
     if $cust_credit->refund_to_unapply;
 }
diff --git a/httemplate/view/cust_main/payment_history/payment.html b/httemplate/view/cust_main/payment_history/payment.html
index 5288385..6c72323 100644
--- a/httemplate/view/cust_main/payment_history/payment.html
+++ b/httemplate/view/cust_main/payment_history/payment.html
@@ -103,7 +103,7 @@ if ($unapplied > 0) {
     if ( $opt{total_unapplied_refunds} > 0 ) {
       $apply.= ' ('.
                include( '/elements/popup_link.html',
-                          'label'       => emt('apply refund'),
+                          'label'       => emt('apply').' '.emt('refund'),
                           'action'      => "${p}edit/cust_pay_refund.cgi?".
                                            $cust_pay->paynum,
                           'actionlabel' => emt('Apply payment to refund'),
@@ -213,7 +213,7 @@ if ($opt{'Unapply payment'} && !$cust_pay->closed) {
   $unapply .= areyousure_link("${p}misc/unapply-cust_pay_refund.cgi?".$cust_pay->paynum,
                                emt('Are you sure you want to unapply this payment from refunds?'),
                                emt('Keep this payment, but dissociate it from the refunds it is currently applied to'),
-                               emt('unapply refunds')
+                               emt('unapply').' '.emt('refunds')
                              )
     if $cust_pay->refund_to_unapply;
 }

commit d01e39fb1dfe39717ddf7a7b0870a95ef433af41
Author: Jonathan Prykop <jonathan at freeside.biz>
Date:   Tue Feb 23 09:30:59 2016 -0600

    RT#39586 Manual check refunds cannot be unapplied [v3 merge]

diff --git a/FS/FS/cust_main/Billing_Realtime.pm b/FS/FS/cust_main/Billing_Realtime.pm
index 58ae97c..e9a3db2 100644
--- a/FS/FS/cust_main/Billing_Realtime.pm
+++ b/FS/FS/cust_main/Billing_Realtime.pm
@@ -1382,8 +1382,6 @@ sub realtime_refund_bop {
     warn "  $_ => $options{$_}\n" foreach keys %options;
   }
 
-  return "No reason specified" unless $options{'reasonnum'} =~ /^\d+$/;
-
   my %content = ();
 
   ###
diff --git a/FS/FS/cust_refund.pm b/FS/FS/cust_refund.pm
index d6cedf5..1791510 100644
--- a/FS/FS/cust_refund.pm
+++ b/FS/FS/cust_refund.pm
@@ -158,7 +158,6 @@ sub insert {
       $self->set('reasonnum', $reason->get('reasonnum'));
       $self->set('reason', '');
     }
-    $self->set('reasonnum', $reason->reasonnum);
   }
 
   if ( $self->crednum ) {

commit 3c3608637cf9ed1f6368b2f4d17415db903e4b92
Author: Jonathan Prykop <jonathan at freeside.biz>
Date:   Mon Feb 22 17:14:07 2016 -0600

    RT#39586 Manual check refunds cannot be unapplied [v3 merge]

diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm
index 774a11f..3fdd4a8 100644
--- a/FS/FS/Schema.pm
+++ b/FS/FS/Schema.pm
@@ -2144,6 +2144,7 @@ sub tables_hashref {
 	'paymask', 'varchar', 'NULL', $char_d, '', '', 
         'paybatch',     'varchar',   'NULL', $char_d, '', '', 
         'closed',    'char', 'NULL', 1, '', '', 
+        'source_paynum', 'int', 'NULL', '', '', '', # link to cust_payby, to prevent unapply of gateway-generated refunds
         # credit card/EFT fields (formerly in paybatch)
         'gatewaynum',     'int', 'NULL', '', '', '', # payment_gateway FK
         'processor',  'varchar', 'NULL', $char_d, '', '', # module name
diff --git a/FS/FS/cust_credit.pm b/FS/FS/cust_credit.pm
index dfa4b1b..bf205aa 100644
--- a/FS/FS/cust_credit.pm
+++ b/FS/FS/cust_credit.pm
@@ -1061,7 +1061,7 @@ sub refund_to_unapply {
     'table'   => 'cust_credit_refund',
     'hashref' => { 'crednum' => $self->crednum },
     'addl_from' => 'LEFT JOIN cust_refund USING (refundnum)',
-    'extra_sql' => "AND (cust_refund.closed = '' OR cust_refund.closed IS NULL)",
+    'extra_sql' => "AND cust_refund.closed IS NULL AND cust_refund.source_paynum IS NULL",
   });
 }
 
diff --git a/FS/FS/cust_main/Billing_Realtime.pm b/FS/FS/cust_main/Billing_Realtime.pm
index 61acb1d..58ae97c 100644
--- a/FS/FS/cust_main/Billing_Realtime.pm
+++ b/FS/FS/cust_main/Billing_Realtime.pm
@@ -1382,6 +1382,8 @@ sub realtime_refund_bop {
     warn "  $_ => $options{$_}\n" foreach keys %options;
   }
 
+  return "No reason specified" unless $options{'reasonnum'} =~ /^\d+$/;
+
   my %content = ();
 
   ###
@@ -1665,6 +1667,7 @@ sub realtime_refund_bop {
   my $cust_refund = new FS::cust_refund ( {
     'custnum'  => $self->custnum,
     'paynum'   => $options{'paynum'},
+    'source_paynum' => $options{'paynum'},
     'refund'   => $amount,
     '_date'    => '',
     'payby'    => $bop_method2payby{$options{method}},
@@ -1678,6 +1681,7 @@ sub realtime_refund_bop {
   my $error = $cust_refund->insert;
   if ( $error ) {
     $cust_refund->paynum(''); #try again with no specific paynum
+    $cust_refund->source_paynum('');
     my $error2 = $cust_refund->insert;
     if ( $error2 ) {
       # gah, even with transactions.
diff --git a/FS/FS/cust_pay.pm b/FS/FS/cust_pay.pm
index 817e379..d0966ca 100644
--- a/FS/FS/cust_pay.pm
+++ b/FS/FS/cust_pay.pm
@@ -962,7 +962,7 @@ sub refund_to_unapply {
     'table'   => 'cust_pay_refund',
     'hashref' => { 'paynum' => $self->paynum },
     'addl_from' => 'LEFT JOIN cust_refund USING (refundnum)',
-    'extra_sql' => "AND (cust_refund.closed = '' OR cust_refund.closed IS NULL)",
+    'extra_sql' => "AND cust_refund.closed IS NULL AND cust_refund.source_paynum IS NULL",
   });
 }
 
diff --git a/FS/FS/cust_refund.pm b/FS/FS/cust_refund.pm
index 74728a6..d6cedf5 100644
--- a/FS/FS/cust_refund.pm
+++ b/FS/FS/cust_refund.pm
@@ -158,6 +158,7 @@ sub insert {
       $self->set('reasonnum', $reason->get('reasonnum'));
       $self->set('reason', '');
     }
+    $self->set('reasonnum', $reason->reasonnum);
   }
 
   if ( $self->crednum ) {
@@ -306,6 +307,7 @@ sub check {
     || $self->ut_numbern('_date')
     || $self->ut_textn('paybatch')
     || $self->ut_enum('closed', [ '', 'Y' ])
+    || $self->ut_foreign_keyn('source_paynum', 'cust_pay', 'paynum')
   ;
   return $error if $error;
 
diff --git a/httemplate/view/cust_main/payment_history/credit.html b/httemplate/view/cust_main/payment_history/credit.html
index e9b42d3..2a41196 100644
--- a/httemplate/view/cust_main/payment_history/credit.html
+++ b/httemplate/view/cust_main/payment_history/credit.html
@@ -45,7 +45,7 @@ if (    scalar(@cust_credit_bill)   == 0
     if ( $opt{total_unapplied_refunds} > 0 ) {
       $apply.= ' ('.
                include( '/elements/popup_link.html',
-                          'label'    => emt('apply to refund'),
+                          'label'    => emt('apply refund'),
                           'action'   => "${p}edit/cust_credit_refund.cgi?".
                                         $cust_credit->crednum,
                           'actionlabel' => emt('Apply credit to refund'),
@@ -100,7 +100,7 @@ if (    scalar(@cust_credit_bill)   == 0
       if ( $opt{total_unapplied_refunds} > 0 ) {
         $apply.= ' ('.
                  include( '/elements/popup_link.html',
-                            'label'       => emt('apply to refund'),
+                            'label'       => emt('apply refund'),
                             'action'      => "${p}edit/cust_credit_refund.cgi?".
                                              $cust_credit->crednum,
                             'actionlabel' => emt('Apply credit to refund'),
@@ -150,20 +150,18 @@ $delete = areyousure_link("${p}misc/delete-cust_credit.cgi?".$cust_credit->credn
 my $unapply = '';
 
 if ($opt{'Unapply credit'} && !$cust_credit->closed) {
-  my $refund_to_unapply = $cust_credit->refund_to_unapply;
-  my $usepre = $refund_to_unapply && @cust_credit_bill;
   $unapply = areyousure_link("${p}misc/unapply-cust_credit.cgi?".$cust_credit->crednum,
                               emt('Are you sure you want to unapply this credit from invoices?'),
                               emt('Keep this credit, but dissociate it from the invoices it is currently applied against'),
-                              emt('unapply') . ($usepre ? ' ' . emt('invoices') : '')
+                              emt('unapply')
                             )
     if @cust_credit_bill;
   $unapply .= areyousure_link("${p}misc/unapply-cust_credit_refund.cgi?".$cust_credit->crednum,
                                emt('Are you sure you want to unapply this credit from refunds?'),
                                emt('Keep this credit, but dissociate it from the refunds it is currently applied to'),
-                               emt('unapply') . ($usepre ? ' ' . emt('refunds') : '')
+                               emt('unapply refunds')
                              )
-    if $refund_to_unapply;
+    if $cust_credit->refund_to_unapply;
 }
 
 my $reason = $cust_credit->reason;
diff --git a/httemplate/view/cust_main/payment_history/payment.html b/httemplate/view/cust_main/payment_history/payment.html
index c690a92..5288385 100644
--- a/httemplate/view/cust_main/payment_history/payment.html
+++ b/httemplate/view/cust_main/payment_history/payment.html
@@ -103,7 +103,7 @@ if ($unapplied > 0) {
     if ( $opt{total_unapplied_refunds} > 0 ) {
       $apply.= ' ('.
                include( '/elements/popup_link.html',
-                          'label'       => emt('apply to refund'),
+                          'label'       => emt('apply refund'),
                           'action'      => "${p}edit/cust_pay_refund.cgi?".
                                            $cust_pay->paynum,
                           'actionlabel' => emt('Apply payment to refund'),
@@ -204,20 +204,18 @@ $delete = areyousure_link("${p}misc/delete-cust_pay.cgi?".$cust_pay->paynum,
 
 my $unapply = '';
 if ($opt{'Unapply payment'} && !$cust_pay->closed) {
-  my $refund_to_unapply = $cust_pay->refund_to_unapply;
-  my $usepre = $refund_to_unapply && @cust_bill_pay;
   $unapply = areyousure_link("${p}misc/unapply-cust_pay.cgi?".$cust_pay->paynum,
                               emt('Are you sure you want to unapply this payment from invoices?'),
                               emt('Keep this payment, but dissociate it from the invoices it is currently applied against'),
-                              emt('unapply') . ($usepre ? ' ' . emt('invoices') : '')
+                              emt('unapply')
                             )
     if @cust_bill_pay;
   $unapply .= areyousure_link("${p}misc/unapply-cust_pay_refund.cgi?".$cust_pay->paynum,
                                emt('Are you sure you want to unapply this payment from refunds?'),
                                emt('Keep this payment, but dissociate it from the refunds it is currently applied to'),
-                               emt('unapply') . ($usepre ? ' ' . emt('refunds') : '')
+                               emt('unapply refunds')
                              )
-    if $refund_to_unapply;
+    if $cust_pay->refund_to_unapply;
 }
 
 </%init>

commit 1ea1290793b5a6edd164906f1fc0ee1fc1e7d217
Author: Jonathan Prykop <jonathan at freeside.biz>
Date:   Fri Feb 5 15:16:12 2016 -0600

    RT#39586 Manual check refunds cannot be unapplied

diff --git a/FS/FS/cust_credit.pm b/FS/FS/cust_credit.pm
index 77b914f..dfa4b1b 100644
--- a/FS/FS/cust_credit.pm
+++ b/FS/FS/cust_credit.pm
@@ -1044,6 +1044,58 @@ sub credit_lineitems {
 
 }
 
+### refund_to_unapply/unapply_refund false laziness with FS::cust_pay
+
+=item refund_to_unapply
+
+Returns L<FS::cust_credit_refund> objects that will be deleted by L</unapply_refund>
+(all currently applied refunds that aren't closed.)
+Returns empty list if credit itself is closed.
+
+=cut
+
+sub refund_to_unapply {
+  my $self = shift;
+  return () if $self->closed;
+  qsearch({
+    'table'   => 'cust_credit_refund',
+    'hashref' => { 'crednum' => $self->crednum },
+    'addl_from' => 'LEFT JOIN cust_refund USING (refundnum)',
+    'extra_sql' => "AND (cust_refund.closed = '' OR cust_refund.closed IS NULL)",
+  });
+}
+
+=item unapply_refund
+
+Deletes all objects returned by L</refund_to_unapply>.
+
+=cut
+
+sub unapply_refund {
+  my $self = shift;
+
+  local $SIG{HUP} = 'IGNORE';
+  local $SIG{INT} = 'IGNORE';
+  local $SIG{QUIT} = 'IGNORE';
+  local $SIG{TERM} = 'IGNORE';
+  local $SIG{TSTP} = 'IGNORE';
+  local $SIG{PIPE} = 'IGNORE';
+
+  my $oldAutoCommit = $FS::UID::AutoCommit;
+  local $FS::UID::AutoCommit = 0;
+
+  foreach my $cust_credit_refund ($self->refund_to_unapply) {
+    my $error = $cust_credit_refund->delete;
+    if ($error) {
+      dbh->rollback if $oldAutoCommit;
+      return $error;
+    }
+  }
+
+  dbh->commit or die dbh->errstr if $oldAutoCommit;
+  return '';
+}
+
 =back
 
 =head1 SUBROUTINES
diff --git a/FS/FS/cust_pay.pm b/FS/FS/cust_pay.pm
index 90f491b..817e379 100644
--- a/FS/FS/cust_pay.pm
+++ b/FS/FS/cust_pay.pm
@@ -945,6 +945,58 @@ sub refund {
   return '';
 }
 
+### refund_to_unapply/unapply_refund false laziness with FS::cust_credit
+
+=item refund_to_unapply
+
+Returns L<FS::cust_pay_refund> objects that will be deleted by L</unapply_refund>
+(all currently applied refunds that aren't closed.)
+Returns empty list if payment itself is closed.
+
+=cut
+
+sub refund_to_unapply {
+  my $self = shift;
+  return () if $self->closed;
+  qsearch({
+    'table'   => 'cust_pay_refund',
+    'hashref' => { 'paynum' => $self->paynum },
+    'addl_from' => 'LEFT JOIN cust_refund USING (refundnum)',
+    'extra_sql' => "AND (cust_refund.closed = '' OR cust_refund.closed IS NULL)",
+  });
+}
+
+=item unapply_refund
+
+Deletes all objects returned by L</refund_to_unapply>.
+
+=cut
+
+sub unapply_refund {
+  my $self = shift;
+
+  local $SIG{HUP} = 'IGNORE';
+  local $SIG{INT} = 'IGNORE';
+  local $SIG{QUIT} = 'IGNORE';
+  local $SIG{TERM} = 'IGNORE';
+  local $SIG{TSTP} = 'IGNORE';
+  local $SIG{PIPE} = 'IGNORE';
+
+  my $oldAutoCommit = $FS::UID::AutoCommit;
+  local $FS::UID::AutoCommit = 0;
+
+  foreach my $cust_pay_refund ($self->refund_to_unapply) {
+    my $error = $cust_pay_refund->delete;
+    if ($error) {
+      dbh->rollback if $oldAutoCommit;
+      return $error;
+    }
+  }
+
+  dbh->commit or die dbh->errstr if $oldAutoCommit;
+  return '';
+}
+
 =back
 
 =head1 CLASS METHODS
@@ -1032,7 +1084,7 @@ sub batch_insert {
 
 Returns an SQL fragment to retreive the unapplied amount.
 
-=cut 
+=cut
 
 sub unapplied_sql {
   my ($class, $start, $end) = @_;
diff --git a/httemplate/misc/unapply-cust_credit_refund.cgi b/httemplate/misc/unapply-cust_credit_refund.cgi
new file mode 100755
index 0000000..55a81b0
--- /dev/null
+++ b/httemplate/misc/unapply-cust_credit_refund.cgi
@@ -0,0 +1,18 @@
+<% $cgi->redirect($p. "view/cust_main.cgi?custnum=". $custnum. ";show=payment_history") %>
+<%init>
+
+die "access denied"
+  unless $FS::CurrentUser::CurrentUser->access_right('Unapply credit');
+
+#untaint crednum
+my($query) = $cgi->keywords;
+$query =~ /^(\d+)$/ || die "Illegal crednum";
+my $crednum = $1;
+
+my $cust_credit = qsearchs('cust_credit', { 'crednum' => $crednum } );
+my $custnum = $cust_credit->custnum;
+
+my $error = $cust_credit->unapply_refund;
+errorpage($error) if $error;
+
+</%init>
diff --git a/httemplate/misc/unapply-cust_pay_refund.cgi b/httemplate/misc/unapply-cust_pay_refund.cgi
new file mode 100755
index 0000000..9e470b6
--- /dev/null
+++ b/httemplate/misc/unapply-cust_pay_refund.cgi
@@ -0,0 +1,18 @@
+<% $cgi->redirect($p. "view/cust_main.cgi?custnum=". $custnum. ";show=payment_history") %>
+<%init>
+
+die "access denied"
+  unless $FS::CurrentUser::CurrentUser->access_right('Unapply payment');
+
+#untaint paynum
+my($query) = $cgi->keywords;
+$query =~ /^(\d+)$/ || die "Illegal paynum";
+my $paynum = $1;
+
+my $cust_pay = qsearchs('cust_pay', { 'paynum' => $paynum } );
+my $custnum = $cust_pay->custnum;
+
+my $error = $cust_pay->unapply_refund;
+errorpage($error) if $error;
+
+</%init>
diff --git a/httemplate/view/cust_main/payment_history/credit.html b/httemplate/view/cust_main/payment_history/credit.html
index 3eed833..e9b42d3 100644
--- a/httemplate/view/cust_main/payment_history/credit.html
+++ b/httemplate/view/cust_main/payment_history/credit.html
@@ -148,14 +148,23 @@ $delete = areyousure_link("${p}misc/delete-cust_credit.cgi?".$cust_credit->credn
   && $opt{'Delete credit'};
 
 my $unapply = '';
-$unapply = areyousure_link("${p}misc/unapply-cust_credit.cgi?".$cust_credit->crednum,
-                            emt('Are you sure you want to unapply this credit?'),
-                            '',
-                            emt('unapply')
-                          )
-  if $cust_credit->closed !~ /^Y/i
-  && scalar(@cust_credit_bill)
-  && $opt{'Unapply credit'};
+
+if ($opt{'Unapply credit'} && !$cust_credit->closed) {
+  my $refund_to_unapply = $cust_credit->refund_to_unapply;
+  my $usepre = $refund_to_unapply && @cust_credit_bill;
+  $unapply = areyousure_link("${p}misc/unapply-cust_credit.cgi?".$cust_credit->crednum,
+                              emt('Are you sure you want to unapply this credit from invoices?'),
+                              emt('Keep this credit, but dissociate it from the invoices it is currently applied against'),
+                              emt('unapply') . ($usepre ? ' ' . emt('invoices') : '')
+                            )
+    if @cust_credit_bill;
+  $unapply .= areyousure_link("${p}misc/unapply-cust_credit_refund.cgi?".$cust_credit->crednum,
+                               emt('Are you sure you want to unapply this credit from refunds?'),
+                               emt('Keep this credit, but dissociate it from the refunds it is currently applied to'),
+                               emt('unapply') . ($usepre ? ' ' . emt('refunds') : '')
+                             )
+    if $refund_to_unapply;
+}
 
 my $reason = $cust_credit->reason;
 $reason = $reason ? " ($reason)" : '';
diff --git a/httemplate/view/cust_main/payment_history/payment.html b/httemplate/view/cust_main/payment_history/payment.html
index 6520017..c690a92 100644
--- a/httemplate/view/cust_main/payment_history/payment.html
+++ b/httemplate/view/cust_main/payment_history/payment.html
@@ -203,13 +203,21 @@ $delete = areyousure_link("${p}misc/delete-cust_pay.cgi?".$cust_pay->paynum,
   && $opt{'Delete payment'};
 
 my $unapply = '';
-$unapply = areyousure_link("${p}misc/unapply-cust_pay.cgi?".$cust_pay->paynum,
-                            emt('Are you sure you want to unapply this payment?'),
-                            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)           
-  && $opt{'Unapply payment'};
+if ($opt{'Unapply payment'} && !$cust_pay->closed) {
+  my $refund_to_unapply = $cust_pay->refund_to_unapply;
+  my $usepre = $refund_to_unapply && @cust_bill_pay;
+  $unapply = areyousure_link("${p}misc/unapply-cust_pay.cgi?".$cust_pay->paynum,
+                              emt('Are you sure you want to unapply this payment from invoices?'),
+                              emt('Keep this payment, but dissociate it from the invoices it is currently applied against'),
+                              emt('unapply') . ($usepre ? ' ' . emt('invoices') : '')
+                            )
+    if @cust_bill_pay;
+  $unapply .= areyousure_link("${p}misc/unapply-cust_pay_refund.cgi?".$cust_pay->paynum,
+                               emt('Are you sure you want to unapply this payment from refunds?'),
+                               emt('Keep this payment, but dissociate it from the refunds it is currently applied to'),
+                               emt('unapply') . ($usepre ? ' ' . emt('refunds') : '')
+                             )
+    if $refund_to_unapply;
+}
 
 </%init>

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

Summary of changes:
 FS/FS/Schema.pm                                    |    1 +
 FS/FS/cust_credit.pm                               |   52 +++++++++++++++++++
 FS/FS/cust_main/Billing_Realtime.pm                |    2 +
 FS/FS/cust_pay.pm                                  |   54 +++++++++++++++++++-
 FS/FS/cust_refund.pm                               |    1 +
 ...t_credit.cgi => unapply-cust_credit_refund.cgi} |    8 ++-
 ...ly-cust_pay.cgi => unapply-cust_pay_refund.cgi} |    4 +-
 .../view/cust_main/payment_history/credit.html     |   27 ++++++----
 .../view/cust_main/payment_history/payment.html    |   24 +++++----
 9 files changed, 146 insertions(+), 27 deletions(-)
 copy httemplate/misc/{unapply-cust_credit.cgi => unapply-cust_credit_refund.cgi} (62%)
 copy httemplate/misc/{unapply-cust_pay.cgi => unapply-cust_pay_refund.cgi} (72%)




More information about the freeside-commits mailing list