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/cust_credit.cgi | |
| parent | a2df4ef9575be1ae2f1f5b9089f121316f796bac (diff) | |
| parent | bf50a8356a7344b4f75c7bc7f952019b98867f26 (diff) | |
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'httemplate/edit/process/cust_credit.cgi')
| -rwxr-xr-x | httemplate/edit/process/cust_credit.cgi | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/httemplate/edit/process/cust_credit.cgi b/httemplate/edit/process/cust_credit.cgi index 245f31af7..e442d7fa6 100755 --- a/httemplate/edit/process/cust_credit.cgi +++ b/httemplate/edit/process/cust_credit.cgi @@ -1,5 +1,4 @@ %if ( $error ) { -% $cgi->param('reasonnum', $reasonnum); % $cgi->param('error', $error); % $dbh->rollback if $oldAutoCommit; % @@ -37,19 +36,11 @@ my $oldAutoCommit = $FS::UID::AutoCommit; local $FS::UID::AutoCommit = 0; my $dbh = dbh; -my $error = ''; -if ($reasonnum == -1) { - - $error = 'Enter a new reason (or select an existing one)' - unless $cgi->param('newreasonnum') !~ /^\s*$/; - my $reason = new FS::reason { - 'reason_type' => scalar($cgi->param('newreasonnumT')), - 'reason' => scalar($cgi->param('newreasonnum')), - }; - $error ||= $reason->insert; - $cgi->param('reasonnum', $reason->reasonnum) - unless $error; +my ($reasonnum, $error) = $m->comp('/misc/process/elements/reason'); +if (!$reasonnum) { + $error ||= 'Reason required' } +$cgi->param('reasonnum', $reasonnum) unless $error; unless ($error) { my $new = new FS::cust_credit ( { |
