[freeside-commits] freeside/httemplate/search svc_acct.cgi, 1.55, 1.55.4.1
Ivan,,,
ivan at wavetail.420.am
Thu Nov 5 14:01:59 PST 2009
Update of /home/cvs/cvsroot/freeside/httemplate/search
In directory wavetail.420.am:/tmp/cvs-serv16082
Modified Files:
Tag: FREESIDE_1_9_BRANCH
svc_acct.cgi
Log Message:
improvements in time remaining report: correctly account for unpaid time for non-monthly customers, report in hours+minutes intead of using Time::Duration days/hours
Index: svc_acct.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/svc_acct.cgi,v
retrieving revision 1.55
retrieving revision 1.55.4.1
diff -u -d -r1.55 -r1.55.4.1
--- svc_acct.cgi 24 Jan 2009 21:04:17 -0000 1.55
+++ svc_acct.cgi 5 Nov 2009 22:01:57 -0000 1.55.4.1
@@ -39,7 +39,8 @@
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;
@@ -135,8 +136,10 @@
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 );
},
More information about the freeside-commits
mailing list