Gestellungen
This commit is contained in:
@@ -2225,6 +2225,8 @@ Public Class frmSendungsdetailsNEU
|
||||
'cbxSpedBuch.Checked = (posnr.Filiale > 0 And posnr.Abfertigungsnummer > 0 And posnr.UnterNr >= 0) ' Wenn Sped Eintrag gelöscht-> - 1, dann ist der Eintrag nicht mehr vorhanden
|
||||
Dim vorhanden = ADMIN.getValueTxtBySql("SELECT COUNT(*) FROM [Speditionsbuch] WHERE [FilialenNr]='" & cboFiliale._value & "' AND AbfertigungsNr='" & txtAbfertigungsnummer.Text & "'", "FMZOLL") ' AND UnterNr='" & txtUnterNr.Text & "'
|
||||
cbxSpedBuch.Checked = (vorhanden > 0)
|
||||
|
||||
|
||||
End If
|
||||
|
||||
lblAbfNrExists.Visible = checkDoppelAbfNr()
|
||||
@@ -7372,56 +7374,62 @@ Public Class frmSendungsdetailsNEU
|
||||
Private Sub btnWWberechnen_Click(sender As Object, e As EventArgs) Handles btnWWberechnen.Click
|
||||
Dim calcWarenwerte As Double = 0
|
||||
Dim vorpT1 = usrcntl_ATB.txtATBT1.Text
|
||||
Try
|
||||
|
||||
If SENDUNG_LIST(CURRENT_INDEX).tblSnd_WarenwertWaehrung = "" Then
|
||||
txtWarenwertWaehrung.SET_VALUE("EUR")
|
||||
SAVE_ME()
|
||||
End If
|
||||
If SENDUNG_LIST(CURRENT_INDEX).tblSnd_WarenwertWaehrung = "" Then
|
||||
txtWarenwertWaehrung.SET_VALUE("EUR")
|
||||
SAVE_ME()
|
||||
End If
|
||||
|
||||
If vorpT1 = "" Then
|
||||
MsgBox("Vorpapier/T1 muss eingetragen werden!")
|
||||
usrcntl_ATB.txtATBT1.Focus()
|
||||
Exit Sub
|
||||
End If
|
||||
If vorpT1 = "" Then
|
||||
MsgBox("Vorpapier/T1 muss eingetragen werden!")
|
||||
usrcntl_ATB.txtATBT1.Focus()
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If SENDUNG_LIST(CURRENT_INDEX).tblSnd_WarenwertWaehrung <> "EUR" Then
|
||||
MsgBox("Warenwert darf nur in EUR angegeben werden")
|
||||
Exit Sub
|
||||
End If
|
||||
If SENDUNG_LIST(CURRENT_INDEX).tblSnd_WarenwertWaehrung <> "EUR" Then
|
||||
MsgBox("Warenwert darf nur in EUR angegeben werden")
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
|
||||
|
||||
For Each s As cSendungen In SENDUNG_LIST
|
||||
'nur Betrag EUR
|
||||
If s.tblSnd_Vorpapier = vorp Then
|
||||
If s.tblSnd_WarenwertWaehrung = "EUR" AndAlso s.tblSnd_Warenwert > 0 AndAlso s.FilialenNr = SENDUNG_LIST(CURRENT_INDEX).FilialenNr Then
|
||||
calcWarenwerte += s.tblSnd_Warenwert
|
||||
Else
|
||||
MsgBox("Bei Sendung " & s.AbfertigungsNr & " ist der Warenwert nicht in EUR angegeben!")
|
||||
Exit Sub
|
||||
For Each s As cSendungen In SENDUNG_LIST
|
||||
'nur Betrag EUR
|
||||
If s.tblSnd_Vorpapier = vorp Then
|
||||
If s.tblSnd_WarenwertWaehrung = "EUR" AndAlso s.tblSnd_Warenwert > 0 AndAlso s.FilialenNr = SENDUNG_LIST(CURRENT_INDEX).FilialenNr Then
|
||||
calcWarenwerte += s.tblSnd_Warenwert
|
||||
Else
|
||||
MsgBox("Bei Sendung " & s.AbfertigungsNr & " ist der Warenwert nicht in EUR angegeben!")
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
If SENDUNG_LIST(CURRENT_INDEX).tblSnd_Warenwert Is Nothing Then
|
||||
SENDUNG_LIST(CURRENT_INDEX).tblSnd_Warenwert = Math.Round(calcWarenwerte, 2)
|
||||
SAVE_ME()
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
If SENDUNG_LIST(CURRENT_INDEX).tblSnd_Warenwert Is Nothing Then
|
||||
SENDUNG_LIST(CURRENT_INDEX).tblSnd_Warenwert = Math.Round(calcWarenwerte, 2)
|
||||
SAVE_ME()
|
||||
End If
|
||||
|
||||
|
||||
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)
|
||||
If IsNumeric(SENDUNG_LIST(CURRENT_INDEX).tblSnd_Warenwert) AndAlso Math.Round(calcWarenwerte, 2) <> Math.Round(SENDUNG_LIST(CURRENT_INDEX).tblSnd_Warenwert, 2) 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
|
||||
Else
|
||||
|
||||
txtWarenwert.Text = Math.Round(calcWarenwerte, 2)
|
||||
If txtWarenwertWaehrung._value = "" Then
|
||||
txtWarenwertWaehrung._value = "EUR"
|
||||
txtWarenwert.Text = Math.Round(calcWarenwerte, 2)
|
||||
If txtWarenwertWaehrung._value = "" Then
|
||||
txtWarenwertWaehrung._value = "EUR"
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
Catch ex As Exception
|
||||
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user