add residential/commercial conditions, RT#75886
authorIvan Kohler <ivan@freeside.biz>
Thu, 11 May 2017 17:08:16 +0000 (10:08 -0700)
committerIvan Kohler <ivan@freeside.biz>
Thu, 11 May 2017 17:08:16 +0000 (10:08 -0700)
FS/FS/part_event/Condition/has_company.pm [new file with mode: 0644]
FS/FS/part_event/Condition/hasnt_company.pm [new file with mode: 0644]

diff --git a/FS/FS/part_event/Condition/has_company.pm b/FS/FS/part_event/Condition/has_company.pm
new file mode 100644 (file)
index 0000000..6fdeb34
--- /dev/null
@@ -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 (file)
index 0000000..f9fbc03
--- /dev/null
@@ -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;