[freeside-commits] freeside/httemplate/misc/process payment.cgi, 1.18, 1.19

Ivan,,, ivan at wavetail.420.am
Sun Oct 4 19:16:48 PDT 2009


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

Modified Files:
	payment.cgi 
Log Message:
add manual_process-display config to subtract fee from amount instead of adding, RT#5889

Index: payment.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/misc/process/payment.cgi,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- payment.cgi	25 Sep 2009 12:29:16 -0000	1.18
+++ payment.cgi	5 Oct 2009 02:16:46 -0000	1.19
@@ -150,11 +150,18 @@
 
   #no error, so order the fee package if applicable...
   if ( $cgi->param('fee_pkgpart') =~ /^(\d+)$/ ) {
-    my $error = $cust_main->order_pkg(
-      'cust_pkg' => new FS::cust_pkg { 'pkgpart' => $1 }
-    );
+
+    my $cust_pkg = new FS::cust_pkg { 'pkgpart' => $1 };
+
+    my $error = $cust_main->order_pkg( 'cust_pkg' => $cust_pkg );
     errorpage("payment processed successfully, but error ordering fee: $error")
       if $error;
+
+    #and generate an invoice for it now too
+    $error = $cust_main->bill( 'pkg_list' => [ $cust_pkg ] );
+    errorpage("payment processed and fee ordered sucessfully, but error billing fee: $error")
+      if $error;
+
   }
 
   $cust_main->apply_payments;



More information about the freeside-commits mailing list