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

@@ -24,13 +24,13 @@ Public Class frmGesamtsicherheitenMenuNEU
Select Case Standort
Case "Verag GmbH" : firmaId = 2 : chkOffen.Checked = True
Case "VERAG AG" : firmaId = 1 : chkOffen.Checked = False
Case "IMEX" : firmaId = 20 : chkOffen.Checked = False
Case "Verag CS" : firmaId = 11 : chkOffen.Checked = False
Case "Unisped GmbH" : firmaId = 21 : chkOffen.Checked = False
Case "AMBAR GmbH" : firmaId = 24 : chkOffen.Checked = False
Case "Atilla GmbH" : firmaId = 7 : chkOffen.Checked = False
Case Sicherheiten_Standort.VERAG_GMBH : firmaId = 2 : chkOffen.Checked = True
Case Sicherheiten_Standort.VERAG_AG : firmaId = 1 : chkOffen.Checked = False
Case Sicherheiten_Standort.IMEX : firmaId = 20 : chkOffen.Checked = False
Case Sicherheiten_Standort.VERAG_CS : firmaId = 11 : chkOffen.Checked = False
Case Sicherheiten_Standort.UNISPED : firmaId = 21 : chkOffen.Checked = False
Case Sicherheiten_Standort.AMBAR : firmaId = 24 : chkOffen.Checked = False
Case Sicherheiten_Standort.ATILLA : firmaId = 7 : chkOffen.Checked = False
End Select
@@ -41,9 +41,9 @@ Public Class frmGesamtsicherheitenMenuNEU
Me.Text = "Gesamtsicherheiten " & Standort
frmHauptfenster.EnableDoubleBuffered(dgvListe)
GesSichRef = New VERAG_PROG_ALLGEMEIN.cAufschubKonten(Standort)
GesSichRef = New VERAG_PROG_ALLGEMEIN.cAufschubKonten(Standort, firmaId)
If GesSichRef.hasEntry = False Then
MsgBox("Für den Standort " & Standort & " wurde keine Referenz hingerlegt!")
MsgBox("Für den Standort " & Standort & " wurde keine Referenz hinterlegt!")
Exit Sub
End If

View File

@@ -101,13 +101,13 @@ Public Class frmGesamtsicherheitenNEU
changeLabel()
Select Case Standort
Case "Verag GmbH" : btnDAKOSY_AUTO.Enabled = Not DAKOSY_AUTO
Case "AMBAR GmbH" : btnDAKOSY_AUTO.Enabled = Not DAKOSY_AUTO
Case "Atilla GmbH" : btnDAKOSY_AUTO.Enabled = False
Case "VERAG AG" : btnDAKOSY_AUTO.Enabled = False
Case "IMEX" : btnDAKOSY_AUTO.Enabled = False
Case "Verag CS" : btnDAKOSY_AUTO.Enabled = False
Case "Unisped GmbH" : btnDAKOSY_AUTO.Enabled = False
Case Sicherheiten_Standort.VERAG_GMBH : btnDAKOSY_AUTO.Enabled = Not DAKOSY_AUTO
Case Sicherheiten_Standort.AMBAR : btnDAKOSY_AUTO.Enabled = Not DAKOSY_AUTO
Case Sicherheiten_Standort.ATILLA : btnDAKOSY_AUTO.Enabled = False
Case Sicherheiten_Standort.VERAG_AG : btnDAKOSY_AUTO.Enabled = False
Case Sicherheiten_Standort.IMEX : btnDAKOSY_AUTO.Enabled = False
Case Sicherheiten_Standort.VERAG_CS : btnDAKOSY_AUTO.Enabled = False
Case Sicherheiten_Standort.UNISPED : btnDAKOSY_AUTO.Enabled = False
Case Else : btnDAKOSY_AUTO.Enabled = False
End Select
@@ -172,7 +172,7 @@ Public Class frmGesamtsicherheitenNEU
.Columns("gs_ust").DefaultCellStyle.Format = "c2"
Case Else
If Standort = "Verag GmbH" Then
If Standort = Sicherheiten_Standort.VERAG_GMBH Then
.Columns("gs_ATBNr").HeaderText = "Reg-Nr."
Else
.Columns("gs_ATBNr").HeaderText = "T1 MRN"
@@ -561,9 +561,9 @@ Public Class frmGesamtsicherheitenNEU
.Columns("gsp_sicherheitsbetrag").DefaultCellStyle.Format = "c"
Select Case currentGesSichRef.brgakto_gs_ATR
Case True
If Standort = "Verag GmbH" Then
If Standort = Sicherheiten_Standort.VERAG_GMBH Then
.Columns("gsp_MRNNr").HeaderText = "ATC. / MRN"
ElseIf Standort = "VERAG AG" Then
ElseIf Standort = Sicherheiten_Standort.VERAG_AG Then
.Columns("gsp_MRNNr").HeaderText = "T1 CRN"
Else
.Columns("gsp_MRNNr").HeaderText = "EZA / T1 CRN"
@@ -2081,7 +2081,7 @@ Public Class frmGesamtsicherheitenNEU
Private Sub changeLabel(Optional isATR As Boolean = True)
If Standort = "Verag GmbH" Then
If Standort = Sicherheiten_Standort.VERAG_GMBH Then
'Label1.Text = "Reg-Nr."
If isATR Then
@@ -2092,7 +2092,7 @@ Public Class frmGesamtsicherheitenNEU
End If
ElseIf Standort = "VERAG AG" Then
ElseIf Standort = Sicherheiten_Standort.VERAG_AG Then
Label12.Text = "T1 CRN"
'Label1.Text = "T1 MRN"
Else
@@ -2325,7 +2325,7 @@ Public Class frmGesamtsicherheitenNEU
Dim whereWarenort As String = " WHERE [wo_aktiv] = 1 AND wo_ze = 1"
If Standort = "Atilla GmbH" Then
If Standort = Sicherheiten_Standort.ATILLA Then
'----'nicht unisped und cs und ambar aber alle anderen - laut j.Siener am 23.03.2026
@@ -2345,7 +2345,7 @@ Public Class frmGesamtsicherheitenNEU
If setDefaultValue AndAlso cboWarenort.Items.Count > 0 Then
If Standort = "AMBAR GmbH" Then
If Standort = Sicherheiten_Standort.AMBAR Then
For i As Integer = 0 To cboFiliale.Items.Count - 1
If cboFiliale.Items(i).ToString().Contains("5701") Then
cboFiliale.SelectedIndex = i

View File

@@ -4783,15 +4783,17 @@ ELSE_ATILLA:
Private Sub ATGesamtsicherheitVeragAGToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ATVeragAGToolStripMenuItem.Click, DEVeragGmbHToolStripMenuItem.Click, ATImexCSToolStripMenuItem.Click, ATVeragCSToolStripMenuItem.Click, ATUnispedGmbHToolStripMenuItem.Click, DEAmbarToolStripMenuItem.Click, ATAtillaToolStripMenuItem.Click
Dim frm As New frmGesamtsicherheitenMenuNEU()
Select Case sender.name
Case "ATVeragAGToolStripMenuItem" : frm.Standort = "VERAG AG"
Case "DEVeragGmbHToolStripMenuItem" : frm.Standort = "Verag GmbH"
Case "ATImexCSToolStripMenuItem" : frm.Standort = "IMEX"
Case "ATVeragCSToolStripMenuItem" : frm.Standort = "Verag CS"
Case "ATUnispedGmbHToolStripMenuItem" : frm.Standort = "Unisped GmbH"
Case "DEAmbarToolStripMenuItem" : frm.Standort = "AMBAR GmbH"
Case "ATAtillaToolStripMenuItem" : frm.Standort = "Atilla GmbH"
Case "ATVeragAGToolStripMenuItem" : frm.Standort = Sicherheiten_Standort.VERAG_AG
Case "DEVeragGmbHToolStripMenuItem" : frm.Standort = Sicherheiten_Standort.VERAG_GMBH
Case "ATImexCSToolStripMenuItem" : frm.Standort = Sicherheiten_Standort.IMEX
Case "ATVeragCSToolStripMenuItem" : frm.Standort = Sicherheiten_Standort.VERAG_CS
Case "ATUnispedGmbHToolStripMenuItem" : frm.Standort = Sicherheiten_Standort.UNISPED
Case "DEAmbarToolStripMenuItem" : frm.Standort = Sicherheiten_Standort.AMBAR
Case "ATAtillaToolStripMenuItem" : frm.Standort = Sicherheiten_Standort.ATILLA
End Select
frm.Show()

View File

@@ -24,24 +24,26 @@ Partial Class usrCntlSND_ATBGestellung
Private Sub InitializeComponent()
Me.pnlT1 = New System.Windows.Forms.Panel()
Me.PictureBox5 = New System.Windows.Forms.PictureBox()
Me.txtT1Datum = New VERAG_PROG_ALLGEMEIN.MyTextBox()
Me.DateTimePicker1 = New System.Windows.Forms.DateTimePicker()
Me.Label1 = New System.Windows.Forms.Label()
Me.btnGesSicherheit = New System.Windows.Forms.Button()
Me.Button1 = New System.Windows.Forms.Button()
Me.cbxATBFakturieren = New System.Windows.Forms.CheckBox()
Me.Label4 = New System.Windows.Forms.Label()
Me.Label3 = New System.Windows.Forms.Label()
Me.Label33 = New System.Windows.Forms.Label()
Me.txtT1Datum = New VERAG_PROG_ALLGEMEIN.MyTextBox()
Me.txtATBNr = New VERAG_PROG_ALLGEMEIN.MyTextBox()
Me.txtATBT1 = New VERAG_PROG_ALLGEMEIN.MyTextBox()
Me.Label4 = New System.Windows.Forms.Label()
Me.Label3 = New System.Windows.Forms.Label()
Me.txtT1VerzollungsadresseBestimmungszollstelle = New VERAG_PROG_ALLGEMEIN.MySearchBox()
Me.Label33 = New System.Windows.Forms.Label()
Me.Button2 = New System.Windows.Forms.Button()
Me.pnlT1.SuspendLayout()
CType(Me.PictureBox5, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'pnlT1
'
Me.pnlT1.Controls.Add(Me.Button2)
Me.pnlT1.Controls.Add(Me.PictureBox5)
Me.pnlT1.Controls.Add(Me.txtT1Datum)
Me.pnlT1.Controls.Add(Me.DateTimePicker1)
@@ -70,6 +72,31 @@ Partial Class usrCntlSND_ATBGestellung
Me.PictureBox5.TabIndex = 132
Me.PictureBox5.TabStop = False
'
'txtT1Datum
'
Me.txtT1Datum._DateTimeOnly = False
Me.txtT1Datum._numbersOnly = False
Me.txtT1Datum._numbersOnlyKommastellen = ""
Me.txtT1Datum._numbersOnlyTrennzeichen = True
Me.txtT1Datum._Prozent = False
Me.txtT1Datum._ShortDateNew = True
Me.txtT1Datum._ShortDateOnly = False
Me.txtT1Datum._TimeOnly = False
Me.txtT1Datum._TimeOnly_Seconds = False
Me.txtT1Datum._value = ""
Me.txtT1Datum._Waehrung = False
Me.txtT1Datum._WaehrungZeichen = True
Me.txtT1Datum.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.txtT1Datum.ForeColor = System.Drawing.Color.Black
Me.txtT1Datum.Location = New System.Drawing.Point(272, 33)
Me.txtT1Datum.MaxLength = 10
Me.txtT1Datum.MaxLineLength = -1
Me.txtT1Datum.MaxLines_Warning = ""
Me.txtT1Datum.MaxLines_Warning_Label = Nothing
Me.txtT1Datum.Name = "txtT1Datum"
Me.txtT1Datum.Size = New System.Drawing.Size(83, 20)
Me.txtT1Datum.TabIndex = 38
'
'DateTimePicker1
'
Me.DateTimePicker1.CustomFormat = "''"
@@ -125,60 +152,6 @@ Partial Class usrCntlSND_ATBGestellung
Me.cbxATBFakturieren.ThreeState = True
Me.cbxATBFakturieren.UseVisualStyleBackColor = True
'
'Label4
'
Me.Label4.AutoSize = True
Me.Label4.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label4.Location = New System.Drawing.Point(23, 59)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(92, 13)
Me.Label4.TabIndex = 20
Me.Label4.Text = "ATB / Gestellung:"
'
'Label3
'
Me.Label3.AutoSize = True
Me.Label3.Location = New System.Drawing.Point(23, 81)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(51, 13)
Me.Label3.TabIndex = 15
Me.Label3.Text = "Zollstelle:"
'
'Label33
'
Me.Label33.AutoSize = True
Me.Label33.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label33.Location = New System.Drawing.Point(23, 14)
Me.Label33.Name = "Label33"
Me.Label33.Size = New System.Drawing.Size(79, 13)
Me.Label33.TabIndex = 3
Me.Label33.Text = "Vorpapier / T1:"
'
'txtT1Datum
'
Me.txtT1Datum._DateTimeOnly = False
Me.txtT1Datum._numbersOnly = False
Me.txtT1Datum._numbersOnlyKommastellen = ""
Me.txtT1Datum._numbersOnlyTrennzeichen = True
Me.txtT1Datum._Prozent = False
Me.txtT1Datum._ShortDateNew = True
Me.txtT1Datum._ShortDateOnly = False
Me.txtT1Datum._TimeOnly = False
Me.txtT1Datum._TimeOnly_Seconds = False
Me.txtT1Datum._value = ""
Me.txtT1Datum._Waehrung = False
Me.txtT1Datum._WaehrungZeichen = True
Me.txtT1Datum.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.txtT1Datum.ForeColor = System.Drawing.Color.Black
Me.txtT1Datum.Location = New System.Drawing.Point(272, 33)
Me.txtT1Datum.MaxLength = 10
Me.txtT1Datum.MaxLineLength = -1
Me.txtT1Datum.MaxLines_Warning = ""
Me.txtT1Datum.MaxLines_Warning_Label = Nothing
Me.txtT1Datum.Name = "txtT1Datum"
Me.txtT1Datum.Size = New System.Drawing.Size(83, 20)
Me.txtT1Datum.TabIndex = 38
'
'txtATBNr
'
Me.txtATBNr._DateTimeOnly = False
@@ -225,6 +198,25 @@ Partial Class usrCntlSND_ATBGestellung
Me.txtATBT1.Size = New System.Drawing.Size(269, 20)
Me.txtATBT1.TabIndex = 22
'
'Label4
'
Me.Label4.AutoSize = True
Me.Label4.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label4.Location = New System.Drawing.Point(23, 59)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(92, 13)
Me.Label4.TabIndex = 20
Me.Label4.Text = "ATB / Gestellung:"
'
'Label3
'
Me.Label3.AutoSize = True
Me.Label3.Location = New System.Drawing.Point(23, 81)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(51, 13)
Me.Label3.TabIndex = 15
Me.Label3.Text = "Zollstelle:"
'
'txtT1VerzollungsadresseBestimmungszollstelle
'
Me.txtT1VerzollungsadresseBestimmungszollstelle._allowFreitext = False
@@ -251,6 +243,27 @@ Partial Class usrCntlSND_ATBGestellung
Me.txtT1VerzollungsadresseBestimmungszollstelle.TabIndex = 16
Me.txtT1VerzollungsadresseBestimmungszollstelle.usrcntl = Nothing
'
'Label33
'
Me.Label33.AutoSize = True
Me.Label33.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label33.Location = New System.Drawing.Point(23, 14)
Me.Label33.Name = "Label33"
Me.Label33.Size = New System.Drawing.Size(79, 13)
Me.Label33.TabIndex = 3
Me.Label33.Text = "Vorpapier / T1:"
'
'Button2
'
Me.Button2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
Me.Button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.Button2.Location = New System.Drawing.Point(424, 94)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(94, 28)
Me.Button2.TabIndex = 133
Me.Button2.Text = "Saldocheck"
Me.Button2.UseVisualStyleBackColor = True
'
'usrCntlSND_ATBGestellung
'
Me.Controls.Add(Me.pnlT1)
@@ -276,4 +289,5 @@ Partial Class usrCntlSND_ATBGestellung
Friend WithEvents txtT1Datum As VERAG_PROG_ALLGEMEIN.MyTextBox
Friend WithEvents DateTimePicker1 As DateTimePicker
Friend WithEvents PictureBox5 As PictureBox
Friend WithEvents Button2 As Button
End Class

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