X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Ftr-select-reason.html;h=c1df10b9408a4379d3e0005d44b5e173a4f72632;hb=00938b30a69411a743aa01db5e27100818a3c82b;hp=d85538f0c93851af114cf744bce9bf317b1701f3;hpb=40a7b3dc653e099f7bd0bd762b649b04c4432db2;p=freeside.git diff --git a/httemplate/elements/tr-select-reason.html b/httemplate/elements/tr-select-reason.html index d85538f0c..c1df10b94 100755 --- a/httemplate/elements/tr-select-reason.html +++ b/httemplate/elements/tr-select-reason.html @@ -32,8 +32,15 @@ Example: - Reason + <% mt('Reason') |h %> @@ -83,13 +90,13 @@ Example: % if (scalar(@types) < 1) { # we should never reach this -

No reason types. Go add some.

+

<% mt('No reason types. Please add some.') |h %>

% }elsif (scalar(@types) == 1) { -

Reason Type

+

<% mt('Reason Type') |h %>

<% $types[0]->type %> @@ -101,7 +108,7 @@ Example: -

Reason Type

+

<% mt('Reason Type') |h %>

" style="display:<% $display %>"> @@ -184,6 +198,43 @@ my @reasons = qsearch({ order_by => 'ORDER BY reason_type.type ASC, reason.reason ASC', }); +my @hints; +if ( $class eq 'S' ) { + my $conf = FS::Conf->new; + @hints = ( '' ); + foreach my $reason (@reasons) { + if ( $reason->unsuspend_pkgpart ) { + my $part_pkg = FS::part_pkg->by_key($reason->unsuspend_pkgpart); + if ( $part_pkg ) { + if ( $part_pkg->option('setup_fee',1) > 0 and + $part_pkg->option('recur_fee',1) == 0 ) { + # the usual case + push @hints, + mt('A [_1] unsuspension fee will apply.', + ($conf->config('money_char') || '$') . + sprintf('%.2f', $part_pkg->option('setup_fee')) + ); + } else { + # oddball cases--not really supported + push @hints, + mt('An unsuspension package will apply: [_1]', + $part_pkg->price_info + ); + } + } else { #no $part_pkg + push @hints, + 'Unsuspend pkg #'.$reason->unsuspend_pkgpart. + ' not found.'; + } + } else { #no unsuspend_pkgpart + push @hints, ''; + } + } + push @hints, ''; # for the "new reason" case + @hints = map {''.$_.''} @hints; +} + + my $curuser = $FS::CurrentUser::CurrentUser;