[freeside-commits] freeside/httemplate/edit/process cust_bill_pay.cgi, 1.8, 1.9 cust_credit_bill.cgi, 1.10, 1.11 cust_pay_refund.cgi, NONE, 1.1 cust_credit_refund.cgi, NONE, 1.1

Ivan,,, ivan at wavetail.420.am
Wed Jun 4 22:06:38 PDT 2008


Update of /home/cvs/cvsroot/freeside/httemplate/edit/process
In directory wavetail.420.am:/tmp/cvs-serv21594/httemplate/edit/process

Modified Files:
	cust_bill_pay.cgi cust_credit_bill.cgi 
Added Files:
	cust_pay_refund.cgi cust_credit_refund.cgi 
Log Message:
payment and credit applications have separate "apply to refund" choices now, and no auto-refund choice in the invoice dropdown.  RT#3545

Index: cust_bill_pay.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/cust_bill_pay.cgi,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- cust_bill_pay.cgi	13 Jan 2008 21:41:35 -0000	1.8
+++ cust_bill_pay.cgi	5 Jun 2008 05:06:36 -0000	1.9
@@ -1,49 +1,13 @@
-%if ( $error ) {
-%  $cgi->param('error', $error);
-<% $cgi->redirect(popurl(2). "cust_bill_pay.cgi?". $cgi->query_string ) %>
-%} else {
-<% header('Payment application sucessful') %>
-  <SCRIPT TYPE="text/javascript">
-    window.top.location.reload();
-  </SCRIPT>
-  </BODY>
-  </HTML>
-% } 
+<% include('elements/ApplicationCommon.html',
+     'error_redirect' => 'cust_bill_pay.cgi',
+     'src_table'      => 'cust_pay',
+     'src_thing'      => 'payment',
+     'link_table'     => 'cust_bill_pay',
+   )
+%>
 <%init>
 
 die "access denied"
   unless $FS::CurrentUser::CurrentUser->access_right('Apply payment');
 
-$cgi->param('paynum') =~ /^(\d*)$/ or die "Illegal paynum!";
-my $paynum = $1;
-
-my $cust_pay = qsearchs('cust_pay', { 'paynum' => $paynum } )
-  or die "No such paynum";
-
-my $cust_main = qsearchs('cust_main', { 'custnum' => $cust_pay->custnum } )
-  or die "Bogus credit:  not attached to customer";
-
-my $custnum = $cust_main->custnum;
-
-my $new;
-if ($cgi->param('invnum') =~ /^Refund$/) {
-  $new = new FS::cust_refund ( {
-    'reason'  => 'Refunding payment', #enter reason in UI
-    'refund'  => $cgi->param('amount'),
-    'payby'   => 'BILL',
-    #'_date'   => $cgi->param('_date'),
-    'payinfo' => 'Cash', #enter payinfo in UI
-    'paynum' => $paynum,
-  } );
-} else {
-  $new = new FS::cust_bill_pay ( {
-    map {
-      $_, scalar($cgi->param($_));
-    #} qw(custnum _date amount invnum)
-    } fields('cust_bill_pay')
-  } );
-}
-
-my $error = $new->insert;
-
 </%init>

--- NEW FILE: cust_pay_refund.cgi ---
<% include('elements/ApplicationCommon.html',
     'error_redirect' => 'cust_bill_pay.cgi',
     'src_table'      => 'cust_pay',
     'src_thing'      => 'payment',
     'link_table'     => 'cust_pay_refund',
   )
%>
<%init>

die "access denied"
  unless $FS::CurrentUser::CurrentUser->access_right('Apply payment');

</%init>

--- NEW FILE: cust_credit_refund.cgi ---
<% include('elements/ApplicationCommon.html',
     'error_redirect' => 'cust_credit_bill.cgi',
     'src_table'      => 'cust_credit',
     'src_thing'      => 'credit',
     'link_table'     => 'cust_credit_refund',
   )
%>
<%init>

die "access denied"
  unless $FS::CurrentUser::CurrentUser->access_right('Apply credit');

</%init>

Index: cust_credit_bill.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/cust_credit_bill.cgi,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- cust_credit_bill.cgi	13 Jan 2008 21:44:01 -0000	1.10
+++ cust_credit_bill.cgi	5 Jun 2008 05:06:36 -0000	1.11
@@ -1,50 +1,13 @@
-%if ( $error ) {
-%  $cgi->param('error', $error);
-<% $cgi->redirect(popurl(2). "cust_credit_bill.cgi?". $cgi->query_string ) %>
-%} else {
-<% header('Credit application sucessful') %>
-  <SCRIPT TYPE="text/javascript">
-    window.top.location.reload();
-  </SCRIPT>
-  </BODY>
-  </HTML>
-% } 
+<% include('elements/ApplicationCommon.html',
+     'error_redirect' => 'cust_credit_bill.cgi',
+     'src_table'      => 'cust_credit',
+     'src_thing'      => 'credit',
+     'link_table'     => 'cust_credit_bill',
+   )
+%>
 <%init>
 
 die "access denied"
   unless $FS::CurrentUser::CurrentUser->access_right('Apply credit');
 
-$cgi->param('crednum') =~ /^(\d*)$/ or die "Illegal crednum!";
-my $crednum = $1;
-
-my $cust_credit = qsearchs('cust_credit', { 'crednum' => $crednum } )
-  or die "No such crednum";
-
-my $cust_main = qsearchs('cust_main', { 'custnum' => $cust_credit->custnum } )
-  or die "Bogus credit:  not attached to customer";
-
-my $custnum = $cust_main->custnum;
-
-my $new;
-if ($cgi->param('invnum') =~ /^Refund$/) {
-  $new = new FS::cust_refund ( {
-    'reason'  => ( $cust_credit->reason || 'refund from credit' ),
-    'refund'  => $cgi->param('amount'),
-    'payby'   => 'BILL',
-    #'_date'   => $cgi->param('_date'),
-    #'payinfo' => 'Cash',
-    'payinfo' => 'Refund',
-    'crednum' => $crednum,
-  } );
-} else {
-  $new = new FS::cust_credit_bill ( {
-    map {
-      $_, scalar($cgi->param($_));
-    #} qw(custnum _date amount invnum)
-    } fields('cust_credit_bill')
-  } );
-}
-
-my $error = $new->insert;
-
 </%init>



More information about the freeside-commits mailing list