From 33946b44f596f2164b0f1c2598a8f1dad917c6bc Mon Sep 17 00:00:00 2001 From: "d.breimaier" Date: Fri, 15 May 2026 11:06:56 +0200 Subject: [PATCH] Zollern - Gesamtsicherheiten, etc. --- initATLASAufschubkonten/cWorker_Verwahrung.vb | 36 +++++++++++++++---- initATLASAufschubkonten/frmStartOptions.vb | 10 +++--- 2 files changed, 34 insertions(+), 12 deletions(-) diff --git a/initATLASAufschubkonten/cWorker_Verwahrung.vb b/initATLASAufschubkonten/cWorker_Verwahrung.vb index 445e924..baffd5b 100644 --- a/initATLASAufschubkonten/cWorker_Verwahrung.vb +++ b/initATLASAufschubkonten/cWorker_Verwahrung.vb @@ -596,15 +596,15 @@ Anzeige: Select Case filiale Case "4803", "4809" - Standort = "VERAG AG" + Standort = Sicherheiten_Standort.VERAG_AG Case "5601" - Standort = "Unisped GmbH" + Standort = Sicherheiten_Standort.UNISPED Case "5701" - Standort = "AMBAR GmbH" + Standort = Sicherheiten_Standort.AMBAR Case "4810", "5103", "5901" - Standort = "VERAG GmbH" + Standort = Sicherheiten_Standort.VERAG_GMBH Case "5501" - Standort = "IMEX" + Standort = Sicherheiten_Standort.IMEX Case Else Return False End Select @@ -617,6 +617,11 @@ Anzeige: If SND IsNot Nothing AndAlso SND.tblSnd_Abfertigungsart_ID = 44 Then + If isZollern(SND) Then + Standort = Sicherheiten_Standort.ZOLLERN + End If + + Dim existingEntries As DataTable existingEntries = (New SQL).loadDgvBySql("Select gs_gsnr, gs_gsId, gs_posNr,gs_DK_laufnr, gs_freitext,gs_systemuser,gs_VeralteteWeitereRegistriernummer,gs_MRNNr, gs_ATBNr, gs_dakoyimport from [tblGesamtsicherheit] where [gs_ATBNr] = '" & Vorpapiernummer & "' order by gs_datum desc", "AVISO") If existingEntries.Rows.Count = 0 Then @@ -1210,9 +1215,9 @@ Anzeige: TextHTMLtable &= "" - End If + End If - TextHTMLtable &= "" + TextHTMLtable &= "" TextHTMLtable &= vbNewLine & vbNewLine & vbNewLine & "*Automatic generated e-mail*" Return TextHTMLtable @@ -1245,5 +1250,22 @@ Anzeige: End Select + End Function + + Private Shared Function isZollern(SND As cSendungen) + + Dim zollernKdnr = {772383, 712203} + + If zollernKdnr.Contains(SND.tblSnd_AbsenderKdNr) OrElse + zollernKdnr.Contains(SND.tblSnd_AuftraggeberKdNr) OrElse + (SND.tblSnd_AvisiererKdNr IsNot Nothing AndAlso zollernKdnr.Contains(SND.tblSnd_AvisiererKdNr)) OrElse + zollernKdnr.Contains(SND.tblSnd_EmpfaengerKdNr) OrElse + (SND.tblSnd_FrachtfuehrerKdNr IsNot Nothing AndAlso zollernKdnr.Contains(SND.tblSnd_FrachtfuehrerKdNr)) Then + Return True + Else + Return False + End If + + End Function End Class diff --git a/initATLASAufschubkonten/frmStartOptions.vb b/initATLASAufschubkonten/frmStartOptions.vb index 5d26189..4596caa 100644 --- a/initATLASAufschubkonten/frmStartOptions.vb +++ b/initATLASAufschubkonten/frmStartOptions.vb @@ -1094,14 +1094,14 @@ Public Class frmStartOptions '========================================== sql.doSQL("Update Speditionsbuch SET [DokumentId_Steuerbeleg]='" & cDHF_Anhaenge.docID & "' WHERE AtlasBezNrEZA='" & cDHF_Anhaenge.LRN & "' AND [DokumentId_Steuerbeleg] is null", "FMZOLL") - If sendMail Then doMailZollbeleg(destFull, "STB", SPEDBUCH_TMP.SendungID, cDHF_Anhaenge.LRN) + If sendMail AndAlso SPEDBUCH_TMP IsNot Nothing AndAlso SPEDBUCH_TMP.SendungID IsNot Nothing Then doMailZollbeleg(destFull, "STB", SPEDBUCH_TMP.SendungID, cDHF_Anhaenge.LRN) Case "TR109", "CC029C" If DAKOSY_Worker.cZOLL_IMPORT.EZOLLImport(cDHF_Anhaenge.LRN, "NCTS", SPEDBUCH_TMP) And Not sendMail Then addTODatatable(dtSPEDEintrageAusEinarbeitung_HISTORY, cDHF_Anhaenge, SPEDBUCH_TMP, datum) End If 'Versucht den SpedBucheintrag, falls noch nicht vorhanden sql.doSQL("Update Speditionsbuch SET [DokumentId_VBD]='" & cDHF_Anhaenge.docID & "' WHERE AtlasBezNrNCTS='" & cDHF_Anhaenge.LRN & "' AND [DokumentId_VBD] is null", "FMZOLL") ' BEREITSTELLUNG DER DATEN AN FREMDSYSTEME - If sendMail Then + If sendMail AndAlso SPEDBUCH_TMP IsNot Nothing AndAlso SPEDBUCH_TMP.SendungID IsNot Nothing Then cVERAG_out_ncts.copyFileFTP_VERAGncts_EZOLL(cDHF_Anhaenge.AnmID) doMailZollbeleg(destFull, "VBD", SPEDBUCH_TMP.SendungID, cDHF_Anhaenge.LRN) End If @@ -1117,7 +1117,7 @@ Public Class frmStartOptions 'Zeitspanne ? 3 Tage , älter nicht senden.. If destFull <> "" AndAlso SPEDBUCH_TMP IsNot Nothing AndAlso SPEDBUCH_TMP.SendungID IsNot Nothing Then - If sendMail Then doMailZollbeleg(destFull, "ABD", SPEDBUCH_TMP.SendungID, cDHF_Anhaenge.LRN) + If sendMail AndAlso SPEDBUCH_TMP IsNot Nothing AndAlso SPEDBUCH_TMP.SendungID IsNot Nothing Then doMailZollbeleg(destFull, "ABD", SPEDBUCH_TMP.SendungID, cDHF_Anhaenge.LRN) End If Case Else '' --> EINFUHR --> 'Ergänzung STB - Mitteilung @@ -1125,7 +1125,7 @@ Public Class frmStartOptions addTODatatable(dtSPEDEintrageAusEinarbeitung_HISTORY, cDHF_Anhaenge, SPEDBUCH_TMP, datum) End If 'Versucht den SpedBucheintrag, falls noch nicht vorhanden sql.doSQL("Update Speditionsbuch SET DokumentId_Mitteilung='" & cDHF_Anhaenge.docID & "' WHERE AtlasBezNrEZA='" & cDHF_Anhaenge.LRN & "' AND DokumentId_Mitteilung is null", "FMZOLL") - If sendMail Then doMailZollbeleg(destFull, "STB", SPEDBUCH_TMP.SendungID, cDHF_Anhaenge.LRN) + If sendMail AndAlso SPEDBUCH_TMP IsNot Nothing AndAlso SPEDBUCH_TMP.SendungID IsNot Nothing Then doMailZollbeleg(destFull, "STB", SPEDBUCH_TMP.SendungID, cDHF_Anhaenge.LRN) End Select @@ -1144,7 +1144,7 @@ Public Class frmStartOptions sql.doSQL("Update Speditionsbuch SET [DokumentId_AVM]='" & cDHF_Anhaenge.docID & "' WHERE AtlasBezNrAES='" & cDHF_Anhaenge.LRN & "' AND DokumentId_AVM is null", "FMZOLL") If destFull <> "" AndAlso SPEDBUCH_TMP IsNot Nothing AndAlso SPEDBUCH_TMP.SendungID IsNot Nothing Then - If sendMail Then doMailZollbeleg(destFull, "AVM", SPEDBUCH_TMP.SendungID, cDHF_Anhaenge.LRN) + If sendMail AndAlso SPEDBUCH_TMP IsNot Nothing AndAlso SPEDBUCH_TMP.SendungID IsNot Nothing Then doMailZollbeleg(destFull, "AVM", SPEDBUCH_TMP.SendungID, cDHF_Anhaenge.LRN) End If End Select