bugfixing_gesamtsicherheiten
This commit is contained in:
@@ -95,7 +95,7 @@ Public Class frmGesamtsicherheitenNEU
|
||||
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.Text & "%'"
|
||||
If cbx_Suche_Warenort._value <> "" Then sqlSearchSting &= "AND gs_warenort like '%" & cbx_Suche_Warenort._value & "%'"
|
||||
End If
|
||||
|
||||
'Dim addtosqlstring As String = ""
|
||||
@@ -118,28 +118,30 @@ Public Class frmGesamtsicherheitenNEU
|
||||
Select Case currentGesSichRef.gsr_ATR
|
||||
Case True
|
||||
.Columns("gs_ATBNr").HeaderText = "ATB"
|
||||
.Columns("gs_ATBNr").Width = 130
|
||||
.Columns("gs_atr").HeaderText = "MRN"
|
||||
.Columns("gs_atr").Visible = True
|
||||
.Columns("gs_atr").Width = 33
|
||||
.Columns("gs_ust").Width = 69
|
||||
.Columns("gs_atr").Width = 35
|
||||
.Columns("gs_ust").Width = 70
|
||||
.Columns("gs_ust").HeaderText = "Ust"
|
||||
Case Else
|
||||
.Columns("gs_ATBNr").HeaderText = "ATB"
|
||||
.Columns("gs_ATBNr").Width = 150
|
||||
End Select
|
||||
.Columns("gs_ATBNr").Width = 146
|
||||
|
||||
|
||||
.Columns("gs_posNr").Width = 35
|
||||
.Columns("gs_posNr").HeaderText = "Pos#"
|
||||
.Columns("gs_datum").Width = 95
|
||||
.Columns("gs_datum").HeaderText = "Datum"
|
||||
.Columns("gs_warenwert").Width = 100
|
||||
.Columns("gs_warenwert").Width = 85
|
||||
.Columns("gs_warenwert").HeaderText = "Warenwert"
|
||||
.Columns("gs_saldo").Width = 100
|
||||
.Columns("gs_saldo").HeaderText = "Saldo"
|
||||
|
||||
.Columns("gs_sicherheitsbetrag").Width = 85
|
||||
.Columns("gs_sicherheitsbetrag").HeaderText = "S-Betrag"
|
||||
.Columns("gs_freitext").AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill
|
||||
.Columns("gs_freitext").HeaderText = "Freitext"
|
||||
End With
|
||||
|
||||
End If
|
||||
@@ -176,12 +178,15 @@ Public Class frmGesamtsicherheitenNEU
|
||||
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.Text & "%'"
|
||||
If cbx_Suche_Warenort._value <> "" Then sqlSearchSting &= " AND gs_warenort like '%" & cbx_Suche_Warenort._value & "%'"
|
||||
sqlSearchSting &= ")"
|
||||
End If
|
||||
|
||||
|
||||
Dim SQLStringCRN As String = "select [gsp_gspPosId] ,[gsp_gsId],[gsp_gsnr],[gsp_warenwert],[gsp_sicherheitsbetrag],[gsp_freitext],[gsp_art] ,[gsp_avisoId] ,[gsp_ust] ,[gsp_filialenNr],[gsp_abfertigungsNr] ,[gsp_ATCNr] ,[gsp_MRNNr],[gsp_erstellungsdatum] from [tblGesamtsicherheitsPositionen] where [gsp_gsnr] = '" & gsNr & "'" & sqlSearchSting & " order by [gsp_gsId]"
|
||||
Dim SQLStringCRN As String =
|
||||
"select [gsp_gspPosId],[gsp_ATCNr],[gsp_erstellungsdatum],[gsp_gsId],[gsp_gsnr],[gsp_warenwert],[gsp_sicherheitsbetrag], [gsp_freitext]" &' ,[gsp_avisoId] ,[gsp_ust] ,[gsp_filialenNr],[gsp_abfertigungsNr] ,[gsp_MRNNr], [gsp_art]
|
||||
"From [tblGesamtsicherheitsPositionen] where [gsp_gsnr] = '" & gsNr & "'" & sqlSearchSting & " order by [gsp_gsId]"
|
||||
|
||||
dgvSicherheitsPos.SET_SQL(SQLStringCRN, "AVISO", ,)
|
||||
dgvSicherheitsPos.LOAD()
|
||||
|
||||
@@ -194,23 +199,22 @@ Public Class frmGesamtsicherheitenNEU
|
||||
.Columns("gsp_gsnr").Visible = False
|
||||
.Columns("gsp_warenwert").DefaultCellStyle.Format = "c"
|
||||
.Columns("gsp_sicherheitsbetrag").DefaultCellStyle.Format = "c"
|
||||
'.Columns("gs_saldo").DefaultCellStyle.Format = "c"
|
||||
'.Columns("gs_saldo").Visible = False
|
||||
Select Case currentGesSichRef.gsr_ATR
|
||||
Case True
|
||||
.Columns("gsp_ATCNr").HeaderText = "ATC / MRN"
|
||||
Case Else
|
||||
.Columns("gsp_ATCNr").HeaderText = "CRN / MRN"
|
||||
End Select
|
||||
.Columns("gsp_ATCNr").Width = 120
|
||||
.Columns("gsp_ATCNr").Width = 140
|
||||
.Columns("gsp_erstellungsdatum").Width = 100
|
||||
.Columns("gsp_erstellungsdatum").HeaderText = "Datum"
|
||||
.Columns("gsp_warenwert").Width = 100
|
||||
.Columns("gsp_warenwert").HeaderText = "Warenwert"
|
||||
.Columns("gsp_sicherheitsbetrag").Width = 85
|
||||
.Columns("gsp_sicherheitsbetrag").HeaderText = "S-Betrag"
|
||||
.Columns("gsp_freitext").Width = 110
|
||||
.Columns("gsp_freitext").AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill
|
||||
.Columns("gsp_freitext").HeaderText = "Freitext"
|
||||
|
||||
End With
|
||||
|
||||
End If
|
||||
@@ -433,11 +437,7 @@ Public Class frmGesamtsicherheitenNEU
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If (checkSicherheitsbetrag() = False) Then
|
||||
MsgBox("Der Warenwert der Positionen übersteigt den Warenwert der Gestellung!")
|
||||
txtPosWarenwert.Focus()
|
||||
Exit Sub
|
||||
End If
|
||||
If checkSicherheitsbetrag() = False Then Exit Sub
|
||||
|
||||
Try
|
||||
|
||||
@@ -642,7 +642,7 @@ Public Class frmGesamtsicherheitenNEU
|
||||
'.saldo = currentGesSichRef.Saldo
|
||||
.gs_atr = setNullToZero(cboSicherheitATR.SelectedItem)
|
||||
End With
|
||||
checkSicherheitsbetrag()
|
||||
If checkSicherheitsbetrag() = False Then Exit Sub
|
||||
currentSicherheit.SAVE()
|
||||
txtAnzahlPos.Enabled = True
|
||||
btnUpdateSicherheit.Visible = False
|
||||
@@ -661,7 +661,7 @@ Public Class frmGesamtsicherheitenNEU
|
||||
.gsp_ATCNr = txtPositionenCRN.Text
|
||||
|
||||
End With
|
||||
checkSicherheitsbetrag()
|
||||
If checkSicherheitsbetrag() = False Then Exit Sub
|
||||
currentSPos.SAVE()
|
||||
btnAddPos.Visible = True
|
||||
btnUpdatePos.Visible = False
|
||||
@@ -811,9 +811,14 @@ Public Class frmGesamtsicherheitenNEU
|
||||
|
||||
offenerSicherheitsbetrag = calcOffenerSicherheitsbetrag()
|
||||
|
||||
If (offenerSicherheitsbetrag < 0) Then Return False
|
||||
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
|
||||
Return False
|
||||
End If
|
||||
End If
|
||||
|
||||
If (offenerSicherheitsbetrag < offenerSicherheitsbetragPos) Then Return False
|
||||
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message)
|
||||
@@ -829,7 +834,7 @@ Public Class frmGesamtsicherheitenNEU
|
||||
sicherheitsbetragSumPositionen = CDbl(SQL.DLookup("SUM(gsp_sicherheitsbetrag)", "[tblGesamtsicherheitsPositionen]", "gsp_gsnr ='" & currentSicherheit.gs_gsNr & "'", "AVISO"))
|
||||
|
||||
If currentSPos IsNot Nothing Then
|
||||
sicherheitsbetragSumPositionen = sicherheitsbetragSumPositionen + Double.Parse(setNullToZero(txtPosWarenwert.Text))
|
||||
sicherheitsbetragSumPositionen = sicherheitsbetragSumPositionen + Double.Parse(setNullToZero(txtPosSicherheitsbetrag.Text))
|
||||
End If
|
||||
|
||||
Return sicherheitsbetragSumPositionen
|
||||
@@ -871,7 +876,7 @@ Public Class frmGesamtsicherheitenNEU
|
||||
lbloffenerSaldo.Text = "offener S-Saldo: "
|
||||
Dim offernerSB As Double = Me.calcOffenerSicherheitsbetrag()
|
||||
If offernerSB <> 0 Then
|
||||
lbloffenerSaldo.Text &= Math.Round(calcOffenerSicherheitsbetrag(), 2).ToString
|
||||
lbloffenerSaldo.Text &= Math.Round(offernerSB, 2).ToString
|
||||
isOpen = True
|
||||
Else
|
||||
lbloffenerSaldo.Text &= "0"
|
||||
@@ -1093,6 +1098,5 @@ Public Class frmGesamtsicherheitenNEU
|
||||
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
Reference in New Issue
Block a user