X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fcust_svc.pm;h=3f73483215ecdf4ff0e6038bb41f73552a4e944e;hp=d91fa0d7ae43c4b23282bba051f801ad32d47243;hb=674cb2d9d7105f4cc2871539b2e9f7088cdaa750;hpb=791e374dc2f6d6cecd51e2fad52d74587bf879bf diff --git a/FS/FS/cust_svc.pm b/FS/FS/cust_svc.pm index d91fa0d7a..3f7348321 100644 --- a/FS/FS/cust_svc.pm +++ b/FS/FS/cust_svc.pm @@ -16,6 +16,7 @@ use FS::domain_record; use FS::part_export; use FS::cdr; use FS::UI::Web; +use FS::export_cust_svc; #most FS::svc_ classes are autoloaded in svc_x emthod use FS::svc_acct; #this one is used in the cache stuff @@ -169,6 +170,17 @@ sub delete { local $FS::UID::AutoCommit = 0; my $dbh = dbh; + # delete associated export_cust_svc + foreach my $export_cust_svc ( + qsearch('export_cust_svc',{ 'svcnum' => $self->svcnum }) + ) { + my $error = $export_cust_svc->delete; + if ( $error ) { + $dbh->rollback if $oldAutoCommit; + return $error; + } + } + my $error = $self->SUPER::delete; if ( $error ) { $dbh->rollback if $oldAutoCommit; @@ -811,13 +823,12 @@ sub seconds_since { 'internal session db deprecated'; }; =item seconds_since_sqlradacct TIMESTAMP_START TIMESTAMP_END -See L. Equivalent to -$cust_svc->svc_x->seconds_since_sqlradacct, but more efficient. Meaningless -for records where B is not "svc_acct". +Equivalent to $cust_svc->svc_x->seconds_since_sqlradacct, but +more efficient. Meaningless for records where B is not +svc_acct or svc_broadband. =cut -#note: implementation here, POD in FS::svc_acct sub seconds_since_sqlradacct { my($self, $start, $end) = @_; @@ -956,12 +967,11 @@ sub seconds_since_sqlradacct { =item attribute_since_sqlradacct TIMESTAMP_START TIMESTAMP_END ATTRIBUTE See L. Equivalent to -$cust_svc->svc_x->attribute_since_sqlradacct, but more efficient. Meaningless -for records where B is not "svc_acct". +$cust_svc->svc_x->attribute_since_sqlradacct, but more efficient. +Meaningless for records where B is not svc_acct or svc_broadband. =cut -#note: implementation here, POD in FS::svc_acct #(false laziness w/seconds_since_sqlradacct above) sub attribute_since_sqlradacct { my($self, $start, $end, $attrib) = @_;