[freeside-commits] freeside/httemplate/edit/process prepay_credit.cgi, 1.5.2.2, 1.5.2.3

Ivan,,, ivan at wavetail.420.am
Tue Feb 19 18:07:05 PST 2008


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

Modified Files:
      Tag: FREESIDE_1_7_BRANCH
	prepay_credit.cgi 
Log Message:
retry collisions a bit, acme is getting duplicate errors... guess they're using lots and lots of prepaid cards.  closes: RT#3104

Index: prepay_credit.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/prepay_credit.cgi,v
retrieving revision 1.5.2.2
retrieving revision 1.5.2.3
diff -u -d -r1.5.2.2 -r1.5.2.3
--- prepay_credit.cgi	13 Jan 2008 21:36:09 -0000	1.5.2.2
+++ prepay_credit.cgi	20 Feb 2008 02:07:02 -0000	1.5.2.3
@@ -1,41 +1,9 @@
-%
-%my $hashref = {};
-%
-%my $agent = '';
-%if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) {
-%  $agent = qsearchs('agent', { 'agentnum' => $hashref->{agentnum}=$1 } );
-%}
-%
-%my $error = '';
-%
-%my $num = 0;
-%if ( $cgi->param('num') =~ /^\s*(\d+)\s*$/ ) {
-%  $num = $1;
-%} else {
-%  $error = 'Illegal number of prepaid cards: '. $cgi->param('num');
-%}
-%
-%$hashref->{amount}    = $cgi->param('amount');
-%$hashref->{seconds}   = $cgi->param('seconds') * $cgi->param('multiplier');
-%$hashref->{upbytes}   = $cgi->param('upbytes') * $cgi->param('upmultiplier');
-%$hashref->{downbytes} = $cgi->param('downbytes') * $cgi->param('downmultiplier');
-%$hashref->{totalbytes} = $cgi->param('totalbytes') * $cgi->param('totalmultiplier');
-%
-%$error ||= FS::prepay_credit::generate( $num,
-%                                        scalar($cgi->param('type')), 
-%                                        $hashref
-%                                      );
-%
 %unless ( ref($error) ) {
 %  $cgi->param('error', $error );
-%
-<%
-  $cgi->redirect(popurl(3). "edit/prepay_credit.cgi?". $cgi->query_string )
-%>
+<% $cgi->redirect(popurl(3). "edit/prepay_credit.cgi?". $cgi->query_string ) %>
 % } else { 
 
-
-<% include("/elements/header.html", "$num prepaid cards generated".
+<% include('/elements/header.html', "$num prepaid cards generated".
               ( $agent ? ' for '.$agent->agent : '' )
           )
 %>
@@ -54,14 +22,41 @@
   <br>
 % } 
 
-
 </FONT>
 
-</BODY></HTML>
+<% include('/elements/footer.html') %>
+
 % } 
 <%init>
 
 die "access denied"
   unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
 
+my $hashref = {};
+
+my $agent = '';
+if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) {
+  $agent = qsearchs('agent', { 'agentnum' => $hashref->{agentnum}=$1 } );
+}
+
+my $error = '';
+
+my $num = 0;
+if ( $cgi->param('num') =~ /^\s*(\d+)\s*$/ ) {
+  $num = $1;
+} else {
+  $error = 'Illegal number of prepaid cards: '. $cgi->param('num');
+}
+
+$hashref->{amount}    = $cgi->param('amount');
+$hashref->{seconds}   = $cgi->param('seconds') * $cgi->param('multiplier');
+$hashref->{upbytes}   = $cgi->param('upbytes') * $cgi->param('upmultiplier');
+$hashref->{downbytes} = $cgi->param('downbytes') * $cgi->param('downmultiplier');
+$hashref->{totalbytes} = $cgi->param('totalbytes') * $cgi->param('totalmultiplier');
+
+$error ||= FS::prepay_credit::generate( $num,
+                                        scalar($cgi->param('type')), 
+                                        $hashref
+                                      );
+
 </%init>



More information about the freeside-commits mailing list