[freeside-commits] freeside/FS/FS cust_pkg_discount.pm,1.2,1.3

Ivan,,, ivan at wavetail.420.am
Sat Jan 30 18:57:16 PST 2010


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv20011/FS/FS

Modified Files:
	cust_pkg_discount.pm 
Log Message:
discounts, RT#6679

Index: cust_pkg_discount.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_pkg_discount.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- cust_pkg_discount.pm	30 Jan 2010 08:55:11 -0000	1.2
+++ cust_pkg_discount.pm	31 Jan 2010 02:57:14 -0000	1.3
@@ -133,6 +133,8 @@
 
 =item cust_pkg
 
+Returns the customer package (see L<FS::cust_pkg>).
+
 =cut
 
 sub cust_pkg {
@@ -142,6 +144,8 @@
 
 =item discount
 
+Returns the discount (see L<FS::discount>).
+
 =cut
 
 sub discount {
@@ -149,6 +153,20 @@
   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



More information about the freeside-commits mailing list