From 9faa9827bb822e0b6af9de8ce37cc72fa3941a91 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Mon, 12 Mar 2012 13:32:49 +0100 Subject: [PATCH] =?utf8?q?vclimit=20auch=20korrekt=20f=C3=BCr=20Bugfix=201?= =?utf8?q?837=20setzen=20(s.a.=20Commit=20davor)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Form.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SL/Form.pm b/SL/Form.pm index 6c8bbe9cf..07e3d3e6b 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -2545,14 +2545,14 @@ sub all_vc { $table = $table eq "customer" ? "customer" : "vendor"; - my $query = qq|SELECT count(*) FROM $table WHERE NOT obsolete|; - my ($count) = selectrow_query($self, $dbh, $query); - # build selection list # Hotfix für Bug 1837 - Besser wäre es alte Buchungsbelege # OHNE Auswahlliste (reines Textfeld) zu laden. Hilft aber auch # nicht für veränderbare Belege (oe, do, ...) my $obsolete = "WHERE NOT obsolete" unless $self->{id}; + my $query = qq|SELECT count(*) FROM $table WHERE NOT $obsolete|; + my ($count) = selectrow_query($self, $dbh, $query); + if ($count < $myconfig->{vclimit}) { $query = qq|SELECT id, name, salesman_id FROM $table $obsolete -- 2.20.1