From: ivan Date: Mon, 13 Aug 2001 23:10:34 +0000 (+0000) Subject: properly massage ship_state & work okay when no initial pkg is selected X-Git-Tag: freeside_1_4_0pre11~447 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=092cdf2ba5fbd1c94305688dd7f7821d4dbf06d3 properly massage ship_state & work okay when no initial pkg is selected --- diff --git a/httemplate/edit/process/cust_main.cgi b/httemplate/edit/process/cust_main.cgi index 1b916b00b..86e6abef6 100755 --- a/httemplate/edit/process/cust_main.cgi +++ b/httemplate/edit/process/cust_main.cgi @@ -1,5 +1,5 @@ <% -# $Id: cust_main.cgi,v 1.2 2001-08-12 00:07:55 ivan Exp $ +# $Id: cust_main.cgi,v 1.3 2001-08-13 23:10:34 ivan Exp $ use strict; use vars qw( $cgi $payby @invoicing_list $new $custnum $error ); @@ -30,6 +30,12 @@ $cgi->param('state', $1); $cgi->param('county', $3 || ''); $cgi->param('country', $4); +$cgi->param('ship_state') =~ /^(\w*)( \(([\w ]+)\))? ?\/ ?(\w+)$/ + 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' ) ); $cgi->param('paydate', @@ -123,7 +129,7 @@ if ( $new->custnum eq '' ) { use Tie::RefHash; tie my %hash, 'Tie::RefHash'; - %hash = ( $cust_pkg => [ $svc_acct ] ); + %hash = ( $cust_pkg => [ $svc_acct ] ) if $cust_pkg; $error ||= $new->insert( \%hash, \@invoicing_list ); } else { #create old record object my $old = qsearchs( 'cust_main', { 'custnum' => $new->custnum } );