From 10ffb6447a6e045b379f38bb78a7cb154076c2fd Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 5 Sep 2002 13:28:00 +0000 Subject: batch charge/credit import --- httemplate/misc/cust_main-import_charges.cgi | 14 ++++++++++++ .../misc/process/cust_main-import_charges.cgi | 26 ++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 httemplate/misc/cust_main-import_charges.cgi create mode 100644 httemplate/misc/process/cust_main-import_charges.cgi (limited to 'httemplate/misc') diff --git a/httemplate/misc/cust_main-import_charges.cgi b/httemplate/misc/cust_main-import_charges.cgi new file mode 100644 index 000000000..0822b9eb6 --- /dev/null +++ b/httemplate/misc/cust_main-import_charges.cgi @@ -0,0 +1,14 @@ + +<%= header('Batch Customer Charge') %> +
+Import a CSV file containing customer charges.

+Default file format is CSV, with the following field order: custnum, amount, description

+If amount is negative, a credit will be applied instead.

+

+ + CSV Filename:

+ +
+ + + diff --git a/httemplate/misc/process/cust_main-import_charges.cgi b/httemplate/misc/process/cust_main-import_charges.cgi new file mode 100644 index 000000000..14df1bd8d --- /dev/null +++ b/httemplate/misc/process/cust_main-import_charges.cgi @@ -0,0 +1,26 @@ +<% + + my $fh = $cgi->upload('csvfile'); + #warn $cgi; + #warn $fh; + + my $error = defined($fh) + ? FS::cust_main::batch_charge( { + filehandle => $fh, + 'fields' => [qw( custnum amount pkg )], + } ) + : 'No file'; + + if ( $error ) { + %> + + <% + eidiot($error); +# $cgi->param('error', $error); +# print $cgi->redirect( "${p}cust_main-import_charges.cgi + } else { + %> + + <%= header('Import sucessful') %> <% + } +%> -- cgit v1.2.1