[freeside-commits] freeside/FS/FS cust_bill.pm, 1.344, 1.345 svc_phone.pm, 1.37, 1.38
Erik Levinson
levinse at wavetail.420.am
Tue Jun 21 15:41:45 PDT 2011
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv2126/FS/FS
Modified Files:
cust_bill.pm svc_phone.pm
Log Message:
invoice DID summary performance enhancement, RT10886
Index: svc_phone.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/svc_phone.pm,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -w -d -r1.37 -r1.38
--- svc_phone.pm 18 Jan 2011 03:44:29 -0000 1.37
+++ svc_phone.pm 21 Jun 2011 22:41:43 -0000 1.38
@@ -727,7 +727,8 @@
'table' => 'cdr',
'hashref' => \%hash,
'extra_sql' => $extra_sql,
- 'order_by' => "ORDER BY startdate $for_update",
+ 'order_by' => $options{'billsec_sum'} ? '' : "ORDER BY startdate $for_update",
+ 'select' => $options{'billsec_sum'} ? 'sum(billsec) as billsec_sum' : '*',
} );
@cdrs;
Index: cust_bill.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_bill.pm,v
retrieving revision 1.344
retrieving revision 1.345
diff -u -w -d -r1.344 -r1.345
--- cust_bill.pm 21 Jun 2011 22:15:58 -0000 1.344
+++ cust_bill.pm 21 Jun 2011 22:41:43 -0000 1.345
@@ -4134,10 +4134,8 @@
# increment usage minutes
if ( $phone_inserted ) {
- my @cdrs = $phone_inserted->get_cdrs('begin'=>$start,'end'=>$end);
- foreach my $cdr ( @cdrs ) {
- $minutes += $cdr->billsec/60;
- }
+ my @cdrs = $phone_inserted->get_cdrs('begin'=>$start,'end'=>$end,'billsec_sum'=>1);
+ $minutes = $cdrs[0]->billsec_sum if scalar(@cdrs) == 1;
}
else {
warn "WARNING: no matching h_svc_phone insert record for insert time $inserted, svcnum " . $h_cust_svc->svcnum;
More information about the freeside-commits
mailing list