From 75125d51297402390c1bbb489cf39b74611b1009 Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 31 Jan 2010 07:04:38 +0000 Subject: [PATCH] discounts, RT#6679 --- FS/FS/discount.pm | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/FS/FS/discount.pm b/FS/FS/discount.pm index 558d0f881..457c9d681 100644 --- a/FS/FS/discount.pm +++ b/FS/FS/discount.pm @@ -126,13 +126,17 @@ sub check { $self->SUPER::check; } +=item description_short + =item description Returns a text description incorporating the amount, percent and months fields. +description_short omits term information + =cut -sub description { +sub description_short { my $self = shift; my $conf = new FS::Conf; @@ -143,11 +147,17 @@ sub description { if $self->amount > 0; $desc .= $self->percent. '% ' if $self->percent > 0; - $desc .= 'for '. $self->months. ' months' if $self->months; $desc; } +sub description { + my $self = shift; + my $desc = $self->description_short; + $desc .= ' for '. $self->months. ' months' if $self->months; + $desc; +} + =back =head1 BUGS -- 2.11.0