summaryrefslogtreecommitdiff
path: root/httemplate/edit/process/cust_credit.cgi
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2014-11-25 19:39:23 -0800
committerMark Wells <mark@freeside.biz>2014-11-25 19:39:23 -0800
commit3cda3a85eb0daa5b8b9f4d30cd0896da6ccf4a9b (patch)
treee1d8a4f8b8572396fd2d4fe7a82327f1c9768c0f /httemplate/edit/process/cust_credit.cgi
parent77be6115a8972c8e7917fc9f80e30a6ba571a552 (diff)
option to credit unused time on suspension as part of suspend reason, #31702
Diffstat (limited to 'httemplate/edit/process/cust_credit.cgi')
-rwxr-xr-xhttemplate/edit/process/cust_credit.cgi17
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 ( {