diff options
Diffstat (limited to 'FS')
-rw-r--r-- | FS/FS/cust_pkg_discount.pm | 3 | ||||
-rw-r--r-- | FS/FS/part_pkg/flat.pm | 6 |
2 files changed, 4 insertions, 5 deletions
diff --git a/FS/FS/cust_pkg_discount.pm b/FS/FS/cust_pkg_discount.pm index d41f497a6..72a1e9c92 100644 --- a/FS/FS/cust_pkg_discount.pm +++ b/FS/FS/cust_pkg_discount.pm @@ -171,6 +171,9 @@ sub check { ; return $error if $error; + return "Discount does not apply to setup fees, and package has no recurring" + if ! $self->discount->setup && ! $self->cust_pkg->freq; + $self->usernum($FS::CurrentUser::CurrentUser->usernum) unless $self->usernum; $self->SUPER::check; diff --git a/FS/FS/part_pkg/flat.pm b/FS/FS/part_pkg/flat.pm index 5f5254dbf..9ff9e2e5b 100644 --- a/FS/FS/part_pkg/flat.pm +++ b/FS/FS/part_pkg/flat.pm @@ -197,11 +197,7 @@ sub is_prepaid { 0; } #no, we're postpaid sub can_start_date { ! shift->option('start_1st', 1) } -#XXX discounts only on recurring fees for now (no setup/one-time or usage) -sub can_discount { - my $self = shift; - $self->freq =~ /^\d+$/ && $self->freq > 0; -} +sub can_discount { 1; } sub usage_valuehash { my $self = shift; |