RT# 73422 Changes to report Customer Contacts
[freeside.git] / httemplate / misc / cust_main-import_charges.cgi
1 <% include("/elements/header.html",'Batch Charge Import') %>
2
3 Import a CSV file containing customer charges.
4 <BR><BR>
5
6 <& /elements/form-file_upload.html,
7      'name'      => 'OneTimeChargeImportForm',
8      'action'    => 'process/cust_main-import_charges.cgi',
9      'num_files' => 1,
10      'fields'    => [ 'agentnum', 'custbatch', 'format' ],
11      'message'   => 'One time charge batch import successful',
12      'url'       => $p."misc/cust_main-import_charges.cgi",
13      'onsubmit'  => "document.OneTimeChargeImportForm.submitButton.disabled=true;",
14 &>
15
16 <% &ntable("#cccccc", 2) %>
17
18 <% include('/elements/tr-select-agent.html',
19               #'curr_value' => '', #$agentnum,
20               'label'       => "<B>Agent</B>",
21               'empty_label' => 'Select agent',
22            )
23 %>
24
25 <INPUT TYPE="hidden" NAME="custbatch" VALUE="<% $custbatch %>"%>
26
27 <TR>
28   <TH ALIGN="right">Format</TH>
29   <TD>
30     <SELECT NAME="format">
31       <OPTION VALUE="simple">Simple
32       <OPTION VALUE="ooma">Ooma
33 <!--      <OPTION VALUE="extended" SELECTED>Extended -->
34     </SELECT>
35   </TD>
36 </TR>
37
38   <% include( '/elements/file-upload.html',
39                 'field' => 'file',
40                 'label' => 'Filename',
41             )
42   %>
43
44 <TR>
45     <TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px">
46       <INPUT TYPE    = "submit"
47              NAME    = "submitButton"
48              ID      = "submitButton"
49              VALUE   = "Import file"
50       >
51     </TD>
52 </TR>
53
54 </TABLE>
55
56 </FORM>
57
58 <BR>
59
60 Simple file format is CSV, with the following field order: <i>custnum, agent_custid, amount, description</i>
61 <BR><BR>
62
63 <!-- Extended file format is not yet defined</i>
64 <BR><BR> -->
65
66 Field information:
67
68 <ul>
69
70   <li><i>custnum</i>: This is the freeside customer number.  It may be left blank.  If specified, agent_custid must be blank.
71
72   <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.
73
74   <li><i>amount</i>: A numeric value with at most two digits after the decimal point.  If <i>amount</i> is negative, a credit will be applied instead.
75
76   <li><i>description</i>: Text describing the transaction.
77
78 </ul>
79
80 <BR>
81
82 <b>Ooma</b> format has the following field order: <i>Description, Description2, Record Type, Customer Number, Billing Phone Number or Zip Code, Bus/Res Indicator, Invoice Date, Invoice Number, Group, Item, Revenue<%$req%>, LineCount, Exempt, ExemptList, State, City, Zipcode, OfferingPK, Offering name<%$req%>, Quantity, AccountNo<%$req%>, Status, Cust Created, PartnerID</i>
83 <BR><BR>
84
85
86 <% include('/elements/footer.html') %>
87
88 <%once>
89   my $req = qq!<font color="#ff0000">*</font>!;
90 </%once>
91
92 <%init>
93
94 die "access denied"
95   unless $FS::CurrentUser::CurrentUser->access_right('Import');
96
97   my $custbatch = time2str('webimport-%Y/%m/%d-%T'. "-$$-". rand() * 2**32, time);
98
99 </%init>
100