1 <% include("/elements/header.html",'Batch Charge Import') %>
3 Import a CSV file containing customer charges.
6 <& /elements/form-file_upload.html,
7 'name' => 'OneTimeChargeImportForm',
8 'action' => 'process/cust_main-import_charges.cgi',
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;",
16 <% &ntable("#cccccc", 2) %>
18 <% include('/elements/tr-select-agent.html',
19 #'curr_value' => '', #$agentnum,
20 'label' => "<B>Agent</B>",
21 'empty_label' => 'Select agent',
25 <INPUT TYPE="hidden" NAME="custbatch" VALUE="<% $custbatch %>"%>
28 <TH ALIGN="right">Format</TH>
30 <SELECT NAME="format">
31 % foreach my $format ( keys %formats ) {
32 <OPTION VALUE="<% $format %>"><% $formats{$format} %></OPTION>
38 <% include( '/elements/file-upload.html',
40 'label' => 'Filename',
45 <TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px">
46 <INPUT TYPE = "submit"
60 Simple file format is CSV, with the following field order: <i>custnum, agent_custid, amount, description</i>
63 <!-- Extended file format is not yet defined</i>
70 <li><i>custnum</i>: This is the freeside customer number. It may be left blank. If specified, agent_custid must be blank.
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.
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.
76 <li><i>description</i>: Text describing the transaction.
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>
86 <% include('/elements/footer.html') %>
89 my $req = qq!<font color="#ff0000">*</font>!;
95 unless $FS::CurrentUser::CurrentUser->access_right('Import');
97 tie my %formats, 'Tie::IxHash', FS::cust_main::Import_Charges->import_formats;
99 my $custbatch = time2str('webimport-%Y/%m/%d-%T'. "-$$-". rand() * 2**32, time);