gesamtsicherheiten, etc.

This commit is contained in:
2026-05-04 11:47:10 +02:00
parent 7c9cc1007a
commit df05d16aa3
5 changed files with 130 additions and 111 deletions

View File

@@ -1,6 +1,5 @@
Imports DAKOSY_Worker
Imports SDL
Imports VERAG_PROG_ALLGEMEIN
@@ -82,52 +81,53 @@ Public Class usrCntlSND_ATBGestellung
End If
Dim Standort As String = ""
Dim Standort As String = ""
Dim firmaID As Integer = -1
Select Case SND.FilialenNr
Select Case SND.FilialenNr
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"
End Select
Standort = Sicherheiten_Standort.VERAG_AG : firmaID = 1
Case 5601
Standort = Sicherheiten_Standort.UNISPED : firmaID = 21
Case 5701
Standort = Sicherheiten_Standort.AMBAR : firmaID = 24
Case 4810, 5103, 5901
Standort = Sicherheiten_Standort.VERAG_GMBH : firmaID = 2
Case 5501
Standort = Sicherheiten_Standort.IMEX : firmaID = 20
End Select
'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
Standort = Sicherheiten_Standort.VERAG_GMBH : firmaID = 2
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
Standort = Sicherheiten_Standort.VERAG_CS : firmaID = 11
ElseIf SND.tblSnd_Abfertigungsart_ID = 38 Then 'EV-Verz
Select Case SND.FilialenNr
Case 4803, 5303, 4809, 5103
Standort = "VERAG CS"
End Select
Standort = Sicherheiten_Standort.VERAG_CS : firmaID = 11
End Select
End If
End If
Dim GesSichRef = New VERAG_PROG_ALLGEMEIN.cGesamtsicherheitsReferenz(Standort)
If GesSichRef Is Nothing Then MsgBox("Verwahrungsreferenz kann nicht ermittelt werden!") : Exit Sub
Dim GesSichRef = New VERAG_PROG_ALLGEMEIN.cAufschubKonten(Standort, firmaID)
If GesSichRef Is Nothing Then MsgBox("Verwahrungsreferenz kann nicht ermittelt werden!") : Exit Sub
Dim saldo = CDbl(GesSichRef.CalcSaldo())
Dim sicherheitsbertrag As Double = WarenwertEUR * (GesSichRef.gsr_zollsatz / 100)
Dim sicherheitsbertrag As Double = WarenwertEUR * (GesSichRef.brgakto_gs_zollsatz / 100)
If sicherheitsbertrag > saldo Then
If sicherheitsbertrag > saldo Then
If MsgBox(Standort & vbNewLine & "Gestellung kann NICHT durchgeführt werden!" & vbNewLine & "Eingetragener Warenwert in EUR: " & WarenwertEUR & " (Sicherheitsbetrag: " & sicherheitsbertrag & ") übersteigt den vorhandenen Sicherheitssaldo von: " & saldo & vbNewLine & "Trotzdem fortfahren", vbYesNoCancel) <> vbYes Then Exit Sub
End If
@@ -362,4 +362,7 @@ Public Class usrCntlSND_ATBGestellung
Process.Start(webAddress)
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
End Sub
End Class