From b282a5536ad5145f956ef27704e2267a124aacf5 Mon Sep 17 00:00:00 2001 From: Christopher Burger Date: Wed, 1 Nov 2017 12:56:48 -0400 Subject: RT# 75095 - Added Ooma integration to one time charges --- httemplate/misc/cust_main-import_charges.cgi | 41 +++++++++++++++++++--- .../misc/process/cust_main-import_charges.cgi | 20 ++--------- 2 files changed, 39 insertions(+), 22 deletions(-) (limited to 'httemplate/misc') diff --git a/httemplate/misc/cust_main-import_charges.cgi b/httemplate/misc/cust_main-import_charges.cgi index 065506369..4eacce13a 100644 --- a/httemplate/misc/cust_main-import_charges.cgi +++ b/httemplate/misc/cust_main-import_charges.cgi @@ -3,7 +3,15 @@ Import a CSV file containing customer charges.

-
+<& /elements/form-file_upload.html, + 'name' => 'OneTimeChargeImportForm', + 'action' => 'process/cust_main-import_charges.cgi', + 'num_files' => 1, + 'fields' => [ 'agentnum', 'custbatch', 'format' ], + 'message' => 'One time charge batch import successful', + 'url' => $p."misc/cust_main-import_charges.cgi", + 'onsubmit' => "document.OneTimeChargeImportForm.submitButton.disabled=true;", +&> <% &ntable("#cccccc", 2) %> @@ -14,23 +22,35 @@ Import a CSV file containing customer charges. ) %> + + Format + <% include( '/elements/file-upload.html', + 'field' => 'file', + 'label' => 'Filename', + ) + %> + - CSV filename - + + + - -
@@ -59,11 +79,22 @@ Field information:
+Ooma format has the following field order: 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 +

+ + <% include('/elements/footer.html') %> + +<%once> + my $req = qq!*!; + + <%init> die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Import'); + my $custbatch = time2str('webimport-%Y/%m/%d-%T'. "-$$-". rand() * 2**32, time); + diff --git a/httemplate/misc/process/cust_main-import_charges.cgi b/httemplate/misc/process/cust_main-import_charges.cgi index d877ad17d..42ca82592 100644 --- a/httemplate/misc/process/cust_main-import_charges.cgi +++ b/httemplate/misc/process/cust_main-import_charges.cgi @@ -1,24 +1,10 @@ -% if ( $error ) { -% errorpage($error); -% } else { - <% include('/elements/header.html','Import successful') %> - <% include('/elements/footer.html') %> -% } +<% $server->process %> <%init> die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Import'); -my $fh = $cgi->upload('csvfile'); -#warn $cgi; -#warn $fh; - -my $error = defined($fh) - ? FS::cust_main::Import_Charges::batch_charge( { - filehandle => $fh, - 'agentnum' => scalar($cgi->param('agentnum')), - 'format' => scalar($cgi->param('format')), - } ) - : 'No file'; +my $server = + new FS::UI::Web::JSRPC 'FS::cust_main::Import_Charges::batch_charge', $cgi; -- cgit v1.2.1