Gesamtsicherheiten Excel-Export für Zollamut und Plausibiltätsprüfungen, Export für Essensbestellungen verbessert.
This commit is contained in:
@@ -68,9 +68,6 @@ Public Class frmGesamtsicherheitenNEU
|
||||
|
||||
Me.Text = "Gesamtsicherheit " & Standort
|
||||
|
||||
|
||||
cbx_Suche_Warenort.fillWithSQL("SELECT [wo_warenort],CONCAT([wo_knnr],' - ' ,[wo_bezeichnung]) FROM [tblWarenorte] WHERE [wo_aktiv] ='1' AND wo_ze = 1 AND [wo_firma] = '" & firmaId & "' ORDER BY [wo_reihenfolge]", True, "AVISO", True)
|
||||
|
||||
If setNullToZero(gessicherheitID) = "" Or Neu = True Then
|
||||
|
||||
panOben.Enabled = False : panOben.Enabled = False
|
||||
@@ -106,16 +103,13 @@ Public Class frmGesamtsicherheitenNEU
|
||||
|
||||
Public Sub LoadDGVSicherheiten(Optional withFilterParam As Boolean = False)
|
||||
|
||||
|
||||
'lblSaldo.Text = "Saldo: € " & currentGesSichRef.gsr_Saldo.ToString()
|
||||
txtGestellInfo.Text = ""
|
||||
Dim sqladd1 As String = ""
|
||||
If currentGesSichRef.brgakto_gs_ustEnabled Then sqladd1 &= ", FORMAT((([gs_warenwert] + [gs_sicherheitsbetrag]) * " & currentGesSichRef.brgakto_gs_ust & "/100), 'C', 'de-DE') as gs_ust"
|
||||
If currentGesSichRef.brgakto_gs_ATR Then sqladd1 &= ", [gs_atr]"
|
||||
Dim sqlSearchSting As String = ""
|
||||
If withFilterParam = True Then
|
||||
If txt_Suche.Text <> "" Then sqlSearchSting &= "AND ([gs_abfertigungsNr] Like '%" & txt_Suche.Text & "%' OR [gs_ATBNr] Like '%" & txt_Suche.Text & "%' OR [gs_LKWKZ] like '%" & txt_Suche.Text & "%' OR [gs_avisoId] like '%" & txt_Suche.Text & "%' OR [gs_freitext] like '%" & txt_Suche.Text & "%')"
|
||||
If cbx_Suche_Warenort._value <> "" Then sqlSearchSting &= "AND gs_warenort like '%" & cbx_Suche_Warenort._value & "%'"
|
||||
If txtSuche.Text <> "" Then sqlSearchSting &= "AND ([gs_abfertigungsNr] Like '%" & txtSuche.Text & "%' OR [gs_ATBNr] Like '%" & txtSuche.Text & "%' OR [gs_LKWKZ] like '%" & txtSuche.Text & "%' OR [gs_avisoId] like '%" & txtSuche.Text & "%' OR [gs_freitext] like '%" & txtSuche.Text & "%')"
|
||||
If cbxRundPosanzeigen.Checked = False Then sqlSearchSting &= "AND ISNULL(gs_isRundungsdiff,0) = 0"
|
||||
End If
|
||||
|
||||
@@ -351,11 +345,11 @@ Public Class frmGesamtsicherheitenNEU
|
||||
|
||||
If dgvGesamtsicherheit.Enabled = False Then Exit Sub
|
||||
ATBNraendernToolStripMenuItem.Visible = True
|
||||
|
||||
btnAddPos.Visible = False
|
||||
Else
|
||||
LoadDGVSicherheitsPos(-1, True)
|
||||
ATBNraendernToolStripMenuItem.Visible = False
|
||||
|
||||
'btnAddPos.Visible = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -363,20 +357,19 @@ Public Class frmGesamtsicherheitenNEU
|
||||
|
||||
'If gsNr = "" Then Exit Sub
|
||||
|
||||
Dim sqlSearchSting As String = ""
|
||||
Dim sqlSearch As String = ""
|
||||
|
||||
If withFilterParam = True Then
|
||||
sqlSearchSting &= "And gsp_gsid In (Select gs_gsId from [tblGesamtsicherheit] where [gs_gsnr] = '" & gessicherheitID & "'"
|
||||
If txt_Suche.Text <> "" Then sqlSearchSting &= "AND ([gs_abfertigungsNr] Like '%" & txt_Suche.Text & "%' OR [gs_ATBNr] Like '%" & txt_Suche.Text & "%' OR [gs_LKWKZ] like '%" & txt_Suche.Text & "%' OR [gs_avisoId] like '%" & txt_Suche.Text & "%' OR [gs_freitext] like '%" & txt_Suche.Text & "%')"
|
||||
If cbx_Suche_Warenort._value <> "" Then sqlSearchSting &= " AND gs_warenort like '%" & cbx_Suche_Warenort._value & "%'"
|
||||
If cbxRundPosanzeigen.Checked = False Then sqlSearchSting &= "AND ISNULL(gsp_isPosRundungsdiff,0) = 0"
|
||||
sqlSearchSting &= ")"
|
||||
sqlSearch &= "And gsp_gsid In (Select gs_gsId from [tblGesamtsicherheit] where [gs_gsnr] = '" & gessicherheitID & "'"
|
||||
If txtSuche.Text <> "" Then sqlSearch &= "AND ([gs_abfertigungsNr] Like '%" & txtSuche.Text & "%' OR [gs_ATBNr] Like '%" & txtSuche.Text & "%' OR [gs_LKWKZ] like '%" & txtSuche.Text & "%' OR [gs_avisoId] like '%" & txtSuche.Text & "%' OR [gs_freitext] like '%" & txtSuche.Text & "%')"
|
||||
If cbxRundPosanzeigen.Checked = False Then sqlSearch &= "AND ISNULL(gsp_isPosRundungsdiff,0) = 0"
|
||||
sqlSearch &= ")"
|
||||
End If
|
||||
|
||||
|
||||
Dim SQLStringCRN As String =
|
||||
"select [gsp_gspPosId],[gsp_ATCNr],[gsp_datum],[gsp_gsId],[gsp_gsnr],[gsp_warenwert],[gsp_sicherheitsbetrag], [gsp_freitext]" &' ,[gsp_avisoId] ,[gsp_ust] ,[gsp_filialenNr],[gsp_abfertigungsNr] ,[gsp_MRNNr], [gsp_art]
|
||||
"From [tblGesamtsicherheitsPositionen] inner join [tblGesamtsicherheit] on gs_gsId = gsp_gsId where [gsp_gsnr] = '" & gsNr & "'" & sqlSearchSting & " order by [gs_ATBNr], [gs_posNr]"
|
||||
"From [tblGesamtsicherheitsPositionen] inner join [tblGesamtsicherheit] on gs_gsId = gsp_gsId where [gsp_gsnr] = '" & gsNr & "'" & sqlSearch & " order by [gs_ATBNr], [gs_posNr]"
|
||||
|
||||
dgvSicherheitsPos.SET_SQL(SQLStringCRN, "AVISO", ,)
|
||||
dgvSicherheitsPos.LOAD()
|
||||
@@ -427,20 +420,7 @@ Public Class frmGesamtsicherheitenNEU
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
'Private Sub dgvSicherheitsPos_SelectionChanged(sender As Object, e As EventArgs) Handles dgvSicherheitsPos.SelectionChanged
|
||||
' If dgvSicherheitsPos.SelectedRows.Count > 0 Then
|
||||
|
||||
' indexGspPosId = CInt(dgvSicherheitsPos.SelectedRows(0).Cells("gsp_gspPosId").Value)
|
||||
' currentSPos = New cGesamtsicherheitsPositionen(indexGsId, indexGspPosId)
|
||||
|
||||
' If dgvSicherheitsPos.Enabled = False Then Exit Sub
|
||||
|
||||
' End If
|
||||
'End Sub
|
||||
|
||||
Sub loadTitle()
|
||||
'Dim StandortSqlString As String = "select * from [tblGesamtsicherheit] where [gs_gsNr] = '" & gessicherheitID & "'"
|
||||
|
||||
txtGestellInfo.Text = ""
|
||||
lblId.Text = ""
|
||||
@@ -483,8 +463,6 @@ Public Class frmGesamtsicherheitenNEU
|
||||
|
||||
Private Sub Warenwert_TextChanged(sender As Object, e As EventArgs) Handles txtSicherheitWarenwert.TextChanged, txtPosWarenwert.TextChanged
|
||||
|
||||
|
||||
|
||||
If Not IsNumeric(txtSicherheitWarenwert.Text) And sender.name = "txtSicherheitWarenwert" Then
|
||||
txtSicherheitWarenwert.ForeColor = Color.Red
|
||||
Exit Sub
|
||||
@@ -493,7 +471,6 @@ Public Class frmGesamtsicherheitenNEU
|
||||
|
||||
End If
|
||||
|
||||
|
||||
If Not IsNumeric(txtPosWarenwert.Text) And sender.name = "txtPosWarenwert" Then
|
||||
txtPosWarenwert.ForeColor = Color.Red
|
||||
Exit Sub
|
||||
@@ -600,21 +577,26 @@ Public Class frmGesamtsicherheitenNEU
|
||||
End Sub
|
||||
|
||||
Private Sub btnAddSicherheit_Click(sender As Object, e As EventArgs) Handles btnAddSicherheit.Click
|
||||
|
||||
If checkNothingValue(txtSicherheitSicherheitsbetrag.Text, "Double") IsNot Nothing Then
|
||||
Dim sichBetr As Double = Double.Parse(txtSicherheitSicherheitsbetrag.Text)
|
||||
If checkSaldo(sichBetr, True) = False Then Exit Sub
|
||||
End If
|
||||
|
||||
Dim attachPosNrToExistingATB As Boolean = False
|
||||
|
||||
Try
|
||||
|
||||
If (txtSicherheitATBNr.Text = "") Then
|
||||
txtSicherheitATBNr.Focus()
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If (txtAnzahlPos.Text = "") Then
|
||||
txtAnzahlPos.Focus()
|
||||
Exit Sub
|
||||
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
|
||||
End If
|
||||
|
||||
Dim attachPosNrToExistingATB As Boolean = False
|
||||
|
||||
Dim limit As Integer = Integer.Parse(setNullToZero(txtAnzahlPos.Text))
|
||||
|
||||
|
||||
@@ -1056,7 +1038,6 @@ Public Class frmGesamtsicherheitenNEU
|
||||
cboFiliale.fillWithSQL("SELECT FilialenNr, cast(FilialenNr as varchar(4)) + ' ' + Grenzstelle FROM Filialen WHERE Fil_Status='A' ORDER BY FilialenNr ", True, "FMZOLL", True)
|
||||
cboFiliale.SelectedIndex = cboFiliale.FindString(Me.FilialNummer)
|
||||
cboWarenort.fillWithSQL("SELECT [wo_warenort],CONCAT([wo_knnr],' - ' ,[wo_bezeichnung]) FROM [tblWarenorte] WHERE [wo_aktiv] ='1' AND wo_ze = 1 AND [wo_firma] = '" & firmaId & "' ORDER BY [wo_reihenfolge] ", True, "AVISO", True)
|
||||
cboWarenort.SelectedIndex = cbx_Suche_Warenort.FindString(Me.warenortID)
|
||||
txtlkwIdSearch.initSearchBox(Me.FindForm, " LKW_Nr, avisoID, CAST(datum As Date) As Datum FROM [Aviso]", {"LKW_Nr", "AvisoID", "Datum"}, "", "Datum desc", "LKW_Nr", "AvisoId", "AVISO",, 250, 200)
|
||||
txtlkwIdSearch.SET_VALUE(avisoID)
|
||||
txtAbfertNum.Text = Me.Abfertigungsnummer
|
||||
@@ -1109,7 +1090,7 @@ Public Class frmGesamtsicherheitenNEU
|
||||
|
||||
End Function
|
||||
|
||||
Private Sub btnSuche_Click(sender As Object, e As EventArgs) Handles btnSuche.Click
|
||||
Private Sub btnSuche_Click(sender As Object, e As EventArgs)
|
||||
Try
|
||||
If Me.Visible Then LoadDGVSicherheiten(True)
|
||||
Catch ex As Exception
|
||||
@@ -1121,24 +1102,19 @@ Public Class frmGesamtsicherheitenNEU
|
||||
panOverlay.Visible = True
|
||||
End Sub
|
||||
|
||||
Private Sub btn_resetSearch_Click(sender As Object, e As EventArgs) Handles btn_resetSearch.Click
|
||||
Private Sub btn_resetSearch_Click(sender As Object, e As EventArgs)
|
||||
|
||||
Dim dgv As String = ""
|
||||
For Each c As DataGridViewColumn In dgvGesamtsicherheit.Columns
|
||||
dgv &= c.Width & c.HeaderText & vbCrLf
|
||||
Next
|
||||
|
||||
clearSearchFields()
|
||||
|
||||
LoadDGVSicherheiten()
|
||||
currentGesSichRef.LOAD()
|
||||
LoadStandort()
|
||||
End Sub
|
||||
|
||||
Private Sub clearSearchFields()
|
||||
cbx_Suche_Warenort.changeItem("")
|
||||
txt_Suche.Clear()
|
||||
End Sub
|
||||
|
||||
|
||||
Private Function checkSicherheitsbetrag() As Boolean
|
||||
|
||||
@@ -1152,7 +1128,7 @@ Public Class frmGesamtsicherheitenNEU
|
||||
' Return False
|
||||
'End If
|
||||
|
||||
If (offenerSicherheitsbetrag <0 Or offenerSicherheitsbetrag <offenerSicherheitsbetragPos) Then
|
||||
If (offenerSicherheitsbetrag < 0 Or offenerSicherheitsbetrag < offenerSicherheitsbetragPos) Then
|
||||
If vbYes = MsgBox("Der Warenwert der Positionen übersteigt den Warenwert der Gestellung!" & vbCrLf & "Trotzdem speichen?", vbYesNo) Then
|
||||
Return True
|
||||
Else
|
||||
@@ -1901,8 +1877,8 @@ Public Class frmGesamtsicherheitenNEU
|
||||
|
||||
If datumPos <> Nothing And dgvGesamtsicherheit.Rows.Count > 0 Then
|
||||
If IsDate(dgvGesamtsicherheit.Rows(0).Cells("gs_datum").Value) Then
|
||||
If datumPos < dgvGesamtsicherheit.Rows(0).Cells("gs_datum").Value Then
|
||||
MsgBox("Datum/Uhrzeit der Pos-Gestellung darf zeitlich nicht vor der Gestellung liegen! (" & dgvGesamtsicherheit.Rows(0).Cells("gs_datum").Value & ")")
|
||||
If datumPos <= dgvGesamtsicherheit.Rows(0).Cells("gs_datum").Value Then
|
||||
MsgBox("Datum/Uhrzeit des Gestellungsausganges muss zeitlich nach dem Gestellungseingang liegen! (" & dgvGesamtsicherheit.Rows(0).Cells("gs_datum").Value & ")")
|
||||
checkOK = False
|
||||
End If
|
||||
End If
|
||||
@@ -1911,4 +1887,37 @@ Public Class frmGesamtsicherheitenNEU
|
||||
Return checkOK
|
||||
End Function
|
||||
|
||||
|
||||
Private Function checkMandatoryFields() As Boolean
|
||||
|
||||
Dim valuesOK As Boolean = True
|
||||
|
||||
If (txtAnzahlPos.Text = "") Then
|
||||
txtAnzahlPos.Focus()
|
||||
valuesOK = False
|
||||
End If
|
||||
|
||||
|
||||
Return valuesOK
|
||||
|
||||
End Function
|
||||
|
||||
Private Sub txt_Suche_KeyDown(sender As Object, e As KeyEventArgs) Handles txtSuche.KeyDown
|
||||
If e.KeyCode = Keys.Enter Then
|
||||
If txtSuche.Text <> "" Then
|
||||
If Me.Visible Then LoadDGVSicherheiten(True)
|
||||
e.Handled = True
|
||||
Else
|
||||
If Me.Visible Then LoadDGVSicherheiten(True)
|
||||
e.Handled = True
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub txtAnzahlPos_Leave(sender As Object, e As EventArgs) Handles txtAnzahlPos.Leave
|
||||
If txtAnzahlPos.Text = "" Then
|
||||
txtAnzahlPos.Text = 1
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user