usvat, anhänge markieren verbessert

This commit is contained in:
2026-06-24 11:40:13 +02:00
parent 82eb473f5f
commit b7fc0b147f
2 changed files with 53 additions and 18 deletions

View File

@@ -1916,17 +1916,26 @@ Public Class usrCntlFaktAbrechnung
For Each RG_AH In RECHNUNG.ANHAENGE
For Each r As DataGridViewRow In .Rows
If r.Cells("clmnDsId").Value = RG_AH.dsId Or r.Cells("clmnAnhId").Value = 0 Then 'anh_id = 0 --> Anhang ohne AVISO-Bezug
DirectCast(r.Cells("optAnhSel"), DataGridViewCheckBoxCell).Value = -1
DirectCast(r.Cells("optAnhSel"), DataGridViewCheckBoxCell).Value = False
End If
If r.Cells("clmnBezeichnung").Value.ToString.ToLower.Contains("handelsrechnung") AndAlso kdFirmaRechnungAn.KdData_KUNDE_ERW IsNot Nothing AndAlso kdFirmaRechnungAn.KdData_KUNDE_ERW.kde_autoselect_handelsrechnung Then 'anh_id = 0 --> Anhang ohne AVISO-Bezug
DirectCast(r.Cells("optAnhSel"), DataGridViewCheckBoxCell).Value = 1
If r.Cells("clmnBezeichnung").Value.ToString.ToLower.Contains("handelsrechnung") AndAlso kdFirmaRechnungAn.KdData_KUNDE_ERW IsNot Nothing AndAlso kdFirmaRechnungAn.KdData_KUNDE_ERW.kde_autoselect_handelsrechnung Then
DirectCast(r.Cells("optAnhSel"), DataGridViewCheckBoxCell).Value = True
End If
Next
Next
'-----------------------------
If RECHNUNG.ANHAENGE.Count = 0 Then
For Each rowTemp In .Rows
If rowTemp.Cells("clmnBezeichnung").Value.ToString.ToLower.Contains("handelsrechnung") AndAlso kdFirmaRechnungAn.KdData_KUNDE_ERW IsNot Nothing AndAlso kdFirmaRechnungAn.KdData_KUNDE_ERW.kde_autoselect_handelsrechnung Then
DirectCast(rowTemp.Cells("optAnhSel"), DataGridViewCheckBoxCell).Value = True
End If
Next
End If
End If
'Anhänge aus USTVA -> SPED-BUCH + Excel Pos-Liste
If SPEDBUCH IsNot Nothing Then
@@ -4600,12 +4609,33 @@ Nächste_Textzeile_lesen:
Private Sub dbgAnhaenge_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles dgvAnhaenge.CellClick 'dbgAnhaenge.CellContentClick,
Try
' DirectCast(r.Cells("optAnhSel"), DataGridViewCheckBoxCell).Value = 1
'If dgvAnhaenge.Columns(e.ColumnIndex).Name = "optAnhSel" Then
' Select Case dgvAnhaenge.Rows(e.RowIndex).Cells(e.ColumnIndex).Value
' Case 1, -1
' dgvAnhaenge.Rows(e.RowIndex).Cells(e.ColumnIndex).Value = Not DirectCast(dgvAnhaenge.Rows(e.RowIndex).Cells(e.ColumnIndex), DataGridViewCheckBoxCell).Value
' Case Else
' dgvAnhaenge.Rows(e.RowIndex).Cells(e.ColumnIndex).Value = -1
' End Select
'End If
If e.RowIndex < 0 OrElse e.ColumnIndex < 0 Then Exit Sub
If dgvAnhaenge.Columns(e.ColumnIndex).Name = "optAnhSel" Then
' MsgBox(DirectCast(dgvAnhaenge.Rows(e.RowIndex).Cells(e.ColumnIndex), DataGridViewCheckBoxCell).Value)
dgvAnhaenge.Rows(e.RowIndex).Cells(e.ColumnIndex).Value = Not DirectCast(dgvAnhaenge.Rows(e.RowIndex).Cells(e.ColumnIndex), DataGridViewCheckBoxCell).Value
Dim cell = dgvAnhaenge.Rows(e.RowIndex).Cells(e.ColumnIndex)
If CInt(If(cell.Value, 0)) = -1 Then
cell.Value = 0
Else
cell.Value = -1
End If
End If
dgvAnhaenge.ClearSelection()
Catch ex As Exception
MsgBox(ex.Message & ex.StackTrace)
End Try

View File

@@ -4317,7 +4317,9 @@ Public Class frmMDM_USTVAntrag
Dim code As Integer = 0
Dim Subcode = ""
If listOfLeistungstyp.Count > 0 Then
getCode(Antrag_LandKz, listOfLeistungstyp(0), code, Subcode, "RO")
End If
Dim goods As New GoodsDescription With {.GoodsItem = New List(Of GoodsItem)}
goods.GoodsItem.Add(New GoodsItem With {.Code = code, .SubCode = Subcode, .FreeText = ""})
@@ -4609,7 +4611,9 @@ Public Class frmMDM_USTVAntrag
Dim code As Integer = 0
Dim Subcode = ""
If listOfLeistungstyp.Count > 0 Then
getCode(Antrag_LandKz, listOfLeistungstyp(0), code, Subcode)
End If
p.GoodsDescription = New GoodsDescription_ With {.Code = code, .Subcode = Subcode}
@@ -5012,7 +5016,7 @@ Public Class frmMDM_USTVAntrag
listOfLeistungstyp = getLeistungsTyp(row.Cells("UStVPo_Leistungsbezeichnung").Value, row.Cells("UStVPo_SchnittstellenNr").Value)
If listOfLeistungstyp.Count > 0 Then
For Each listEntry In listOfLeistungstyp
Dim code As Integer = 0
@@ -5024,6 +5028,7 @@ Public Class frmMDM_USTVAntrag
counterLeistungen += 1
Next
End If
End If