BH, handling, etc.

This commit is contained in:
2026-10-28 13:48:21 +01:00
parent 0e9c282f5e
commit 3e841185e4
3 changed files with 39 additions and 11 deletions

View File

@@ -28,11 +28,13 @@
Me.dgvHandling = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components) Me.dgvHandling = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components)
Me.btnPreisliste = New System.Windows.Forms.Button() Me.btnPreisliste = New System.Windows.Forms.Button()
Me.cbxDivers = New System.Windows.Forms.CheckBox() Me.cbxDivers = New System.Windows.Forms.CheckBox()
Me.lblWarning = New System.Windows.Forms.Label()
CType(Me.dgvHandling, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.dgvHandling, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout() Me.SuspendLayout()
' '
'Button1 'Button1
' '
Me.Button1.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.Button1.BackColor = System.Drawing.Color.LightGray Me.Button1.BackColor = System.Drawing.Color.LightGray
Me.Button1.DialogResult = System.Windows.Forms.DialogResult.Cancel Me.Button1.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.Button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.Button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat
@@ -45,6 +47,7 @@
' '
'Button2 'Button2
' '
Me.Button2.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.Button2.DialogResult = System.Windows.Forms.DialogResult.OK Me.Button2.DialogResult = System.Windows.Forms.DialogResult.OK
Me.Button2.FlatAppearance.BorderSize = 0 Me.Button2.FlatAppearance.BorderSize = 0
Me.Button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.Button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat
@@ -65,15 +68,16 @@
Me.dgvHandling.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill Me.dgvHandling.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
Me.dgvHandling.BackgroundColor = System.Drawing.Color.White Me.dgvHandling.BackgroundColor = System.Drawing.Color.White
Me.dgvHandling.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize Me.dgvHandling.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
Me.dgvHandling.Location = New System.Drawing.Point(12, 12) Me.dgvHandling.Location = New System.Drawing.Point(12, 24)
Me.dgvHandling.Name = "dgvHandling" Me.dgvHandling.Name = "dgvHandling"
Me.dgvHandling.ReadOnly = True Me.dgvHandling.ReadOnly = True
Me.dgvHandling.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect Me.dgvHandling.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect
Me.dgvHandling.Size = New System.Drawing.Size(776, 397) Me.dgvHandling.Size = New System.Drawing.Size(776, 385)
Me.dgvHandling.TabIndex = 3 Me.dgvHandling.TabIndex = 3
' '
'btnPreisliste 'btnPreisliste
' '
Me.btnPreisliste.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.btnPreisliste.FlatAppearance.BorderSize = 0 Me.btnPreisliste.FlatAppearance.BorderSize = 0
Me.btnPreisliste.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.btnPreisliste.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btnPreisliste.Location = New System.Drawing.Point(12, 415) Me.btnPreisliste.Location = New System.Drawing.Point(12, 415)
@@ -85,8 +89,9 @@
' '
'cbxDivers 'cbxDivers
' '
Me.cbxDivers.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.cbxDivers.AutoSize = True Me.cbxDivers.AutoSize = True
Me.cbxDivers.Location = New System.Drawing.Point(134, 421) Me.cbxDivers.Location = New System.Drawing.Point(105, 421)
Me.cbxDivers.Name = "cbxDivers" Me.cbxDivers.Name = "cbxDivers"
Me.cbxDivers.Size = New System.Drawing.Size(81, 17) Me.cbxDivers.Size = New System.Drawing.Size(81, 17)
Me.cbxDivers.TabIndex = 5 Me.cbxDivers.TabIndex = 5
@@ -94,11 +99,22 @@
Me.cbxDivers.UseVisualStyleBackColor = True Me.cbxDivers.UseVisualStyleBackColor = True
Me.cbxDivers.Visible = False Me.cbxDivers.Visible = False
' '
'lblWarning
'
Me.lblWarning.AutoSize = True
Me.lblWarning.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.lblWarning.ForeColor = System.Drawing.Color.Red
Me.lblWarning.Location = New System.Drawing.Point(22, 8)
Me.lblWarning.Name = "lblWarning"
Me.lblWarning.Size = New System.Drawing.Size(0, 13)
Me.lblWarning.TabIndex = 6
'
'frmAbrechnungHandling 'frmAbrechnungHandling
' '
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(800, 450) Me.ClientSize = New System.Drawing.Size(800, 450)
Me.Controls.Add(Me.lblWarning)
Me.Controls.Add(Me.cbxDivers) Me.Controls.Add(Me.cbxDivers)
Me.Controls.Add(Me.btnPreisliste) Me.Controls.Add(Me.btnPreisliste)
Me.Controls.Add(Me.dgvHandling) Me.Controls.Add(Me.dgvHandling)
@@ -119,4 +135,5 @@
Friend WithEvents dgvHandling As VERAG_PROG_ALLGEMEIN.MyDatagridview Friend WithEvents dgvHandling As VERAG_PROG_ALLGEMEIN.MyDatagridview
Friend WithEvents btnPreisliste As Button Friend WithEvents btnPreisliste As Button
Friend WithEvents cbxDivers As CheckBox Friend WithEvents cbxDivers As CheckBox
Friend WithEvents lblWarning As Label
End Class End Class

View File

@@ -5,13 +5,15 @@ Public Class frmAbrechnungHandling
Dim dt As DataTable Dim dt As DataTable
Dim HandlingList As cHandlingssaetzeInternLIST Dim HandlingList As cHandlingssaetzeInternLIST
Dim title As String Dim title As String
Public Sub New(dt As DataTable, HandlingList As VERAG_PROG_ALLGEMEIN.cHandlingssaetzeInternLIST, title As String) Dim Warning As String
Public Sub New(dt As DataTable, HandlingList As VERAG_PROG_ALLGEMEIN.cHandlingssaetzeInternLIST, title As String, Optional warning As String = "")
InitializeComponent() InitializeComponent()
Me.dt = dt Me.dt = dt
Me.HandlingList = HandlingList Me.HandlingList = HandlingList
Me.title = title Me.title = title
Me.Warning = warning
End Sub End Sub
@@ -34,6 +36,7 @@ Public Class frmAbrechnungHandling
Me.Text = title Me.Text = title
Me.lblWarning.Text = Warning
End Sub End Sub

View File

@@ -2398,7 +2398,7 @@ Public Class usrCntlBH
'Dim letzteZeile As Integer = Blatt.UsedRange.Rows.Count 'Dim letzteZeile As Integer = Blatt.UsedRange.Rows.Count
'For row As Integer = startHeaderRow + 1 To letzteZeile 'For row As Integer = startHeaderRow + 1 To letzteZeile
Dim countMissingFields As Integer = 0
For Each d In dataRows For Each d In dataRows
If TYP = "Q" Then If TYP = "Q" Then
@@ -2419,6 +2419,7 @@ Public Class usrCntlBH
If String.IsNullOrWhiteSpace(Umsatz_ID) Then If String.IsNullOrWhiteSpace(Umsatz_ID) Then
countMissingFields += 1
Continue For Continue For
End If End If
@@ -2469,7 +2470,7 @@ Public Class usrCntlBH
dt.Rows.Add(R) dt.Rows.Add(R)
Else Else
countMissingFields += 1
Continue For Continue For
End If End If
@@ -2511,7 +2512,6 @@ Public Class usrCntlBH
R("Buchungstext") = Buchungstext R("Buchungstext") = Buchungstext
R("Währung") = Währung R("Währung") = Währung
R("Betrag") = Betrag R("Betrag") = Betrag
R("KdNr") = 0 R("KdNr") = 0
If visibleKdNrCheck Then If visibleKdNrCheck Then
@@ -2543,7 +2543,7 @@ Public Class usrCntlBH
dt.Rows.Add(R) dt.Rows.Add(R)
Else Else
countMissingFields += 1
Continue For Continue For
End If End If
@@ -2554,8 +2554,16 @@ Public Class usrCntlBH
Next Next
If dt.Rows.Count > 0 Then If dt.Rows.Count > 0 Then
Dim Warning As String = ""
If countMissingFields > 0 Then
If TYP = "Q" Then
Warning = countMissingFields & " Einträge mit fehlenden Datum/Kontoauszug/Umsatz_ID/Betrag"
Else
Warning = countMissingFields & " Einträge mit fehlenden Betrag/Buchungstext/Datum"
End If
Using frm As New frmAbrechnungHandling(dt, Nothing, "Import " & dt.Rows.Count & " Buchungsdaten " & cbxBankspesentyp.SelectedItem.Text & IIf(missingKdNr > 0, missingKdNr & " Kundenkonten konnten nicht gefunden werden!", "")) End If
Using frm As New frmAbrechnungHandling(dt, Nothing, "Import " & dt.Rows.Count & " Buchungsdaten " & cbxBankspesentyp.SelectedItem.Text & IIf(missingKdNr > 0, missingKdNr & " Kundenkonten konnten nicht gefunden werden!", ""), Warning)
With frm With frm
.btnPreisliste.Visible = False .btnPreisliste.Visible = False