From: Jan Büren Date: Mon, 12 Mar 2012 12:32:49 +0000 (+0100) Subject: vclimit auch korrekt für Bugfix 1837 setzen (s.a. Commit davor) X-Git-Tag: release-3.0.0beta1~346^2~1 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=9faa9827bb822e0b6af9de8ce37cc72fa3941a91;p=kivitendo-erp.git vclimit auch korrekt für Bugfix 1837 setzen (s.a. Commit davor) --- 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