projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
18968ca
)
improvements in time remaining report: correctly account for unpaid time for non...
author
ivan
<ivan>
Thu, 5 Nov 2009 22:01:56 +0000
(22:01 +0000)
committer
ivan
<ivan>
Thu, 5 Nov 2009 22:01:56 +0000
(22:01 +0000)
httemplate/search/svc_acct.cgi
patch
|
blob
|
history
diff --git
a/httemplate/search/svc_acct.cgi
b/httemplate/search/svc_acct.cgi
index
2324399
..
7ddb3f0
100755
(executable)
--- a/
httemplate/search/svc_acct.cgi
+++ b/
httemplate/search/svc_acct.cgi
@@
-39,7
+39,8
@@
sub timelast {
my $seconds = $sth->fetchrow_arrayref->[0];
my $seconds = $sth->fetchrow_arrayref->[0];
- my $return = (($seconds < 0) ? '-' : '') . concise(duration($seconds));
+ #my $return = (($seconds < 0) ? '-' : '') . concise(duration($seconds));
+ my $return = (($seconds < 0) ? '-' : '') . format_time($seconds);
$return .= sprintf(' (%.2fx)', $seconds / $permonth ) if $permonth;
$return .= sprintf(' (%.2fx)', $seconds / $permonth ) if $permonth;
@@
-135,8
+136,10
@@
if ( $cgi->param('magic') =~ /^(all|unlinked)$/ ) {
return format_time($seconds) unless $timepermonth && $recur;
my $balance = $cust_pkg->cust_main->balance;
return format_time($seconds) unless $timepermonth && $recur;
my $balance = $cust_pkg->cust_main->balance;
- my $months_unpaid = $balance / $recur;
- my $time_unpaid = $months_unpaid * $timepermonth;
+ my $periods_unpaid = $balance / $recur;
+ my $time_unpaid = $periods_unpaid * $timepermonth;
+ $time_unpaid *= $part_pkg->freq
+ if $part_pkg->freq =~ /^\d+$/ && $part_pkg->freq != 0;
format_time($seconds-$time_unpaid).
sprintf(' (%.2fx monthly)', ( $seconds-$time_unpaid ) / $timepermonth );
},
format_time($seconds-$time_unpaid).
sprintf(' (%.2fx monthly)', ( $seconds-$time_unpaid ) / $timepermonth );
},