select a date when importing payments, RT#27087
[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       'format'     => scalar($cgi->param('format')),
13
14       'agentnum'   => scalar($cgi->param('agentnum')),
15       '_date'      => scalar($cgi->param('_date')),
16       'paybatch'   => $paybatch,
17     } )
18   : 'No file';
19
20 errorpage($error)
21   if ( $error );
22
23 </%init>