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