projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
09aa4ca
)
torrus: default to "preceding" behavior, RT#10574
author
ivan
<ivan>
Fri, 8 Apr 2011 01:00:37 +0000
(
01:00
+0000)
committer
ivan
<ivan>
Fri, 8 Apr 2011 01:00:37 +0000
(
01:00
+0000)
FS/FS/cust_main/Billing.pm
patch
|
blob
|
history
FS/FS/part_pkg/cdr_termination.pm
patch
|
blob
|
history
FS/FS/part_pkg/flat.pm
patch
|
blob
|
history
FS/FS/part_pkg/torrus_Common.pm
patch
|
blob
|
history
FS/FS/part_pkg/torrus_bw_percentile.pm
patch
|
blob
|
history
FS/FS/part_pkg/torrus_bw_usage.pm
patch
|
blob
|
history
FS/FS/part_pkg/voip_cdr.pm
patch
|
blob
|
history
FS/FS/part_pkg/voip_inbound.pm
patch
|
blob
|
history
diff --git
a/FS/FS/cust_main/Billing.pm
b/FS/FS/cust_main/Billing.pm
index
3b9f0c9
..
b710f33
100644
(file)
--- a/
FS/FS/cust_main/Billing.pm
+++ b/
FS/FS/cust_main/Billing.pm
@@
-1019,11
+1019,11
@@
sub _make_lines {
'freq' => $part_pkg->freq,
};
'freq' => $part_pkg->freq,
};
- if ( $part_pkg->
option('recur_temporality', 1)
eq 'preceding' ) {
+ if ( $part_pkg->
recur_temporality
eq 'preceding' ) {
$cust_bill_pkg->sdate( $hash{last_bill} );
$cust_bill_pkg->edate( $sdate - 86399 ); #60s*60m*24h-1
$cust_bill_pkg->edate( $time ) if $options{cancel};
$cust_bill_pkg->sdate( $hash{last_bill} );
$cust_bill_pkg->edate( $sdate - 86399 ); #60s*60m*24h-1
$cust_bill_pkg->edate( $time ) if $options{cancel};
- } else { #if ( $part_pkg->
option('recur_temporality', 1)
eq 'upcoming' ) {
+ } else { #if ( $part_pkg->
recur_temporality
eq 'upcoming' ) {
$cust_bill_pkg->sdate( $sdate );
$cust_bill_pkg->edate( $cust_pkg->bill );
#$cust_bill_pkg->edate( $time ) if $options{cancel};
$cust_bill_pkg->sdate( $sdate );
$cust_bill_pkg->edate( $cust_pkg->bill );
#$cust_bill_pkg->edate( $time ) if $options{cancel};
diff --git
a/FS/FS/part_pkg/cdr_termination.pm
b/FS/FS/part_pkg/cdr_termination.pm
index
840da82
..
3723629
100644
(file)
--- a/
FS/FS/part_pkg/cdr_termination.pm
+++ b/
FS/FS/part_pkg/cdr_termination.pm
@@
-103,7
+103,7
@@
sub calc_recur {
my $last_bill = $cust_pkg->get('last_bill'); #->last_bill falls back to setup
return 0
my $last_bill = $cust_pkg->get('last_bill'); #->last_bill falls back to setup
return 0
- if $self->
option('recur_temporality', 1)
eq 'preceding'
+ if $self->
recur_temporality
eq 'preceding'
&& ( $last_bill eq '' || $last_bill == 0 );
# termination calculations
&& ( $last_bill eq '' || $last_bill == 0 );
# termination calculations
diff --git
a/FS/FS/part_pkg/flat.pm
b/FS/FS/part_pkg/flat.pm
index
89de551
..
04f4951
100644
(file)
--- a/
FS/FS/part_pkg/flat.pm
+++ b/
FS/FS/part_pkg/flat.pm
@@
-123,7
+123,7
@@
sub calc_recur {
my $last_bill = $cust_pkg->get('last_bill'); #->last_bill falls back to setup
return 0
my $last_bill = $cust_pkg->get('last_bill'); #->last_bill falls back to setup
return 0
- if $self->
option('recur_temporality', 1)
eq 'preceding' && $last_bill == 0;
+ if $self->
recur_temporality
eq 'preceding' && $last_bill == 0;
my $charge = $self->base_recur($cust_pkg, $sdate);
if ( my $cutoff_day = $self->cutoff_day($cust_pkg) ) {
my $charge = $self->base_recur($cust_pkg, $sdate);
if ( my $cutoff_day = $self->cutoff_day($cust_pkg) ) {
@@
-209,6
+209,11
@@
sub can_discount {
$self->freq =~ /^\d+$/ && $self->freq > 0;
}
$self->freq =~ /^\d+$/ && $self->freq > 0;
}
+sub recur_temporality {
+ my $self = shift;
+ $self->option('recur_temporality', 1);
+}
+
sub usage_valuehash {
my $self = shift;
map { $_, $self->option($_) }
sub usage_valuehash {
my $self = shift;
map { $_, $self->option($_) }
diff --git
a/FS/FS/part_pkg/torrus_Common.pm
b/FS/FS/part_pkg/torrus_Common.pm
index
2eda725
..
d0dc9d1
100644
(file)
--- a/
FS/FS/part_pkg/torrus_Common.pm
+++ b/
FS/FS/part_pkg/torrus_Common.pm
@@
-7,6
+7,8
@@
our %info = ( 'disabled' => 1 ); #torrus_Common not a usable price plan directly
our $DEBUG = 1;
our $DEBUG = 1;
+sub recur_temporality { 'preceding'; }
+
sub price_info {
my $self = shift;
my $str = $self->SUPER::price_info;
sub price_info {
my $self = shift;
my $str = $self->SUPER::price_info;
diff --git
a/FS/FS/part_pkg/torrus_bw_percentile.pm
b/FS/FS/part_pkg/torrus_bw_percentile.pm
index
16be627
..
d879899
100644
(file)
--- a/
FS/FS/part_pkg/torrus_bw_percentile.pm
+++ b/
FS/FS/part_pkg/torrus_bw_percentile.pm
@@
-10,7
+10,6
@@
our %info = (
'weight' => 54.5, #:/
'inherit_fields' => [ 'flat', 'global_Mixin' ],
'fields' => {
'weight' => 54.5, #:/
'inherit_fields' => [ 'flat', 'global_Mixin' ],
'fields' => {
- #'recur_temporality' => { 'hidden' => 1, 'value' => 'preceding' }, #XXX do
'recur_temporality' => { 'disabled' => 1 },
'sync_bill_date' => { 'disabled' => 1 },
'cutoff_day' => { 'disabled' => 1 },
'recur_temporality' => { 'disabled' => 1 },
'sync_bill_date' => { 'disabled' => 1 },
'cutoff_day' => { 'disabled' => 1 },
diff --git
a/FS/FS/part_pkg/torrus_bw_usage.pm
b/FS/FS/part_pkg/torrus_bw_usage.pm
index
5a2dd36
..
12912b3
100644
(file)
--- a/
FS/FS/part_pkg/torrus_bw_usage.pm
+++ b/
FS/FS/part_pkg/torrus_bw_usage.pm
@@
-10,7
+10,6
@@
our %info = (
'weight' => 54.7, #:/
'inherit_fields' => [ 'flat', 'global_Mixin' ],
'fields' => {
'weight' => 54.7, #:/
'inherit_fields' => [ 'flat', 'global_Mixin' ],
'fields' => {
- #'recur_temporality' => { 'hidden' => 1, 'value' => 'preceding' }, #XXX do
'recur_temporality' => { 'disabled' => 1 },
'sync_bill_date' => { 'disabled' => 1 },
'cutoff_day' => { 'disabled' => 1 },
'recur_temporality' => { 'disabled' => 1 },
'sync_bill_date' => { 'disabled' => 1 },
'cutoff_day' => { 'disabled' => 1 },
diff --git
a/FS/FS/part_pkg/voip_cdr.pm
b/FS/FS/part_pkg/voip_cdr.pm
index
cd1be35
..
3b1648c
100644
(file)
--- a/
FS/FS/part_pkg/voip_cdr.pm
+++ b/
FS/FS/part_pkg/voip_cdr.pm
@@
-318,7
+318,7
@@
sub calc_usage {
my $last_bill = $cust_pkg->get('last_bill'); #->last_bill falls back to setup
return 0
my $last_bill = $cust_pkg->get('last_bill'); #->last_bill falls back to setup
return 0
- if $self->
option('recur_temporality', 1)
eq 'preceding'
+ if $self->
recur_temporality
eq 'preceding'
&& ( $last_bill eq '' || $last_bill == 0 );
my $ratenum = $cust_pkg->part_pkg->option('ratenum');
&& ( $last_bill eq '' || $last_bill == 0 );
my $ratenum = $cust_pkg->part_pkg->option('ratenum');
diff --git
a/FS/FS/part_pkg/voip_inbound.pm
b/FS/FS/part_pkg/voip_inbound.pm
index
36efad1
..
e3e6faa
100644
(file)
--- a/
FS/FS/part_pkg/voip_inbound.pm
+++ b/
FS/FS/part_pkg/voip_inbound.pm
@@
-202,7
+202,7
@@
sub calc_usage {
my $last_bill = $cust_pkg->get('last_bill'); #->last_bill falls back to setup
return 0
my $last_bill = $cust_pkg->get('last_bill'); #->last_bill falls back to setup
return 0
- if $self->
option('recur_temporality', 1)
eq 'preceding'
+ if $self->
recur_temporality
eq 'preceding'
&& ( $last_bill eq '' || $last_bill == 0 );
my $spool_cdr = $cust_pkg->cust_main->spool_cdr;
&& ( $last_bill eq '' || $last_bill == 0 );
my $spool_cdr = $cust_pkg->cust_main->spool_cdr;