From 19edca650774cd66c69d505e03038c5bc8736b9d Mon Sep 17 00:00:00 2001 From: Waldemar Toews Date: Wed, 8 Jan 2014 09:24:47 +0100 Subject: [PATCH] =?utf8?q?Zahlungseingang:=20Filter=20f=C3=BCr=20Rechnungs?= =?utf8?q?nummer=20angepasst.=20Behebt=20#2098?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/CP.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/SL/CP.pm b/SL/CP.pm index 29ac35ab0..451cc7b30 100644 --- a/SL/CP.pm +++ b/SL/CP.pm @@ -147,13 +147,17 @@ sub get_openinvoices { my $buysell = $form->{vc} eq 'customer' ? "buy" : "sell"; my $arap = $form->{arap} eq "ar" ? "ar" : "ap"; + + my $whereinvoice = $form->{invnumber} ? qq| AND a.invnumber = '| . $form->{invnumber} . qq|' | : undef; my $query = qq|SELECT a.id, a.invnumber, a.transdate, a.amount, a.paid, cu.name AS curr | . qq|FROM $arap a | . qq|LEFT JOIN currencies cu ON (cu.id=a.currency_id)| . qq|WHERE (a.${vc}_id = ?) AND cu.name = ? AND NOT (a.amount = a.paid)| . + $whereinvoice . qq|ORDER BY a.id|; + my $sth = prepare_execute_query($form, $dbh, $query, conv_i($form->{"${vc}_id"}), "$form->{currency}"); -- 2.20.1