RT# 75095 - Added Ooma integration to one time charges
[freeside.git] / httemplate / misc / process / cust_main-import_charges.cgi
index d877ad1..42ca825 100644 (file)
@@ -1,24 +1,10 @@
-% if ( $error ) {
-%   errorpage($error);
-%  } else {
-     <% include('/elements/header.html','Import successful') %> 
-     <% include('/elements/footer.html') %> 
-%  }
+<% $server->process %>
 <%init>
 
 die "access denied"
   unless $FS::CurrentUser::CurrentUser->access_right('Import');
 
-my $fh = $cgi->upload('csvfile');
-#warn $cgi;
-#warn $fh;
-
-my $error = defined($fh)
-  ? FS::cust_main::Import_Charges::batch_charge( {
-      filehandle => $fh,
-      'agentnum' => scalar($cgi->param('agentnum')),
-      'format'   => scalar($cgi->param('format')),
-    } )
-  : 'No file';
+my $server =
+  new FS::UI::Web::JSRPC 'FS::cust_main::Import_Charges::batch_charge', $cgi;
 
 </%init>