fixing SQL builded if there is no where_strings
authorPaul Poulain <paul.poulain@biblibre.com>
Wed, 28 Oct 2009 17:28:34 +0000 (18:28 +0100)
committerPaul Poulain <paul.poulain@biblibre.com>
Wed, 28 Oct 2009 17:28:34 +0000 (18:28 +0100)
C4/Budgets.pm

index 6ce1174..debb6fa 100644 (file)
@@ -489,7 +489,7 @@ sub GetBudgetHierarchy {
             push @bind_params, $branchcode;
         }
     }
-       $query.=" WHERE ".join(' AND ', @where_strings);
+       $query.=" WHERE ".join(' AND ', @where_strings) if @where_strings;
        $debug && warn $query,join(",",@bind_params);
        my $sth = $dbh->prepare($query);
        $sth->execute(@bind_params);