X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=htdocs%2Fedit%2Fcust_main.cgi;h=9c61c654e7cfee93b596b51498eabada4528a97f;hp=1405fe34e659ea661f70f3ffd9d5bfe797923b4a;hb=e6cf4af2b9d3ffefebe1a3e358f0674f566b56bc;hpb=18e983e01dff4ef98d08b5ed0b158870462654ab diff --git a/htdocs/edit/cust_main.cgi b/htdocs/edit/cust_main.cgi index 1405fe34e..9c61c654e 100755 --- a/htdocs/edit/cust_main.cgi +++ b/htdocs/edit/cust_main.cgi @@ -1,6 +1,6 @@ #!/usr/bin/perl -Tw # -# $Id: cust_main.cgi,v 1.19 1999-08-21 02:14:25 ivan Exp $ +# $Id: cust_main.cgi,v 1.29 2001-05-23 13:47:07 ivan Exp $ # # Usage: cust_main.cgi custnum # http://server.name/path/cust_main.cgi?custnum @@ -38,7 +38,37 @@ # fixed one missed day->daytime ivan@sisd.com 98-jul-13 # # $Log: cust_main.cgi,v $ -# Revision 1.19 1999-08-21 02:14:25 ivan +# Revision 1.29 2001-05-23 13:47:07 ivan +# bugfix for defaultcountry +# +# Revision 1.28 2000/12/26 23:51:40 ivan +# statedefault & referraldefault config files +# +# Revision 1.27 2000/12/03 13:45:15 ivan +# patch from Jason Spence : admin.html doc, autocapgen +# +# Revision 1.26 2000/06/27 12:15:50 ivan +# i18n +# +# Revision 1.25 2000/03/02 08:09:38 ivan +# still need to allow blank expiration dates +# +# Revision 1.24 2000/01/30 06:54:50 ivan +# credit card expiration dates not sticky bug fixed? +# +# Revision 1.23 2000/01/27 00:53:14 ivan +# 5.004_04 workaround +# +# Revision 1.22 1999/12/17 02:33:23 ivan +# argh +# +# Revision 1.21 1999/08/23 07:40:38 ivan +# missing flag +# +# Revision 1.20 1999/08/23 07:08:11 ivan +# no CGI::Switch for now +# +# Revision 1.19 1999/08/21 02:14:25 ivan # better error message for no agents # # Revision 1.18 1999/08/11 15:38:33 ivan @@ -97,7 +127,8 @@ use vars qw( $cgi $custnum $action $cust_main $p1 @agents $agentnum $daytime $night $fax @invoicing_list $invoicing_list $payinfo $payname %payby %paybychecked $refnum $otaker $r ); use vars qw ( $conf $pkgpart $username $password $popnum $ulen $ulen2 ); -use CGI::Switch; +#use CGI::Switch; +use CGI; use CGI::Carp qw(fatalsToBrowser); use FS::UID qw(cgisuidsetup getotaker); #use FS::Record qw(qsearch qsearchs fields); @@ -166,7 +197,54 @@ print $cgi->header( '-expires' => 'now' ), header("Customer $action", ''); print qq!Error: !, $cgi->param('error'), "" if $cgi->param('error'); -print qq!
!, + +# JRS: Javascript to set up the form for us + if ( $conf->exists('autocapnames') ) { + print < + +END +} + +print qq!!, qq!!, qq!Customer # !, ( $custnum ? $custnum : " (NEW)" ), @@ -178,7 +256,7 @@ $r = qq!*!; @agents = qsearch( 'agent', {} ); #die "No agents created!" unless @agents; -die "You have not created any agents. You must create at least one agent before adding a customer. Create at least one agent here." unless @agents; +die "You have not created any agents. You must create at least one agent before adding a customer. Go to ". popurl(2). "browse/agent.cgi and create one or more agents." unless @agents; $agentnum = $cust_main->agentnum || $agents[0]->agentnum; #default to first if ( scalar(@agents) == 1 ) { print qq!!; @@ -197,7 +275,7 @@ if ( scalar(@agents) == 1 ) { #referral -$refnum = $cust_main->refnum || 0; +$refnum = $cust_main->refnum || $conf->config('referraldefault') || 0; if ( $custnum && ! $conf->exists('editreferrals') ) { print qq!!; } else { @@ -234,14 +312,33 @@ if ( $custnum && ! $conf->exists('editreferrals') ) { ); print "

Contact information", &itable("#c0c0c0"), <${r}Contact name
(last, first), SS# +${r}Contact name
(last, first) +END + +if ( $conf->exists('autocapnames') ) { + print <, + +END +} else { + print <, + +END +} + +print <SS# Company ${r}Address   -${r}City${r}State/Country${r}State/Country!; for ( 1 .. 12 ) { $return .= "/