1 package FS::part_event::Condition::balance;
6 use base qw( FS::part_event::Condition );
8 sub description { 'Customer balance'; }
10 sub implicit_flag { 20; }
13 'Are you sure you want to remove this condition? Doing so will allow this event to run even if the customer has no outstanding balance. Perhaps you want to reset "Balance over" to 0 instead of removing the condition entirely?'; #better error msg?
18 'balance' => { 'label' => 'Balance over',
20 'value' => '0.00', #default
26 my($self, $object) = @_;
28 my $cust_main = $self->cust_main($object);
30 my $over = $self->option('balance');
31 $over = 0 unless length($over);
33 $cust_main->balance > $over;
37 my( $class, $table ) = @_;
39 my $over = $class->condition_sql_option('balance');
41 my $balance_sql = FS::cust_main->balance_sql;
43 "$balance_sql > $over";