projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b8aee5a
)
torrus, RT#10574
author
ivan
<ivan>
Mon, 24 Jan 2011 00:54:09 +0000
(
00:54
+0000)
committer
ivan
<ivan>
Mon, 24 Jan 2011 00:54:09 +0000
(
00:54
+0000)
FS/FS/part_pkg/torrus_Common.pm
patch
|
blob
|
history
diff --git
a/FS/FS/part_pkg/torrus_Common.pm
b/FS/FS/part_pkg/torrus_Common.pm
index
c8915ce
..
cbd9ee3
100644
(file)
--- a/
FS/FS/part_pkg/torrus_Common.pm
+++ b/
FS/FS/part_pkg/torrus_Common.pm
@@
-74,14
+74,15
@@
sub calc_usage {
$max -= $inc;
next if $max < 0;
$max -= $inc;
next if $max < 0;
- my $amount = sprintf('%.2f', $self->option($self->_torrus_rate) * $max );
+ my $rate = $self->option($self->_torrus_rate);
+ my $amount = sprintf('%.2f', $rate * $max );
$total += $amount;
#add usage details to invoice
my $l = $self->_torrus_label;
$total += $amount;
#add usage details to invoice
my $l = $self->_torrus_label;
- my $d = "Last month's usage for $serviceid:
$max$l"
;
+ my $d = "Last month's usage for $serviceid:
". sprintf('%2f',$max). $l
;
$d .= " (". ($max+$inc). "$l - $inc$l included)" if $inc;
$d .= " (". ($max+$inc). "$l - $inc$l included)" if $inc;
- $d .= ": $money_char$amount";
+ $d .= "
@ $money_char$rate/$l
: $money_char$amount";
push @$details, $d;
push @$details, $d;