From 4e35d4c08e7527a7e8261b40f43937af5fe1f1fc Mon Sep 17 00:00:00 2001 From: Thomas Heck Date: Tue, 26 Nov 2013 17:22:43 +0100 Subject: [PATCH] Kunden Lieferungen-Tab: bei "Alle" nach der Kundenid suchen fixt #2393 --- SL/Controller/CustomerVendor.pm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/SL/Controller/CustomerVendor.pm b/SL/Controller/CustomerVendor.pm index f2e4ff609..0ffa2f589 100644 --- a/SL/Controller/CustomerVendor.pm +++ b/SL/Controller/CustomerVendor.pm @@ -407,21 +407,24 @@ sub action_get_delivery { $qty_sign = ''; } - my $where = ' WHERE 1=1 '; + my $where = ' WHERE 1=1'; my @values; if ( !$self->is_vendor() && $::form->{shipto_id} && $::form->{shipto_id} ne 'all' ) { - $where .= "AND ${arap}.shipto_id = ?"; + $where .= " AND ${arap}.shipto_id = ?"; push(@values, $::form->{shipto_id}); + } else { + $where .= " AND ${arap}.${db}_id = ?"; + push(@values, $::form->{id}); } if ( $::form->{delivery_from} ) { - $where .= "AND ${arap}.transdate >= ?"; + $where .= " AND ${arap}.transdate >= ?"; push(@values, conv_date($::form->{delivery_from})); } if ( $::form->{delivery_to} ) { - $where .= "AND ${arap}.transdate <= ?"; + $where .= " AND ${arap}.transdate <= ?"; push(@values, conv_date($::form->{delivery_to})); } -- 2.20.1