X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_event%2FCondition.pm;h=9900acaa9bdd7ec781bc7e4dad18f9a9d135b0df;hb=07d4f40fde413451502a42550da0cff9fa65a014;hp=d1d519683f16ec29552b1c1a4a9761761b960db7;hpb=a2ecb1cf6a6c084c521710f1256da082f70ba9e5;p=freeside.git 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