[freeside-commits] freeside/FS/FS/part_pkg prorate_Mixin.pm, 1.8, 1.9

Mark Wells mark at wavetail.420.am
Mon Jan 10 16:56:17 PST 2011


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

Modified Files:
	prorate_Mixin.pm 
Log Message:
add_full_period fix, RT#9874

Index: prorate_Mixin.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg/prorate_Mixin.pm,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -w -d -r1.8 -r1.9
--- prorate_Mixin.pm	8 Jan 2011 01:40:20 -0000	1.8
+++ prorate_Mixin.pm	11 Jan 2011 00:56:14 -0000	1.9
@@ -35,9 +35,9 @@
 Takes all the arguments of calc_recur, followed by a day of the month 
 to prorate to (which must be <= 28).  Calculates a prorated charge from 
 the $sdate to that day, and sets the $sdate and $param->{months} accordingly.
+base_recur() will be called to determine the base price per billing cycle.
 
 Options:
-- recur_fee: The charge to use for a complete billing period.
 - add_full_period: Bill for the time up to the prorate day plus one full
 billing period after that.
 - prorate_round_day: Round the current time to the nearest full day, 
@@ -90,8 +90,8 @@
     my $permonth = $charge / $self->freq;
     my $months = ( ( $self->freq - 1 ) + ($mend-$mnow) / ($mend-$mstart) );
 
-    if ( $self->option('add_full_period',1) ) {
-      # charge a full period in addition to the partial month
+    # add a full period if currently billing for a partial period
+    if ( $self->option('add_full_period',1) and $months < $self->freq ) {
       $months += $self->freq;
       $$sdate = $self->add_freq($mstart);
     }



More information about the freeside-commits mailing list