diff options
Diffstat (limited to 'httemplate/edit/process')
-rw-r--r-- | httemplate/edit/process/did_order.html | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/httemplate/edit/process/did_order.html b/httemplate/edit/process/did_order.html index a7d30c36c..6a2884413 100644 --- a/httemplate/edit/process/did_order.html +++ b/httemplate/edit/process/did_order.html @@ -5,7 +5,7 @@ 'process_o2m' => { 'table' => 'did_order_item', 'fields' => [ qw( msanum npa latanum ratecenternum state - quantity ) ], + quantity custnum ) ], }, ) %> @@ -25,14 +25,23 @@ my $value_callback = sub { my @params = $cgi->param; foreach my $param ( @params ) { - next unless $param =~ /^(orderitemnum[0-9]+)_rc_new$/; - my $prefix = $1; - my $value = $cgi->param($param); - next unless $value =~ /^[A-Za-z0-9\- ]+$/; - my $rc = new FS::rate_center({ description => $value }); - my $error = $rc->insert; - die "error inserting new rate center: $error" if $error; - $cgi->param("${prefix}_ratecenternum",$rc->ratecenternum); + if ( $param =~ /^(orderitemnum[0-9]+)_rc_new$/ ) { + my $prefix = $1; + my $value = $cgi->param($param); + if( $value =~ /^[A-Za-z0-9\- ]+$/ ) { + my $rc = new FS::rate_center({ description => $value }); + my $error = $rc->insert; + die "error inserting new rate center: $error" if $error; + $cgi->param("${prefix}_ratecenternum",$rc->ratecenternum); + } + } + elsif ( $param =~ /^(orderitemnum[0-9]+)_custnum$/ ) { + my $prefix = $1; + my $value = $cgi->param($param); + if ( $value =~ /^\d+$/ ) { + $cgi->param("custnum",''); + } + } } </%init> |