offeneAntraege
This commit is contained in:
@@ -568,12 +568,29 @@ Public Class frmUSTVoffeneAntraege
|
||||
If dtKundeMWST.Rows.Count > 0 Then
|
||||
Dim counter = 0
|
||||
Dim landBez As String = ""
|
||||
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 &= ","
|
||||
Dim klammer = ""
|
||||
For Each t In dtKundeMWST.Rows
|
||||
klammer &= ")"
|
||||
Next
|
||||
sqlwhereLand &= " AND Einreichland not in (" & landBez & ")"
|
||||
|
||||
If dtKundeMWST.Columns.Contains("KdNr") Then
|
||||
If dtKundeMWST.Rows.Count > 0 Then sqlwhereLand &= "And "
|
||||
For Each row As DataRow In dtKundeMWST.Rows
|
||||
landBez = row.Item("abc").ToString.Replace(";", "'")
|
||||
counter = counter + 1
|
||||
sqlwhereLand &= " ( AdressenNr = " & row.Item("KdNr") & " AND Einreichland Not in (" & landBez.ToString.Substring(0, landBez.ToString.Length - 1) & ") " & IIf(dtKundeMWST.Rows.Count <> 0 And counter <> dtKundeMWST.Rows.Count, "OR ", klammer)
|
||||
Next
|
||||
|
||||
Else
|
||||
|
||||
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 &= ","
|
||||
Next
|
||||
sqlwhereLand &= " AND Einreichland not in (" & landBez & ")"
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
@@ -813,7 +830,10 @@ Public Class frmUSTVoffeneAntraege
|
||||
End Sub
|
||||
|
||||
Sub init()
|
||||
Select Case LIEFERANT.ToString.ToLower
|
||||
|
||||
setdtKundeMWST(IIf(cbxAlleoffenen.Checked, -1, kdNr))
|
||||
|
||||
Select Case LIEFERANT.ToString.ToLower
|
||||
Case "plose" : initDgv_PLOSE(txtmaxAnz.Text, IIf(cbxAlleoffenen.Checked, -1, kdNr))
|
||||
Case "rmc" : initDgv_RMC(txtmaxAnz.Text, IIf(cbxAlleoffenen.Checked, -1, kdNr))
|
||||
Case "mse" : initDgv_MSE(txtmaxAnz.Text, IIf(cbxAlleoffenen.Checked, -1, kdNr))
|
||||
@@ -979,10 +999,25 @@ Public Class frmUSTVoffeneAntraege
|
||||
|
||||
Private Sub frmUSTVoffeneAntraege_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
dtkeineMWST = (New SQL).loadDgvBySql("select Land, Erstattungsland, Lieferant from tblKeineMWSTErstattung", "FMZOLL")
|
||||
setdtKundeMWST(kdNr)
|
||||
|
||||
|
||||
If kdNr > 0 Then
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub setdtKundeMWST(kd As Integer)
|
||||
|
||||
If kd > 0 Then
|
||||
dtKundeMWST = (New SQL).loadDgvBySql("select LandKz from tblKundenMWST where KdNr = " & kdNr, "FMZOLL")
|
||||
Else
|
||||
dtKundeMWST = (New SQL).loadDgvBySql("SELECT KdNr, abc = STUFF(
|
||||
(SELECT ';' + LandKz + ';' + ','
|
||||
FROM tblKundenMWST t1
|
||||
WHERE t1.KdNr = t2.KdNr
|
||||
FOR XML PATH (''))
|
||||
, 1, 1, ';') from tblKundenMWST t2
|
||||
group by KdNr;", "FMZOLL")
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user