d877ad17dbbda37b3c745ce007a77198d9bb9258
[freeside.git] / httemplate / misc / process / cust_main-import_charges.cgi
1 % if ( $error ) {
2 %   errorpage($error);
3 %  } else {
4      <% include('/elements/header.html','Import successful') %> 
5      <% include('/elements/footer.html') %> 
6 %  }
7 <%init>
8
9 die "access denied"
10   unless $FS::CurrentUser::CurrentUser->access_right('Import');
11
12 my $fh = $cgi->upload('csvfile');
13 #warn $cgi;
14 #warn $fh;
15
16 my $error = defined($fh)
17   ? FS::cust_main::Import_Charges::batch_charge( {
18       filehandle => $fh,
19       'agentnum' => scalar($cgi->param('agentnum')),
20       'format'   => scalar($cgi->param('format')),
21     } )
22   : 'No file';
23
24 </%init>