1 <& /elements/header.html, 'Batch Payment Import' &>
3 Import a file containing customer payments.
7 <% include( '/elements/form-file_upload.html',
8 'name' => 'OneTrueForm',
9 'action' => 'process/cust_pay-import.cgi', #progress-init target
10 'fields' => [ 'agentnum', '_date', 'paybatch', 'format', 'payby' ],
12 'url' => popurl(2)."search/cust_pay.html?magic=paybatch;paybatch=$paybatch",
13 'message' => 'Batch Payment Imported',
17 <% &ntable("#cccccc", 2) %>
19 <INPUT TYPE="hidden" NAME="paybatch" VALUE="<% $paybatch | h %>">
21 <& /elements/tr-select-agent.html,
22 'label' => "<B>Agent</B>",
23 'empty_label' => 'Select agent',
26 <& /elements/tr-input-date-field.html, {
28 'label' => '<B>Date</B>',
33 <TH ALIGN="right">Format</TH>
35 <SELECT NAME="format">
36 <OPTION VALUE="simple">Simple</OPTION>
41 <% include( '/elements/tr-select-payby.html',
44 'label' => '<B>Payment type</B>',
48 <% include( '/elements/file-upload.html',
50 'label' => 'Filename',
54 <TR><TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px"><INPUT TYPE="submit" VALUE="Import file"></TD></TR>
62 Simple file format is CSV or XLS, with the following field order: <i>custnum, agent_custid, amount, checknum, invnum</i>
65 <!-- Extended file format is not yet defined -->
71 <li><i>custnum</i>: This is the freeside customer number. It may be left blank. If specified, agent_custid must be blank.
73 <li><i>agent_custid</i>: This is the reseller's idea of the customer number or identifier. It may be left blank. If specified, custnum must be blank.
75 <li><i>amount</i>: A positive numeric value with at most two digits after the decimal point.
77 <li><i>checknum</i>: A sequence of digits. May be left blank.
79 <li><i>invnum</i>: Invoice number, optional
85 <& /elements/footer.html &>
88 my $paybatch = time2str('webbatch-%Y/%m/%d-%T'. "-$$-". rand() * 2**32, time);
90 tie %paybys, 'Tie::IxHash', FS::payby->payment_payby2payname();