add upload of batch result from TD Canada Trust
[freeside.git] / httemplate / misc / upload-batch.cgi
1 <%
2
3   my $fh = $cgi->upload('batch_results');
4   my $filename = $cgi->param('batch_results');
5   my $paybatch = basename($filename);
6
7   my $error = defined($fh)
8     ? FS::cust_pay_batch::import_results( {
9         'filehandle' => $fh,
10         'format'     => $cgi->param('format'),
11         'paybatch'   => $paybatch,
12       } )
13     : 'No file';
14
15   if ( $error ) {
16     %>
17     <!-- mason kludge -->
18     <%
19     eidiot($error);
20 #    $cgi->param('error', $error);
21 #    print $cgi->redirect( "${p}cust_main-import.cgi
22   } else {
23     %>
24     <!-- mason kludge -->
25     <%= header('Batch results upload sucessful') %> <%
26   }
27 %>
28