<& /elements/header.html, 'Batch Payment Import' &> Import a file containing customer payments.

<% include( '/elements/form-file_upload.html', 'name' => 'OneTrueForm', 'action' => 'process/cust_pay-import.cgi', #progress-init target 'fields' => [ 'agentnum', '_date', 'paybatch', 'format', 'payby' ], 'num_files' => 1, 'url' => popurl(2)."search/cust_pay.html?magic=paybatch;paybatch=$paybatch", 'message' => 'Batch Payment Imported', ) %> <% &ntable("#cccccc", 2) %> <& /elements/tr-select-agent.html, 'label' => "Agent", 'empty_label' => 'Select agent', &> <& /elements/tr-input-date-field.html, { 'name' => '_date', 'label' => 'Date', } &> Format <% include( '/elements/tr-select-payby.html', 'paybys' => \%paybys, 'disable_empty' => 1, 'label' => 'Payment type', ) %> <% include( '/elements/file-upload.html', 'field' => 'file', 'label' => 'Filename', ) %>
Simple file format is CSV or XLS, with the following field order: custnum, agent_custid, amount, checknum, invnum

Field information:
<& /elements/footer.html &> <%init> my $paybatch = time2str('webbatch-%Y/%m/%d-%T'. "-$$-". rand() * 2**32, time); my %paybys; tie %paybys, 'Tie::IxHash', FS::payby->payment_payby2payname();