1 package FS::part_event::Condition::cust_payments;
4 use base qw( FS::part_event::Condition );
6 sub description { 'Customer total payments (amount)'; }
10 'over' => { 'label' => 'Customer total payments at least',
12 'value' => '0.00', #default
18 my($self, $object) = @_;
20 my $cust_main = $self->cust_main($object);
22 my $over = $self->option('over');
23 $over = 0 unless length($over);
25 $cust_main->total_paid >= $over;
29 #XXX add for efficiency. could use cust_main::total_paid_sql
32 # my( $class, $table ) = @_;
34 # my $over = $class->condition_sql_option('balance');
36 # my $balance_sql = FS::cust_main->balance_sql;
38 # "$balance_sql > $over";