default to a session cookie instead of setting an explicit timeout, weird timezone...
[freeside.git] / httemplate / misc / cust_pay-import.cgi
1 <& /elements/header.html, 'Batch Payment Import' &>
2
3 Import a file containing customer payments.
4 <BR><BR>
5
6
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' ],
11      'num_files' => 1,
12      'url' => popurl(2)."search/cust_pay.html?magic=paybatch;paybatch=$paybatch",
13      'message' => 'Batch Payment Imported',
14    )
15 %>
16
17 <% &ntable("#cccccc", 2) %>
18
19 <INPUT TYPE="hidden" NAME="paybatch" VALUE="<% $paybatch | h %>">
20
21 <& /elements/tr-select-agent.html,
22      'label'       => "<B>Agent</B>",
23      'empty_label' => 'Select agent',
24 &>
25
26 <& /elements/tr-input-date-field.html, {
27      'name'  => '_date',
28      'label' => '<B>Date</B>',
29    }
30 &>
31
32 <TR>
33   <TH ALIGN="right">Format</TH>
34   <TD>
35     <SELECT NAME="format">
36       <OPTION VALUE="simple">Simple</OPTION>
37     </SELECT>
38   </TD>
39 </TR>
40
41 <% include( '/elements/tr-select-payby.html',
42      'paybys' => \%paybys,
43      'disable_empty' => 1,
44      'label'  => '<B>Payment type</B>',
45    )
46 %>
47
48 <% include( '/elements/file-upload.html',
49              'field'    => 'file',
50              'label'    => 'Filename',
51    )
52 %>
53
54 <TR><TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px"><INPUT TYPE="submit" VALUE="Import file"></TD></TR>
55
56 </TABLE>
57
58 </FORM>
59
60 <BR>
61
62 Simple file format is CSV or XLS, with the following field order: <i>custnum, agent_custid, amount, checknum, invnum</i>
63 <BR><BR>
64
65 <!-- Extended file format is not yet defined -->
66
67 Field information:
68
69 <ul>
70
71   <li><i>custnum</i>: This is the freeside customer number.  It may be left blank.  If specified, agent_custid must be blank.
72
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.
74
75   <li><i>amount</i>: A positive numeric value with at most two digits after the decimal point.
76
77   <li><i>checknum</i>: A sequence of digits.  May be left blank.
78
79   <li><i>invnum</i>: Invoice number, optional
80
81 </ul>
82
83 <BR>
84
85 <& /elements/footer.html &>
86
87 <%init>
88 my $paybatch = time2str('webbatch-%Y/%m/%d-%T'. "-$$-". rand() * 2**32, time);
89 my %paybys;
90 tie %paybys, 'Tie::IxHash', FS::payby->payment_payby2payname();
91 </%init>