X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=eg%2FTEMPLATE_cust_main.import;h=448186991238b0e723d9fe50815e9e1dd4985948;hp=39a5785db62377185daf3e10456648d8ff746ef5;hb=6cd87c0d3b5280446301c647fa5f1ec5a593fa3f;hpb=082d87c7773121bac0f3043e1011e5929a444d54 diff --git a/eg/TEMPLATE_cust_main.import b/eg/TEMPLATE_cust_main.import index 39a5785db..448186991 100755 --- a/eg/TEMPLATE_cust_main.import +++ b/eg/TEMPLATE_cust_main.import @@ -2,16 +2,30 @@ # Template for importing legacy customer data # +# $Id: TEMPLATE_cust_main.import,v 1.3 1999-03-26 13:15:56 ivan Exp $ +# # ivan@sisd.com 98-aug-17 - 20 +# +# $Log: TEMPLATE_cust_main.import,v $ +# Revision 1.3 1999-03-26 13:15:56 ivan +# s/create/new/, use all necessary FS::table_names to avoid warnings +# +# Revision 1.2 1998/12/16 05:29:45 ivan +# adminsuidsetup now need user +# use strict; +use Date::Parse; use FS::UID qw(adminsuidsetup datasrc); use FS::Record qw(fields qsearch qsearchs); use FS::cust_main; use FS::cust_pkg; -use Date::Parse; +use FS::cust_svc; +use FS::svc_acct; +use FS::pkg_svc; -adminsuidsetup; +my $user = shift or die &usage; +adminsuidsetup $user; # use these for the imported cust_main records (unless you have these in legacy # data) @@ -90,7 +104,7 @@ while () { $svc{'First'} =~ s/&/and/go; $svc{'Zip'} =~ s/\s+$//go; - my($cust_main) = create FS::cust_main ( { + my($cust_main) = new FS::cust_main ( { 'custnum' => $svc{'custnum'}, 'agentnum' => $agentnum, 'last' => $svc{'last'}, @@ -121,7 +135,7 @@ while () { die $error; } - my($cust_pkg)=create FS::cust_pkg ( { + my($cust_pkg)=new FS::cust_pkg ( { 'custnum' => $svc{'custnum'}, 'pkgpart' => $pkgpart{$svc{'LegacyBillingData'}}, 'setup' => '', @@ -168,7 +182,7 @@ while () { } else { #create new cust_svc record linked to cust_pkg record - my($n_cust_svc) = create FS::cust_svc ({ + my($n_cust_svc) = new FS::cust_svc ({ 'svcnum' => $o_cust_svc->svcnum, 'pkgnum' => $cust_pkg->pkgnum, 'svcpart' => $pkg_svc->svcpart, @@ -187,3 +201,8 @@ while () { warn "\n$link of $line lines linked\n"; +# --- + +sub usage { + die "Usage:\n\n cust_main.import user\n"; +}