This commit is contained in:
2024-11-04 15:14:04 +01:00
6 changed files with 767 additions and 559 deletions

View File

@@ -633,8 +633,6 @@ Public Class frmGesamtsicherheitenNEU
End If
If checkNothingValue(txtSicherheitSicherheitsbetrag.Text, "Double") IsNot Nothing Then
Dim sichBetr As Double = Double.Parse(txtSicherheitSicherheitsbetrag.Text)
If checkSaldo(sichBetr, True) = False Then Exit Sub

File diff suppressed because it is too large Load Diff

View File

@@ -406,6 +406,7 @@ Public Class frmSendungsdetailsNEU
Private Sub frmSendungsdetails_Load(sender As Object, e As EventArgs) Handles Me.Load
VERAG_PROG_ALLGEMEIN.cAllgemein._TRANSLATE(Me)
Button23.Visible = True
btnWWberechnen.Visible = False
If UNBOUND Then
FlowLayoutPanel.Visible = False
@@ -1549,6 +1550,9 @@ Public Class frmSendungsdetailsNEU
End If
pnlT1.Controls.Add(usrcntl_ATB)
btnWWberechnen.Visible = True
End Select
cboAbfertigungsart_SelectedIndexChanged(cboAbfertigungsart, New EventArgs)
@@ -7364,4 +7368,93 @@ Public Class frmSendungsdetailsNEU
Panel22.BackColor = Color.FromArgb(255, 255, 192)
End If
End Sub
Private Sub btnWWberechnen_Click(sender As Object, e As EventArgs) Handles btnWWberechnen.Click
Dim calcWarenwerte As Double = 0
Dim vorpT1 = usrcntl_ATB.txtATBT1.Text
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 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
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
If 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
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
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
End Sub
End Class

View File

@@ -23,6 +23,7 @@ Partial Class usrCntlSND_ATBGestellung
<System.Diagnostics.DebuggerStepThrough()>
Private Sub InitializeComponent()
Me.pnlT1 = New System.Windows.Forms.Panel()
Me.btnGesSicherheit = New System.Windows.Forms.Button()
Me.Button1 = New System.Windows.Forms.Button()
Me.cbxATBFakturieren = New System.Windows.Forms.CheckBox()
Me.txtATBNr = New VERAG_PROG_ALLGEMEIN.MyTextBox()
@@ -36,6 +37,7 @@ Partial Class usrCntlSND_ATBGestellung
'
'pnlT1
'
Me.pnlT1.Controls.Add(Me.btnGesSicherheit)
Me.pnlT1.Controls.Add(Me.Button1)
Me.pnlT1.Controls.Add(Me.cbxATBFakturieren)
Me.pnlT1.Controls.Add(Me.txtATBNr)
@@ -49,6 +51,15 @@ Partial Class usrCntlSND_ATBGestellung
Me.pnlT1.Size = New System.Drawing.Size(549, 101)
Me.pnlT1.TabIndex = 0
'
'btnGesSicherheit
'
Me.btnGesSicherheit.Location = New System.Drawing.Point(417, 3)
Me.btnGesSicherheit.Name = "btnGesSicherheit"
Me.btnGesSicherheit.Size = New System.Drawing.Size(113, 49)
Me.btnGesSicherheit.TabIndex = 25
Me.btnGesSicherheit.Text = "Gesamtsicherheit (Verwahrung)"
Me.btnGesSicherheit.UseVisualStyleBackColor = True
'
'Button1
'
Me.Button1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
@@ -192,5 +203,6 @@ Partial Class usrCntlSND_ATBGestellung
Friend WithEvents Label4 As Label
Friend WithEvents txtATBNr As VERAG_PROG_ALLGEMEIN.MyTextBox
Friend WithEvents cbxATBFakturieren As CheckBox
Friend WithEvents btnGesSicherheit As Button
Friend WithEvents Button1 As Button
End Class

View File

@@ -1,8 +1,14 @@
Imports DAKOSY_Worker
Imports SDL
Imports VERAG_PROG_ALLGEMEIN
Public Class usrCntlSND_ATBGestellung
Dim _SendungsId As Object
Public firmaId As Integer
'Public NCTS_GA As VERAG_PROG_ALLGEMEIN.cNCTSGestellungsadressen
Dim AVISO As VERAG_PROG_ALLGEMEIN.cAviso = Nothing
@@ -10,6 +16,7 @@ Public Class usrCntlSND_ATBGestellung
Sub New(AVISO, SND)
' Dieser Aufruf ist für den Designer erforderlich.
InitializeComponent()
@@ -40,10 +47,96 @@ Public Class usrCntlSND_ATBGestellung
MsgBox("Fehler beim Speichern. Ankunftsanzeige abgebrochen.")
End If
Me.Cursor = Cursors.Default
End Sub
Private Sub btnGesSicherheit_Click(sender As Object, e As EventArgs) Handles btnGesSicherheit.Click
If txtATBT1.Text <> "" Then
Dim Standort = ""
Select Case SND.FilialenNr
Case 4803, 4809
Standort = "VERAG AG" : firmaId = 1
Case 5601
Standort = "Unisped GmbH" : firmaId = 21
Case 5701
Standort = "AMBAR" : firmaId = 24
Case 4810,
Standort = "VERAG GmbH" : firmaId = 1
Case 5103
Standort = "VERAG CS" : firmaId = 11
Case 5501
Standort = "IMEX" : firmaId = 20
End Select
Dim GesSichRef = New VERAG_PROG_ALLGEMEIN.cAufschubKonten(Standort)
If GesSichRef Is Nothing Then
Exit Sub
End If
Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
Dim gsid As Integer = 0
Dim SQLString As String = "Select top (1) gs_gsNr from [tblGesamtsicherheit] where [gs_ATBNr] = '" & txtATBT1.Text & "' or ([gs_filialenNr] = '" & SND.FilialenNr & "' and [gs_abfertigungsNr] = " & SND.AbfertigungsNr & " ) or gs_avisoId = '" & SND.tblSnd_AvisoID & "' "
Dim dt As New DataTable
dt = SQL.loadDgvBySql(SQLString, "AVISO", 100, True)
If dt.Rows.Count > 0 Then
gsid = dt.Rows(0).Item("gs_gsNr")
End If
Dim frm As New frmGesamtsicherheitenNEU
If gsid > 0 Then
Dim gessicherheit As New cSicherheiten(gsid)
With frm
.currentGesSichRef = GesSichRef
.gessicherheitID = gessicherheit.gs_gsId
.Standort = Standort
.FilialNummer = gessicherheit.gs_filialenNr
.Abfertigungsnummer = gessicherheit.gs_abfertigungsnr
.warenortID = gessicherheit.gs_warenort
.LKWKZ = gessicherheit.gs_LKWKZ
.firmaId = firmaId
End With
AddHandler frm.FormClosing, Function()
GesSichRef.CalcSaldo()
Me.BringToFront()
End Function
frm.Show()
Else
With frm
.currentGesSichRef = GesSichRef
.Standort = Standort
.datum = Date.Now
.Neu = True
.FilialNummer = SND.FilialenNr
.Abfertigungsnummer = SND.AbfertigungsNr
.firmaId = firmaId
End With
AddHandler frm.FormClosing, Function()
GesSichRef.CalcSaldo()
Me.BringToFront()
End Function
frm.Show(Me)
End If
End If
End Sub
'Public Sub setValues()
' txtATBT1.Text = If(NCTS_GA.nga_name, "")
' txtT1VerzollungsadresseStrasse.Text = If(NCTS_GA.nga_strasse, "")

View File

@@ -1533,8 +1533,8 @@ Public Class usrcntlAktDetails
End Sub
Sub ArrowDown_ShowHide()
If isFailureShown Then Exit Sub
picArrowDown.Visible = False
If isFailureShown Then Exit Sub
If dgvSendungen.RowCount = 0 Then Exit Sub
Select Case tbcntlVermerke.SelectedIndex
Case 0, 1, 2
@@ -1543,7 +1543,7 @@ Public Class usrcntlAktDetails
For Each r As DataGridViewRow In gridVermerke.Rows
If r.Displayed Then showFirst = True
If showFirst Then
If (r.Cells("Hervorheben") IsNot Nothing AndAlso r.Cells("Hervorheben").Value = "1" Or r.Cells("VermerkeOptions") IsNot Nothing AndAlso r.Cells("VermerkeOptions").Value <> "") AndAlso Not r.Displayed Then
If ((r.Cells("Hervorheben") IsNot Nothing AndAlso r.Cells("Hervorheben").Value = "1") Or (r.Cells("VermerkeOptions") IsNot Nothing AndAlso r.Cells("VermerkeOptions").Value <> "")) AndAlso Not r.Displayed Then
picArrowDown.Visible = True
End If
End If