Import_DY, Prüfung Belege, VAT_ATEZ, etc.

This commit is contained in:
2025-09-22 12:26:39 +02:00
parent fd1f235d99
commit 813b23bb12
11 changed files with 166 additions and 90 deletions

View File

@@ -2,6 +2,7 @@
Imports System.Reflection
Imports System.Windows.Forms
Imports com.sun.org.apache.xpath.internal.operations
Imports com.sun.source.tree
'Imports DocumentFormat.OpenXml.Drawing.Charts
'Imports DocumentFormat.OpenXml.Spreadsheet
@@ -525,38 +526,48 @@ Public Class cRechnungsausgang
End If
End If
End If
End If
If dgv Is Nothing Then
errMsg = "ERROR: Keine Positionen angegeben!" : Return False
ElseIf dgv.Rows.Count = 0 Then
errMsg = "ERROR: Keine Positionen angegeben!" : Return False
Else
If dgv.Rows.Count > 1 Then
'Prüfung für doppelte Positionen mit PK: Bezeichnung und LeistungNr!
Dim dt As New DataTable
dt.Columns.Add("name", GetType(String))
If dgv Is Nothing Then
errMsg = "ERROR: Keine Positionen angegeben!" : Return False
ElseIf dgv.Rows.Count = 0 Then
errMsg = "ERROR: Keine Positionen angegeben!" : Return False
Else
If dgv.Rows.Count > 1 Then
'Prüfung für doppelte Positionen mit PK: Bezeichnung und LeistungNr!
Dim dt As New DataTable
dt.Columns.Add("name", GetType(String))
For Each row As DataGridViewRow In dgv.Rows
Dim R As DataRow = dt.NewRow
R("name") = row.Cells(0).Value
dt.Rows.Add(R)
Next
Dim dv As New DataView(dt)
Dim distinct As DataTable = dv.ToTable(True, New String() {"name"})
If distinct.Rows.Count <> dt.Rows.Count Then
errMsg = "ERROR: Doppelte Positionen vorhanden!" : Return False
End If
For Each row As DataGridViewRow In dgv.Rows
Dim R As DataRow = dt.NewRow
R("name") = row.Cells(0).Value
dt.Rows.Add(R)
Next
Dim dv As New DataView(dt)
Dim distinct As DataTable = dv.ToTable(True, New String() {"name"})
If distinct.Rows.Count <> dt.Rows.Count Then
errMsg = "ERROR: Doppelte Positionen vorhanden!" : Return False
End If
End If
End If
If FIRMA.Firma_ID = 19 Then
Select Case Me.BelegartenKz
Case "AR" : If (Me.SteuerfreierGesamtbetrag + Me.SteuerpflichtigerGesamtbetrag) < 0 Then errMsg = "ERROR: Vorzeichenfehler!" : Return False
Case "AG" : If (Me.SteuerfreierGesamtbetrag + Me.SteuerpflichtigerGesamtbetrag) > 0 Then errMsg = "ERROR: Vorzeichenfehler!" : Return False
End Select
End If
'checkFirmen
Return True
'checkFirmen
Return True
End Function
Public Function SAVE_POSITIONEN(RK_ID) As Boolean