gesamtsicherheiten

This commit is contained in:
2026-03-18 13:53:44 +01:00
parent 5490712df7
commit e93748277b
7 changed files with 416 additions and 298 deletions

View File

@@ -14,6 +14,7 @@ Public Class usrCntlSND_ATBGestellung
Dim AVISO As VERAG_PROG_ALLGEMEIN.cAviso = Nothing
Dim SND As VERAG_PROG_ALLGEMEIN.cSendungen = Nothing
Dim gsnr_global As Integer = -1
Dim gsnr_proLKW_global As Integer = -1
Sub New(AVISO, SND)
@@ -39,6 +40,11 @@ Public Class usrCntlSND_ATBGestellung
SND = f.SENDUNG_LIST(f.CURRENT_INDEX)
If Not IsNumeric(SND.AbfertigungsNr) OrElse CInt(SND.AbfertigungsNr) < 100000 Then MsgBox("Abfertigungsnummer angeben!") : Exit Sub
If Not IsNumeric(SND.tblSnd_Warenwert) OrElse CInt(SND.tblSnd_Warenwert) < 0 Then MsgBox("Warenwert angeben!") : Exit Sub
If (SND.tblSnd_WarenwertWaehrung) Is Nothing Then MsgBox("Währungseinheit angeben!") : Exit Sub
If If(SND.tblSnd_ATB_T1, "") = "" Then MsgBox("MRN (Gestellung) angeben!") : Exit Sub
If SND.tblSnd_T1_Frist IsNot Nothing AndAlso IsDate(SND.tblSnd_T1_Frist) Then
@@ -103,7 +109,7 @@ Public Class usrCntlSND_ATBGestellung
If MsgBox("Gestellung kann NICHT durchgeführt werden!" & vbNewLine & "Eingetragener Warenwert: " & SND.tblSnd_Warenwert & " (Sicherheitsbetrag: " & sicherheitsbertrag & ") übersteigt den vorhandenen Sicherheitssaldo von: " & saldo & vbNewLine & "Trotzdem fortfahren", vbYesNoCancel) <> vbYes Then Exit Sub
End If
Dim frMZA As New SDL.frmZollanmeldung("AA", Nothing, AVISO, SND, Now.ToString("yy"), GesSichRef, Standort)
Dim frMZA As New SDL.frmZollanmeldung("AA", Nothing, AVISO, SND, Now.ToString("yy"), GesSichRef, Standort, gsnr_proLKW_global)
frMZA.Show()
@@ -112,11 +118,11 @@ Public Class usrCntlSND_ATBGestellung
initGesamtsicherheiten()
' initdgvZollAnmeldungen()
End Sub
Else
Else
MsgBox("Fehler beim Speichern. Ankunftsanzeige abgebrochen.")
End If
Me.Cursor = Cursors.Default
End Sub
End If
Me.Cursor = Cursors.Default
End Sub
Private Sub btnGesSicherheit_Click(sender As Object, e As EventArgs) Handles btnGesSicherheit.Click
@@ -139,7 +145,7 @@ Public Class usrCntlSND_ATBGestellung
'falls nicht gefunden, 2 Schritt -> Gestellung nach AVISO ID, oder Aberftigungsnr and FilialNr
If gsnr = 0 Then
Dim SQLString As String = "Select top (1) gs_gsNr from [tblGesamtsicherheit] where ([gs_filialenNr] = '" & SND.FilialenNr & "' and [gs_abfertigungsNr] = " & SND.AbfertigungsNr & " ) or gs_avisoId = '" & SND.tblSnd_AvisoID & "' order by gs_datum desc"
Dim SQLString As String = "Select top (1) gs_gsNr from [tblGesamtsicherheit] where ([gs_filialenNr] = '" & SND.FilialenNr & "' and [gs_abfertigungsNr] = " & SND.AbfertigungsNr & " ) order by gs_datum desc"
dt = SQL.loadDgvBySql(SQLString, "AVISO", 100, True)
If dt.Rows.Count > 0 Then
gsnr = dt.Rows(0).Item("gs_gsNr")
@@ -275,12 +281,21 @@ Public Class usrCntlSND_ATBGestellung
Private Sub initGesamtsicherheiten()
Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
Dim gsnr As Integer = 0
Dim gsnr_proLKW As Integer = 0
Dim sqlWhere = ""
Dim dt As New DataTable
If SND.tblSnd_ATB_T1 IsNot Nothing Then txtATBT1.Text = SND.tblSnd_ATB_T1.ToString
If gsnr_proLKW = 0 Then
Dim SQLString As String = "Select top (1) gs_gsNr from [tblGesamtsicherheit] where gs_avisoId = '" & SND.tblSnd_AvisoID & "' order by gs_datum desc"
dt = SQL.loadDgvBySql(SQLString, "AVISO", 100, True)
If dt.Rows.Count > 0 Then
gsnr_proLKW = dt.Rows(0).Item("gs_gsNr")
End If
End If
'1.Schritt -> Gestellung nach aktuellster ATB-NR
If txtATBT1.Text <> "" Then
Dim SQLString As String = "Select top (1) gs_gsNr from [tblGesamtsicherheit] where [gs_ATBNr] = '" & txtATBT1.Text & "' order by gs_datum desc"
@@ -292,7 +307,7 @@ Public Class usrCntlSND_ATBGestellung
'falls nicht gefunden, 2 Schritt -> Gestellung nach AVISO ID, oder Aberftigungsnr and FilialNr
If gsnr = 0 Then
Dim SQLString As String = "Select top (1) gs_gsNr from [tblGesamtsicherheit] where ([gs_filialenNr] = '" & SND.FilialenNr & "' and [gs_abfertigungsNr] = " & SND.AbfertigungsNr & " ) or gs_avisoId = '" & SND.tblSnd_AvisoID & "' order by gs_datum desc"
Dim SQLString As String = "Select top (1) gs_gsNr from [tblGesamtsicherheit] where ([gs_filialenNr] = '" & SND.FilialenNr & "' and [gs_abfertigungsNr] = " & SND.AbfertigungsNr & " ) order by gs_datum desc"
dt = SQL.loadDgvBySql(SQLString, "AVISO", 100, True)
If dt.Rows.Count > 0 Then
gsnr = dt.Rows(0).Item("gs_gsNr")
@@ -300,15 +315,18 @@ Public Class usrCntlSND_ATBGestellung
End If
gsnr_global = gsnr
gsnr_proLKW_global = gsnr_proLKW
If gsnr_global > 0 Then
If gsnr_global > 0 Then 'es gibt
btnGesSicherheit.Enabled = True
Button1.Enabled = False
Else
btnGesSicherheit.Enabled = False
Button1.Enabled = True
End If
If gsnr_proLKW_global > 0 AndAlso gsnr_global < 1 OrElse gsnr_proLKW_global < 1 Then
Button1.Enabled = True
Else
Button1.Enabled = False
End If
End Sub
@@ -322,37 +340,4 @@ Public Class usrCntlSND_ATBGestellung
Process.Start(webAddress)
End Sub
'Public Sub setValues()
' txtATBT1.Text = If(NCTS_GA.nga_name, "")
' txtT1VerzollungsadresseStrasse.Text = If(NCTS_GA.nga_strasse, "")
' txtT1VerzollungsadressePlz.Text = If(NCTS_GA.nga_plz, "")
' txtT1VerzollungsadresseOrt.Text = If(NCTS_GA.nga_ort, "")
' sbT1VerzollungsadresseLand.SET_VALUE(If(NCTS_GA.nga_land, ""))
' txtT1VerzollungsadresseAnspr.Text = If(NCTS_GA.nga_Ansprechpartner, "")
' txtT1VerzollungsadresseEORI.Text = If(NCTS_GA.nga_EORI, "")
' txtT1VerzollungsadresseEORI_NL.Text = If(NCTS_GA.nga_EORI_NL, "")
' txtT1VerzollungsadresseBestimmungszollstelle.SET_VALUE(If(NCTS_GA.nga_bestZollst, ""))
' lblNGAId.Text = If(NCTS_GA.nga_id > 0, NCTS_GA.nga_id, "-")
' picDel.Visible = (NCTS_GA.nga_id > 0)
'End Sub
'Public Sub getValues()
' NCTS_GA.nga_name = txtATBT1.Text
' NCTS_GA.nga_strasse = VERAG_PROG_ALLGEMEIN.SQL.isNullNothing(txtT1VerzollungsadresseStrasse.Text)
' NCTS_GA.nga_plz = VERAG_PROG_ALLGEMEIN.SQL.isNullNothing(txtT1VerzollungsadressePlz.Text)
' NCTS_GA.nga_ort = VERAG_PROG_ALLGEMEIN.SQL.isNullNothing(txtT1VerzollungsadresseOrt.Text)
' NCTS_GA.nga_land = VERAG_PROG_ALLGEMEIN.SQL.isNullNothing(sbT1VerzollungsadresseLand._value)
' NCTS_GA.nga_Ansprechpartner = VERAG_PROG_ALLGEMEIN.SQL.isNullNothing(txtT1VerzollungsadresseAnspr.Text)
' NCTS_GA.nga_EORI = VERAG_PROG_ALLGEMEIN.SQL.isNullNothing(txtT1VerzollungsadresseEORI.Text)
' NCTS_GA.nga_EORI_NL = VERAG_PROG_ALLGEMEIN.SQL.isNullNothing(txtT1VerzollungsadresseEORI_NL.Text)
' NCTS_GA.nga_bestZollst = VERAG_PROG_ALLGEMEIN.SQL.isNullNothing(txtT1VerzollungsadresseBestimmungszollstelle._value)
'End Sub
End Class