[freeside-commits] freeside/FS/FS cust_bill.pm, 1.299.2.37, 1.299.2.38

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


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

Modified Files:
      Tag: FREESIDE_2_1_BRANCH
	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.299.2.37
retrieving revision 1.299.2.38
diff -u -w -d -r1.299.2.37 -r1.299.2.38
--- cust_bill.pm	21 Jun 2011 18:20:42 -0000	1.299.2.37
+++ cust_bill.pm	21 Jun 2011 22:16:00 -0000	1.299.2.38
@@ -4054,7 +4054,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;
 	    
@@ -4087,10 +4087,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