X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/9589ecd776677cdeb2fbaf8de211963d24cf5aa1..3a45c5ca624f39ebbab4fffcbc7ccb1c96e0f3e0:/SL/DB/Manager/PriceRule.pm diff --git a/SL/DB/Manager/PriceRule.pm b/SL/DB/Manager/PriceRule.pm index 09e588b88..e94fd1546 100644 --- a/SL/DB/Manager/PriceRule.pm +++ b/SL/DB/Manager/PriceRule.pm @@ -27,8 +27,7 @@ sub get_matching_filter { my $type = $params{record}->is_sales ? 'customer' : 'vendor'; # plan: 1. search all rule_items that do NOT match this record/record item combo - my ($sub_where, @value_subs) = SL::DB::Manager::PriceRuleItem->not_matching_sql_and_values(type => $type); - my @values = map { $_->($params{record}, $params{record_item}) } @value_subs; + my ($sub_where, @values) = SL::DB::Manager::PriceRuleItem->not_matching_sql_and_values(type => $type, %params); # now union all NOT matching, invert ids, load these my $matching_rule_ids = <get_matching_filter(%params); my @ids = selectall_ids($::form, $::form->get_standard_dbh, $query, 0, @values); + return [] unless @ids; + $self->get_all(query => [ id => \@ids ]); }