[freeside-commits] freeside/FS/FS/part_pkg prorate_Mixin.pm, 1.17, 1.18
Mark Wells
mark at wavetail.420.am
Sat Dec 3 11:49:27 PST 2011
Update of /home/cvs/cvsroot/freeside/FS/FS/part_pkg
In directory wavetail.420.am:/tmp/cvs-serv3027/FS/FS/part_pkg
Modified Files:
prorate_Mixin.pm
Log Message:
fix edge case with prorate_defer_bill, #15432
Index: prorate_Mixin.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg/prorate_Mixin.pm,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -w -d -r1.17 -r1.18
--- prorate_Mixin.pm 13 Oct 2011 07:55:59 -0000 1.17
+++ prorate_Mixin.pm 3 Dec 2011 19:49:25 -0000 1.18
@@ -103,7 +103,7 @@
$months += $param->{'freq_override'} - 1;
}
elsif ( ( $self->option('add_full_period',1)
- or $self->option('prorate_defer_bill',1) ) # necessary
+ or $self->option('prorate_defer_bill',1) )
and $months < $self->freq ) {
$months += $self->freq;
$$sdate = $self->add_freq($mstart);
@@ -131,10 +131,12 @@
and $cutoff_day
) {
my ($mnow, $mend, $mstart) = $self->_endpoints($sdate, $cutoff_day);
- # if today is the cutoff day, set the next bill to right now instead
- # of waiting a month.
+ # If today is the cutoff day, set the next bill and setup both to
+ # midnight today, so that the customer will be billed normally for a
+ # month starting today.
if ( $mnow - $mstart < 86400 ) {
- $cust_pkg->bill($mnow);
+ $cust_pkg->setup($mstart);
+ $cust_pkg->bill($mstart);
}
else {
$cust_pkg->bill($mend);
More information about the freeside-commits
mailing list