summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2017-05-11 10:08:18 -0700
committerIvan Kohler <ivan@freeside.biz>2017-05-11 10:08:18 -0700
commit9cc374c60cd0b4d04e18b7e5a395006dbe3fc7ed (patch)
tree766cf3a008f350c6cc9af5d88ccdf1036d54a78a
parentb2e645b79aab7fca4ce4d2305ce4c95f093008d5 (diff)
add residential/commercial conditions, RT#75886
-rw-r--r--FS/FS/part_event/Condition/has_company.pm16
-rw-r--r--FS/FS/part_event/Condition/hasnt_company.pm17
2 files changed, 33 insertions, 0 deletions
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;