summaryrefslogtreecommitdiff
path: root/httemplate/misc/process/cust_pay-import.cgi
blob: d4ff226ecf4b505bfa3c8d4205713a509a729a37 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<% $cgi->redirect(popurl(3). "search/cust_pay.cgi?magic=paybatch;paybatch=$paybatch") %> 
<%init>

my $fh = $cgi->upload('csvfile');

# webbatch?  I suppose
my $paybatch = time2str('webbatch-%Y/%m/%d-%T'. "-$$-". rand() * 2**32, time);

my $error = defined($fh)
  ? FS::cust_pay::batch_import( {
      'filehandle' => $fh,
      'agentnum'   => scalar($cgi->param('agentnum')),
      'format'     => scalar($cgi->param('format')),
      'paybatch'   => $paybatch,
    } )
  : 'No file';

errorpage($error)
  if ( $error );

</%init>