projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix payment application to term discounts, #14524
[freeside.git]
/
FS
/
FS
/
part_pkg
/
prorate_Mixin.pm
diff --git
a/FS/FS/part_pkg/prorate_Mixin.pm
b/FS/FS/part_pkg/prorate_Mixin.pm
index
75dbe5c
..
380f0b0
100644
(file)
--- a/
FS/FS/part_pkg/prorate_Mixin.pm
+++ b/
FS/FS/part_pkg/prorate_Mixin.pm
@@
-1,10
+1,9
@@
package FS::part_pkg::prorate_Mixin;
use strict;
package FS::part_pkg::prorate_Mixin;
use strict;
-use vars qw(
@ISA %info
);
-use Time::Local qw(
timelocal
);
+use vars qw(
%info
);
+use Time::Local qw(
timelocal
);
-@ISA = qw(FS::part_pkg);
%info = (
'disabled' => 1,
# define all fields that are referenced in this code
%info = (
'disabled' => 1,
# define all fields that are referenced in this code
@@
-99,7
+98,11
@@
sub calc_prorate {
my $months = ( ( $self->freq - 1 ) + ($mend-$mnow) / ($mend-$mstart) );
# add a full period if currently billing for a partial period
my $months = ( ( $self->freq - 1 ) + ($mend-$mnow) / ($mend-$mstart) );
# add a full period if currently billing for a partial period
- if ( ( $self->option('add_full_period',1)
+ # 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)
or $self->option('prorate_defer_bill',1) ) # necessary
and $months < $self->freq ) {
$months += $self->freq;
or $self->option('prorate_defer_bill',1) ) # necessary
and $months < $self->freq ) {
$months += $self->freq;