projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
d6107b6
)
fix cancellation errors with updated flat_introrate, RT#5865
author
ivan
<ivan>
Wed, 5 Aug 2009 23:34:28 +0000
(23:34 +0000)
committer
ivan
<ivan>
Wed, 5 Aug 2009 23:34:28 +0000
(23:34 +0000)
FS/FS/part_pkg/agent.pm
patch
|
blob
|
history
FS/FS/part_pkg/base_rate.pm
patch
|
blob
|
history
FS/FS/part_pkg/flat.pm
patch
|
blob
|
history
FS/FS/part_pkg/flat_delayed.pm
patch
|
blob
|
history
FS/FS/part_pkg/prorate_delayed.pm
patch
|
blob
|
history
diff --git
a/FS/FS/part_pkg/agent.pm
b/FS/FS/part_pkg/agent.pm
index
2ebaf58
..
d41978c
100644
(file)
--- a/
FS/FS/part_pkg/agent.pm
+++ b/
FS/FS/part_pkg/agent.pm
@@
-119,7
+119,7
@@
sub calc_recur {
my $pkg_setup_fee =
$part_pkg->setup_cost || $part_pkg->option('setup_fee');
my $pkg_base_recur =
my $pkg_setup_fee =
$part_pkg->setup_cost || $part_pkg->option('setup_fee');
my $pkg_base_recur =
- $part_pkg->recur_cost || $part_pkg->base_recur_permonth;
+ $part_pkg->recur_cost || $part_pkg->base_recur_permonth
($cust_pkg)
;
my $pkg_start = $cust_pkg->get('setup');
if ( $pkg_start < $last_bill ) {
my $pkg_start = $cust_pkg->get('setup');
if ( $pkg_start < $last_bill ) {
diff --git
a/FS/FS/part_pkg/base_rate.pm
b/FS/FS/part_pkg/base_rate.pm
index
64636d9
..
440e985
100644
(file)
--- a/
FS/FS/part_pkg/base_rate.pm
+++ b/
FS/FS/part_pkg/base_rate.pm
@@
-63,7
+63,7
@@
sub calc_remain {
my $time = time; #should be able to pass this in for credit calculation
my $next_bill = $cust_pkg->getfield('bill') || 0;
my $last_bill = $cust_pkg->last_bill || 0;
my $time = time; #should be able to pass this in for credit calculation
my $next_bill = $cust_pkg->getfield('bill') || 0;
my $last_bill = $cust_pkg->last_bill || 0;
- return 0 if ! $self->base_recur
+ return 0 if ! $self->base_recur
($cust_pkg)
|| ! $self->option('unused_credit', 1)
|| ! $last_bill
|| ! $next_bill
|| ! $self->option('unused_credit', 1)
|| ! $last_bill
|| ! $next_bill
@@
-81,7
+81,7
@@
sub calc_remain {
my $freq_sec = $1 * $sec{$2||'m'};
return 0 unless $freq_sec;
my $freq_sec = $1 * $sec{$2||'m'};
return 0 unless $freq_sec;
- sprintf("%.2f", $self->base_recur * ( $next_bill - $time ) / $freq_sec );
+ sprintf("%.2f", $self->base_recur
($cust_pkg)
* ( $next_bill - $time ) / $freq_sec );
}
}
diff --git
a/FS/FS/part_pkg/flat.pm
b/FS/FS/part_pkg/flat.pm
index
d1863f4
..
02ac6ae
100644
(file)
--- a/
FS/FS/part_pkg/flat.pm
+++ b/
FS/FS/part_pkg/flat.pm
@@
-162,11
+162,11
@@
sub base_recur {
}
sub base_recur_permonth {
}
sub base_recur_permonth {
- my($self, $cust_pkg) = @_;
#$cust_pkg?
+ my($self, $cust_pkg) = @_;
return 0 unless $self->freq =~ /^\d+$/ && $self->freq > 0;
return 0 unless $self->freq =~ /^\d+$/ && $self->freq > 0;
- sprintf('%.2f', $self->base_recur / $self->freq );
+ sprintf('%.2f', $self->base_recur
($cust_pkg)
/ $self->freq );
}
sub calc_remain {
}
sub calc_remain {
@@
-184,7
+184,7
@@
sub calc_remain {
#my $last_bill = $cust_pkg->last_bill || 0;
my $last_bill = $cust_pkg->get('last_bill') || 0; #->last_bill falls back to setup
#my $last_bill = $cust_pkg->last_bill || 0;
my $last_bill = $cust_pkg->get('last_bill') || 0; #->last_bill falls back to setup
- return 0 if ! $self->base_recur
+ return 0 if ! $self->base_recur
($cust_pkg)
|| ! $self->option('unused_credit', 1)
|| ! $last_bill
|| ! $next_bill
|| ! $self->option('unused_credit', 1)
|| ! $last_bill
|| ! $next_bill
@@
-202,7
+202,7
@@
sub calc_remain {
my $freq_sec = $1 * $sec{$2||'m'};
return 0 unless $freq_sec;
my $freq_sec = $1 * $sec{$2||'m'};
return 0 unless $freq_sec;
- sprintf("%.2f", $self->base_recur * ( $next_bill - $time ) / $freq_sec );
+ sprintf("%.2f", $self->base_recur
($cust_pkg)
* ( $next_bill - $time ) / $freq_sec );
}
}
@@
-216,7
+216,7
@@
sub is_prepaid {
sub usage_valuehash {
my $self = shift;
sub usage_valuehash {
my $self = shift;
- map { $_, $self->option($_) }
+ map { $_, $self->option($_) }
grep { $self->option($_, 'hush') }
qw(seconds upbytes downbytes totalbytes);
}
grep { $self->option($_, 'hush') }
qw(seconds upbytes downbytes totalbytes);
}
diff --git
a/FS/FS/part_pkg/flat_delayed.pm
b/FS/FS/part_pkg/flat_delayed.pm
index
4a2f1ba
..
33f9dd8
100644
(file)
--- a/
FS/FS/part_pkg/flat_delayed.pm
+++ b/
FS/FS/part_pkg/flat_delayed.pm
@@
-58,7
+58,7
@@
sub calc_remain {
return 0 if $last_bill + (86400 * $free_days) == $next_bill
&& $last_bill == $cust_pkg->setup;
return 0 if $last_bill + (86400 * $free_days) == $next_bill
&& $last_bill == $cust_pkg->setup;
- return 0 if ! $self->base_recur
+ return 0 if ! $self->base_recur
($cust_pkg)
|| ! $self->option('unused_credit', 1)
|| ! $last_bill
|| ! $next_bill;
|| ! $self->option('unused_credit', 1)
|| ! $last_bill
|| ! $next_bill;
diff --git
a/FS/FS/part_pkg/prorate_delayed.pm
b/FS/FS/part_pkg/prorate_delayed.pm
index
1d22798
..
0073493
100644
(file)
--- a/
FS/FS/part_pkg/prorate_delayed.pm
+++ b/
FS/FS/part_pkg/prorate_delayed.pm
@@
-56,7
+56,7
@@
sub calc_remain {
return 0 if $last_bill + (86400 * $free_days) == $next_bill
&& $last_bill == $cust_pkg->setup;
return 0 if $last_bill + (86400 * $free_days) == $next_bill
&& $last_bill == $cust_pkg->setup;
- return 0 if ! $self->base_recur
+ return 0 if ! $self->base_recur
($cust_pkg)
|| ! $self->option('unused_credit', 1)
|| ! $last_bill
|| ! $next_bill;
|| ! $self->option('unused_credit', 1)
|| ! $last_bill
|| ! $next_bill;