From 9b6b116d4a492cb0edc31e53abf1fdb43be42d0e Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 31 Jan 2010 02:57:14 +0000 Subject: discounts, RT#6679 --- FS/FS/cust_pkg_discount.pm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'FS/FS/cust_pkg_discount.pm') 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). + =cut sub cust_pkg { @@ -142,6 +144,8 @@ sub cust_pkg { =item discount +Returns the discount (see L). + =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 -- cgit v1.1