This commit is contained in:
2026-03-09 13:18:36 +01:00
6 changed files with 230 additions and 62 deletions

View File

@@ -757,12 +757,25 @@ Public Class frmEintragAviso
For Each LKWNr In ListOfLKWNr For Each LKWNr In ListOfLKWNr
Dim temp_avisoID As Integer = -1
Dim hLKWCheck2 As String = AvisoDAL.Suche_LKWStatus(LKWNr) Dim hLKWCheck2 As String = AvisoDAL.Suche_LKWStatus(LKWNr, temp_avisoID)
If hLKWCheck2 <> "" Then If hLKWCheck2 <> "" Then
Dim antwort As MsgBoxResult = MsgBox(hLKWCheck2 & vbCrLf & vbCrLf & "Wollen Sie den Eintrag trotzdem speichern?", CType(MsgBoxStyle.YesNo + MsgBoxStyle.Exclamation, MsgBoxStyle), Dim antwort As MsgBoxResult = MsgBox(hLKWCheck2 & vbCrLf & vbCrLf & "Wollen Sie den Eintrag trotzdem speichern?" & vbNewLine & "NEIN -> Springe zu existierendem Eintrag!", CType(MsgBoxStyle.YesNoCancel + MsgBoxStyle.Exclamation, MsgBoxStyle),
"Aviso-Eintrag") "Aviso-Eintrag")
If antwort = vbNo Then If antwort = vbNo Then
If temp_avisoID > 0 Then
Dim frmGrayOut = VERAG_PROG_ALLGEMEIN.cMeineFunktionenAVISO.grayoutForm()
Dim FRM As New frmSendungsdetailsNEU(temp_avisoID, -1)
FRM.ShowDialog(frmGrayOut)
frmGrayOut.Close()
Exit Sub
Else
MsgBox("AVISO-ID konnte nicht ermittelt werden")
Exit Sub
End If
ElseIf antwort = vbCancel Then
Exit Sub Exit Sub
Else Else
EintragMehrfach = True EintragMehrfach = True
@@ -771,13 +784,25 @@ Public Class frmEintragAviso
If hLKWCheck2 = "" Then If hLKWCheck2 = "" Then
'jetzt eine Prüfung, ob dieser LKW bereits vor kurzem erfasst wurde 'jetzt eine Prüfung, ob dieser LKW bereits vor kurzem erfasst wurde
Dim hLKWCheck As String = AvisoDAL.Suche_LKW(LKWNr) Dim hLKWCheck As String = AvisoDAL.Suche_LKW(LKWNr, temp_avisoID)
If hLKWCheck <> "" Then If hLKWCheck <> "" Then
Dim antwort As MsgBoxResult = MsgBox(hLKWCheck & vbCrLf & vbCrLf & "Wollen Sie den Eintrag trotzdem speichern?", CType(MsgBoxStyle.YesNo + MsgBoxStyle.Exclamation, MsgBoxStyle), Dim antwort As MsgBoxResult = MsgBox(hLKWCheck & vbCrLf & vbCrLf & "Wollen Sie den Eintrag trotzdem speichern?" & vbNewLine & "NEIN -> Springe zu existierendem Eintrag!", CType(MsgBoxStyle.YesNoCancel + MsgBoxStyle.Exclamation, MsgBoxStyle),
"Aviso-Eintrag") "Aviso-Eintrag")
If antwort = vbNo Then If antwort = vbNo Then
If temp_avisoID > 0 Then
Dim frmGrayOut = VERAG_PROG_ALLGEMEIN.cMeineFunktionenAVISO.grayoutForm()
Dim FRM As New frmSendungsdetailsNEU(temp_avisoID, -1)
FRM.ShowDialog(frmGrayOut)
frmGrayOut.Close()
Exit Sub Exit Sub
Else Else
MsgBox("AVISO-ID konnte nicht ermittelt werden")
Exit Sub
End If
ElseIf antwort = vbCancel Then
Exit Sub
Else
EintragMehrfach = True EintragMehrfach = True
End If End If
End If End If

View File

@@ -218,6 +218,9 @@ Public Class frmGesamtsicherheitenMenuNEU
Private Sub OpenFRM(sender As Object, e As DataGridViewCellEventArgs) Handles dgvListe.CellDoubleClick Private Sub OpenFRM(sender As Object, e As DataGridViewCellEventArgs) Handles dgvListe.CellDoubleClick
Try
Dim frm As New frmGesamtsicherheitenNEU Dim frm As New frmGesamtsicherheitenNEU
With frm With frm
.currentGesSichRef = GesSichRef .currentGesSichRef = GesSichRef
@@ -240,6 +243,10 @@ Public Class frmGesamtsicherheitenMenuNEU
Me.BringToFront() Me.BringToFront()
End Function End Function
frm.Show() frm.Show()
Catch ex As Exception
End Try
End Sub End Sub
Private Sub btnNeu_Click(sender As Object, e As EventArgs) Handles btnNeu.Click Private Sub btnNeu_Click(sender As Object, e As EventArgs) Handles btnNeu.Click

View File

@@ -603,6 +603,9 @@ Public Class frmGesamtsicherheitenNEU
Sub loadTitle() Sub loadTitle()
Try
txtGestellInfo.Text = "" txtGestellInfo.Text = ""
lblId.Text = "" lblId.Text = ""
Dim StandortSqlString As String = "select * from [tblGesamtsicherheit] where [gs_gsNr] = '" & indexGsNr & "'" Dim StandortSqlString As String = "select * from [tblGesamtsicherheit] where [gs_gsNr] = '" & indexGsNr & "'"
@@ -613,7 +616,7 @@ Public Class frmGesamtsicherheitenNEU
If dt.Rows.Count > 0 Then If dt.Rows.Count > 0 Then
Me.avisoID = setNullToZero(dt.Rows(0).Item("gs_avisoId")) Me.avisoID = setNullToZero(dt.Rows(0).Item("gs_avisoId"))
Me.LKWKZ = setNullToZero(dt.Rows(0).Item("gs_LKWKZ")) Me.LKWKZ = dt.Rows(0).Item("gs_LKWKZ")
Me.FilialNummer = setNullToZero(dt.Rows(0).Item("gs_filialenNr")) Me.FilialNummer = setNullToZero(dt.Rows(0).Item("gs_filialenNr"))
Me.Abfertigungsnummer = dt.Rows(0).Item("gs_abfertigungsNr") Me.Abfertigungsnummer = dt.Rows(0).Item("gs_abfertigungsNr")
Me.warenortID = setNullToZero(dt.Rows(0).Item("gs_warenort")) Me.warenortID = setNullToZero(dt.Rows(0).Item("gs_warenort"))
@@ -626,7 +629,9 @@ Public Class frmGesamtsicherheitenNEU
If Me.warenortID.Length > 0 Then txtGestellInfo.Text &= "Warenort: " & Me.warenortID & " " If Me.warenortID.Length > 0 Then txtGestellInfo.Text &= "Warenort: " & Me.warenortID & " "
If gessicherheitID <> 0 Then lblId.Text &= "GS-Nr: " & gessicherheitID 'currentSicherheit.gs_gsNr If gessicherheitID <> 0 Then lblId.Text &= "GS-Nr: " & gessicherheitID 'currentSicherheit.gs_gsNr
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
End Sub End Sub

View File

@@ -1654,6 +1654,7 @@ Public Class frmSendungsdetailsNEU
Case 44 Case 44
usrcntl_ATB.txtATBT1.Text = loadValue(SENDUNG_LIST(CURRENT_INDEX).tblSnd_ATB_T1, "") usrcntl_ATB.txtATBT1.Text = loadValue(SENDUNG_LIST(CURRENT_INDEX).tblSnd_ATB_T1, "")
usrcntl_ATB.txtATBNr.Text = loadValue(SENDUNG_LIST(CURRENT_INDEX).tblSnd_ATB_Nr, "") usrcntl_ATB.txtATBNr.Text = loadValue(SENDUNG_LIST(CURRENT_INDEX).tblSnd_ATB_Nr, "")
usrcntl_ATB.txtT1Datum.Text = loadValue(SENDUNG_LIST(CURRENT_INDEX).tblSnd_T1_Frist, "")
If SENDUNG_LIST(CURRENT_INDEX).tblSnd_ATBFakturieren Is Nothing Then If SENDUNG_LIST(CURRENT_INDEX).tblSnd_ATBFakturieren Is Nothing Then
usrcntl_ATB.cbxATBFakturieren.CheckState = CheckState.Indeterminate usrcntl_ATB.cbxATBFakturieren.CheckState = CheckState.Indeterminate
@@ -2099,6 +2100,7 @@ Public Class frmSendungsdetailsNEU
If pnlT1.Controls.Count > 0 AndAlso pnlT1.Controls(0).GetType Is GetType(usrCntlSND_ATBGestellung) Then If pnlT1.Controls.Count > 0 AndAlso pnlT1.Controls(0).GetType Is GetType(usrCntlSND_ATBGestellung) Then
SENDUNG_LIST(CURRENT_INDEX).tblSnd_ATB_T1 = usrcntl_ATB.txtATBT1.Text SENDUNG_LIST(CURRENT_INDEX).tblSnd_ATB_T1 = usrcntl_ATB.txtATBT1.Text
SENDUNG_LIST(CURRENT_INDEX).tblSnd_ATB_Nr = usrcntl_ATB.txtATBNr.Text SENDUNG_LIST(CURRENT_INDEX).tblSnd_ATB_Nr = usrcntl_ATB.txtATBNr.Text
SENDUNG_LIST(CURRENT_INDEX).tblSnd_T1_Frist = usrcntl_ATB.txtT1Datum.Text
Select Case usrcntl_ATB.cbxATBFakturieren.CheckState Select Case usrcntl_ATB.cbxATBFakturieren.CheckState
Case CheckState.Indeterminate : SENDUNG_LIST(CURRENT_INDEX).tblSnd_ATBFakturieren = Nothing Case CheckState.Indeterminate : SENDUNG_LIST(CURRENT_INDEX).tblSnd_ATBFakturieren = Nothing

View File

@@ -32,11 +32,17 @@ Partial Class usrCntlSND_ATBGestellung
Me.Label3 = New System.Windows.Forms.Label() Me.Label3 = New System.Windows.Forms.Label()
Me.txtT1VerzollungsadresseBestimmungszollstelle = New VERAG_PROG_ALLGEMEIN.MySearchBox() Me.txtT1VerzollungsadresseBestimmungszollstelle = New VERAG_PROG_ALLGEMEIN.MySearchBox()
Me.Label33 = New System.Windows.Forms.Label() Me.Label33 = New System.Windows.Forms.Label()
Me.Label1 = New System.Windows.Forms.Label()
Me.txtT1Datum = New VERAG_PROG_ALLGEMEIN.MyTextBox()
Me.DateTimePicker1 = New System.Windows.Forms.DateTimePicker()
Me.pnlT1.SuspendLayout() Me.pnlT1.SuspendLayout()
Me.SuspendLayout() Me.SuspendLayout()
' '
'pnlT1 'pnlT1
' '
Me.pnlT1.Controls.Add(Me.txtT1Datum)
Me.pnlT1.Controls.Add(Me.DateTimePicker1)
Me.pnlT1.Controls.Add(Me.Label1)
Me.pnlT1.Controls.Add(Me.btnGesSicherheit) Me.pnlT1.Controls.Add(Me.btnGesSicherheit)
Me.pnlT1.Controls.Add(Me.Button1) Me.pnlT1.Controls.Add(Me.Button1)
Me.pnlT1.Controls.Add(Me.cbxATBFakturieren) Me.pnlT1.Controls.Add(Me.cbxATBFakturieren)
@@ -48,7 +54,7 @@ Partial Class usrCntlSND_ATBGestellung
Me.pnlT1.Controls.Add(Me.Label33) Me.pnlT1.Controls.Add(Me.Label33)
Me.pnlT1.Location = New System.Drawing.Point(0, 0) Me.pnlT1.Location = New System.Drawing.Point(0, 0)
Me.pnlT1.Name = "pnlT1" Me.pnlT1.Name = "pnlT1"
Me.pnlT1.Size = New System.Drawing.Size(549, 101) Me.pnlT1.Size = New System.Drawing.Size(549, 125)
Me.pnlT1.TabIndex = 0 Me.pnlT1.TabIndex = 0
' '
'btnGesSicherheit 'btnGesSicherheit
@@ -77,7 +83,7 @@ Partial Class usrCntlSND_ATBGestellung
Me.cbxATBFakturieren.AutoSize = True Me.cbxATBFakturieren.AutoSize = True
Me.cbxATBFakturieren.Checked = True Me.cbxATBFakturieren.Checked = True
Me.cbxATBFakturieren.CheckState = System.Windows.Forms.CheckState.Indeterminate Me.cbxATBFakturieren.CheckState = System.Windows.Forms.CheckState.Indeterminate
Me.cbxATBFakturieren.Location = New System.Drawing.Point(121, 80) Me.cbxATBFakturieren.Location = New System.Drawing.Point(121, 102)
Me.cbxATBFakturieren.Name = "cbxATBFakturieren" Me.cbxATBFakturieren.Name = "cbxATBFakturieren"
Me.cbxATBFakturieren.Size = New System.Drawing.Size(153, 17) Me.cbxATBFakturieren.Size = New System.Drawing.Size(153, 17)
Me.cbxATBFakturieren.TabIndex = 24 Me.cbxATBFakturieren.TabIndex = 24
@@ -100,7 +106,7 @@ Partial Class usrCntlSND_ATBGestellung
Me.txtATBNr._Waehrung = False Me.txtATBNr._Waehrung = False
Me.txtATBNr._WaehrungZeichen = True Me.txtATBNr._WaehrungZeichen = True
Me.txtATBNr.ForeColor = System.Drawing.Color.Black Me.txtATBNr.ForeColor = System.Drawing.Color.Black
Me.txtATBNr.Location = New System.Drawing.Point(121, 30) Me.txtATBNr.Location = New System.Drawing.Point(121, 56)
Me.txtATBNr.MaxLineLength = -1 Me.txtATBNr.MaxLineLength = -1
Me.txtATBNr.MaxLines_Warning = "" Me.txtATBNr.MaxLines_Warning = ""
Me.txtATBNr.MaxLines_Warning_Label = Nothing Me.txtATBNr.MaxLines_Warning_Label = Nothing
@@ -135,7 +141,7 @@ Partial Class usrCntlSND_ATBGestellung
' '
Me.Label4.AutoSize = True 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.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, 33) Me.Label4.Location = New System.Drawing.Point(23, 59)
Me.Label4.Name = "Label4" Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(92, 13) Me.Label4.Size = New System.Drawing.Size(92, 13)
Me.Label4.TabIndex = 20 Me.Label4.TabIndex = 20
@@ -144,7 +150,7 @@ Partial Class usrCntlSND_ATBGestellung
'Label3 'Label3
' '
Me.Label3.AutoSize = True Me.Label3.AutoSize = True
Me.Label3.Location = New System.Drawing.Point(23, 59) Me.Label3.Location = New System.Drawing.Point(23, 81)
Me.Label3.Name = "Label3" Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(51, 13) Me.Label3.Size = New System.Drawing.Size(51, 13)
Me.Label3.TabIndex = 15 Me.Label3.TabIndex = 15
@@ -164,7 +170,7 @@ Partial Class usrCntlSND_ATBGestellung
Me.txtT1VerzollungsadresseBestimmungszollstelle.INVISIBLE_COLUMNS = Nothing Me.txtT1VerzollungsadresseBestimmungszollstelle.INVISIBLE_COLUMNS = Nothing
Me.txtT1VerzollungsadresseBestimmungszollstelle.key_visible = False Me.txtT1VerzollungsadresseBestimmungszollstelle.key_visible = False
Me.txtT1VerzollungsadresseBestimmungszollstelle.KEYPARAM = Nothing Me.txtT1VerzollungsadresseBestimmungszollstelle.KEYPARAM = Nothing
Me.txtT1VerzollungsadresseBestimmungszollstelle.Location = New System.Drawing.Point(121, 56) Me.txtT1VerzollungsadresseBestimmungszollstelle.Location = New System.Drawing.Point(121, 78)
Me.txtT1VerzollungsadresseBestimmungszollstelle.MaxLength = 8 Me.txtT1VerzollungsadresseBestimmungszollstelle.MaxLength = 8
Me.txtT1VerzollungsadresseBestimmungszollstelle.Name = "txtT1VerzollungsadresseBestimmungszollstelle" Me.txtT1VerzollungsadresseBestimmungszollstelle.Name = "txtT1VerzollungsadresseBestimmungszollstelle"
Me.txtT1VerzollungsadresseBestimmungszollstelle.searchActive = True Me.txtT1VerzollungsadresseBestimmungszollstelle.searchActive = True
@@ -186,11 +192,57 @@ Partial Class usrCntlSND_ATBGestellung
Me.Label33.TabIndex = 3 Me.Label33.TabIndex = 3
Me.Label33.Text = "Vorpapier / T1:" Me.Label33.Text = "Vorpapier / T1:"
' '
'Label1
'
Me.Label1.AutoSize = True
Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label1.Location = New System.Drawing.Point(158, 36)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(101, 13)
Me.Label1.TabIndex = 26
Me.Label1.Text = "Vorpapier / T1 Frist:"
'
'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 = "''"
Me.DateTimePicker1.Format = System.Windows.Forms.DateTimePickerFormat.Custom
Me.DateTimePicker1.Location = New System.Drawing.Point(272, 33)
Me.DateTimePicker1.Margin = New System.Windows.Forms.Padding(0)
Me.DateTimePicker1.Name = "DateTimePicker1"
Me.DateTimePicker1.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.DateTimePicker1.Size = New System.Drawing.Size(115, 20)
Me.DateTimePicker1.TabIndex = 39
'
'usrCntlSND_ATBGestellung 'usrCntlSND_ATBGestellung
' '
Me.Controls.Add(Me.pnlT1) Me.Controls.Add(Me.pnlT1)
Me.Name = "usrCntlSND_ATBGestellung" Me.Name = "usrCntlSND_ATBGestellung"
Me.Size = New System.Drawing.Size(553, 106) Me.Size = New System.Drawing.Size(553, 129)
Me.pnlT1.ResumeLayout(False) Me.pnlT1.ResumeLayout(False)
Me.pnlT1.PerformLayout() Me.pnlT1.PerformLayout()
Me.ResumeLayout(False) Me.ResumeLayout(False)
@@ -206,4 +258,7 @@ Partial Class usrCntlSND_ATBGestellung
Friend WithEvents cbxATBFakturieren As CheckBox Friend WithEvents cbxATBFakturieren As CheckBox
Friend WithEvents btnGesSicherheit As Button Friend WithEvents btnGesSicherheit As Button
Friend WithEvents Button1 As Button Friend WithEvents Button1 As Button
Friend WithEvents Label1 As Label
Friend WithEvents txtT1Datum As VERAG_PROG_ALLGEMEIN.MyTextBox
Friend WithEvents DateTimePicker1 As DateTimePicker
End Class End Class

View File

@@ -13,6 +13,7 @@ Public Class usrCntlSND_ATBGestellung
Dim AVISO As VERAG_PROG_ALLGEMEIN.cAviso = Nothing Dim AVISO As VERAG_PROG_ALLGEMEIN.cAviso = Nothing
Dim SND As VERAG_PROG_ALLGEMEIN.cSendungen = Nothing Dim SND As VERAG_PROG_ALLGEMEIN.cSendungen = Nothing
Dim gsnr_global As Integer = -1
Sub New(AVISO, SND) Sub New(AVISO, SND)
@@ -34,11 +35,25 @@ Public Class usrCntlSND_ATBGestellung
Dim f As frmSendungsdetailsNEU = Me.FindForm Dim f As frmSendungsdetailsNEU = Me.FindForm
If f.SAVE_ME() Then If f.SAVE_ME() Then
SND = f.SENDUNG_LIST(f.CURRENT_INDEX) 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.AbfertigungsNr) OrElse CInt(SND.AbfertigungsNr) < 100000 Then MsgBox("Abfertigungsnummer angeben!") : Exit Sub
If If(SND.tblSnd_ATB_T1, "") = "" Then MsgBox("MRN (Gestellung) 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
If CDate(SND.tblSnd_T1_Frist) <= Today() Then
'-> OK
Else
MsgBox("T1 Frist ist abgelaufen!")
Exit Sub
End If
Else
MsgBox("T1 Frist muss befüllt werden")
Exit Sub
End If
Dim Standort As String = "" Dim Standort As String = ""
Select Case SND.FilialenNr Select Case SND.FilialenNr
@@ -81,13 +96,20 @@ Public Class usrCntlSND_ATBGestellung
If GesSichRef Is Nothing Then MsgBox("Verwahrungsreferenz kann nicht ermittelt werden!") : Exit Sub If GesSichRef Is Nothing Then MsgBox("Verwahrungsreferenz kann nicht ermittelt werden!") : Exit Sub
Dim saldo = CDbl(GesSichRef.CalcSaldo()) Dim saldo = CDbl(GesSichRef.CalcSaldo())
If SND.tblSnd_Warenwert > saldo Then
If MsgBox("Gestellung kann NICHT durchgeführt werden!" & vbNewLine & "Eingetragener Warenwert: " & SND.tblSnd_Warenwert & " übersteigt den vorhandenen Sicherheitssaldo von: " & saldo & vbNewLine & "Trotzdem fortfahren", vbYesNoCancel) <> vbYes Then Exit Sub Dim sicherheitsbertrag As Double = SND.tblSnd_Warenwert * (GesSichRef.gsr_zollsatz / 100)
If sicherheitsbertrag > saldo Then
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 End If
Dim frMZA As New SDL.frmZollanmeldung("AA", Nothing, AVISO, SND, Now.ToString("yy")) Dim frMZA As New SDL.frmZollanmeldung("AA", Nothing, AVISO, SND, Now.ToString("yy"), GesSichRef, Standort)
frMZA.Show() frMZA.Show()
AddHandler frMZA.FormClosed, Sub() AddHandler frMZA.FormClosed, Sub()
initGesamtsicherheiten()
' initdgvZollAnmeldungen() ' initdgvZollAnmeldungen()
End Sub End Sub
Else Else
@@ -115,7 +137,7 @@ Public Class usrCntlSND_ATBGestellung
End If End If
End If End If
'falls nicht gefunden, 2 Schritt -> Gestellung nach AVISO ID, oder Aberftigungsnrand FilialNr 'falls nicht gefunden, 2 Schritt -> Gestellung nach AVISO ID, oder Aberftigungsnr and FilialNr
If gsnr = 0 Then 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 & " ) or gs_avisoId = '" & SND.tblSnd_AvisoID & "' order by gs_datum desc"
dt = SQL.loadDgvBySql(SQLString, "AVISO", 100, True) dt = SQL.loadDgvBySql(SQLString, "AVISO", 100, True)
@@ -124,13 +146,13 @@ Public Class usrCntlSND_ATBGestellung
End If End If
End If End If
gsnr_global = gsnr
If gsnr > 0 Then If gsnr > 0 Then
Dim gessicherheit As New cSicherheiten(gsnr) Dim gessicherheit As New cSicherheiten(gsnr)
Dim GesSichRef = New VERAG_PROG_ALLGEMEIN.cAufschubKonten(gessicherheit.gs_standort) Dim GesSichRef = New VERAG_PROG_ALLGEMEIN.cAufschubKonten(gessicherheit.gs_standort)
Dim frm As New frmGesamtsicherheitenNEU Dim frm As New frmGesamtsicherheitenNEU()
Select Case gessicherheit.gs_standort Select Case gessicherheit.gs_standort
Case "Verag GmbH" Case "Verag GmbH"
@@ -243,6 +265,58 @@ Public Class usrCntlSND_ATBGestellung
End Sub End Sub
Private Sub usrCntlSND_ATBGestellung_Load(sender As Object, e As EventArgs) Handles MyBase.Load
initGesamtsicherheiten()
End Sub
Private Sub initGesamtsicherheiten()
Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
Dim gsnr 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
'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"
dt = SQL.loadDgvBySql(SQLString, "AVISO", 100, True)
If dt.Rows.Count > 0 Then
gsnr = dt.Rows(0).Item("gs_gsNr")
End If
End If
'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"
dt = SQL.loadDgvBySql(SQLString, "AVISO", 100, True)
If dt.Rows.Count > 0 Then
gsnr = dt.Rows(0).Item("gs_gsNr")
End If
End If
gsnr_global = gsnr
If gsnr_global > 0 Then
btnGesSicherheit.Enabled = True
Button1.Enabled = False
Else
btnGesSicherheit.Enabled = False
Button1.Enabled = True
End If
End Sub
Private Sub DateTimePicker1_ValueChanged(sender As Object, e As EventArgs) Handles DateTimePicker1.ValueChanged
txtT1Datum._value = CDate(sender.value).ToShortDateString
End Sub
'Public Sub setValues() 'Public Sub setValues()