diff options
author | ivan <ivan> | 2009-08-04 22:04:51 +0000 |
---|---|---|
committer | ivan <ivan> | 2009-08-04 22:04:51 +0000 |
commit | de7dc370b95f4175dd3119acffe2af2c8f6d735f (patch) | |
tree | e0baaf58c5d465a09e5bfbed22ba00ca0fe87572 /FS/FS/svc_Common.pm | |
parent | 32c4b823d2561ec9ed14fa446c11f15a68404d37 (diff) |
ignore problams calling ->overlimit during sqlradius-reset, wtf?! RT#5868
Diffstat (limited to 'FS/FS/svc_Common.pm')
-rw-r--r-- | FS/FS/svc_Common.pm | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/FS/FS/svc_Common.pm b/FS/FS/svc_Common.pm index 869ab58..8fd5d0d 100644 --- a/FS/FS/svc_Common.pm +++ b/FS/FS/svc_Common.pm @@ -1,8 +1,9 @@ package FS::svc_Common; use strict; -use vars qw( @ISA $noexport_hack $DEBUG $me ); -use Carp qw( cluck carp croak ); #specify cluck have to specify them all.. +use vars qw( @ISA $noexport_hack $DEBUG $me + $overlimit_missing_cust_svc_nonfatal_kludge ); +use Carp qw( cluck carp croak confess ); #specify cluck have to specify them all use Scalar::Util qw( blessed ); use FS::Record qw( qsearch qsearchs fields dbh ); use FS::cust_main_Mixin; @@ -18,6 +19,8 @@ use FS::inventory_class; $me = '[FS::svc_Common]'; $DEBUG = 0; +$overlimit_missing_cust_svc_nonfatal_kludge = 0; + =head1 NAME FS::svc_Common - Object method for all svc_ records @@ -798,7 +801,19 @@ Sets or retrieves overlimit date. sub overlimit { my $self = shift; - $self->cust_svc->overlimit(@_); + #$self->cust_svc->overlimit(@_); + my $cust_svc = $self->cust_svc; + unless ( $cust_svc ) { #wtf? + my $error = "$me overlimit: missing cust_svc record for svc_acct svcnum ". + $self->svcnum; + if ( $overlimit_missing_cust_svc_nonfatal_kludge ) { + cluck "$error; continuing anyway as requested"; + return ''; + } else { + confess $error; + } + } + $cust_svc->overlimit(@_); } =item cancel |