Fremdrechnungen, offeneAntraege, etc.
This commit is contained in:
@@ -511,6 +511,8 @@ Public Class frmUSTVoffeneAntraege
|
||||
Dim sqlwhereLand = ""
|
||||
Dim sqlwhereSteuerNr = ""
|
||||
|
||||
Dim kundenLandISO2 As String = ""
|
||||
|
||||
Dim SQLPLOSEUMSTELLUNG = ""
|
||||
|
||||
If kdnr > 0 Then
|
||||
@@ -528,6 +530,15 @@ Public Class frmUSTVoffeneAntraege
|
||||
|
||||
If cbxKundeLand._value <> "" Then
|
||||
sqlwhereLand &= " and Kundenland = '" & cbxKundeLand._value & "'"
|
||||
'LandKZ vom Kunden muss auf ISO2 konvertiert werden, weil da ein Misch-Masch in der Datenbank herrscht!
|
||||
If cbxKundeLand._value.Length = 2 Then
|
||||
kundenLandISO2 = cbxKundeLand._value
|
||||
ElseIf cbxKundeLand._value.Length = 3 Then
|
||||
kundenLandISO2 = VERAG_PROG_ALLGEMEIN.cProgramFunctions.getISO2LandFromISO3Land(cbxKundeLand._value)
|
||||
ElseIf cbxKundeLand._value.Length = 1 Then
|
||||
kundenLandISO2 = VERAG_PROG_ALLGEMEIN.cProgramFunctions.getISO2LandFromISO1Land(cbxKundeLand._value)
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
If cbxUStV.Checked Then
|
||||
@@ -538,17 +549,18 @@ Public Class frmUSTVoffeneAntraege
|
||||
sqlwhereLand &= " and isnull(UStVAn_ID,0) = 0 "
|
||||
End If
|
||||
|
||||
If dtkeineMWST.Rows.Count > 0 AndAlso kundenLandISO2 <> "" Then
|
||||
Dim dtkeineMWST_ohneContraint As DataTable = dtkeineMWST.Select("Land = '" & kundenLandISO2 & "'").CopyToDataTable
|
||||
Dim counter = 0
|
||||
Dim landBez As String = ""
|
||||
For Each row As DataRow In dtkeineMWST_ohneContraint.Rows
|
||||
landBez &= "'" & row.Item("Erstattungsland") & "'"
|
||||
counter = counter + 1
|
||||
If (dtkeineMWST_ohneContraint.Rows.Count <> 0 And counter <> dtkeineMWST_ohneContraint.Rows.Count) Then landBez &= ","
|
||||
Next
|
||||
sqlwhereLand &= " AND Einreichland not in (" & landBez & ")"
|
||||
|
||||
Dim dtkeineMWST_ohneContraint As DataTable = dtkeineMWST.Select("Lieferant = ''").CopyToDataTable
|
||||
Dim counter = 0
|
||||
Dim landBez As String = ""
|
||||
For Each row As DataRow In dtkeineMWST_ohneContraint.Rows
|
||||
landBez = "'" & row.Item("Erstattungsland") & "'"
|
||||
counter = counter + 1
|
||||
If (dtkeineMWST_ohneContraint.Rows.Count <> 0 And counter <> dtkeineMWST_ohneContraint.Rows.Count) Then landBez &= ","
|
||||
Next
|
||||
sqlwhereLand &= " AND Einreichland not in (" & landBez & ")"
|
||||
|
||||
End If
|
||||
|
||||
|
||||
Dim year = CDate(dat_Sum_Von.Value).Year
|
||||
|
||||
Reference in New Issue
Block a user