Option to ignore old CDRs, RT#81480
[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', '_date', '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   <& /elements/tr-input-date-field.html, {
22        'name'  => '_date',
23        #'value' => '',
24        'label' => 'Date',
25      }
26   &>
27
28   <!--
29   <TR>
30     <TH ALIGN="right">Format</TH>
31     <TD>
32       <SELECT NAME="format">
33         <OPTION VALUE="simple">Simple
34       </SELECT>
35     </TD>
36   </TR>
37   -->
38   <INPUT TYPE="hidden" NAME="format" VALUE="simple">
39
40   <% include( '/elements/file-upload.html',
41                 'field' => 'file',
42                 'label' => 'Filename',
43             )
44   %>
45
46   <TR>
47     <TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px">
48       <INPUT TYPE    = "submit"
49              ID      = "submitButton"
50              NAME    = "submitButton"
51              VALUE   = "Import file"
52       >
53     </TD>
54   </TR>
55
56 </TABLE>
57
58 </FORM>
59
60 <BR>
61
62 Uploaded files can be CSV (comma-separated value) files or Excel spreadsheets.  The file should have a .CSV or .XLS extension.
63 <BR><BR>
64
65     <b>Default</b> format has the following field order: <i>custnum, amount, reasonnum, invnum, agent_custid</i><br>
66 <BR><BR>
67
68 Field information:
69 <ul>
70   <li><i>custnum</i>: This is the freeside customer number. It may be left blank. If specified, agent_custid must be blank.</li>
71   <li><i>amount</i>:</li>
72   <li><i>reasonnum</i>: <A HREF="<%$p%>browse/reason_type.html?class=R">Credit reason</A></li>
73   <li><i>invnum</i>: Invoice number</li>
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.</li>
75 </ul>
76 <BR><BR>
77
78 <% include('/elements/footer.html') %>
79
80 <%init>
81
82 die "access denied"
83   unless $FS::CurrentUser::CurrentUser->access_right('Import');
84
85 my $credbatch = time2str('webimport-%Y/%m/%d-%T'. "-$$-". rand() * 2**32, time);
86
87 </%init>