X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fdiscount.pm;h=dd696049572a652c0769fa6a552fad9f4cd6f545;hb=2c04f1df05a1b14d9539bbae97275c1d3a0995e2;hp=4c9898a7bc99390125f196f10daa07abb371529f;hpb=c6cf1d919265a487593143131ab70a5651161ac9;p=freeside.git diff --git a/FS/FS/discount.pm b/FS/FS/discount.pm index 4c9898a7b..dd6960495 100644 --- a/FS/FS/discount.pm +++ b/FS/FS/discount.pm @@ -175,7 +175,12 @@ sub description_short { my $conf = new FS::Conf; my $money_char = $conf->config('money_char') || '$'; - my $desc = $self->name ? $self->name.': ' : ''; + my $desc; + if ( $self->name ) { + $desc = $self->name . ': '; + } else { + $desc = 'Discount of '; + } $desc .= $money_char. sprintf('%.2f/month', $self->amount) if $self->amount > 0; @@ -193,7 +198,13 @@ sub description { ( my $months = $self->months ) =~ s/\.0+$//; $months =~ s/(\.\d*[1-9])0+$/$1/; - $desc .= " for $months months" if $months; + if ($months) { + if ($months == 1) { + $desc .= " for 1 month"; + } else { + $desc .= " for $months months"; + } + } $desc .= ', applies to setup' if $self->setup;