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-csv">Comma-separated (.csv)</OPTION>
37 <OPTION VALUE="simple-xls">Excel (.xls)</OPTION>
42 <% include( '/elements/tr-select-payby.html',
45 'label' => '<B>Payment type</B>',
49 <% include( '/elements/file-upload.html',
51 'label' => 'Filename',
55 <TR><TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px"><INPUT TYPE="submit" VALUE="Import file"></TD></TR>
63 Simple file format is CSV or XLS, with the following field order: <i>custnum, agent_custid, amount, checknum, invnum</i>
66 <!-- Extended file format is not yet defined -->
72 <li><i>custnum</i>: This is the freeside customer number. It may be left blank. If specified, agent_custid must be blank.
74 <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.
76 <li><i>amount</i>: A positive numeric value with at most two digits after the decimal point.
78 <li><i>checknum</i>: A sequence of digits. May be left blank.
80 <li><i>invnum</i>: Invoice number, optional
86 <& /elements/footer.html &>
89 my $paybatch = time2str('webbatch-%Y/%m/%d-%T'. "-$$-". rand() * 2**32, time);
91 tie %paybys, 'Tie::IxHash', FS::payby->payment_payby2longname();