disabled
+=item setup - apply discount to setup fee (not just to recurring fee)
+
+If the discount is based on a percentage, then the % will be applied to the
+setup and recurring portions.
+
=back
=head1 METHODS
|| $self->ut_float('percent') #actually decimal, but this will do
|| $self->ut_floatn('months') #actually decimal, but this will do
|| $self->ut_enum('disabled', [ '', 'Y' ])
+ || $self->ut_enum('setup', [ '', 'Y' ])
;
return $error if $error;
my $desc = $self->name ? $self->name.': ' : '';
$desc .= $money_char. sprintf('%.2f/month ', $self->amount)
if $self->amount > 0;
- $desc .= $self->percent. '% '
+
+ ( my $percent = $self->percent ) =~ s/\.0+$//;
+ $percent =~ s/(\.\d*[1-9])0+$/$1/;
+ $desc .= $percent. '% '
if $self->percent > 0;
$desc;
sub description {
my $self = shift;
my $desc = $self->description_short;
- $desc .= ' for '. $self->months. ' months' if $self->months;
+
+ ( my $months = $self->months ) =~ s/\.0+$//;
+ $months =~ s/(\.\d*[1-9])0+$/$1/;
+ $desc .= " for $months months" if $months;
+
+ $desc .= ', applies to setup' if $self->setup;
+
$desc;
}