[freeside-commits] freeside/httemplate/edit/process cust_bill_pay.cgi, 1.6.2.2, 1.6.2.3 cust_credit_bill.cgi, 1.8.2.2, 1.8.2.3 cust_pay_refund.cgi, NONE, 1.1.2.2 cust_credit_refund.cgi, NONE, 1.1.2.2

Ivan,,, ivan at wavetail.420.am
Wed Jun 4 22:07:58 PDT 2008


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

Modified Files:
      Tag: FREESIDE_1_7_BRANCH
	cust_bill_pay.cgi cust_credit_bill.cgi 
Added Files:
      Tag: FREESIDE_1_7_BRANCH
	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.6.2.2
retrieving revision 1.6.2.3
diff -u -d -r1.6.2.2 -r1.6.2.3
--- cust_bill_pay.cgi	13 Jan 2008 21:41:06 -0000	1.6.2.2
+++ cust_bill_pay.cgi	5 Jun 2008 05:07:55 -0000	1.6.2.3
@@ -1,50 +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') #;
-      || $FS::CurrentUser::CurrentUser->access_right('Post payment'); #remove after 1.7.3
-
-$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;
+  unless $FS::CurrentUser::CurrentUser->access_right('Apply payment');
 
 </%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.8.2.2
retrieving revision 1.8.2.3
diff -u -d -r1.8.2.2 -r1.8.2.3
--- cust_credit_bill.cgi	13 Jan 2008 21:43:26 -0000	1.8.2.2
+++ cust_credit_bill.cgi	5 Jun 2008 05:07:55 -0000	1.8.2.3
@@ -1,51 +1,14 @@
-%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',
+     'form_action' => 'process/cust_credit_bill.cgi',
+     'src_table'   => 'cust_credit',
+     'src_thing'   => 'credit',
+     'dst_table'   => 'cust_bill',
+     'dst_thing'   => 'invoice',
+   )
+%>
 <%init>
 
 die "access denied"
-  unless $FS::CurrentUser::CurrentUser->access_right('Apply credit') #;
-      || $FS::CurrentUser::CurrentUser->access_right('Post credit'); #remove after 1.7.3
-
-$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;
+  unless $FS::CurrentUser::CurrentUser->access_right('Apply credit');
 
 </%init>



More information about the freeside-commits mailing list