worker_verwahrung, Plose
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
Imports VERAG_PROG_ALLGEMEIN
|
||||
Imports com.sun.org.apache.bcel.internal.generic
|
||||
Imports DocumentFormat.OpenXml.Wordprocessing
|
||||
Imports Spire.Pdf
|
||||
Imports VERAG_PROG_ALLGEMEIN
|
||||
|
||||
Public Class cWorker_Verwahrung
|
||||
Public Shared Dateiname = ""
|
||||
@@ -87,33 +90,10 @@ Public Class cWorker_Verwahrung
|
||||
If saveVerwahrung Then
|
||||
|
||||
'----------------------------------------------------------------
|
||||
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = True
|
||||
|
||||
|
||||
Try
|
||||
|
||||
''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
|
||||
|
||||
|
||||
Dim BezugsNr = readVW_SumAVerwahrungsinfo
|
||||
|
||||
Dim Standort As String = ""
|
||||
@@ -122,73 +102,140 @@ Public Class cWorker_Verwahrung
|
||||
Case 4803, 4809
|
||||
Standort = "VERAG AG"
|
||||
Case 5601
|
||||
Standort = "Unisped GmbH"
|
||||
Standort = "UNISPED GmbH"
|
||||
Case 5701
|
||||
Standort = "AMBAR"
|
||||
Standort = "AMBAR GmbH"
|
||||
Case 4810, 5103, 5901
|
||||
Standort = "VERAG GmbH"
|
||||
Case 5501
|
||||
Standort = "IMEX"
|
||||
Case Else
|
||||
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = False
|
||||
Return "" 'keine passener Standort
|
||||
GoTo Anzeige
|
||||
End Select
|
||||
|
||||
Dim GesSichRef = New VERAG_PROG_ALLGEMEIN.cGesamtsicherheitsReferenz(Standort)
|
||||
|
||||
'For Each pos In NCTS.EinzelErledigungsmeldung.Position
|
||||
|
||||
Dim saldo = GesSichRef.CalcSaldo()
|
||||
Dim filiale
|
||||
Dim abfertigungsnummer
|
||||
Dim filiale = IIf(BezugsNr.Length > 4, BezugsNr.Substring(0, 4), "")
|
||||
Dim abfertigungsnummer = IIf(BezugsNr.Length >= 14, BezugsNr.Substring(5, 8), "")
|
||||
Dim dy_SendungsId = VWI.Transaktion.IOReferenz
|
||||
If dy_SendungsId IsNot Nothing AndAlso IsNumeric(dy_SendungsId) Then
|
||||
Dim SND As New VERAG_PROG_ALLGEMEIN.cSendungen(dy_SendungsId)
|
||||
If SND IsNot Nothing Then
|
||||
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 existingEntry As Integer = 0
|
||||
existingEntry = CInt((New SQL).getValueTxtBySql("Select count(*) from [tblGesamtsicherheit] where [gs_ATBNr] = '" & RegistriernummerATLAS & "' order by gs_datum desc"))
|
||||
If existingEntry > 0 Then GoTo Anzeige
|
||||
existingEntry = CInt((New SQL).getValueTxtBySql("Select count(*) from [tblGesamtsicherheit] where ([gs_filialenNr] = '" & SND.FilialenNr & "' and [gs_abfertigungsNr] = " & SND.AbfertigungsNr & " ) or gs_avisoId = '" & SND.tblSnd_AvisoID & "' order by gs_datum desc"))
|
||||
If existingEntry > 0 Then GoTo Anzeige
|
||||
|
||||
''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
|
||||
|
||||
|
||||
Dim GesSichRef = New VERAG_PROG_ALLGEMEIN.cAufschubKonten(Standort)
|
||||
|
||||
Dim saldo = GesSichRef.CalcSaldo()
|
||||
|
||||
|
||||
If SND.FilialenNr > 0 Then filiale = SND.FilialenNr
|
||||
If SND.AbfertigungsNr > 0 Then abfertigungsnummer = SND.AbfertigungsNr
|
||||
|
||||
'Verwahrung ANSCHREIBUNG
|
||||
Dim ANSCHREIBUNG As New cSicherheiten()
|
||||
|
||||
Dim gsId As Integer
|
||||
With ANSCHREIBUNG
|
||||
.gs_ATBNr = Vorpapiernummer
|
||||
.gs_ATBNr = RegistriernummerATLAS
|
||||
.gs_posNr = 1
|
||||
.gs_datum = gestellungsdatum
|
||||
.gs_warenwert = SND.tblSnd_Warenwert
|
||||
.gs_sicherheitsbetrag = (SND.tblSnd_Warenwert * (GesSichRef.gsr_zollsatz / 100))
|
||||
.gs_warenwert = IIf(SND.tblSnd_Warenwert IsNot Nothing AndAlso IsNumeric(SND.tblSnd_Warenwert), CDbl(SND.tblSnd_Warenwert), 0)
|
||||
.gs_sicherheitsbetrag = IIf(SND.tblSnd_Warenwert IsNot Nothing AndAlso IsNumeric(SND.tblSnd_Warenwert), CDbl(SND.tblSnd_Warenwert) * (GesSichRef.brgakto_gs_zollsatz / 100), 0)
|
||||
.gs_standort = Standort
|
||||
.gs_art = "OPEN"
|
||||
'.gs_gsNr = ANSCHREIBUNG.gessicherheitID
|
||||
.gs_erstellungsdatum = Now()
|
||||
.gs_freitext = ""
|
||||
.gs_saldo = GesSichRef.gsr_Saldo
|
||||
.gs_saldo = saldo
|
||||
.gs_atr = ""
|
||||
.gs_filialenNr = filiale
|
||||
.gs_abfertigungsnr = abfertigungsnummer
|
||||
'.gs_LKWKZ = SND.tblSnd_id
|
||||
.gs_LKWKZ = SND.tblSnd_AvisoID
|
||||
'.gs_warenort = gessich.warenortID
|
||||
'.grenzstelle = AVISO.Grenzstelle.ToString.Replace("WO_", "")
|
||||
.gs_systemuser = "DAKOSY-AUTO"
|
||||
.gs_zollsatz = GesSichRef.brgakto_gs_zollsatz
|
||||
.gs_avisoId = SND.tblSnd_AvisoID
|
||||
|
||||
End With
|
||||
End If
|
||||
|
||||
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = True
|
||||
gsId = ANSCHREIBUNG.SAVEOBJECT()
|
||||
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = False
|
||||
|
||||
|
||||
If posGestellung.Rows.Count > 1 Then
|
||||
For i As Integer = 2 To posGestellung.Rows.Count
|
||||
|
||||
Dim ANSCHREIBUNG_POS As New cSicherheiten()
|
||||
With ANSCHREIBUNG_POS
|
||||
|
||||
.gs_gsNr = gsId
|
||||
.gs_ATBNr = RegistriernummerATLAS
|
||||
.gs_posNr = i
|
||||
.gs_datum = gestellungsdatum
|
||||
.gs_warenwert = 0
|
||||
.gs_sicherheitsbetrag = 0
|
||||
.gs_standort = Standort
|
||||
.gs_art = "OPEN"
|
||||
.gs_erstellungsdatum = DateTime.Now
|
||||
.gs_freitext = ""
|
||||
.gs_saldo = saldo
|
||||
.gs_atr = ""
|
||||
.gs_zollsatz = GesSichRef.brgakto_gs_zollsatz
|
||||
.gs_avisoId = SND.tblSnd_AvisoID
|
||||
|
||||
End With
|
||||
|
||||
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = True
|
||||
ANSCHREIBUNG.SAVE()
|
||||
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = False
|
||||
|
||||
Next
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
Catch ex As Exception
|
||||
|
||||
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = False
|
||||
|
||||
End Try
|
||||
|
||||
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = False
|
||||
|
||||
End If
|
||||
|
||||
|
||||
Anzeige:
|
||||
FORM.addDGVEinarbeitung("VW: Verwahrungsinfo", STATUS.dySt_BezugsNr)
|
||||
End If
|
||||
|
||||
|
||||
Reference in New Issue
Block a user