1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
<& /elements/header.html, 'Batch Credit Import' &>
Import a file containing credits.
<BR><BR>
<& /elements/form-file_upload.html,
'name' => 'CreditImportForm',
'action' => 'process/cust_credit-import.cgi',
'num_files' => 1,
'fields' => [ 'format', 'credbatch' ],
'message' => 'Credit import successful',
'url' => $p."search/cust_credit.html?credbatch=$credbatch",
'onsubmit' => "document.CreditImportForm.submitButton.disabled=true;",
&>
<% &ntable("#cccccc", 2) %>
<INPUT TYPE="hidden" NAME="credbatch" VALUE="<% $credbatch %>"%>
<!--
<TR>
<TH ALIGN="right">Format</TH>
<TD>
<SELECT NAME="format">
<OPTION VALUE="simple">Simple
</SELECT>
</TD>
</TR>
-->
<INPUT TYPE="hidden" NAME="format" VALUE="simple">
<% include( '/elements/file-upload.html',
'field' => 'file',
'label' => 'Filename',
)
%>
<TR>
<TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px">
<INPUT TYPE = "submit"
ID = "submitButton"
NAME = "submitButton"
VALUE = "Import file"
>
</TD>
</TR>
</TABLE>
</FORM>
<BR>
Uploaded files can be CSV (comma-separated value) files or Excel spreadsheets. The file should have a .CSV or .XLS extension.
<BR><BR>
<b>Default</b> format has the following field order: <i>custnum, amount, reasonnum, invnum</i><br>
<BR><BR>
Field information:
<ul>
<li><i>custnum</i>: Customer number
<li><i>amount</i>:
<li><i>reasonnum</i>: <A HREF="<%$p%>browse/reason.html?class=R">Credit reason</A>
<li><i>invnum</i>: Invoice number
</ul>
<BR><BR>
<% include('/elements/footer.html') %>
<%init>
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Import');
my $credbatch = time2str('webimport-%Y/%m/%d-%T'. "-$$-". rand() * 2**32, time);
</%init>
|