diff options
author | Jonathan Prykop <jonathan@freeside.biz> | 2016-04-11 07:08:02 -0500 |
---|---|---|
committer | Jonathan Prykop <jonathan@freeside.biz> | 2016-04-11 07:08:02 -0500 |
commit | 19c77bd46e3d0155b9f2a1afb7a3c488bc050f65 (patch) | |
tree | 05e546d15b8ef188c51727e23d170d4f00085f64 /FS/FS/svc_Common.pm | |
parent | 4551d052fce2c17e7c03e01ee66d2f91096f8649 (diff) |
RT#40641: unprovisioning preserved cancelled services
Diffstat (limited to 'FS/FS/svc_Common.pm')
-rw-r--r-- | FS/FS/svc_Common.pm | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/FS/FS/svc_Common.pm b/FS/FS/svc_Common.pm index 73658f6..4fd2d0b 100644 --- a/FS/FS/svc_Common.pm +++ b/FS/FS/svc_Common.pm @@ -1385,11 +1385,17 @@ Parameters: =item order_by +=item cancelled - if true, only returns svcs attached to cancelled pkgs; +if defined and false, only returns svcs not attached to cancelled packages + =back =cut -# svc_broadband::search should eventually use this instead +### Don't call the 'cancelled' option 'Service Status' +### There is no such thing +### See cautionary note in httemplate/browse/part_svc.cgi + sub search { my ($class, $params) = @_; @@ -1493,6 +1499,14 @@ sub search { push @where, "exportnum = $1"; } + if ( defined($params->{'cancelled'}) ) { + if ($params->{'cancelled'}) { + push @where, "cust_pkg.cancel IS NOT NULL"; + } else { + push @where, "cust_pkg.cancel IS NULL"; + } + } + # # sector and tower # my @where_sector = $class->tower_sector_sql($params); # if ( @where_sector ) { |