Merge branch 'requirement-specs-custom-variables'
[kivitendo-erp.git] / SL / DB / Helper / CustomVariables.pm
index 2810c50..97837a2 100644 (file)
@@ -295,7 +295,6 @@ sub make_cvar_custom_filter {
       my $conversion  = $config->type =~ m{^(?:date|timestamp)$}       ? $config->type
                       : $config->type =~ m{^(?:customer|vendor|part)$} ? 'integer'
                       : $config->type eq 'number'                      ? 'numeric'
-                      # : $config->type eq 'bool'                        ? 'boolean'
                       :                                                  '';
 
       ($query{config}, $bind_vals{config}) = Rose::DB::Object::QueryBuilder::build_select(
@@ -310,7 +309,7 @@ sub make_cvar_custom_filter {
         query_is_sql       => 1,
       );
 
-      $query{config} =~ s{ \bdefault_value\b \s*=\s* (?!'') }{default_value::${conversion} = }x if $conversion;
+      $query{config} =~ s{ (?<! NOT\( ) default_value (?! \s*is\s+not\s+null) }{default_value::${conversion}}x if $conversion;
 
       ($query{not_customized}, $bind_vals{not_customized}) = Rose::DB::Object::QueryBuilder::build_select(
         dbh          => $config->dbh,