refactor cch tax import to remove tons of false laziness and improve flexibility...
[freeside.git] / FS / FS / part_event / Condition / cust_bill_owed.pm
index e90d3db..0fd9922 100644 (file)
@@ -16,6 +16,12 @@ sub eventtable_hashref {
     };
 }
 
+sub implicit_flag { 30; }
+
+sub remove_warning {
+  '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?
+}
+
 sub option_fields {
   (
     'owed' => { 'label'      => 'Amount owed over',
@@ -42,7 +48,7 @@ sub condition_sql {
 
   my $owed_sql = FS::cust_bill->owed_sql;
 
-  "$owed_sql > $over";
+  "$owed_sql > CAST( $over AS numeric )";
 }
 
 1;