[freeside-commits] freeside/FS/FS cust_bill.pm,1.343,1.344

Erik Levinson levinse at wavetail.420.am
Tue Jun 21 15:16:00 PDT 2011


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv31839/FS/FS

Modified Files:
	cust_bill.pm 
Log Message:
cust_bill.pm: if DID summary is turned on, don't try to get CDRs in the unlikely case that the h_svc_phone record isn't found with the correct insert time, RT13361

Index: cust_bill.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_bill.pm,v
retrieving revision 1.343
retrieving revision 1.344
diff -u -w -d -r1.343 -r1.344
--- cust_bill.pm	21 Jun 2011 18:20:39 -0000	1.343
+++ cust_bill.pm	21 Jun 2011 22:15:58 -0000	1.344
@@ -4100,7 +4100,7 @@
 
 	    my $inserted = $h_cust_svc->date_inserted;
 	    my $deleted = $h_cust_svc->date_deleted;
-	    my $phone_inserted = $h_cust_svc->h_svc_x($inserted);
+	    my $phone_inserted = $h_cust_svc->h_svc_x($inserted+5);
 	    my $phone_deleted;
 	    $phone_deleted =  $h_cust_svc->h_svc_x($deleted) if $deleted;
 	    
@@ -4133,10 +4133,15 @@
 	    }
 
 	    # increment usage minutes
+        if ( $phone_inserted ) {
 	    my @cdrs = $phone_inserted->get_cdrs('begin'=>$start,'end'=>$end);
 	    foreach my $cdr ( @cdrs ) {
 		$minutes += $cdr->billsec/60;
 	    }
+        }
+        else {
+            warn "WARNING: no matching h_svc_phone insert record for insert time $inserted, svcnum " . $h_cust_svc->svcnum;
+        }
 
 	    # don't look at this service again
 	    push @seen, $h_cust_svc->svcnum;



More information about the freeside-commits mailing list