UID-Prüfung Kompatiblitätsprüfungen
This commit is contained in:
@@ -152,9 +152,9 @@ Public Class cUIDPruefung
|
||||
End Function
|
||||
|
||||
|
||||
Public Shared Function doUIDPruefungALL(Optional datum As Object = Nothing, Optional SaveErgInAdressen As Boolean = True, Optional Sciherheitsabfrage As Boolean = True, Optional MaxEintraege As Integer = -1, Optional showErr As Boolean = True, Optional finanzOnline As Boolean = True, Optional veroegerungMs As Integer = 1500) As DataTable
|
||||
Public Shared Function doUIDPruefungALL(Optional datum As Object = Nothing, Optional SaveErgInAdressen As Boolean = True, Optional Sciherheitsabfrage As Boolean = True, Optional MaxEintraege As Integer = -1, Optional showErr As Boolean = True, Optional finanzOnline As Boolean = True, Optional veroegerungMs As Integer = 3000) As DataTable
|
||||
Dim dt As DataTable = Nothing
|
||||
|
||||
|
||||
dt = get_zupruefendeKunden(MaxEintraege, datum)
|
||||
|
||||
If dt IsNot Nothing Then
|
||||
@@ -193,25 +193,29 @@ Public Class cUIDPruefung
|
||||
Case "EUROPE"
|
||||
|
||||
For Each r As DataRow In dt.Rows
|
||||
Dim UID_TMP = doUIDPruefung(r("KdNr"),, SaveErgInAdressen, showErr, ART)
|
||||
If UID_TMP IsNot Nothing Then
|
||||
If UID_TMP.uid_valid Then
|
||||
r("Ergebnis") = "OK"
|
||||
|
||||
For Each row As DataRow In dt.Select("UstIdnr = '" & r("UstIdnr") & "' AND UstIdKz ='" & r("UstIdKz") & "'")
|
||||
row("Ergebnis") = r("Ergebnis")
|
||||
Next
|
||||
If Not IsDBNull(r("istEUVAT")) AndAlso r("istEUVAT") = "Ja" Then ' Alle 27 Mitgliedstaaten der Europäischen Union
|
||||
|
||||
Dim UID_TMP = doUIDPruefung(r("KdNr"),, SaveErgInAdressen, showErr, ART)
|
||||
If UID_TMP IsNot Nothing Then
|
||||
If UID_TMP.uid_valid Then
|
||||
r("Ergebnis") = "OK"
|
||||
|
||||
For Each row As DataRow In dt.Select("UstIdnr = '" & r("UstIdnr") & "' AND UstIdKz ='" & r("UstIdKz") & "'")
|
||||
row("Ergebnis") = r("Ergebnis")
|
||||
Next
|
||||
|
||||
Else
|
||||
r("Ergebnis") = "UNGÜLTIG"
|
||||
End If
|
||||
Else
|
||||
r("Ergebnis") = "UNGÜLTIG"
|
||||
r("Ergebnis") = "ERROR"
|
||||
|
||||
End If
|
||||
Else
|
||||
r("Ergebnis") = "ERROR"
|
||||
|
||||
End If
|
||||
|
||||
If veroegerungMs > 0 Then
|
||||
Thread.Sleep(veroegerungMs) 'Bei Verögeung soll zwischen jeder Abfrage eine Pause gemacht werden! (Wegen Sperre bei zu vielen Abfragen)
|
||||
If veroegerungMs > 0 Then
|
||||
Thread.Sleep(veroegerungMs) 'Bei Verögeung soll zwischen jeder Abfrage eine Pause gemacht werden! (Wegen Sperre bei zu vielen Abfragen)
|
||||
End If
|
||||
End If
|
||||
|
||||
Next
|
||||
@@ -227,62 +231,57 @@ Public Class cUIDPruefung
|
||||
|
||||
For Each r As DataRow In dt.Rows
|
||||
|
||||
If IsDBNull(r("Ergebnis")) Then
|
||||
If Not IsDBNull(r("istEUVAT")) AndAlso r("istEUVAT") = "Ja" Then ' Alle 27 Mitgliedstaaten der Europäischen Union
|
||||
|
||||
counter += 1
|
||||
Dim errorCode = -99
|
||||
Dim errormsg = ""
|
||||
Dim UID_TMP = FO.Call_Web_Service_MethodUID_Abfrage_NEU2020(r("KdNr"),, SaveErgInAdressen, showErr,, errorCode, errormsg)
|
||||
If UID_TMP IsNot Nothing Then
|
||||
If UID_TMP.uid_valid Then
|
||||
r("Ergebnis") = "OK"
|
||||
If IsDBNull(r("Ergebnis")) Then
|
||||
|
||||
For Each row As DataRow In dt.Select("UstIdnr = '" & r("UstIdnr") & "' AND UstIdKz ='" & r("UstIdKz") & "'")
|
||||
row("Ergebnis") = r("Ergebnis")
|
||||
Next
|
||||
' Bei ungültig soll er einzeln durchgehen! Besprochen mit A.Stockenhuber
|
||||
counter += 1
|
||||
Dim errorCode = -99
|
||||
Dim errormsg = ""
|
||||
Dim UID_TMP = FO.Call_Web_Service_MethodUID_Abfrage_NEU2020(r("KdNr"),, SaveErgInAdressen, showErr,, errorCode, errormsg)
|
||||
If UID_TMP IsNot Nothing Then
|
||||
If UID_TMP.uid_valid Then
|
||||
r("Ergebnis") = "OK"
|
||||
|
||||
For Each row As DataRow In dt.Select("UstIdnr = '" & r("UstIdnr") & "' AND UstIdKz ='" & r("UstIdKz") & "'")
|
||||
row("Ergebnis") = r("Ergebnis")
|
||||
Next
|
||||
' Bei ungültig soll er einzeln durchgehen! Besprochen mit A.Stockenhuber
|
||||
Else
|
||||
r("Ergebnis") = "UNGÜLTIG"
|
||||
End If
|
||||
Else
|
||||
r("Ergebnis") = "UNGÜLTIG"
|
||||
' For Each row As DataRow In dt.Select("UstIdnr = '" & r("UstIdnr") & "' AND UstIdKz ='" & r("UstIdKz") & "'")
|
||||
' row("Ergebnis") = r("Ergebnis")
|
||||
' Next
|
||||
End If
|
||||
Else
|
||||
r("Ergebnis") = "ERROR"
|
||||
r("Error-Code") = errorCode.ToString()
|
||||
r("Error-Text") = FO.GetCodeText(errorCode) & errormsg
|
||||
r("Ergebnis") = "ERROR"
|
||||
r("Error-Code") = errorCode.ToString()
|
||||
r("Error-Text") = FO.GetCodeText(errorCode) & errormsg
|
||||
|
||||
If r("Error-Code") = "1511" Then
|
||||
errorCounter += 1 'Fehler Mitgliedsstaat nicht erreichbar!!!
|
||||
ElseIf r("Error-Code") = "-99" AndAlso r("Error-Text") <> "" AndAlso r("Error-Text").ToString.Contains("Wegen Wartungsarbeiten") Then
|
||||
Exit For 'Wartungsarbeiten -> sofort abbrechen!
|
||||
|
||||
End If
|
||||
|
||||
If r("Error-Code") = "1511" Then
|
||||
errorCounter += 1 'Fehler Mitgliedsstaat nicht erreichbar!!!
|
||||
ElseIf r("Error-Code") = "-99" AndAlso r("Error-Text") <> "" AndAlso r("Error-Text").ToString.Contains("Wegen Wartungsarbeiten") Then
|
||||
Exit For
|
||||
|
||||
End If
|
||||
|
||||
' Bei ERROR soll er ebenfalls einzeln durchgehen! Besprochen mit A.Stockenhuber
|
||||
'For Each row As DataRow In dt.Select("UstIdnr = '" & r("UstIdnr") & "' AND UstIdKz ='" & r("UstIdKz") & "'")
|
||||
' row("Ergebnis") = r("Ergebnis")
|
||||
' row("Error-Code") = r("Error-Code")
|
||||
' row("Error-Text") = r("Error-Text")
|
||||
'Next
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
r("Re-Login") = "0"
|
||||
|
||||
r("Re-Login") = "0"
|
||||
If counter Mod 100 = 0 OrElse errorCounter > 10 Then
|
||||
If errorCounter > 10 Then errorCounter = 0
|
||||
FO.Call_Web_Service_MethodUID_Logout_NEU2020()
|
||||
Thread.Sleep(2000)
|
||||
FO.Call_Web_Service_MethodUID_Login_NEU2020()
|
||||
r("Re-Login") = "1"
|
||||
End If
|
||||
|
||||
If counter Mod 100 = 0 OrElse errorCounter > 10 Then
|
||||
If errorCounter > 10 Then errorCounter = 0
|
||||
FO.Call_Web_Service_MethodUID_Logout_NEU2020()
|
||||
Thread.Sleep(2000)
|
||||
FO.Call_Web_Service_MethodUID_Login_NEU2020()
|
||||
r("Re-Login") = "1"
|
||||
End If
|
||||
If veroegerungMs > 0 Then
|
||||
r("Verzoegerung") = veroegerungMs
|
||||
Thread.Sleep(veroegerungMs) 'Bei Verögeung soll zwischen jeder Abfrage eine Pause gemacht werden! (Wegen Sperre bei zu vielen Abfragen)
|
||||
End If
|
||||
|
||||
If veroegerungMs > 0 Then
|
||||
r("Verzoegerung") = veroegerungMs
|
||||
Thread.Sleep(veroegerungMs) 'Bei Verögeung soll zwischen jeder Abfrage eine Pause gemacht werden! (Wegen Sperre bei zu vielen Abfragen)
|
||||
End If
|
||||
|
||||
Next
|
||||
@@ -312,9 +311,9 @@ Public Class cUIDPruefung
|
||||
End If
|
||||
|
||||
Select Case Firma
|
||||
Case "AMBAR" : where = " And Filialen.FilialenNr IN (5701)"
|
||||
Case "IMEX" : where = " And Filialen.FilialenNr IN (5501)"
|
||||
Case "ATILLA" : where = " And Filialen.FilialenNr IN (4801)"
|
||||
Case "AMBAR" : where = " And Filialen.FilialenNr IN (5701) "
|
||||
Case "IMEX" : where = " And Filialen.FilialenNr IN (5501) "
|
||||
Case "ATILLA" : where = " And Filialen.FilialenNr IN (4801) "
|
||||
Case "UNISPED" : where = " AND Filialen.firma='UNISPED' "
|
||||
Case Else : where = " AND Filialen.firma='VERAG' " '" And isnull(FilialenNr,'') Not IN (5501,5701)"
|
||||
End Select
|
||||
@@ -325,7 +324,13 @@ Public Class cUIDPruefung
|
||||
Top = " TOP " & MaxEintraege
|
||||
End If
|
||||
|
||||
dt = SQL.loadDgvBySql("SELECT " & Top & " [AdressenNr] as KdNr,[Ordnungsbegriff] as Firma,UstIdGeprüft as [letzte Prüfung],Adressen.UstIdKz,Adressen.UstIdnr " &
|
||||
dt = SQL.loadDgvBySql("SELECT " & Top & " [AdressenNr] as KdNr,[Ordnungsbegriff] as Firma,UstIdGeprüft as [letzte Prüfung],Adressen.UstIdKz,Adressen.UstIdnr ,CASE
|
||||
WHEN UPPER(Adressen.UstIdKz) IN (
|
||||
'AT','BE','BG','CY','CZ','DE','DK','EE','EL','ES','FI','FR','HR',
|
||||
'HU','IE','IT','LT','LU','LV','MT','NL','PL','PT','RO','SE','SI','SK'
|
||||
) THEN 'Ja'
|
||||
ELSE 'Nein'
|
||||
END AS istEUVAT " &
|
||||
" From [Adressen] inner Join kunden On KundenNr=AdressenNr inner join Filialen on Filialen.FilialenNr=Kunden.FilialenNr " &
|
||||
" where (UstIdGeprüft <= '" & datum.ToShortDateString & "' OR UstIdGeprüft is null) and (isnull(Adressen.UstIdKz,'') <> '' and isnull(Adressen.UstIdNr,'') <> '') " &
|
||||
" And Auswahl='A' " & where & " ORDER BY Ordnungsbegriff", "FMZOLL")
|
||||
|
||||
Reference in New Issue
Block a user