projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
56ce0b6
)
fix edge case with prorate_defer_bill, #15432
author
mark
<mark>
Sat, 3 Dec 2011 19:49:25 +0000
(19:49 +0000)
committer
mark
<mark>
Sat, 3 Dec 2011 19:49:25 +0000
(19:49 +0000)
FS/FS/part_pkg/prorate_Mixin.pm
patch
|
blob
|
history
diff --git
a/FS/FS/part_pkg/prorate_Mixin.pm
b/FS/FS/part_pkg/prorate_Mixin.pm
index
380f0b0
..
78a0893
100644
(file)
--- a/
FS/FS/part_pkg/prorate_Mixin.pm
+++ b/
FS/FS/part_pkg/prorate_Mixin.pm
@@
-103,7
+103,7
@@
sub calc_prorate {
$months += $param->{'freq_override'} - 1;
}
elsif ( ( $self->option('add_full_period',1)
$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);
and $months < $self->freq ) {
$months += $self->freq;
$$sdate = $self->add_freq($mstart);
@@
-131,10
+131,12
@@
sub prorate_setup {
and $cutoff_day
) {
my ($mnow, $mend, $mstart) = $self->_endpoints($sdate, $cutoff_day);
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 ) {
if ( $mnow - $mstart < 86400 ) {
- $cust_pkg->bill($mnow);
+ $cust_pkg->setup($mstart);
+ $cust_pkg->bill($mstart);
}
else {
$cust_pkg->bill($mend);
}
else {
$cust_pkg->bill($mend);