X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fprocess%2Fpart_event.html;h=9a244a8e1e79cb8806c4b92698cb9afdeae6ca20;hb=b71b1576c68bc40ad26592b354feace37a029f0e;hp=0293af8863eebc43cc8616c8ace46b501765e91f;hpb=1aecd5bf33146bf3f374341a3814960ae1d419e8;p=freeside.git diff --git a/httemplate/edit/process/part_event.html b/httemplate/edit/process/part_event.html index 0293af886..9a244a8e1 100644 --- a/httemplate/edit/process/part_event.html +++ b/httemplate/edit/process/part_event.html @@ -40,6 +40,7 @@ }; } elsif ( $info->{'type'} eq 'freq' ) { $value = '0' if !length($value) and !$info->{'allow_blank'}; + $value = '0' if $value =~ /[^\d]/; $value .= $params->{$cgi_field.'_units'} if length($value); } @@ -75,13 +76,13 @@ } ( $option => $value ); } - @{ $object->option_fields_listref }; + @{ $object->option_fields_listref || [] }; }, 'precheck_callback' => sub { my $cgi = shift; my $action = $cgi->param('action') or return; - my %actionfields = map { $_ =~ /^$action\.(.*)/; $1 => $cgi->param($_) } + my %actionfields = map { $_ =~ /^$action\.(.*)/; $1 => scalar($cgi->param($_)) } grep { /^$action\./ } $cgi->param; if ( exists($actionfields{'reasonnum'}) and length($actionfields{'reasonnum'}) == 0 ) { @@ -91,6 +92,10 @@ $cgi->param('disabled', 'Y'); } + if ( $action eq 'pkg_fee' && !$actionfields{feepart} ) { + return "Select a Fee Definition to use this Event Action"; + } + my $balance_age_rx = qr/^(condition.+)\.balance_age\.age$/; foreach my $param ( keys %{ $cgi->Vars() } ){ @@ -99,8 +104,10 @@ next unless $cgi->param($1) eq 'balance_age'; my $errstr = FS::part_event::Condition::balance_age-> - check_options( { age => $cgi->param($param), - age_units => $cgi->param("${param}_units") } ); + check_options( { age => scalar($cgi->param($param)), + age_units => scalar($cgi->param("${param}_units")), + } + ); return $errstr if $errstr; }