diff options
| author | Ivan Kohler <ivan@freeside.biz> | 2014-12-04 10:37:16 -0800 |
|---|---|---|
| committer | Ivan Kohler <ivan@freeside.biz> | 2014-12-04 10:37:16 -0800 |
| commit | 8dd41f364aaba88969dfd0908feb22709025e7f6 (patch) | |
| tree | 471cb3796019d873da648413d88ca70a657414ed /httemplate/edit/process/part_event.html | |
| parent | a2df4ef9575be1ae2f1f5b9089f121316f796bac (diff) | |
| parent | bf50a8356a7344b4f75c7bc7f952019b98867f26 (diff) | |
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'httemplate/edit/process/part_event.html')
| -rw-r--r-- | httemplate/edit/process/part_event.html | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/httemplate/edit/process/part_event.html b/httemplate/edit/process/part_event.html index 481439d53..bac69241c 100644 --- a/httemplate/edit/process/part_event.html +++ b/httemplate/edit/process/part_event.html @@ -62,12 +62,17 @@ my $value = join(',', $cgi->param( "$prefix$option" ) ); if ( $option eq 'reasonnum' && $value == -1 ) { - $value = { - 'typenum' => scalar( $cgi->param( "new$prefix${option}T" ) ), - 'reason' => scalar( $cgi->param( "new$prefix${option}" ) ), - }; + my $reason_prefix = $object->action . '_' . $option . '_new_'; + my $new_reason = FS::reason->new; + foreach ( qw( reason_type reason unsuspend pkgpart + unsuspend_hold unused_credit ) ) { + $new_reason->set($_, $cgi->param("$reason_prefix$_")); + } + warn Dumper $new_reason; + my $error = $new_reason->insert; + die "error creating reason: $error" if $error; + $value = $new_reason->reasonnum; } - ( $option => $value ); } @{ $object->option_fields_listref }; |
