X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fpart_event%2FCondition.pm;h=9900acaa9bdd7ec781bc7e4dad18f9a9d135b0df;hp=d1d519683f16ec29552b1c1a4a9761761b960db7;hb=833cfe5c9938d33c3e6b97ed610c25a7afa6eb04;hpb=5e2b0a5efb81642e86f7704a528767c2ea2961ca diff --git a/FS/FS/part_event/Condition.pm b/FS/FS/part_event/Condition.pm index d1d519683..9900acaa9 100644 --- a/FS/FS/part_event/Condition.pm +++ b/FS/FS/part_event/Condition.pm @@ -533,6 +533,22 @@ sub condition_sql_option_integer { " AS $integer )"; } +=item condition_sql_option_money OPTION + +As I, but cast the option value to DECIMAL so that +comparison to other monetary values is type-correct. + +=cut + +sub condition_sql_option_money { + my ($class, $option ) = @_; + + 'CAST( + COALESCE('. $class->condition_sql_option($option). + " ,'0') ". + " AS DECIMAL(10,2) )"; +} + =head1 NEW CONDITION CLASSES A module should be added in FS/FS/part_event/Condition/ which implements the