[freeside-commits] freeside/httemplate/edit/process cust_pay.cgi, 1.9, 1.10

Ivan,,, ivan at wavetail.420.am
Sun Aug 13 03:26:00 PDT 2006


Update of /home/cvs/cvsroot/freeside/httemplate/edit/process
In directory wavetail:/tmp/cvs-serv20875/httemplate/edit/process

Modified Files:
	cust_pay.cgi 
Log Message:
customer view work:

DONE  1. add status and balance to top

DONE  2. add some sort of oldest date thing so the history doesn't get too
     big (# years and a link to "show older")

  3. make the rest of the action links into js popups?  maybe later,
     weird IENess when closing em
DONE (finished)    - so revert out or finish/commit the Enter check payment one
   - Process page can wait until another day.. it should be more of an *action*

DONE  4. Ticket list config knobs for wtxs (grid it too)

DONE  5. grid the package list



Index: cust_pay.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/cust_pay.cgi,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- cust_pay.cgi	24 Dec 2004 02:54:12 -0000	1.9
+++ cust_pay.cgi	13 Aug 2006 10:25:58 -0000	1.10
@@ -4,15 +4,16 @@
   or die "Illegal linknum: ". $cgi->param('linknum');
 my $linknum = $1;
 
-$cgi->param('link') =~ /^(custnum|invnum)$/
+$cgi->param('link') =~ /^(custnum|invnum|popup)$/
   or die "Illegal link: ". $cgi->param('link');
-my $link = $1;
+my $field = my $link = $1;
+$field = 'custnum' if $field eq 'popup';
 
 my $_date = str2time($cgi->param('_date'));
 
 my $new = new FS::cust_pay ( {
-  $link => $linknum,
-  _date => $_date,
+  $field => $linknum,
+  _date  => $_date,
   map {
     $_, scalar($cgi->param($_));
   } qw(paid payby payinfo paybatch)
@@ -24,19 +25,30 @@
 if ($error) {
   $cgi->param('error', $error);
   print $cgi->redirect(popurl(2). 'cust_pay.cgi?'. $cgi->query_string );
-} elsif ( $link eq 'invnum' ) {
+} elsif ( $field eq 'invnum' ) {
   print $cgi->redirect(popurl(3). "view/cust_bill.cgi?$linknum");
-} elsif ( $link eq 'custnum' ) {
+} elsif ( $field eq 'custnum' ) {
   if ( $cgi->param('apply') eq 'yes' ) {
     my $cust_main = qsearchs('cust_main', { 'custnum' => $linknum })
       or die "unknown custnum $linknum";
     $cust_main->apply_payments;
   }
-  if ( $cgi->param('quickpay') eq 'yes' ) {
-    print $cgi->redirect(popurl(3). "search/cust_main-quickpay.html");
-  } else {
+  if ( $link eq 'popup' ) {
+
+    %><%= header('Payment entered') %>
+    <SCRIPT TYPE="text/javascript">
+      window.top.location.reload();
+    </SCRIPT>
+
+    </BODY></HTML>
+    <%
+
+  } elsif ( $link eq 'custnum' ) {
     print $cgi->redirect(popurl(3). "view/cust_main.cgi?$linknum");
+  } else {
+    die "unknown link $link";
   }
+
 }
 
 %>



More information about the freeside-commits mailing list