diff options
| author | ivan <ivan> | 2011-10-24 01:15:59 +0000 |
|---|---|---|
| committer | ivan <ivan> | 2011-10-24 01:15:59 +0000 |
| commit | b79a8cb932946c849328a3c117c35821d9d21e66 (patch) | |
| tree | 85c936889c30923261129e564bf7742e1a61361e /FS/FS | |
| parent | 4cff911c9c44159b07125841be948a21ed48b160 (diff) | |
fix discounts not appearing for one-time charge packages, RT#13654
Diffstat (limited to 'FS/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 cb7e18369..d59c694b1 100644 --- a/FS/FS/part_pkg/flat.pm +++ b/FS/FS/part_pkg/flat.pm @@ -220,11 +220,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 recur_temporality { my $self = shift; |
