1 package FS::part_event::Condition::cust_bill_owed;
6 use base qw( FS::part_event::Condition );
9 'Amount owed on specific invoice';
12 sub eventtable_hashref {
19 sub implicit_flag { 30; }
22 'Are you sure you want to remove this condition? Doing so will allow this event to run even for invoices which have no outstanding balance. Perhaps you want to reset "Amount owed over" to 0 instead of removing the condition entirely?'; #better error msg?
27 'owed' => { 'label' => 'Amount owed over',
29 'value' => '0.00', #default
35 #my($self, $cust_bill, %opt) = @_;
36 my($self, $cust_bill) = @_;
38 my $over = $self->option('owed');
39 $over = 0 unless length($over);
41 $cust_bill->owed > $over;
45 my( $class, $table ) = @_;
47 my $over = $class->condition_sql_option('owed');
49 my $owed_sql = FS::cust_bill->owed_sql;
51 "$owed_sql > CAST( $over AS DECIMAL(10,2) )";