diff options
author | ivan <ivan> | 2011-10-24 01:16:06 +0000 |
---|---|---|
committer | ivan <ivan> | 2011-10-24 01:16:06 +0000 |
commit | 0935d2f172064807c5a7fe3c15d1c477b3a2b482 (patch) | |
tree | 9558b62705e0f57d05bf97a2b842d8e61f9b725c /FS | |
parent | 85a970bcccc914915b1013d5f401e2265ceaef52 (diff) |
fix discounts not appearing for one-time charge packages, RT#13654
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; |