[freeside-commits] freeside/FS/FS/part_pkg prorate_Mixin.pm, 1.15.2.4, 1.15.2.5
Mark Wells
mark at wavetail.420.am
Sat Jan 14 15:02:45 PST 2012
Update of /home/cvs/cvsroot/freeside/FS/FS/part_pkg
In directory wavetail.420.am:/tmp/cvs-serv483/FS/FS/part_pkg
Modified Files:
Tag: FREESIDE_2_3_BRANCH
prorate_Mixin.pm
Log Message:
adjust prorate_defer_bill, #16057
Index: prorate_Mixin.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg/prorate_Mixin.pm,v
retrieving revision 1.15.2.4
retrieving revision 1.15.2.5
diff -u -w -d -r1.15.2.4 -r1.15.2.5
--- prorate_Mixin.pm 23 Dec 2011 00:02:34 -0000 1.15.2.4
+++ prorate_Mixin.pm 14 Jan 2012 23:02:42 -0000 1.15.2.5
@@ -75,11 +75,14 @@
my $charge = $self->base_recur($cust_pkg, $sdate) || 0;
+ my $add_period = $self->option('add_full_period',1);
+
my $mnow = $$sdate;
# if this is the first bill but the bill date has been set
# (by prorate_defer_bill), calculate from the setup date,
- # and append the setup fee to @$details.
+ # append the setup fee to @$details, and make sure to bill for
+ # a full period after the bill date.
if ( $self->option('prorate_defer_bill',1)
&& ! $cust_pkg->getfield('last_bill')
&& $cust_pkg->setup
@@ -88,6 +91,7 @@
#warn "[calc_prorate] #".$cust_pkg->pkgnum.": running deferred setup\n";
$param->{'setup_fee'} = $self->calc_setup($cust_pkg, $$sdate, $details);
$mnow = $cust_pkg->setup;
+ $add_period = 1;
}
my ($mend, $mstart);
@@ -103,12 +107,8 @@
# or periods up to freq_override if billing for an override interval
if ( ($param->{'freq_override'} || 0) > 1 ) {
$months += $param->{'freq_override'} - 1;
- } elsif ( ( $self->option('add_full_period',1)
- || $self->option('prorate_defer_bill',1) # necessary
- )
- && $months < $self->freq
- )
- {
+ }
+ elsif ( $add_period && $months < $self->freq) {
$months += $self->freq;
$$sdate = $self->add_freq($mstart);
}
More information about the freeside-commits
mailing list