92b6e5a36036ba6d1da9514d69588867b995649e
[freeside.git] / httemplate / misc / process / cust_pay-import.cgi
1 <% $cgi->redirect(popurl(3). "search/cust_pay.html?magic=paybatch;paybatch=$paybatch") %> 
2 <%init>
3
4 my $fh = $cgi->upload('csvfile');
5
6 # webbatch?  I suppose
7 my $paybatch = time2str('webbatch-%Y/%m/%d-%T'. "-$$-". rand() * 2**32, time);
8
9 my $error = defined($fh)
10   ? FS::cust_pay::batch_import( {
11       'filehandle' => $fh,
12       'agentnum'   => scalar($cgi->param('agentnum')),
13       'format'     => scalar($cgi->param('format')),
14       'paybatch'   => $paybatch,
15     } )
16   : 'No file';
17
18 errorpage($error)
19   if ( $error );
20
21 </%init>