Gesamtsicherheiten, Änderungen für Mestan
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
|
||||
Imports System.Data.SqlTypes
|
||||
Imports System.Linq.Expressions
|
||||
Imports Chilkat
|
||||
Imports DocumentFormat.OpenXml.Presentation
|
||||
Imports GrapeCity.Viewer.Common.Model
|
||||
Imports Org.BouncyCastle.Cms
|
||||
Imports Spire.PdfViewer.Forms
|
||||
@@ -170,7 +172,7 @@ Public Class frmGesamtsicherheitenNEU
|
||||
Next
|
||||
|
||||
Dim SQLStringSicherheit As String = "select [gs_ATBNr] as 'ATB Verwahrlager',[gs_gsnr] as 'GS Nr', CAST(gs_datum as Date) as Datum, CONVERT(VARCHAR(5),gs_datum, 108) as Uhrzeit, [gs_warenwert] as Warenwert, [gs_sicherheitsbetrag] as Sicherheitbetrag, [gs_saldo] as Saldo, [gs_freitext] as Freitext, [gs_atr] as 'ATR ja/nein', [gs_ust] as '19% EUSt',
|
||||
[gsp_ATCNr] as 'ATCNr oder MRN eroeffnet', CAST(gsp_erstellungsdatum as Date) as Datum, CONVERT(VARCHAR(5),gsp_erstellungsdatum, 108) as Uhrzeit, [gsp_warenwert] as Warenwert, [gsp_sicherheitsbetrag] as Sicherheitsbetrag2, [gsp_freitext] as Freitext
|
||||
[gsp_ATCNr] as 'ATCNr oder MRN eroeffnet', CAST(gsp_datum as Date) as Datum, CONVERT(VARCHAR(5),gsp_datum, 108) as Uhrzeit, [gsp_warenwert] as Warenwert, [gsp_sicherheitsbetrag] as Sicherheitsbetrag2, [gsp_freitext] as Freitext
|
||||
from [tblGesamtsicherheit]
|
||||
inner join [tblGesamtsicherheitsPositionen] on [tblGesamtsicherheit].gs_gsId = [tblGesamtsicherheitsPositionen].gsp_gsId
|
||||
where [gs_gsnr] IN (" & gsnr & ")
|
||||
@@ -255,7 +257,7 @@ Public Class frmGesamtsicherheitenNEU
|
||||
|
||||
|
||||
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]
|
||||
"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] where [gsp_gsnr] = '" & gsNr & "'" & sqlSearchSting & " order by [gsp_gsId]"
|
||||
|
||||
dgvSicherheitsPos.SET_SQL(SQLStringCRN, "AVISO", ,)
|
||||
@@ -277,8 +279,8 @@ Public Class frmGesamtsicherheitenNEU
|
||||
.Columns("gsp_ATCNr").HeaderText = "CRN / MRN"
|
||||
End Select
|
||||
.Columns("gsp_ATCNr").Width = 140
|
||||
.Columns("gsp_erstellungsdatum").Width = 100
|
||||
.Columns("gsp_erstellungsdatum").HeaderText = "Datum"
|
||||
.Columns("gsp_datum").Width = 100
|
||||
.Columns("gsp_datum").HeaderText = "Datum"
|
||||
.Columns("gsp_warenwert").Width = 100
|
||||
.Columns("gsp_warenwert").HeaderText = "Warenwert"
|
||||
.Columns("gsp_sicherheitsbetrag").Width = 85
|
||||
@@ -396,7 +398,7 @@ Public Class frmGesamtsicherheitenNEU
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Private Sub DateTime_Keypresses(sender As Object, e As System.Windows.Forms.KeyPressEventArgs) Handles txtPosDate.KeyPress, txtPosTime.KeyPress, txtSicherheitDate.KeyPress, txtSicherheitTime.KeyPress
|
||||
Private Sub DateTime_Keypresses(sender As Object, e As System.Windows.Forms.KeyPressEventArgs) Handles txtPosDate.KeyPress, txtPosTime.KeyPress, txtSicherheitDate.KeyPress, txtSicherheitTime.KeyPress, txtDatumaendern.KeyPress, txtUhrzeitaendern.KeyPress
|
||||
Select Case Asc(e.KeyChar)
|
||||
Case 48 To 57, 8, 46, 58
|
||||
|
||||
@@ -409,7 +411,7 @@ Public Class frmGesamtsicherheitenNEU
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub txtMRNDate_GotFocus(sender As Object, e As EventArgs) Handles txtSicherheitDate.GotFocus, txtPosDate.GotFocus, txtSicherheitTime.GotFocus, txtPosTime.GotFocus
|
||||
Private Sub txtMRNDate_GotFocus(sender As Object, e As EventArgs) Handles txtSicherheitDate.GotFocus, txtPosDate.GotFocus, txtSicherheitTime.GotFocus, txtPosTime.GotFocus, txtUhrzeitaendern.GotFocus, txtDatumaendern.GotFocus
|
||||
Select Case sender.name
|
||||
Case "txtSicherheitDate"
|
||||
If txtSicherheitDate.Text.Length < 1 Then txtSicherheitDate.Text = Date.Today.ToString("dd.MM.yyyy")
|
||||
@@ -419,6 +421,10 @@ Public Class frmGesamtsicherheitenNEU
|
||||
If txtSicherheitTime.Text.Length < 1 Then txtSicherheitTime.Text = Date.Now.ToString("HH:mm")
|
||||
Case "txtPosTime"
|
||||
If txtPosTime.Text.Length < 1 Then txtPosTime.Text = Date.Now.ToString("HH:mm")
|
||||
Case "txtDatumaendern"
|
||||
If txtDatumaendern.Text.Length < 1 Then txtDatumaendern.Text = Date.Today.ToString("dd.MM.yyyy")
|
||||
Case "txtUhrzeitaendern"
|
||||
If txtUhrzeitaendern.Text.Length < 1 Then txtUhrzeitaendern.Text = Date.Now.ToString("HH:mm")
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
@@ -464,7 +470,7 @@ Public Class frmGesamtsicherheitenNEU
|
||||
.gs_sicherheitsbetrag = sicherheitsbetrag
|
||||
.gs_standort = Me.Standort
|
||||
.gs_art = "OPEN"
|
||||
.gs_erstellungsdatum = Me.datum
|
||||
.gs_erstellungsdatum = DateTime.Now
|
||||
.gs_freitext = Me.txtSicherheitFreitext.Text
|
||||
.gs_saldo = currentGesSichRef.brgakto_gs_aktSaldo
|
||||
.gs_atr = setNullToZero(cboSicherheitATR.SelectedItem)
|
||||
@@ -509,10 +515,9 @@ Public Class frmGesamtsicherheitenNEU
|
||||
.gsp_filialenNr = OPEN.gs_filialenNr
|
||||
.gsp_art = "OPEN"
|
||||
.gsp_abfertigungsNr = OPEN.gs_abfertigungsnr
|
||||
.gsp_erstellungsdatum = DateTimeString2DateTimeKonvertinator(txtSicherheitDate.Text, txtSicherheitTime.Text)
|
||||
.gsp_erstellungsdatum = DateTime.Now
|
||||
.gsp_ust = ""
|
||||
.gsp_avisoId = Me.avisoID
|
||||
'.gsp_ATCNr = ""
|
||||
.gsp_gsNr = OPEN.gs_gsNr
|
||||
End With
|
||||
|
||||
@@ -551,7 +556,7 @@ Public Class frmGesamtsicherheitenNEU
|
||||
.gs_sicherheitsbetrag = 0
|
||||
.gs_standort = Me.Standort
|
||||
.gs_art = "OPEN"
|
||||
.gs_erstellungsdatum = Me.datum
|
||||
.gs_erstellungsdatum = DateTime.Now
|
||||
.gs_freitext = Me.txtSicherheitFreitext.Text
|
||||
.gs_saldo = currentGesSichRef.brgakto_gs_aktSaldo
|
||||
.gs_atr = setNullToZero(cboSicherheitATR.SelectedItem)
|
||||
@@ -574,7 +579,8 @@ Public Class frmGesamtsicherheitenNEU
|
||||
.gsp_art = "CLOSE"
|
||||
.gsp_gsNr = gessicherheitID
|
||||
.gsp_abfertigungsNr = currentSicherheit.gs_abfertigungsnr
|
||||
.gsp_erstellungsdatum = DateTimeString2DateTimeKonvertinator(txtPosDate.Text, txtPosTime.Text)
|
||||
.gsp_datum = DateTimeString2DateTimeKonvertinator(txtPosDate.Text, txtPosTime.Text)
|
||||
.gsp_erstellungsdatum = DateTime.Now
|
||||
.gsp_ust = currentSicherheit.gs_ust
|
||||
.gsp_ATCNr = txtPositionenCRN.Text
|
||||
.gsp_avisoId = Me.avisoID
|
||||
@@ -715,7 +721,7 @@ Public Class frmGesamtsicherheitenNEU
|
||||
End If
|
||||
|
||||
Case "Double"
|
||||
If obj Is Nothing Or obj Is DBNull.Value Or obj = "" Then
|
||||
If obj Is Nothing Or obj Is DBNull.Value Or obj = "" Then
|
||||
Return Nothing
|
||||
Else
|
||||
Return Double.Parse(CDbl(obj))
|
||||
@@ -786,7 +792,13 @@ Public Class frmGesamtsicherheitenNEU
|
||||
.gsp_sicherheitsbetrag = Double.Parse(txtPosSicherheitsbetrag.Text)
|
||||
.gsp_warenwert = Double.Parse(txtPosWarenwert.Text)
|
||||
.gsp_ATCNr = If(txtPositionenCRN.Text <> "", txtPositionenCRN.Text, Nothing)
|
||||
.gsp_erstellungsdatum = DateTimeString2DateTimeKonvertinator(txtPosDate.Text, txtPosTime.Text)
|
||||
|
||||
If txtPosDate.Text <> "" AndAlso txtPosTime.Text <> "" Then
|
||||
.gsp_datum = DateTimeString2DateTimeKonvertinator(txtPosDate.Text, txtPosTime.Text)
|
||||
Else
|
||||
.gsp_datum = Nothing
|
||||
End If
|
||||
|
||||
|
||||
End With
|
||||
If checkSicherheitsbetrag() = False Then Exit Sub
|
||||
@@ -807,8 +819,16 @@ Public Class frmGesamtsicherheitenNEU
|
||||
txtPosSicherheitsbetrag.Text = sPos.gsp_sicherheitsbetrag
|
||||
txtPosWarenwert.Text = sPos.gsp_warenwert
|
||||
txtPositionenCRN.Text = CStr(sPos.gsp_ATCNr)
|
||||
txtPosDate.Text = sPos.gsp_erstellungsdatum.ToString("dd.MM.yyyy")
|
||||
txtPosTime.Text = sPos.gsp_erstellungsdatum.ToString("HH:mm")
|
||||
|
||||
Try
|
||||
If sPos.gsp_datum IsNot Nothing Then
|
||||
txtPosDate.Text = CDate(sPos.gsp_datum).ToString("dd.MM.yyyy")
|
||||
txtPosTime.Text = CDate(sPos.gsp_datum).ToString("HH:mm")
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message)
|
||||
End Try
|
||||
|
||||
|
||||
currentSPos = sPos
|
||||
@@ -1057,10 +1077,11 @@ Public Class frmGesamtsicherheitenNEU
|
||||
|
||||
Private Sub setSaldo()
|
||||
|
||||
lbloffenerSaldo.Text = "offener S-Betrag: €"
|
||||
Dim offernerSB As Double = Me.calcOffenerSicherheitsbetrag()
|
||||
If offernerSB <> 0 Then
|
||||
lbloffenerSaldo.Text &= Decimal.Parse(Math.Round(offernerSB, 2)).ToString("N")
|
||||
lbloffenerSaldo.Text = "offener Sicherheitswert: €"
|
||||
|
||||
Dim offernerSB As Double = Math.Round(Me.calcOffenerSicherheitsbetrag(), 2)
|
||||
If offernerSB > 0.01 Then
|
||||
lbloffenerSaldo.Text &= Decimal.Parse(offernerSB.ToString("N"))
|
||||
|
||||
isOpen = True
|
||||
Else
|
||||
@@ -1279,6 +1300,10 @@ Public Class frmGesamtsicherheitenNEU
|
||||
txtPosSicherheitsbGes._value = countSicherheitsbetragPos.ToString
|
||||
txtPosWarenwertGes._value = countWarenwertPos.ToString
|
||||
|
||||
lbloffenerWarenwert.Text = "offener Warenwert: €"
|
||||
lbloffenerWarenwert.Text &= Math.Round(countWarenwert, 2) - Math.Round(countWarenwertPos, 2)
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub rearangePosNr(gsNr As Integer, ATBNr As String, posNr As Integer)
|
||||
@@ -1342,9 +1367,13 @@ Public Class frmGesamtsicherheitenNEU
|
||||
|
||||
Private Sub ATCMRNNraendernToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ATCMRNNraendernToolStripMenuItem.Click
|
||||
Dim ATCNr As String
|
||||
Dim tempDatum As String
|
||||
Dim TempUhrzeit As String
|
||||
Dim mutlitpleATCNr As Boolean = False
|
||||
|
||||
ATCNr = dgvSicherheitsPos.SelectedRows(0).Cells("gsp_ATCNr").Value.ToString
|
||||
tempDatum = If(dgvSicherheitsPos.SelectedRows(0).Cells("gsp_datum").Value IsNot DBNull.Value, CDate(dgvSicherheitsPos.SelectedRows(0).Cells("gsp_datum").Value).ToString("dd.MM.yyyy"), "")
|
||||
TempUhrzeit = If(dgvSicherheitsPos.SelectedRows(0).Cells("gsp_datum").Value IsNot DBNull.Value, CDate(dgvSicherheitsPos.SelectedRows(0).Cells("gsp_datum").Value).ToString("HH:mm"), "")
|
||||
|
||||
If dgvSicherheitsPos.SelectedRows.Count > 0 Then
|
||||
|
||||
@@ -1362,6 +1391,8 @@ Public Class frmGesamtsicherheitenNEU
|
||||
End If
|
||||
dgvSicherheitsPos.Enabled = False
|
||||
txtATCaendern.Text = ATCNr
|
||||
txtDatumaendern.Text = tempDatum
|
||||
txtUhrzeitaendern.Text = TempUhrzeit
|
||||
pnlChangeATCNr.Visible = True
|
||||
|
||||
|
||||
@@ -1370,6 +1401,7 @@ Public Class frmGesamtsicherheitenNEU
|
||||
Private Sub dgvSicherheitsPos_SelectionChanged(sender As Object, e As EventArgs) Handles dgvSicherheitsPos.SelectionChanged
|
||||
If dgvSicherheitsPos.SelectedRows.Count > 0 Then
|
||||
ATCMRNNraendernToolStripMenuItem.Visible = True
|
||||
loadTitle()
|
||||
Else
|
||||
ATCMRNNraendernToolStripMenuItem.Visible = False
|
||||
End If
|
||||
@@ -1408,12 +1440,19 @@ Public Class frmGesamtsicherheitenNEU
|
||||
MsgBox("Bitte ATC/MRN-Nr angeben!")
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If txtUhrzeitaendern.Text = "" Or txtDatumaendern.Text = "" Then
|
||||
MsgBox("Bitte Datum/Uhrzeit angeben!")
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If dgvSicherheitsPos.SelectedRows.Count > 0 Then
|
||||
|
||||
For Each row As DataGridViewRow In dgvSicherheitsPos.SelectedRows
|
||||
|
||||
Dim SicherhPos As New cGesamtsicherheitsPositionen(row.Cells("gsp_gsId").Value, row.Cells("gsp_gspPosId").Value)
|
||||
SicherhPos.gsp_ATCNr = txtATCaendern.Text
|
||||
SicherhPos.gsp_datum = DateTimeString2DateTimeKonvertinator(txtDatumaendern.Text, txtUhrzeitaendern.Text)
|
||||
SicherhPos.SAVE()
|
||||
Next
|
||||
End If
|
||||
@@ -1449,5 +1488,4 @@ Public Class frmGesamtsicherheitenNEU
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user