Gestellungen

This commit is contained in:
2024-11-13 13:05:44 +01:00
parent 20ef28a101
commit f35f070b9f
6 changed files with 66 additions and 44 deletions

View File

@@ -85,9 +85,10 @@ Public Class usrCntlSND_ATBGestellung
Dim dt As New DataTable
'erster Schritt -> Gestellung nach ATB-NR
'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 & "'"
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")
@@ -96,7 +97,7 @@ Public Class usrCntlSND_ATBGestellung
'falls nicht gefunden, 2 Schritt -> Gestellung nach AVISO ID, oder Aberftigungsnrand 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 & "' "
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")
@@ -158,7 +159,6 @@ Public Class usrCntlSND_ATBGestellung
Standort = "Unisped GmbH" : firmaId = 21
Case 5701
Standort = "AMBAR" : firmaId = 24
Case 5103
Standort = "VERAG CS" : firmaId = 11
Case 5501
@@ -183,6 +183,10 @@ Public Class usrCntlSND_ATBGestellung
.FilialNummer = SND.FilialenNr
.Abfertigungsnummer = SND.AbfertigungsNr
.firmaId = firmaId
.grenzstelle = AVISO.Grenzstelle.ToString.Replace("WO_", "")
.txtlkwIdSearch.Text = AVISO.LKW_Nr
.txtSicherheitWarenwert.Text = SND.tblSnd_Warenwert
.txtSicherheitATBNr.Text = txtATBT1.Text
End With
AddHandler frm.FormClosing, Function()
GesSichRef.CalcSaldo()