StartOpt, MDM

This commit is contained in:
2025-04-18 15:38:38 +02:00
parent 8f18b27aa7
commit a7836ff9ed
3 changed files with 99 additions and 13 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.org.apache.xerces.internal.impl.dv.xs
Imports MDM_Worker
Imports Renci.SshNet
Imports VERAG_PROG_ALLGEMEIN
@@ -1286,6 +1287,8 @@ Public Class frmStartOptions
End Try
End Sub
Sub sendMailZollbelegGESTELLUNGSADRESSE(pfad As String, nga_id As Object, art As String, ByRef list As List(Of Integer), BezugsNr As String, SND As VERAG_PROG_ALLGEMEIN.cSendungen)
Try
If nga_id IsNot Nothing Then
@@ -5538,12 +5541,24 @@ Public Class frmStartOptions
Private Sub IDS_RE_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles IDS_RE.LinkClicked
Dim fehlendeRechungsdaten As String = "select upper(Invoicenumber) as Invoicenumber, CustomerCode, cast(YearMonthDay as Date) as YearMonthDay FROM [VERAG].[dbo].[tblIDSInvoicesNew] where TransactionVolume is null and AmminclVAT is null and TotalNetAmount is null and VATAmount is null"
Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
nochmal:
Select Case checkDatefromIDSInvioces("tblIDSInvoicesNew")
Case 0 : Exit Sub
Case 1 : GoTo nochmal
Case 2 : GoTo weiter
End Select
weiter:
Dim fehlendeRechungsdaten As String = "select upper(Invoicenumber) as Invoicenumber, CustomerCode, cast(YearMonthDay as Date) as YearMonthDay FROM [VERAG].[dbo].[tblIDSInvoicesNew] where TransactionVolume is null and AmminclVAT is null and TotalNetAmount is null and VATAmount is null and Year(YearMonthDay) >= " & txtIDSYear.Text
Dim dtRechnnungsdaten As DataTable = SQL.loadDgvBySql(fehlendeRechungsdaten, "FMZOLL")
If dtRechnnungsdaten.Rows.Count > 0 Then
@@ -5580,9 +5595,9 @@ Public Class frmStartOptions
Next
MsgBox("alle Rechnungsdaten gesetzt!")
MsgBox("alle Daten in tblIDSInvoicesNew gesetzt!")
Else
MsgBox("keine fehlenden Rechnunngsdaten vorhanden!")
MsgBox("keine fehlenden Daten in tblIDSInvoicesNew vorhanden!")
End If
@@ -5647,9 +5662,20 @@ Public Class frmStartOptions
Private Sub IDS_REDetails_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles IDS_REDetails.LinkClicked
Dim fehlendeRechungsdatenOhneDVR As String = "select upper([Invoicenumber]) as Invoicenumber, CustomerCode, cast(YearMonthDay as Date) as YearMonthDay FROM [VERAG].[dbo].tblIDSInvoicesNewSplittedByCountry where TransactionVolume is null and AmminclVAT is null and TotalNetAmount is null and VATAmount is null and [Invoicenumber] not like 'DEVR%'"
Dim fehlendeRechungsdatenMitDVR As String = "select upper([Invoicenumber]) as Invoicenumber, CustomerCode, cast(YearMonthDay as Date) as YearMonthDay FROM [VERAG].[dbo].tblIDSInvoicesNewSplittedByCountry where TransactionVolume is null and AmminclVAT is null and TotalNetAmount is null and VATAmount is null and [Invoicenumber] like 'DEVR%'"
nochmal:
Select Case checkDatefromIDSInvioces("tblIDSInvoicesNewSplittedByCountry")
Case 0 : Exit Sub
Case 1 : GoTo nochmal
Case 2 : GoTo weiter
End Select
weiter:
Dim fehlendeRechungsdatenOhneDVR As String = "select upper([Invoicenumber]) as Invoicenumber, CustomerCode, cast(YearMonthDay as Date) as YearMonthDay FROM [VERAG].[dbo].tblIDSInvoicesNewSplittedByCountry where TransactionVolume is null and AmminclVAT is null and TotalNetAmount is null and VATAmount is null and [Invoicenumber] not like 'DEVR%' and Year(YearMonthDay) >= " & txtIDSYear.Text
Dim fehlendeRechungsdatenMitDVR As String = "select upper([Invoicenumber]) as Invoicenumber, CustomerCode, cast(YearMonthDay as Date) as YearMonthDay FROM [VERAG].[dbo].tblIDSInvoicesNewSplittedByCountry where TransactionVolume is null and AmminclVAT is null and TotalNetAmount is null and VATAmount is null and [Invoicenumber] like 'DEVR%' and Year(YearMonthDay) >= " & txtIDSYear.Text
Dim fehlendeRechungsdatenTotalInvoiceID As String = "select CustomerCode, cast(YearMonthDay as Date) as YearMonthDay FROM [VERAG].[dbo].tblIDSInvoicesNewSplittedByCountry where TotalInvoiceId is null"
@@ -5696,9 +5722,9 @@ Public Class frmStartOptions
Next
MsgBox("alle Rechnungspositionsdaten gesetzt!")
MsgBox("alle Daten der tblIDSInvoicesNewSplittedByCountry Ohne DVR gesetzt!")
Else
MsgBox("keine fehlenden Rechnungspositionsdaten vorhanden!")
MsgBox("keine fehlenden Daten der tblIDSInvoicesNewSplittedByCountry Ohne DVR vorhanden!")
End If
@@ -5736,9 +5762,9 @@ Public Class frmStartOptions
Next
MsgBox("alle Rechnungspositionsdaten gesetzt!")
MsgBox("alle Daten der tblIDSInvoicesNewSplittedByCountry mit DVR gesetzt!")
Else
MsgBox("keine fehlenden Rechnungspositionsdaten vorhanden!")
MsgBox("keine fehlenden Daten der tblIDSInvoicesNewSplittedByCountry mit DVR vorhanden!")
End If
@@ -5840,4 +5866,55 @@ Public Class frmStartOptions
cPLOSE_Inv_Data.setWahrunginIvoiceFromTransactions(txtPloseJahr.Text, True, kdNrPlose)
End Sub
Private Function checkDatefromIDSInvioces(table As String) As Integer
Dim sql As New SQL
Dim fehlendeRechungsdatenDatum As String = "select distinct(cast(YearMonthDay as Date)) as YearMonthDay FROM [VERAG].[dbo].[" & table & "] where TransactionVolume is null and AmminclVAT is null and TotalNetAmount is null and VATAmount is null and Year(YearMonthDay) >= " & txtIDSYear.Text
Dim dtRechnnungsdatenfalschesDatum As DataTable = sql.loadDgvBySql(fehlendeRechungsdatenDatum, "FMZOLL")
For Each row As DataRow In dtRechnnungsdatenfalschesDatum.Rows
If Not IsDBNull(row.Item("YearMonthDay")) AndAlso row.Item("YearMonthDay") IsNot Nothing AndAlso IsDate(row.Item("YearMonthDay")) Then
Dim abrDate As Date = row.Item("YearMonthDay")
If Not (abrDate.Day = 15 Or abrDate.Day = 30 Or abrDate.Day = 31 Or (abrDate.Month = 2 And abrDate.Day = 28)) Then
If Not vbYes = MsgBox("Die IDS-Rechnungen besitzen das Datum: " & abrDate.ToShortDateString & "!" & vbNewLine & "Soll das Datum auf geändert werden", vbYesNoCancel) Then
Return 0
Else
Dim f As New frmDatumsabfrage("IDS-falsches Rechnungsdatum: " & abrDate.ToShortDateString, True)
f.ShowDialog()
If f.DialogResult = DialogResult.OK Then
If sql.doSQL("Update [" & table & "] set YearMonthDay = '" & f.Datum.ToShortDateString & "' where cast(YearMonthDay as Date) = '" & abrDate.ToShortDateString & "'", "FMZOLL") Then
Return 1
Else
Return 0
End If
Else
Return 0
End If
End If
End If
End If
Next
Return 2
End Function
End Class