- if ( $error ) {
- %>
- <!-- mason kludge -->
- <%
- eidiot($error);
-# $cgi->param('error', $error);
-# print $cgi->redirect( "${p}cust_main-import_charges.cgi
- } else {
- %>
- <!-- mason kludge -->
- <%= header('Import sucessful') %> <%
- }
-%>
+my $error = defined($fh)
+ ? FS::cust_main::batch_charge( {
+ filehandle => $fh,
+ 'agentnum' => scalar($cgi->param('agentnum')),
+ 'format' => scalar($cgi->param('format')),
+ } )
+ : 'No file';
+
+</%init>