UID-Prüfung Kompatiblitätsprüfungen
This commit is contained in:
@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
|
|||||||
' übernehmen, indem Sie "*" eingeben:
|
' übernehmen, indem Sie "*" eingeben:
|
||||||
' <Assembly: AssemblyVersion("1.0.*")>
|
' <Assembly: AssemblyVersion("1.0.*")>
|
||||||
|
|
||||||
<Assembly: AssemblyVersion("1.4.8.7")>
|
<Assembly: AssemblyVersion("1.4.8.8")>
|
||||||
<Assembly: AssemblyFileVersion("1.4.8.7")>
|
<Assembly: AssemblyFileVersion("1.4.8.8")>
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ Public Class cUIDPruefung
|
|||||||
End Function
|
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
|
Dim dt As DataTable = Nothing
|
||||||
|
|
||||||
dt = get_zupruefendeKunden(MaxEintraege, datum)
|
dt = get_zupruefendeKunden(MaxEintraege, datum)
|
||||||
@@ -193,25 +193,29 @@ Public Class cUIDPruefung
|
|||||||
Case "EUROPE"
|
Case "EUROPE"
|
||||||
|
|
||||||
For Each r As DataRow In dt.Rows
|
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") & "'")
|
If Not IsDBNull(r("istEUVAT")) AndAlso r("istEUVAT") = "Ja" Then ' Alle 27 Mitgliedstaaten der Europäischen Union
|
||||||
row("Ergebnis") = r("Ergebnis")
|
|
||||||
Next
|
|
||||||
|
|
||||||
|
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
|
Else
|
||||||
r("Ergebnis") = "UNGÜLTIG"
|
r("Ergebnis") = "ERROR"
|
||||||
|
|
||||||
End If
|
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
|
End If
|
||||||
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
|
Next
|
||||||
@@ -227,62 +231,57 @@ Public Class cUIDPruefung
|
|||||||
|
|
||||||
For Each r As DataRow In dt.Rows
|
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
|
If IsDBNull(r("Ergebnis")) Then
|
||||||
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") & "'")
|
counter += 1
|
||||||
row("Ergebnis") = r("Ergebnis")
|
Dim errorCode = -99
|
||||||
Next
|
Dim errormsg = ""
|
||||||
' Bei ungültig soll er einzeln durchgehen! Besprochen mit A.Stockenhuber
|
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
|
Else
|
||||||
r("Ergebnis") = "UNGÜLTIG"
|
r("Ergebnis") = "ERROR"
|
||||||
' For Each row As DataRow In dt.Select("UstIdnr = '" & r("UstIdnr") & "' AND UstIdKz ='" & r("UstIdKz") & "'")
|
r("Error-Code") = errorCode.ToString()
|
||||||
' row("Ergebnis") = r("Ergebnis")
|
r("Error-Text") = FO.GetCodeText(errorCode) & errormsg
|
||||||
' Next
|
|
||||||
End If
|
If r("Error-Code") = "1511" Then
|
||||||
Else
|
errorCounter += 1 'Fehler Mitgliedsstaat nicht erreichbar!!!
|
||||||
r("Ergebnis") = "ERROR"
|
ElseIf r("Error-Code") = "-99" AndAlso r("Error-Text") <> "" AndAlso r("Error-Text").ToString.Contains("Wegen Wartungsarbeiten") Then
|
||||||
r("Error-Code") = errorCode.ToString()
|
Exit For 'Wartungsarbeiten -> sofort abbrechen!
|
||||||
r("Error-Text") = FO.GetCodeText(errorCode) & errormsg
|
|
||||||
|
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
|
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
|
||||||
|
|
||||||
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 veroegerungMs > 0 Then
|
||||||
If errorCounter > 10 Then errorCounter = 0
|
r("Verzoegerung") = veroegerungMs
|
||||||
FO.Call_Web_Service_MethodUID_Logout_NEU2020()
|
Thread.Sleep(veroegerungMs) 'Bei Verögeung soll zwischen jeder Abfrage eine Pause gemacht werden! (Wegen Sperre bei zu vielen Abfragen)
|
||||||
Thread.Sleep(2000)
|
End If
|
||||||
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
|
End If
|
||||||
|
|
||||||
Next
|
Next
|
||||||
@@ -312,9 +311,9 @@ Public Class cUIDPruefung
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
Select Case Firma
|
Select Case Firma
|
||||||
Case "AMBAR" : where = " And Filialen.FilialenNr IN (5701)"
|
Case "AMBAR" : where = " And Filialen.FilialenNr IN (5701) "
|
||||||
Case "IMEX" : where = " And Filialen.FilialenNr IN (5501)"
|
Case "IMEX" : where = " And Filialen.FilialenNr IN (5501) "
|
||||||
Case "ATILLA" : where = " And Filialen.FilialenNr IN (4801)"
|
Case "ATILLA" : where = " And Filialen.FilialenNr IN (4801) "
|
||||||
Case "UNISPED" : where = " AND Filialen.firma='UNISPED' "
|
Case "UNISPED" : where = " AND Filialen.firma='UNISPED' "
|
||||||
Case Else : where = " AND Filialen.firma='VERAG' " '" And isnull(FilialenNr,'') Not IN (5501,5701)"
|
Case Else : where = " AND Filialen.firma='VERAG' " '" And isnull(FilialenNr,'') Not IN (5501,5701)"
|
||||||
End Select
|
End Select
|
||||||
@@ -325,7 +324,13 @@ Public Class cUIDPruefung
|
|||||||
Top = " TOP " & MaxEintraege
|
Top = " TOP " & MaxEintraege
|
||||||
End If
|
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 " &
|
" 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,'') <> '') " &
|
" 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")
|
" And Auswahl='A' " & where & " ORDER BY Ordnungsbegriff", "FMZOLL")
|
||||||
|
|||||||
Reference in New Issue
Block a user