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;
( 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;