ustva, Kundenblatt, ncts, etc.

This commit is contained in:
2025-08-18 13:27:51 +02:00
parent 66cc884568
commit 66dea78e9d
9 changed files with 178 additions and 77 deletions

View File

@@ -101,53 +101,27 @@ Public Class usrcntlVAT_ATEZ
.Columns("page_count").HeaderText = "Seiten"
.Columns("page_count").Width = 50
.Columns("total_pages").Visible = False
.Columns("start_page").HeaderText = "von"
.Columns("start_page").Width = 50
.Columns("end_page").HeaderText = "bis"
.Columns("end_page").Width = 50
'.Columns("total_pages").Visible = False
.Columns("seller_address_full").Visible = False
'.Columns("doc_index").Visible = False
.Columns("doc_index").Visible = False
.Sort(.Columns("start_page"), System.ComponentModel.ListSortDirection.Ascending)
End With
For Each row As DataGridViewRow In dgvVAT.Rows
If IsNumeric(row.Cells("page_count").Value) AndAlso row.Cells("page_count").Value <> 0 Then
pageCpunterCheck += row.Cells("page_count").Value
End If
If Not IsDBNull(row.Cells("status").Value) Then
Dim akiv As String = (row.Cells("status").Value.ToString).ToLower
If akiv = "success" Then
If Not IsDBNull(row.Cells("total_vat_amount").Value) Then
If IsNumeric(row.Cells("total_vat_amount").Value) AndAlso row.Cells("total_vat_amount").Value <> 0 Then
row.DefaultCellStyle.BackColor = Color.LightGreen
Else
row.DefaultCellStyle.BackColor = Color.IndianRed
End If
Else
row.DefaultCellStyle.BackColor = Color.LightYellow
End If
ElseIf akiv = "nonactive" Then
row.DefaultCellStyle.BackColor = Color.IndianRed
Else
row.DefaultCellStyle.BackColor = Color.LightYellow
End If
End If
Next
If dgvVAT.Rows(0).Cells("total_pages").Value <> pageCpunterCheck Then
@@ -162,6 +136,54 @@ Public Class usrcntlVAT_ATEZ
End If
End Sub
Sub setColorIndgv()
For Each row As DataGridViewRow In dgvVAT.Rows
Dim correctPages As Boolean = False
If IsNumeric(row.Cells("start_page").Value) AndAlso IsNumeric(row.Cells("end_page").Value) AndAlso IsNumeric(row.Cells("page_count").Value) Then
If (Math.Abs(row.Cells("end_page").Value - row.Cells("start_page").Value) + 1) = row.Cells("page_count").Value Then
correctPages = True
Else
row.DefaultCellStyle.BackColor = Color.IndianRed
End If
End If
If Not IsDBNull(row.Cells("status").Value) Then
Dim akiv As String = (row.Cells("status").Value.ToString).ToLower
If akiv = "success" Then
If Not IsDBNull(row.Cells("total_vat_amount").Value) Then
If IsNumeric(row.Cells("total_vat_amount").Value) AndAlso row.Cells("total_vat_amount").Value <> 0 Then
If correctPages Then row.DefaultCellStyle.BackColor = Color.LightGreen
Else
If correctPages Then row.DefaultCellStyle.BackColor = Color.IndianRed
End If
Else
row.DefaultCellStyle.BackColor = Color.LightYellow
End If
ElseIf akiv = "nonactive" Then
row.DefaultCellStyle.BackColor = Color.IndianRed
Else
row.DefaultCellStyle.BackColor = Color.LightYellow
End If
End If
Next
End Sub
Private Sub btnUebernehmen_Click(sender As Object, e As EventArgs) Handles btnUebernehmen.Click
@@ -260,11 +282,18 @@ Public Class usrcntlVAT_ATEZ
btnUebernehmen.Enabled = True
End If
Me.setColorIndgv()
End Sub
Private Sub usrcntlCreditsafe_Load(sender As Object, e As EventArgs) Handles Me.Load
init()
setColorIndgv()
End Sub
Private Sub dgvVAT_Paint(sender As Object, e As PaintEventArgs) Handles dgvVAT.Paint
setColorIndgv()
End Sub
Private Sub dgvCreditsafe_CellDoubleClick(sender As Object, e As DataGridViewCellEventArgs) Handles dgvVAT.CellDoubleClick