From 04cbf1d986eabf7fdcc22ff95b95da17e5f4bf63 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 15 Aug 2006 14:20:51 +0000 Subject: add a new, extended CSV import format --- httemplate/misc/cust_main-import.cgi | 102 ++++++++++++++++++++--------------- 1 file changed, 58 insertions(+), 44 deletions(-) (limited to 'httemplate/misc/cust_main-import.cgi') diff --git a/httemplate/misc/cust_main-import.cgi b/httemplate/misc/cust_main-import.cgi index 484855005..2ad4d95b4 100644 --- a/httemplate/misc/cust_main-import.cgi +++ b/httemplate/misc/cust_main-import.cgi @@ -1,51 +1,65 @@ - <%= include("/elements/header.html",'Batch Customer Import') %> +
-Import a CSV file containing customer records.

-Default file format is CSV, with the following field order: cust_pkg.setup, dayphone, first, last, address1, address2, city, state, zip, comments

-<% - #false laziness with edit/cust_main.cgi - my @agents = qsearch( 'agent', {} ); - die "No agents created!" unless @agents; - my $agentnum = $agents[0]->agentnum; #default to first +Import a CSV file containing customer records. +

+ + + +Extended file format is CSV, with the following field order: agent_custid, refnum[1], last, first, address1, address2, city, state, zip, country, daytime, night, ship_last, ship_first, ship_address1, ship_address2, ship_city, ship_state, ship_zip, ship_country, payinfo, paycvv, paydate, invoicing_list, pkgpart, username, _password +

- if ( scalar(@agents) == 1 ) { +[1] This field has special treatment upon import: If a string is passed instead +of an integer, the string is searched for and if necessary auto-created in the +target table. +

+ +<%= &ntable("#cccccc") %> + +<%= include('/elements/tr-select-agent.html', '', #$agentnum, + 'label' => "Agent", + 'empty_label' => 'Select agent', + ) %> - -<% } else { %> -

Agent

-<% } %> - -<% - my @referrals = qsearch('part_referral',{}); - die "No advertising sources created!" unless @referrals; - my $refnum = $referrals[0]->refnum; #default to first - - if ( scalar(@referrals) == 1 ) { + + + Format + + + + + + + CSV filename + + + +<% #include('/elements/tr-select-part_referral.html') %> - -<% } else { %> -

Advertising source

-<% } %> - - First package:

- - CSV Filename:

- -
- - + + + + +

+ + + + +<%= include('/elements/footer.html') %> -- cgit v1.2.1