diff options
Diffstat (limited to 'FS/FS/part_event/Condition/balance_under.pm')
-rw-r--r-- | FS/FS/part_event/Condition/balance_under.pm | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/FS/FS/part_event/Condition/balance_under.pm b/FS/FS/part_event/Condition/balance_under.pm deleted file mode 100644 index 2002c70..0000000 --- a/FS/FS/part_event/Condition/balance_under.pm +++ /dev/null @@ -1,42 +0,0 @@ -package FS::part_event::Condition::balance_under; - -use strict; -use FS::cust_main; - -use base qw( FS::part_event::Condition ); - -sub description { 'Customer balance (under)'; } - -sub option_fields { - ( - 'balance' => { 'label' => 'Balance under (or equal to)', - 'type' => 'money', - 'value' => '0.00', #default - }, - ); -} - -sub condition { - my($self, $object) = @_; - - my $cust_main = $self->cust_main($object); - - my $under = $self->option('balance'); - $under = 0 unless length($under); - - $cust_main->balance <= $under; -} - -sub condition_sql { - my( $class, $table ) = @_; - - my $under = $class->condition_sql_option('balance'); - - my $balance_sql = FS::cust_main->balance_sql; - - "$balance_sql <= CAST( $under AS DECIMAL(10,2) )"; - -} - -1; - |