From 5b9b7115b1b858bbe0ed1f8af08781d3b1394a33 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Thu, 11 May 2017 10:08:16 -0700 Subject: [PATCH] add residential/commercial conditions, RT#75886 --- FS/FS/part_event/Condition/has_company.pm | 16 ++++++++++++++++ FS/FS/part_event/Condition/hasnt_company.pm | 17 +++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 FS/FS/part_event/Condition/has_company.pm create mode 100644 FS/FS/part_event/Condition/hasnt_company.pm diff --git a/FS/FS/part_event/Condition/has_company.pm b/FS/FS/part_event/Condition/has_company.pm new file mode 100644 index 000000000..6fdeb340a --- /dev/null +++ b/FS/FS/part_event/Condition/has_company.pm @@ -0,0 +1,16 @@ +package FS::part_event::Condition::has_company; +use base qw( FS::part_event::Condition ); + +use strict; + +sub description { 'Customer is commercial'; } + +sub condition { + my( $self, $object) = @_; + + my $cust_main = $self->cust_main($object); + + $cust_main->company =~ /\S/; +} + +1; diff --git a/FS/FS/part_event/Condition/hasnt_company.pm b/FS/FS/part_event/Condition/hasnt_company.pm new file mode 100644 index 000000000..f9fbc0393 --- /dev/null +++ b/FS/FS/part_event/Condition/hasnt_company.pm @@ -0,0 +1,17 @@ +package FS::part_event::Condition::hasnt_company; +use base qw( FS::part_event::Condition ); + +use strict; + +sub description { 'Customer is residential'; } + +sub condition { + my( $self, $object) = @_; + + my $cust_main = $self->cust_main($object); + + $cust_main->company !~ /\S/; + +} + +1; -- 2.11.0