Rundungsdifferenzausgleich implementiert.
This commit is contained in:
@@ -57,7 +57,7 @@ Public Class frmGesamtsicherheitenMenuNEU
|
|||||||
|
|
||||||
Public Function LoadDGV()
|
Public Function LoadDGV()
|
||||||
Dim sqladdon As String = ""
|
Dim sqladdon As String = ""
|
||||||
If chkOffen.Checked Then sqladdon &= " AND gs_SicherheitsSaldo != '0,00 €' AND gs_SicherheitsSaldo != '0,01 €' AND gs_SicherheitsSaldo != '-0,01 €'"
|
If chkOffen.Checked Then sqladdon &= " AND gs_SicherheitsSaldo != '0,00 €'"
|
||||||
If cbxStandort._value <> "" Then sqladdon &= " AND gs_filialenNr = '" & cbxStandort._value.ToString & "'"
|
If cbxStandort._value <> "" Then sqladdon &= " AND gs_filialenNr = '" & cbxStandort._value.ToString & "'"
|
||||||
If cbxWarenort._value <> "" Then sqladdon &= " AND gs_warenort = '" & cbxWarenort._value.ToString & "'"
|
If cbxWarenort._value <> "" Then sqladdon &= " AND gs_warenort = '" & cbxWarenort._value.ToString & "'"
|
||||||
|
|
||||||
@@ -126,7 +126,7 @@ Public Class frmGesamtsicherheitenMenuNEU
|
|||||||
|
|
||||||
For Each row As DataGridViewRow In dgvListe.Rows
|
For Each row As DataGridViewRow In dgvListe.Rows
|
||||||
If Not IsDBNull(row.Cells("gs_SicherheitsSaldo").Value) Then
|
If Not IsDBNull(row.Cells("gs_SicherheitsSaldo").Value) Then
|
||||||
If row.Cells("gs_SicherheitsSaldo").Value <> 0 And row.Cells("gs_SicherheitsSaldo").Value <> 0.01 And row.Cells("gs_SicherheitsSaldo").Value <> -0.01 Then
|
If row.Cells("gs_SicherheitsSaldo").Value <> 0 Then
|
||||||
|
|
||||||
dataTable.Rows.Add(row.Cells("gs_gsnr").Value, True)
|
dataTable.Rows.Add(row.Cells("gs_gsnr").Value, True)
|
||||||
row.DefaultCellStyle.BackColor = Color.IndianRed
|
row.DefaultCellStyle.BackColor = Color.IndianRed
|
||||||
@@ -367,7 +367,7 @@ Public Class frmGesamtsicherheitenMenuNEU
|
|||||||
) as Sicherheitssaldo
|
) as Sicherheitssaldo
|
||||||
|
|
||||||
From [tblGesamtsicherheit] as meh group by gs_gsnr) as meh2
|
From [tblGesamtsicherheit] as meh group by gs_gsnr) as meh2
|
||||||
Where gs_standort = '" & Standort & "' AND Sicherheitssaldo > '0.01' AND gs_datum < '" & Date.Now().AddDays(-85) & "'"
|
Where gs_standort = '" & Standort & "' AND gs_datum < '" & Date.Now().AddDays(-85) & "'"
|
||||||
|
|
||||||
dtNew = SQL.loadDgvBySql(sqlstring, "AVISO", 100, True)
|
dtNew = SQL.loadDgvBySql(sqlstring, "AVISO", 100, True)
|
||||||
|
|
||||||
|
|||||||
1059
Aviso/frmGesamtsicherheitenNEU.Designer.vb
generated
1059
Aviso/frmGesamtsicherheitenNEU.Designer.vb
generated
File diff suppressed because it is too large
Load Diff
@@ -38,6 +38,8 @@ Public Class frmGesamtsicherheitenNEU
|
|||||||
|
|
||||||
Dim isOpen As Boolean = False
|
Dim isOpen As Boolean = False
|
||||||
|
|
||||||
|
Dim rundungsdiff As Double = 0
|
||||||
|
|
||||||
Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
|
Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
|
||||||
|
|
||||||
Public dataTable As New DataTable()
|
Public dataTable As New DataTable()
|
||||||
@@ -50,6 +52,12 @@ Public Class frmGesamtsicherheitenNEU
|
|||||||
|
|
||||||
Private Sub frmGesamtsicherheitNEU_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
Private Sub frmGesamtsicherheitNEU_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||||
|
|
||||||
|
If VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG_bool("GESAMTSICHERHEIT_RUNDUNGSKORREKTUR", "AVISO") Then
|
||||||
|
btnRundungsdifAusgl.Visible = True
|
||||||
|
Else
|
||||||
|
btnRundungsdifAusgl.Visible = False
|
||||||
|
End If
|
||||||
|
|
||||||
currentGesSichRef = New VERAG_PROG_ALLGEMEIN.cAufschubKonten(Standort)
|
currentGesSichRef = New VERAG_PROG_ALLGEMEIN.cAufschubKonten(Standort)
|
||||||
SaldoNew = Decimal.Parse(currentGesSichRef.CalcSaldo())
|
SaldoNew = Decimal.Parse(currentGesSichRef.CalcSaldo())
|
||||||
lblSaldo.Text = "Saldo: €" & SaldoNew.ToString("N")
|
lblSaldo.Text = "Saldo: €" & SaldoNew.ToString("N")
|
||||||
@@ -810,8 +818,14 @@ Public Class frmGesamtsicherheitenNEU
|
|||||||
currentSicherheit = Sicherh
|
currentSicherheit = Sicherh
|
||||||
txtAnzahlPos.Enabled = False
|
txtAnzahlPos.Enabled = False
|
||||||
|
|
||||||
btnAddSicherheit.Visible = False
|
If Sicherh.gs_isRundungsdiff = True Then
|
||||||
btnUpdateSicherheit.Visible = True
|
btnAddSicherheit.Visible = False
|
||||||
|
btnUpdateSicherheit.Visible = False
|
||||||
|
Else
|
||||||
|
btnAddSicherheit.Visible = False
|
||||||
|
btnUpdateSicherheit.Visible = True
|
||||||
|
End If
|
||||||
|
|
||||||
btnDeleteSicherheit.Visible = True
|
btnDeleteSicherheit.Visible = True
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -878,7 +892,7 @@ Public Class frmGesamtsicherheitenNEU
|
|||||||
Private Sub dgvGesamtsicherheitPositionen_CellCellDoubleClick(sender As Object, e As DataGridViewCellEventArgs) Handles dgvSicherheitsPos.CellDoubleClick
|
Private Sub dgvGesamtsicherheitPositionen_CellCellDoubleClick(sender As Object, e As DataGridViewCellEventArgs) Handles dgvSicherheitsPos.CellDoubleClick
|
||||||
|
|
||||||
Dim sPos As New cGesamtsicherheitsPositionen(dgvSicherheitsPos.CurrentRow.Cells("gsp_gsId").Value, dgvSicherheitsPos.CurrentRow.Cells("gsp_gspPosId").Value)
|
Dim sPos As New cGesamtsicherheitsPositionen(dgvSicherheitsPos.CurrentRow.Cells("gsp_gsId").Value, dgvSicherheitsPos.CurrentRow.Cells("gsp_gspPosId").Value)
|
||||||
|
If sPos.gsp_isPosRundungsdiff = True Then Exit Sub
|
||||||
txtPosNr.Text = sPos.gsp_gspPosId
|
txtPosNr.Text = sPos.gsp_gspPosId
|
||||||
txtPosFreitext.Text = sPos.gsp_freitext
|
txtPosFreitext.Text = sPos.gsp_freitext
|
||||||
txtPosSicherheitsbetrag.Text = sPos.gsp_sicherheitsbetrag
|
txtPosSicherheitsbetrag.Text = sPos.gsp_sicherheitsbetrag
|
||||||
@@ -1373,6 +1387,14 @@ Public Class frmGesamtsicherheitenNEU
|
|||||||
lbloffenerWarenwert.Text = "offener Warenwert: €"
|
lbloffenerWarenwert.Text = "offener Warenwert: €"
|
||||||
lbloffenerWarenwert.Text &= Math.Round(countWarenwert, 2) - Math.Round(countWarenwertPos, 2)
|
lbloffenerWarenwert.Text &= Math.Round(countWarenwert, 2) - Math.Round(countWarenwertPos, 2)
|
||||||
|
|
||||||
|
If (Math.Abs(countSicherheitsbetrag - countSicherheitsbetragPos) < 0.1 AndAlso Math.Abs(countSicherheitsbetrag - countSicherheitsbetragPos) <> 0) Then
|
||||||
|
btnRundungsdifAusgl.Enabled = True
|
||||||
|
rundungsdiff = Math.Round(countSicherheitsbetrag - countSicherheitsbetragPos, 2)
|
||||||
|
Else
|
||||||
|
btnRundungsdifAusgl.Enabled = False
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -1645,4 +1667,76 @@ Public Class frmGesamtsicherheitenNEU
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub btnRundungsdifAusgl_Click(sender As Object, e As EventArgs) Handles btnRundungsdifAusgl.Click
|
||||||
|
|
||||||
|
Try
|
||||||
|
If (rundungsdiff <> 0) AndAlso checkIfRundungsPosExists() = False Then
|
||||||
|
|
||||||
|
Dim OPEN As New cSicherheiten()
|
||||||
|
|
||||||
|
With OPEN
|
||||||
|
.gs_gsNr = gessicherheitID
|
||||||
|
.gs_ATBNr = "Korrekt. Rundungsdiff. " & gessicherheitID
|
||||||
|
.gs_posNr = Me.getLatestPosNr(currentSicherheit.gs_gsNr, currentSicherheit.gs_ATBNr) + 1
|
||||||
|
.gs_datum = DateTime.Now
|
||||||
|
.gs_warenwert = 0
|
||||||
|
.gs_sicherheitsbetrag = 0
|
||||||
|
.gs_standort = Me.Standort
|
||||||
|
.gs_art = "OPEN"
|
||||||
|
.gs_erstellungsdatum = DateTime.Now
|
||||||
|
.gs_freitext = ""
|
||||||
|
.gs_saldo = currentGesSichRef.brgakto_gs_aktSaldo
|
||||||
|
.gs_atr = setNullToZero(cboSicherheitATR.SelectedItem)
|
||||||
|
.gs_zollsatz = Me.Zollsatz
|
||||||
|
.gs_avisoId = Me.avisoID
|
||||||
|
.gs_isRundungsdiff = True
|
||||||
|
setEnviromentDataToObject(OPEN, Me)
|
||||||
|
End With
|
||||||
|
|
||||||
|
Dim gs_gsId = OPEN.SAVEOBJECT()
|
||||||
|
|
||||||
|
Dim SicherheitsPos As New cGesamtsicherheitsPositionen()
|
||||||
|
With SicherheitsPos
|
||||||
|
.gsp_gsId = gs_gsId
|
||||||
|
.gsp_gspPosId = OPEN.gs_posNr
|
||||||
|
.gsp_warenwert = 0
|
||||||
|
.gsp_sicherheitsbetrag = rundungsdiff
|
||||||
|
.gsp_freitext = ""
|
||||||
|
.gsp_filialenNr = currentSicherheit.gs_filialenNr
|
||||||
|
.gsp_art = "CLOSE"
|
||||||
|
.gsp_gsNr = gessicherheitID
|
||||||
|
.gsp_abfertigungsNr = currentSicherheit.gs_abfertigungsnr
|
||||||
|
.gsp_datum = DateTime.Now
|
||||||
|
.gsp_erstellungsdatum = DateTime.Now
|
||||||
|
.gsp_ust = currentSicherheit.gs_ust
|
||||||
|
.gsp_ATCNr = "Korrekt. Rundungsdiff. " & gessicherheitID
|
||||||
|
.gsp_isPosRundungsdiff = True
|
||||||
|
.gsp_avisoId = Me.avisoID
|
||||||
|
End With
|
||||||
|
|
||||||
|
SicherheitsPos.SAVE()
|
||||||
|
|
||||||
|
AfterButton()
|
||||||
|
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
MsgBox(ex.Message)
|
||||||
|
End Try
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Function checkIfRundungsPosExists()
|
||||||
|
|
||||||
|
If dgvGesamtsicherheit.Rows.Count < 1 Then Return False
|
||||||
|
|
||||||
|
For Each Row In dgvGesamtsicherheit.Rows
|
||||||
|
Dim sicherh As New cSicherheiten(Row.Cells("gs_gsId").Value, Row.Cells("gs_posNr").Value)
|
||||||
|
|
||||||
|
If sicherh.gs_isRundungsdiff Then Return True
|
||||||
|
|
||||||
|
Next
|
||||||
|
Return False
|
||||||
|
|
||||||
|
End Function
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
Reference in New Issue
Block a user