X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/61cdba5d566357f3beabe0e7f3f0cb2d7bdccd73..7635f647ec7dcdef51684b21601ee0930ea2bc5b:/SL/Form.pm?ds=inline diff --git a/SL/Form.pm b/SL/Form.pm index 30c8bd425..5a2b38df2 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -138,9 +138,15 @@ sub _flatten_variables_rec { foreach my $idx (0 .. scalar @{ $curr->{$key} } - 1) { my $first_array_entry = 1; - foreach my $hash_key (sort keys %{ $curr->{$key}->[$idx] }) { - push @result, $self->_flatten_variables_rec($curr->{$key}->[$idx], $prefix . $key . ($first_array_entry ? '[+].' : '[].'), $hash_key); - $first_array_entry = 0; + my $element = $curr->{$key}[$idx]; + + if ('HASH' eq ref $element) { + foreach my $hash_key (sort keys %{ $element }) { + push @result, $self->_flatten_variables_rec($element, $prefix . $key . ($first_array_entry ? '[+].' : '[].'), $hash_key); + $first_array_entry = 0; + } + } else { + @result = ({ 'key' => $prefix . $key . ($first_array_entry ? '[+]' : '[]'), 'value' => $element }); } } } @@ -2490,7 +2496,7 @@ sub all_vc { my $query = qq|SELECT count(*) FROM $table $obsolete|; my ($count) = selectrow_query($self, $dbh, $query); - if ($count < $myconfig->{vclimit}) { + if ($count <= $myconfig->{vclimit}) { $query = qq|SELECT id, name, salesman_id FROM $table $obsolete ORDER BY name|;