From 7ea2686718a85cd7589871d15a3a4f4f91b982f5 Mon Sep 17 00:00:00 2001 From: "d.breimaier" Date: Fri, 3 Oct 2025 12:28:49 +0200 Subject: [PATCH] ustva --- SDL/USTV/frmUSTVoffeneAntraege.vb | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/SDL/USTV/frmUSTVoffeneAntraege.vb b/SDL/USTV/frmUSTVoffeneAntraege.vb index e878c58c..fc47e190 100644 --- a/SDL/USTV/frmUSTVoffeneAntraege.vb +++ b/SDL/USTV/frmUSTVoffeneAntraege.vb @@ -618,17 +618,21 @@ Public Class frmUSTVoffeneAntraege If dtKundeMWST.Columns.Contains("KdNr") Then + 'bei Einstellung "ALLE KUNDEN" + If dtKundeMWST.Rows.Count > 0 Then sqlwhereLand &= " AND ( NOT " For Each row As DataRow In dtKundeMWST.Rows - landBez = row.Item("abc").ToString.Replace(";", "'") - counter = counter + 1 - sqlwhereLand &= " ( AdressenNr = " & row.Item("KdNr") & " AND Einreichland in (" & landBez.ToString.Substring(0, landBez.ToString.Length - 1) & ")) " & IIf(dtKundeMWST.Rows.Count <> 0 And counter <> dtKundeMWST.Rows.Count, "OR ", ")") + landBez = row.Item("abc").ToString.Replace(";", "'") + counter = counter + 1 + sqlwhereLand &= " ( isnull(AdressenNr,0) = " & row.Item("KdNr") & " AND Einreichland in (" & landBez.ToString.Substring(0, landBez.ToString.Length - 1) & ")) " & IIf(dtKundeMWST.Rows.Count <> 0 And counter <> dtKundeMWST.Rows.Count, "OR ", ")") Next - Else + Else - For Each row As DataRow In dtKundeMWST.Rows + 'bei Einstellung "SPEZIFISCHER KUNDE" + + For Each row As DataRow In dtKundeMWST.Rows landBez &= "'" & row.Item("LandKz") & "'" counter = counter + 1 If (dtKundeMWST.Rows.Count <> 0 And counter <> dtKundeMWST.Rows.Count) Then landBez &= ","