Merge branch 'ADMIN' of https://git.it.verag.ag/edv/ADMIN into ADMIN

This commit is contained in:
2025-12-09 14:57:50 +01:00
2 changed files with 123 additions and 39 deletions

View File

@@ -1,7 +1,4 @@
Imports com.sun.org.apache.bcel.internal.generic Imports VERAG_PROG_ALLGEMEIN
Imports DocumentFormat.OpenXml.Wordprocessing
Imports Spire.Pdf
Imports VERAG_PROG_ALLGEMEIN
Public Class cWorker_Verwahrung Public Class cWorker_Verwahrung
Public Shared Dateiname = "" Public Shared Dateiname = ""
@@ -99,15 +96,15 @@ Public Class cWorker_Verwahrung
Dim Standort As String = "" Dim Standort As String = ""
If BezugsNr.Length > 4 Then If BezugsNr.Length > 4 Then
Select Case BezugsNr.Substring(0, 4) Select Case BezugsNr.Substring(0, 4)
Case 4803, 4809 Case "4803", "4809"
Standort = "VERAG AG" Standort = "VERAG AG"
'Case 5601 'Case 5601
' Standort = "UNISPED GmbH" ' Standort = "UNISPED GmbH"
'Case 5701 'Case 5701
' Standort = "AMBAR GmbH" ' Standort = "AMBAR GmbH"
Case 4810, 5103, 5901 Case "4810", "5103", "5901"
Standort = "VERAG GmbH" Standort = "VERAG GmbH"
Case 5501 Case "5501"
Standort = "IMEX" Standort = "IMEX"
Case Else Case Else
GoTo Anzeige GoTo Anzeige
@@ -151,10 +148,8 @@ Public Class cWorker_Verwahrung
Dim GesSichRef = New VERAG_PROG_ALLGEMEIN.cAufschubKonten(Standort) Dim GesSichRef = New VERAG_PROG_ALLGEMEIN.cAufschubKonten(Standort)
Dim saldo = GesSichRef.CalcSaldo() Dim saldo = GesSichRef.CalcSaldo()
If SND.FilialenNr > 0 Then filiale = SND.FilialenNr If SND.FilialenNr > 0 Then filiale = SND.FilialenNr
If SND.AbfertigungsNr > 0 Then abfertigungsnummer = SND.AbfertigungsNr If SND.AbfertigungsNr > 0 Then abfertigungsnummer = SND.AbfertigungsNr
@@ -208,6 +203,7 @@ Public Class cWorker_Verwahrung
.gs_freitext = "" .gs_freitext = ""
.gs_saldo = saldo .gs_saldo = saldo
.gs_atr = "" .gs_atr = ""
.gs_systemuser = "DAKOSY-AUTO"
.gs_zollsatz = GesSichRef.brgakto_gs_zollsatz .gs_zollsatz = GesSichRef.brgakto_gs_zollsatz
.gs_avisoId = SND.tblSnd_AvisoID .gs_avisoId = SND.tblSnd_AvisoID
@@ -237,7 +233,7 @@ Public Class cWorker_Verwahrung
Anzeige: Anzeige:
FORM.addDGVEinarbeitung("VW: Verwahrungsinfo", STATUS.dySt_BezugsNr) FORM.addDGVEinarbeitung("VW: Verwahrungsinfo", STATUS.dySt_BezugsNr)
End If End If
Catch ex As Exception Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace & vbNewLine & "Datei: " & Dateiname, System.Reflection.MethodInfo.GetCurrentMethod.Name) VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace & vbNewLine & "Datei: " & Dateiname, System.Reflection.MethodInfo.GetCurrentMethod.Name)
@@ -252,6 +248,8 @@ Anzeige:
Dim EZA As DAKOSY_Worker.SumAErledigungsinformationVorpapier_005.SumAErledigungsinformationVorpapierSIVRPTyp = DAKOSY_Worker.SumAErledigungsinformationVorpapier_005.SumAErledigungsinformationVorpapierSIVRPTyp.LoadFromFile(d) Dim EZA As DAKOSY_Worker.SumAErledigungsinformationVorpapier_005.SumAErledigungsinformationVorpapierSIVRPTyp = DAKOSY_Worker.SumAErledigungsinformationVorpapier_005.SumAErledigungsinformationVorpapierSIVRPTyp.LoadFromFile(d)
Dim ART = "" Dim ART = ""
Dim RegistriernummerATLAS = ""
' Dim details = "" ' Dim details = ""
Dim zp As Object = Nothing Dim zp As Object = Nothing
@@ -319,40 +317,133 @@ Anzeige:
If DY_TMP IsNot Nothing Then STATUS.dySt_dyId = DY_TMP.dy_Id If DY_TMP IsNot Nothing Then STATUS.dySt_dyId = DY_TMP.dy_Id
STATUS.SAVE() STATUS.SAVE()
'---------------------------------------------------------------- '----------------------------------------------------------------
'Verwahrung ABSCHREIBUNG 'Verwahrung ABSCHREIBUNG
If saveAbschreibung Then If saveAbschreibung Then
Try Dim BezugsNr = readEZA_SumAErledigungsinformationVorpapier_005
Dim Standort As String = ""
If BezugsNr.Length > 4 Then
Select Case BezugsNr.Substring(0, 4)
Case "4803", "4809"
Standort = "VERAG AG"
'Case 5601
' Standort = "UNISPED GmbH"
'Case 5701
' Standort = "AMBAR GmbH"
Case "4810", "5103", "5901"
Standort = "VERAG GmbH"
Case "5501"
Standort = "IMEX"
Case Else
GoTo Anzeige
End Select
Dim filiale = IIf(BezugsNr.Length > 4, BezugsNr.Substring(0, 4), "")
Dim abfertigungsnummer = IIf(BezugsNr.Length >= 14, BezugsNr.Substring(5, 8), "")
Dim dy_SendungsId = EZA.Transaktion.IOReferenz
If filiale <> "" AndAlso abfertigungsnummer <> "" AndAlso IsNumeric(filiale) AndAlso IsNumeric(abfertigungsnummer) Then
Dim SND = VERAG_PROG_ALLGEMEIN.cSendungen.LOADByFilialenNrAbfertigungsNr(filiale, abfertigungsnummer)
If SND IsNot Nothing AndAlso SND.tblSnd_Abfertigungsart_ID = 44 Then
Dim existingEntryID As Integer = 0
existingEntryID = CInt((New SQL).getValueTxtBySql("Select count(*) From [tblGesamtsicherheitsPositionen] inner join [tblGesamtsicherheit] on gs_gsId = gsp_gsId where [gs_ATBNr] = '" & RegistriernummerATLAS & "' order by gs_datum desc"))
If existingEntryID > 0 Then GoTo Anzeige
existingEntryID = CInt((New SQL).getValueTxtBySql("Select count(*) From [tblGesamtsicherheitsPositionen] inner join [tblGesamtsicherheit] on gs_gsId = gsp_gsId where ([gs_filialenNr] = '" & SND.FilialenNr & "' and [gs_abfertigungsNr] = " & SND.AbfertigungsNr & " ) or gs_avisoId = '" & SND.tblSnd_AvisoID & "' order by gs_datum desc"))
If existingEntryID > 0 Then GoTo Anzeige
Dim gsNr As Integer = 0
gsNr = CInt((New SQL).getValueTxtBySql("Select gsNr From [tblGesamtsicherheit] where [gs_ATBNr] = '" & RegistriernummerATLAS & "' order by gs_datum desc"))
If gsNr > 0 Then GoTo Insert
gsNr = CInt((New SQL).getValueTxtBySql("Select gsNr From [tblGesamtsicherheit] where ([gs_filialenNr] = '" & SND.FilialenNr & "' and [gs_abfertigungsNr] = " & SND.AbfertigungsNr & " ) or gs_avisoId = '" & SND.tblSnd_AvisoID & "' order by gs_datum desc"))
If gsNr > 0 Then
GoTo Insert
Else
GoTo Anzeige
End If
''sonderfälle lt. Mestan
If SND.tblSnd_Zollsystem_Land = "DE" Then
Select Case SND.FilialenNr
Case 5501, 4803, 4809, 5103
Standort = "VERAG GmbH"
End Select
ElseIf SND.tblSnd_Zollsystem_Land = "AT" Then
If SND.tblSnd_Abfertigungsart_ID = 1 Then 'ZA
Standort = "VERAG CS"
ElseIf SND.tblSnd_Abfertigungsart_ID = 38 Then 'EV-Verz
Select Case SND.FilialenNr
Case 4803, 5303, 4809, 5103
Standort = "VERAG CS"
End Select
End If
End If
Insert:
Dim GesSichRef = New VERAG_PROG_ALLGEMEIN.cAufschubKonten(Standort)
Dim saldo = GesSichRef.CalcSaldo()
Try
Dim SicherheitsPos As New cGesamtsicherheitsPositionen()
With SicherheitsPos
'.gsp_gsId = gs_gsId
''.gsp_gspPosId = Me.getLatestPosNr(currentSicherheit.gs_gsNr, ) + 1
'.gsp_gspPosId = OPEN.gs_posNr
'.gsp_warenwert = Double.Parse(txtPosWarenwert.Text)
'.gsp_sicherheitsbetrag = Double.Parse(txtPosSicherheitsbetrag.Text)
'.gsp_freitext = txtPosFreitext.Text
'.gsp_filialenNr = currentSicherheit.gs_filialenNr
'.gsp_art = "CLOSE"
.gsp_gsNr = gsNr
'.gsp_abfertigungsNr = currentSicherheit.gs_abfertigungsnr
.gsp_datum = 'DateTimeString2DateTimeKonvertinator(txtPosDat.Text, txtPosTime.Text)
.gsp_erstellungsdatum = DateTime.Now
.gsp_ust = 'currentSicherheit.gs_ust
.gsp_ATCNr = 'txtPositionenCRN.Text
.gsp_avisoId = 'Me.avisoID'
.gsp_systemuser = "DAKOSY-AUTO"
End With
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = True
SicherheitsPos.SAVE()
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = False
Catch ex As Exception
End Try
Catch ex As Exception End If
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = False
End Try
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = False
End If
End If
Anzeige:
FORM.addDGVEinarbeitung("VW: Erledigungsinformation-Vorpapier", STATUS.dySt_BezugsNr)
End If End If
'----------------------------------------------------------------
FORM.addDGVEinarbeitung("VW: Erledigungsinformation-Vorpapier", STATUS.dySt_BezugsNr)
End If End If
Catch ex As Exception Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace & vbNewLine & "Datei: " & Dateiname, System.Reflection.MethodInfo.GetCurrentMethod.Name) VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace & vbNewLine & "Datei: " & Dateiname, System.Reflection.MethodInfo.GetCurrentMethod.Name)
readEZA_SumAErledigungsinformationVorpapier_005 = "" readEZA_SumAErledigungsinformationVorpapier_005 = ""

View File

@@ -6,11 +6,6 @@ Imports System.Security.Cryptography.X509Certificates
Imports System.Text Imports System.Text
Imports System.Threading Imports System.Threading
Imports System.Xml Imports System.Xml
Imports com.sun.crypto.provider
Imports com.sun.org.apache.bcel.internal.generic
Imports com.sun.org.apache.xpath.internal.operations
Imports com.sun.xml.internal.rngom
Imports io.konik.zugferd
Imports MDM_Worker Imports MDM_Worker
Imports Renci.SshNet Imports Renci.SshNet
Imports VERAG_PROG_ALLGEMEIN Imports VERAG_PROG_ALLGEMEIN
@@ -323,7 +318,7 @@ Public Class frmStartOptions
f.Show() f.Show()
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = False VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = False
Dim finanzonline = True Dim finanzonline = True
getUID_Pruefung(MyTextBox1.Text, finanzonline) getUID_Pruefung(15000, finanzonline) 'max 15.000 wegen Zeit (Routine wird alle 24h wiederholt, 15 Abfragen pro Minute -> 21.600 pro 24h)
closeMe() closeMe()
Case "WOELFL_USTVAntraege" Case "WOELFL_USTVAntraege"
Dim f As New frmInfo(PARAM) Dim f As New frmInfo(PARAM)
@@ -692,7 +687,7 @@ Public Class frmStartOptions
Else Else
counTrans += dt.Rows.Count counTrans += dt.Rows.Count
End If End If
i = i + 1 'i = i + 1 -> In a VB For loop, the loop automatically increases i by 1 each iteration.
pages &= " " & i pages &= " " & i
Next Next
End If End If
@@ -5210,7 +5205,7 @@ Public Class frmStartOptions
Exit Sub Exit Sub
End If End If
i = i + 1 'i = i + 1 In a VB For loop, the loop automatically increases i by 1 each iteration.
pages &= " " & i pages &= " " & i
Next Next
@@ -5608,7 +5603,7 @@ Public Class frmStartOptions
' Exit Sub ' Exit Sub
' End If ' End If
' i = i + 1 ' 'i = i + 1 In a VB For loop, the loop automatically increases i by 1 each iteration.
' Next ' Next
@@ -6932,15 +6927,13 @@ repeatRequest:
'alle ab 2025! 'alle ab 2025!
Dim test As String = " AND Adressen.AdressenNr = 139999"
Select Case Lieferant Select Case Lieferant
Case "IDS" Case "IDS"
sql_query = " select Adressen.AdressenNr as KundenNr,Adressen.AdressenNr as KundenNrVerag, invoice_id, LandKz as KundenLandKz, VATAmount as MWST, Country as RELandKz FROM tblIDSInvoicesNewSplittedByCountry sql_query = " select Adressen.AdressenNr as KundenNr,Adressen.AdressenNr as KundenNrVerag, invoice_id, LandKz as KundenLandKz, VATAmount as MWST, Country as RELandKz FROM tblIDSInvoicesNewSplittedByCountry
inner join [VERAG].[dbo].[tbl_IDS_Kunden] on tblIDSInvoicesNewSplittedByCountry.CustomerCode = tbl_IDS_Kunden.CustomerCode inner join [VERAG].[dbo].[tbl_IDS_Kunden] on tblIDSInvoicesNewSplittedByCountry.CustomerCode = tbl_IDS_Kunden.CustomerCode
inner join Adressen on Adressen.AdressenNr = KdNrVERAG inner join Adressen on Adressen.AdressenNr = KdNrVERAG
WHERE tblIDSInvoicesNewSplittedByCountry.[CustomerCode] in (SELECT distinct([CustomerCode]) FROM [VERAG].[dbo].[tbl_IDS_Kunden] WHERE tblIDSInvoicesNewSplittedByCountry.[CustomerCode] in (SELECT distinct([CustomerCode]) FROM [VERAG].[dbo].[tbl_IDS_Kunden]
WHERE 1 = 1 AND isnull([tbl_IDS_Kunden].KdNrAlt, 0) = 0) AND tblIDSInvoicesNewSplittedByCountry.InvToCustomer is null and Year(YearMonthDay) > 2024" '& test WHERE 1 = 1 AND isnull([tbl_IDS_Kunden].KdNrAlt, 0) = 0) AND tblIDSInvoicesNewSplittedByCountry.InvToCustomer is null and Year(YearMonthDay) > 2024"
sql_query_keineMWST = "select distinct(tblKundenErweitert.kde_KundenNr) as KundenNr FROM tblIDSInvoicesNewSplittedByCountry sql_query_keineMWST = "select distinct(tblKundenErweitert.kde_KundenNr) as KundenNr FROM tblIDSInvoicesNewSplittedByCountry
inner join [VERAG].[dbo].[tbl_IDS_Kunden] on tblIDSInvoicesNewSplittedByCountry.CustomerCode = tbl_IDS_Kunden.CustomerCode inner join [VERAG].[dbo].[tbl_IDS_Kunden] on tblIDSInvoicesNewSplittedByCountry.CustomerCode = tbl_IDS_Kunden.CustomerCode