diff options
author | ivan <ivan> | 2010-01-31 02:57:14 +0000 |
---|---|---|
committer | ivan <ivan> | 2010-01-31 02:57:14 +0000 |
commit | 9b6b116d4a492cb0edc31e53abf1fdb43be42d0e (patch) | |
tree | 2ee0f6c5b965912416269f57ce15729b411e078d /FS/FS/cust_pkg_discount.pm | |
parent | 481011e14852aa62181bed0c7ae34b1e37ebff18 (diff) |
discounts, RT#6679
Diffstat (limited to 'FS/FS/cust_pkg_discount.pm')
-rw-r--r-- | FS/FS/cust_pkg_discount.pm | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/FS/FS/cust_pkg_discount.pm b/FS/FS/cust_pkg_discount.pm index 87f8c52..9fc618c 100644 --- a/FS/FS/cust_pkg_discount.pm +++ b/FS/FS/cust_pkg_discount.pm @@ -133,6 +133,8 @@ sub check { =item cust_pkg +Returns the customer package (see L<FS::cust_pkg>). + =cut sub cust_pkg { @@ -142,6 +144,8 @@ sub cust_pkg { =item discount +Returns the discount (see L<FS::discount>). + =cut sub discount { @@ -149,6 +153,20 @@ sub discount { qsearchs('discount', { 'discountnum' => $self->discountnum } ); } +=item increment_months_used + +Increments months_used by the given parameter + +=cut + +sub increment_months_used { + my( $self, $used ) = @_; + #UPDATE cust_pkg_discount SET months_used = months_used + ? + #leaves no history, and billing is mutexed per-customer, so the dum way is ok + $self->months_used( $self->months_used + $used ); + $self->replace(); +} + =back =head1 BUGS |