projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
cd5882b
)
allow non-integer minutes in CDR usage pools, #5738, see also #28308
author
Mark Wells
<mark@freeside.biz>
Fri, 16 May 2014 02:16:43 +0000
(19:16 -0700)
committer
Mark Wells
<mark@freeside.biz>
Fri, 16 May 2014 02:16:43 +0000
(19:16 -0700)
FS/FS/ClientAPI/MyAccount.pm
patch
|
blob
|
history
FS/FS/Schema.pm
patch
|
blob
|
history
FS/FS/cdr_cust_pkg_usage.pm
patch
|
blob
|
history
FS/FS/cust_pkg.pm
patch
|
blob
|
history
FS/FS/cust_pkg_usage.pm
patch
|
blob
|
history
FS/FS/part_pkg_usage.pm
patch
|
blob
|
history
httemplate/view/cust_main/packages/package.html
patch
|
blob
|
history
diff --git
a/FS/FS/ClientAPI/MyAccount.pm
b/FS/FS/ClientAPI/MyAccount.pm
index
e5078f9
..
6619eb1
100644
(file)
--- a/
FS/FS/ClientAPI/MyAccount.pm
+++ b/
FS/FS/ClientAPI/MyAccount.pm
@@
-1724,7
+1724,7
@@
sub list_svcs {
my $tag = $part->description . ($part->shared ? 1 : 0);
my $row = $usage_pools{$tag}
||= [ $part->description, 0, 0, $part->shared ? 1 : 0 ];
my $tag = $part->description . ($part->shared ? 1 : 0);
my $row = $usage_pools{$tag}
||= [ $part->description, 0, 0, $part->shared ? 1 : 0 ];
- $row->[1] +=
$_->minutes
; # minutes remaining
+ $row->[1] +=
sprintf('%.1f', $_->minutes)
; # minutes remaining
$row->[2] += $part->minutes; # minutes total
}
$row->[2] += $part->minutes; # minutes total
}
diff --git
a/FS/FS/Schema.pm
b/FS/FS/Schema.pm
index
416587d
..
12064af
100644
(file)
--- a/
FS/FS/Schema.pm
+++ b/
FS/FS/Schema.pm
@@
-2735,7
+2735,7
@@
sub tables_hashref {
'columns' => [
'pkgusagenum', 'serial', '', '', '', '',
'pkgnum', 'int', '', '', '', '',
'columns' => [
'pkgusagenum', 'serial', '', '', '', '',
'pkgnum', 'int', '', '', '', '',
- 'minutes', '
int
', '', '', '', '',
+ 'minutes', '
double precision
', '', '', '', '',
'pkgusagepart', 'int', '', '', '', '',
],
'primary_key' => 'pkgusagenum',
'pkgusagepart', 'int', '', '', '', '',
],
'primary_key' => 'pkgusagenum',
@@
-2756,7
+2756,7
@@
sub tables_hashref {
'cdrusagenum', 'bigserial', '', '', '', '',
'acctid', 'bigint', '', '', '', '',
'pkgusagenum', 'int', '', '', '', '',
'cdrusagenum', 'bigserial', '', '', '', '',
'acctid', 'bigint', '', '', '', '',
'pkgusagenum', 'int', '', '', '', '',
- 'minutes', '
int
', '', '', '', '',
+ 'minutes', '
double precision
', '', '', '', '',
],
'primary_key' => 'cdrusagenum',
'unique' => [],
],
'primary_key' => 'cdrusagenum',
'unique' => [],
@@
-4713,7
+4713,7
@@
sub tables_hashref {
'columns' => [
'pkgusagepart', 'serial', '', '', '', '',
'pkgpart', 'int', '', '', '', '',
'columns' => [
'pkgusagepart', 'serial', '', '', '', '',
'pkgpart', 'int', '', '', '', '',
- 'minutes', '
int
', '', '', '', '',
+ 'minutes', '
double precision
', '', '', '', '',
'priority', 'int', 'NULL', '', '', '',
'shared', 'char', 'NULL', 1, '', '',
'rollover', 'char', 'NULL', 1, '', '',
'priority', 'int', 'NULL', '', '', '',
'shared', 'char', 'NULL', 1, '', '',
'rollover', 'char', 'NULL', 1, '', '',
diff --git
a/FS/FS/cdr_cust_pkg_usage.pm
b/FS/FS/cdr_cust_pkg_usage.pm
index
7de8764
..
5d68d66
100644
(file)
--- a/
FS/FS/cdr_cust_pkg_usage.pm
+++ b/
FS/FS/cdr_cust_pkg_usage.pm
@@
-86,7
+86,7
@@
sub check {
$self->ut_numbern('cdrusagenum')
|| $self->ut_foreign_key('acctid', 'cdr', 'acctid')
|| $self->ut_foreign_key('pkgusagenum', 'cust_pkg_usage', 'pkgusagenum')
$self->ut_numbern('cdrusagenum')
|| $self->ut_foreign_key('acctid', 'cdr', 'acctid')
|| $self->ut_foreign_key('pkgusagenum', 'cust_pkg_usage', 'pkgusagenum')
- || $self->ut_
number
('minutes')
+ || $self->ut_
float
('minutes')
;
return $error if $error;
;
return $error if $error;
diff --git
a/FS/FS/cust_pkg.pm
b/FS/FS/cust_pkg.pm
index
b1cdf45
..
cabecd6
100644
(file)
--- a/
FS/FS/cust_pkg.pm
+++ b/
FS/FS/cust_pkg.pm
@@
-4015,7
+4015,7
@@
sub apply_usage {
minutes => min($cust_pkg_usage->minutes, $minutes),
});
$cust_pkg_usage->set('minutes',
minutes => min($cust_pkg_usage->minutes, $minutes),
});
$cust_pkg_usage->set('minutes',
- sprintf('%.0f', $cust_pkg_usage->minutes - $cdr_cust_pkg_usage->minutes)
+ $cust_pkg_usage->minutes - $cdr_cust_pkg_usage->minutes
);
$error = $cust_pkg_usage->replace || $cdr_cust_pkg_usage->insert;
$minutes -= $cdr_cust_pkg_usage->minutes;
);
$error = $cust_pkg_usage->replace || $cdr_cust_pkg_usage->insert;
$minutes -= $cdr_cust_pkg_usage->minutes;
diff --git
a/FS/FS/cust_pkg_usage.pm
b/FS/FS/cust_pkg_usage.pm
index
d295842
..
84ba66e
100644
(file)
--- a/
FS/FS/cust_pkg_usage.pm
+++ b/
FS/FS/cust_pkg_usage.pm
@@
-117,7
+117,7
@@
sub check {
my $error =
$self->ut_numbern('pkgusagenum')
|| $self->ut_foreign_key('pkgnum', 'cust_pkg', 'pkgnum')
my $error =
$self->ut_numbern('pkgusagenum')
|| $self->ut_foreign_key('pkgnum', 'cust_pkg', 'pkgnum')
- || $self->ut_
number
n('minutes')
+ || $self->ut_
float
n('minutes')
|| $self->ut_foreign_key('pkgusagepart', 'part_pkg_usage', 'pkgusagepart')
;
return $error if $error;
|| $self->ut_foreign_key('pkgusagepart', 'part_pkg_usage', 'pkgusagepart')
;
return $error if $error;
diff --git
a/FS/FS/part_pkg_usage.pm
b/FS/FS/part_pkg_usage.pm
index
008a2a9
..
b19c63d
100644
(file)
--- a/
FS/FS/part_pkg_usage.pm
+++ b/
FS/FS/part_pkg_usage.pm
@@
-116,7
+116,7
@@
sub check {
my $error =
$self->ut_numbern('pkgusagepart')
|| $self->ut_foreign_key('pkgpart', 'part_pkg', 'pkgpart')
my $error =
$self->ut_numbern('pkgusagepart')
|| $self->ut_foreign_key('pkgpart', 'part_pkg', 'pkgpart')
- || $self->ut_
number
('minutes')
+ || $self->ut_
float
('minutes')
|| $self->ut_numbern('priority')
|| $self->ut_flag('shared')
|| $self->ut_flag('rollover')
|| $self->ut_numbern('priority')
|| $self->ut_flag('shared')
|| $self->ut_flag('rollover')
diff --git
a/httemplate/view/cust_main/packages/package.html
b/httemplate/view/cust_main/packages/package.html
index
d83bab4
..
9f6169c
100644
(file)
--- a/
httemplate/view/cust_main/packages/package.html
+++ b/
httemplate/view/cust_main/packages/package.html
@@
-277,7
+277,7
@@
% $trstyle = ' CLASS="shared"' if $part->shared;
<TR<%$trstyle%>>
<TD ALIGN="right"><% $part->description %>: </TD>
% $trstyle = ' CLASS="shared"' if $part->shared;
<TR<%$trstyle%>>
<TD ALIGN="right"><% $part->description %>: </TD>
- <TD <%$color%> ALIGN="right"><%
$usage->minutes
%></TD>
+ <TD <%$color%> ALIGN="right"><%
sprintf('%.1f', $usage->minutes)
%></TD>
<TD <%$color%>> / </TD>
<TD <%$color%>><% $part->minutes %></TD>
% if ( $part->shared ) {
<TD <%$color%>> / </TD>
<TD <%$color%>><% $part->minutes %></TD>
% if ( $part->shared ) {