setup and recurring fee tax exempt flags, UI to edit
[freeside.git] / httemplate / edit / process / cust_main.cgi
index 1b916b0..625a850 100755 (executable)
@@ -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.5 2001-10-20 12:18:00 ivan Exp $
 
 use strict;
 use vars qw( $cgi $payby @invoicing_list $new $custnum $error );
@@ -20,7 +20,7 @@ $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] );
 
@@ -30,6 +30,13 @@ $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' ) );
   $cgi->param('paydate',
@@ -123,7 +130,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 } );