Update für IDS_DAID neue SchnittstellenNr

This commit is contained in:
2025-04-28 10:23:48 +02:00
parent 690b97ab54
commit 61daab02df
2 changed files with 745 additions and 732 deletions

View File

@@ -5,6 +5,7 @@ Imports System.Net.Security
Imports System.Security.Cryptography.X509Certificates
Imports System.Text
Imports System.Xml
Imports com.sun.media.sound
Imports com.sun.org.apache.xerces.internal.impl.dv.xs
Imports MDM_Worker
Imports Renci.SshNet
@@ -5920,7 +5921,34 @@ weiter:
End Function
Private Sub IDSUpdateDAID_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles IDSUpdateDAID.LinkClicked
Dim sql As New SQL
Dim IDSdaidaktualiseren As String = "select * from tblUStVPositionen where UStVPo_SchnittstellenNr = 8 and Year(UStVPo_ReDat) >= " & txtIDSYear.Text
Dim dtUSTVA_daid_akt As DataTable = sql.loadDgvBySql(IDSdaidaktualiseren, "FMZOLL")
For Each row As DataRow In dtUSTVA_daid_akt.Rows
Dim ustva As New cUSTVAntrag(row.Item("UStVAn_ID"))
If ustva.UStVAn_LandNr IsNot Nothing AndAlso IsNumeric(ustva.UStVAn_LandNr) Then
Dim Antrag_LandKz = sql.DLookup("LandKz", "[Länderverzeichnis für die Außenhandelsstatistik]", "Landnr='" & ustva.UStVAn_LandNr & "'", "FMZOLL")
Dim daId As Integer = 0
Dim SQL_String = "SELECT isnull(tblIDSInvoicesNewSplittedByCountry.daId ,0) FROM [tblIDSInvoicesNewSplittedByCountry] where tblIDSInvoicesNewSplittedByCountry.[YearMonthDay] ='" & CDate(row.Item("UStVPo_ReDat")).ToShortDateString & "' AND tblIDSInvoicesNewSplittedByCountry.Invoicenumber ='" & row.Item("UStVPo_ReNr").ToString.Replace("/", "") & "' and tblIDSInvoicesNewSplittedByCountry.Country='" & Antrag_LandKz & "' AND tblIDSInvoicesNewSplittedByCountry.daId is not null"
daId = CInt(sql.getValueTxtBySql(SQL_String, "FMZOLL",,, 0))
If daId > 0 Then sql.doSQL("update tblUStVPositionen set UStVPo_daId = " & daId & ", UStVPo_SchnittstellenNr = 12 where UStVAn_ID = " & row.Item("UStVAn_ID") & " and UStVPo_ID = " & row.Item("UStVPo_ID") & " AND UStVPo_SchnittstellenNr = 8", "FMZOLL")
End If
Next
End Sub
End Class