[freeside-commits] freeside/FS/FS cust_bill.pm, 1.299.2.38, 1.299.2.39 svc_phone.pm, 1.28.2.9, 1.28.2.10
Erik Levinson
levinse at wavetail.420.am
Tue Jun 21 15:41:47 PDT 2011
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv2128/FS/FS
Modified Files:
Tag: FREESIDE_2_1_BRANCH
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.28.2.9
retrieving revision 1.28.2.10
diff -u -w -d -r1.28.2.9 -r1.28.2.10
--- svc_phone.pm 18 Jan 2011 03:44:31 -0000 1.28.2.9
+++ svc_phone.pm 21 Jun 2011 22:41:44 -0000 1.28.2.10
@@ -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.299.2.38
retrieving revision 1.299.2.39
diff -u -w -d -r1.299.2.38 -r1.299.2.39
--- cust_bill.pm 21 Jun 2011 22:16:00 -0000 1.299.2.38
+++ cust_bill.pm 21 Jun 2011 22:41:44 -0000 1.299.2.39
@@ -4088,10 +4088,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