diff --git a/Aviso/frmSendungsdetailsNEU.vb b/Aviso/frmSendungsdetailsNEU.vb index d71213b..681b417 100644 --- a/Aviso/frmSendungsdetailsNEU.vb +++ b/Aviso/frmSendungsdetailsNEU.vb @@ -7411,48 +7411,15 @@ Public Class frmSendungsdetailsNEU End If - If Math.Round(calcWarenwerte, 2) <> Math.Round(SENDUNG_LIST(CURRENT_INDEX).tblSnd_Warenwert, 2) Then + If Math.Round(calcWarenwerte, 2) <> Math.Round(SENDUNG_LIST(CURRENT_INDEX).tblSnd_Warenwert, 2) AndAlso SENDUNG_LIST(CURRENT_INDEX).tblSnd_Warenwert <> "" Then MsgBox("Warenwert für Gestellung stimmt nicht überein!" & vbNewLine & "Berechnerter Warenwert: " & Math.Round(calcWarenwerte, 2) & vbNewLine & "Eingetragener Warenwert: " & Math.Round(SENDUNG_LIST(CURRENT_INDEX).tblSnd_Warenwert, 2), MsgBoxStyle.Critical) Else - Dim Standort As String = "" - - - Select Case SENDUNG_LIST(CURRENT_INDEX).FilialenNr - Case 4803, 4809 - Standort = "VERAG AG" - Case 5601 - Standort = "Unisped GmbH" - Case 5701 - Standort = "AMBAR" - Case 4810, - Standort = "VERAG GmbH" - Case 5103 - Standort = "VERAG CS" - Case 5501 - Standort = "IMEX" - - End Select - - - - Dim GesSichRef = New VERAG_PROG_ALLGEMEIN.cGesamtsicherheitsReferenz(Standort) - - If GesSichRef Is Nothing Then - Exit Sub + txtWarenwert.Text = Math.Round(calcWarenwerte, 2) + If txtWarenwertWaehrung._value = "" Then + txtWarenwertWaehrung._value = "EUR" End If - - Dim saldo = GesSichRef.CalcSaldo() - If calcWarenwerte > saldo Then - MsgBox("Gestellung kann NICHT durchgeführt werden!" & vbNewLine & "Eingetragener Warenwert: " & calcWarenwerte & " übersteigt den vorhandenen Saldo von: " & saldo, MsgBoxStyle.Critical) - Else - MsgBox("Gestellung kann durchgeführt werden!") - End If - - - - End If diff --git a/Aviso/usrCntlSND_ATBGestellung.vb b/Aviso/usrCntlSND_ATBGestellung.vb index 17a0050..2729cc9 100644 --- a/Aviso/usrCntlSND_ATBGestellung.vb +++ b/Aviso/usrCntlSND_ATBGestellung.vb @@ -38,6 +38,33 @@ Public Class usrCntlSND_ATBGestellung 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 + + Dim Standort As String = "" + + Select Case SND.FilialenNr + Case 4803, 4809 + Standort = "VERAG AG" + Case 5601 + Standort = "Unisped GmbH" + Case 5701 + Standort = "AMBAR" + Case 4810, + Standort = "VERAG GmbH" + Case 5103 + Standort = "VERAG CS" + Case 5501 + Standort = "IMEX" + + End Select + + Dim GesSichRef = New VERAG_PROG_ALLGEMEIN.cGesamtsicherheitsReferenz(Standort) + If GesSichRef Is Nothing Then MsgBox("Verwahrungsreferenz kann nicht ermittelt werden!") : Exit Sub + + 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 + End If + Dim frMZA As New SDL.frmZollanmeldung("AA", Nothing, AVISO, SND, Now.ToString("yy")) frMZA.Show() AddHandler frMZA.FormClosed, Sub()