X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fprocess%2Fcust_main.cgi;h=c15ea0321d7ddb724c5c57c31b4882ef349a3c1b;hb=f3b8b72d2a07683b2deb2774f29407e25e725b5a;hp=cc5efd6b1b3b468bd6951561825b65d35728fad5;hpb=f0915e1efec95afa1be6100c8d7e919fa0babc71;p=freeside.git diff --git a/httemplate/edit/process/cust_main.cgi b/httemplate/edit/process/cust_main.cgi index cc5efd6b1..c15ea0321 100755 --- a/httemplate/edit/process/cust_main.cgi +++ b/httemplate/edit/process/cust_main.cgi @@ -1,57 +1,34 @@ <% -# $Id: cust_main.cgi,v 1.4 2001-09-04 15:06:03 ivan Exp $ -use strict; -use vars qw( $cgi $payby @invoicing_list $new $custnum $error ); -use vars qw( $cust_pkg $cust_svc $svc_acct ); -use CGI; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup getotaker); -use FS::CGI qw( popurl ); -use FS::Record qw( qsearch qsearchs fields ); -use FS::cust_main; -use FS::type_pkgs; -use FS::agent; - -$cgi = new CGI; -&cgisuidsetup($cgi); - -$error = ''; +my $error = ''; #unmunge stuff -$cgi->param('tax','') unless defined($cgi->param('tax')); +$cgi->param('tax','') unless defined $cgi->param('tax'); $cgi->param('refnum', (split(/:/, ($cgi->param('refnum'))[0] ))[0] ); -$cgi->param('state') =~ /^(\w*)( \(([\w ]+)\))? ?\/ ?(\w+)$/ - or die "Oops, illegal \"state\" param: ". $cgi->param('state'); -$cgi->param('state', $1); -$cgi->param('county', $3 || ''); -$cgi->param('country', $4); - -$cgi->param('ship_state') =~ /^(\w*)( \(([\w ]+)\))? ?\/ ?(\w+)$/ - or $cgi->param('ship_state') =~ /^(((())))$/ - or die "Oops, illegal \"ship_state\" param: ". $cgi->param('ship_state'); -$cgi->param('ship_state', $1); -$cgi->param('ship_county', $3 || ''); -$cgi->param('ship_country', $4); - -if ( $payby = $cgi->param('payby') ) { - $cgi->param('payinfo', $cgi->param( $payby. '_payinfo' ) ); +my $payby = $cgi->param('payby'); +if ( $payby ) { + if ( $payby eq 'CHEK' ) { + $cgi->param('payinfo', + $cgi->param('CHEK_payinfo1'). '@'. $cgi->param('CHEK_payinfo2') ); + } else { + $cgi->param('payinfo', $cgi->param( $payby. '_payinfo' ) ); + } $cgi->param('paydate', - $cgi->param( $payby. '_month' ). '-'. $cgi->param( $payby. '_year' ) ); + $cgi->param( $payby. '_month' ). '-'. $cgi->param( $payby. '_year' ) ); $cgi->param('payname', $cgi->param( $payby. '_payname' ) ); } $cgi->param('otaker', &getotaker ); -@invoicing_list = split( /\s*\,\s*/, $cgi->param('invoicing_list') ); +my @invoicing_list = split( /\s*\,\s*/, $cgi->param('invoicing_list') ); push @invoicing_list, 'POST' if $cgi->param('invoicing_list_POST'); #create new record object -$new = new FS::cust_main ( { +my $new = new FS::cust_main ( { map { $_, scalar($cgi->param($_)) # } qw(custnum agentnum last first ss company address1 address2 city county @@ -68,8 +45,8 @@ if ( defined($cgi->param('same')) && $cgi->param('same') eq "Y" ) { } #perhaps this stuff should go to cust_main.pm -$cust_pkg = ''; -$svc_acct = ''; +my $cust_pkg = ''; +my $svc_acct = ''; if ( $new->custnum eq '' ) { if ( $cgi->param('pkgpart_svcpart') ) { @@ -142,7 +119,6 @@ if ( $error ) { $cgi->param('error', $error); print $cgi->redirect(popurl(2). "cust_main.cgi?". $cgi->query_string ); } else { - $custnum = $new->custnum; - print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum"); + print $cgi->redirect(popurl(3). "view/cust_main.cgi?". $new->custnum); } %>