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:13:08 -0500 |
commit | 9297bc3d2ea9b585532943fe613ed36d9c494ba5 (patch) | |
tree | eb1e2d3e968e463e8bab551df1f55e1c59c3edb5 /FS/FS/svc_Common.pm | |
parent | 46b8fda3ffb17a2aabf7c9cbee68e988400d6273 (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 73658f67a..4fd2d0b63 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 ) { |