X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Ftr-select-reason.html;h=97466f1753736e415e5df4be22907dd96dd67d06;hb=64aa9aa36d8b8636b4984de7d15cd7bd1a889542;hp=37a34babab91fed86f010f0af12ecfa1f9cdf974;hpb=5da68ff1a7c638e30cbafbc9b0749f1e82b333df;p=freeside.git diff --git a/httemplate/elements/tr-select-reason.html b/httemplate/elements/tr-select-reason.html index 37a34baba..97466f175 100755 --- a/httemplate/elements/tr-select-reason.html +++ b/httemplate/elements/tr-select-reason.html @@ -6,8 +6,7 @@ Example: #required 'field' => 'reasonnum', - 'reason_class' => 'C', # currently 'C', 'R', 'F', 'S' or 'X' - # for cancel, credit, refund, suspend or void credit + 'reason_class' => 'C', # one of those in %FS::reason_type::class_name #recommended 'cgi' => $cgi, #easiest way for things to be properly "sticky" on errors @@ -121,6 +120,13 @@ Example: &> % } # scalar(@types) +% if ( $class eq 'C' ) { + <& tr-checkbox.html, + label => 'Credit the unused portion of service when canceling', + field => $id.'_new_unused_credit', + value => 'Y' + &> +% } % if ( $class eq 'S' ) { <& tr-checkbox.html, label => 'Credit the unused portion of service when suspending', @@ -189,20 +195,8 @@ if ( $opt{'cgi'} ) { my $id = $opt{'id'} || $name; $id =~ s/\./_/g; # for edit/part_event -my $add_access_right; -if ($class eq 'C') { - $add_access_right = 'Add on-the-fly cancel reason'; -} elsif ($class eq 'S') { - $add_access_right = 'Add on-the-fly suspend reason'; -} elsif ($class eq 'R') { - $add_access_right = 'Add on-the-fly credit reason'; -} elsif ($class eq 'F') { - $add_access_right = 'Add on-the-fly refund reason'; -} elsif ($class eq 'X') { - $add_access_right = 'Add on-the-fly void reason'; -} else { - die "illegal class: $class"; -} +my $add_access_right = $FS::reason_type::class_add_access_right{$class} + or die "unknown class: $class"; my @reasons = qsearch({ 'table' => 'reason',