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

View File

@@ -1586,11 +1586,40 @@ Public Class cFakturierung
Dim antragsID As Integer = CInt(SQL.getValueTxtBySql("SELECT UStVAn_ID FROM tblUStVAntrag WHERE FilialenNr = " & RECHNUNG.FilialenNr & " AND AbfertigungsNr = " & RECHNUNG.AbfertigungsNr, "FMZOLL",,, "-1"))
If antragsID > 0 Then
Dim MWSTAntrag As New cUSTVAntrag(antragsID)
Dim MonthStart As String = IIf(CDate(MWSTAntrag.UStVAn_ReDatVon).Month < 10, "0", "") & CDate(MWSTAntrag.UStVAn_ReDatVon).Month
Dim MonthEnd As String = IIf(CDate(MWSTAntrag.UStVAn_ReDatBis).Month < 10, "0", "") & CDate(MWSTAntrag.UStVAn_ReDatBis).Month
If MonthStart = MonthEnd Then MonthEnd = ""
Dim listVZMonth As New List(Of Integer)
If RECHNUNG.RK_ID > 0 Then
For Each pos As cUStVPositionen In MWSTAntrag.POSITIONEN.OrderBy(Function(x) If(IsDate(x.UStVPo_ReDat), CDate(x.UStVPo_ReDat), Nothing))
If Not IsDBNull(pos.UStVPo_VZ) AndAlso pos.UStVPo_VZ AndAlso pos.UStVPo_VZ_RKID = RECHNUNG.RK_ID AndAlso IsDate(pos.UStVPo_ReDat) Then
If Not listVZMonth.Contains(CDate(pos.UStVPo_ReDat).Month) Then listVZMonth.Add(CDate(pos.UStVPo_ReDat).Month)
End If
Next
End If
If listVZMonth.Count > 0 Then
If listVZMonth.Count = 1 Then
MonthStart = IIf(CDate(MWSTAntrag.UStVAn_ReDatVon).Month < 10, "0", "") & listVZMonth(0).ToString
MonthEnd = ""
Else
MonthStart = IIf(CDate(MWSTAntrag.UStVAn_ReDatVon).Month < 10, "0", "") & listVZMonth(0).ToString
MonthEnd = IIf(CDate(MWSTAntrag.UStVAn_ReDatBis).Month < 10, "0", "") & listVZMonth(listVZMonth.Count - 1).ToString
End If
End If
If rpt.txtLeistung.Text.Contains("00-00/23") Then
rpt.txtLeistung.Text = rpt.txtLeistung.Text.Replace("00/23", "/" & CDate(MWSTAntrag.UStVAn_ReDatBis).Year.ToString.Substring(2))
ElseIf rpt.txtLeistung.Text.Contains("DL/23") Then
@@ -1600,17 +1629,17 @@ Public Class cFakturierung
End If
If rpt.txtLeistung.Text.Contains("-00") Then
rpt.txtLeistung.Text = rpt.txtLeistung.Text.Replace("-00", MonthStart & "-" & MonthEnd)
rpt.txtLeistung.Text = rpt.txtLeistung.Text.Replace("-00", MonthStart & IIf(MonthEnd <> "", "-" & MonthEnd, ""))
ElseIf rpt.txtLeistung.Text.Contains("00-") Then
rpt.txtLeistung.Text = rpt.txtLeistung.Text.Replace("00-", MonthStart & "-" & MonthEnd)
rpt.txtLeistung.Text = rpt.txtLeistung.Text.Replace("00-", MonthStart & IIf(MonthEnd <> "", "-" & MonthEnd, ""))
ElseIf rpt.txtLeistung.Text.Contains("00") Then
rpt.txtLeistung.Text = rpt.txtLeistung.Text.Replace("00", MonthStart & "-" & MonthEnd)
rpt.txtLeistung.Text = rpt.txtLeistung.Text.Replace("00", MonthStart & IIf(MonthEnd <> "", "-" & MonthEnd, ""))
End If
End If
End If
End If
End If

View File

@@ -1391,6 +1391,7 @@ Public Class frmMDM_USTVAntrag
Dim f As New frmVAT_ATEZ()
f.usrcntlVAT_ATEZ1.initDGV(dt)
f.usrcntlVAT_ATEZ1.setColorIndgv()
If f.ShowDialog = DialogResult.OK Then
@@ -1452,7 +1453,7 @@ Public Class frmMDM_USTVAntrag
Dim TMP_Path_Old = fi_orig.FullName
Dim TMP_Path_New = VERAG_PROG_ALLGEMEIN.DATENVERVER_OPTIONS.getTMPPath(fi_orig.Name, fi_orig.Extension,, True, "USTVA_POS")
VERAG_PROG_ALLGEMEIN.cAllgemein.ExtractPdfPages(TMP_Path_Old, TMP_Path_New, pagestart, r.Cells("page_count").Value)
VERAG_PROG_ALLGEMEIN.cAllgemein.ExtractPdfPages(TMP_Path_Old, TMP_Path_New, r.Cells("start_page").Value, r.Cells("end_page").Value)
Dim DS_NEW As New VERAG_PROG_ALLGEMEIN.cDATENSERVER("MDM", "MDM_DATEN", "ATEZ_KI", Now.Year, Now.ToString("ddMMyy_HHmmss.ffff"), fi_orig.Name, USTV_ANTRAG.UStVAn_KuNr, False)

View File

@@ -667,6 +667,8 @@ Public Class ustCntlUSTV_AntragPosition
Dim f As New frmVAT_ATEZ()
f.usrcntlVAT_ATEZ1.btnUebernehmen.Enabled = UStV_POS.UStVPo_daId_loeschbar 'NUR ÜBERNEHMEN WENN LÖSCHBAR!
f.usrcntlVAT_ATEZ1.initDGV(dt)
f.usrcntlVAT_ATEZ1.setColorIndgv()
If f.ShowDialog = DialogResult.OK Then
txtRgDatum.Text = f.usrcntlVAT_ATEZ1.va.invoice_date
txtRgNr.Text = f.usrcntlVAT_ATEZ1.va.invoice_id

View File

@@ -364,7 +364,7 @@ Partial Class frmKundenblatt
Me.tbcntrMain.Margin = New System.Windows.Forms.Padding(0)
Me.tbcntrMain.Name = "tbcntrMain"
Me.tbcntrMain.SelectedIndex = 0
Me.tbcntrMain.Size = New System.Drawing.Size(1652, 1385)
Me.tbcntrMain.Size = New System.Drawing.Size(1652, 1402)
Me.tbcntrMain.TabIndex = 3
'
'tbAllgemein
@@ -405,7 +405,7 @@ Partial Class frmKundenblatt
Me.tbAllgemein.Margin = New System.Windows.Forms.Padding(0)
Me.tbAllgemein.Name = "tbAllgemein"
Me.tbAllgemein.Padding = New System.Windows.Forms.Padding(3)
Me.tbAllgemein.Size = New System.Drawing.Size(1644, 1356)
Me.tbAllgemein.Size = New System.Drawing.Size(1644, 1373)
Me.tbAllgemein.TabIndex = 0
Me.tbAllgemein.Text = "Allgemein"
'
@@ -486,7 +486,7 @@ Partial Class frmKundenblatt
Me.TabControl1.Location = New System.Drawing.Point(8, 582)
Me.TabControl1.Name = "TabControl1"
Me.TabControl1.SelectedIndex = 0
Me.TabControl1.Size = New System.Drawing.Size(718, 768)
Me.TabControl1.Size = New System.Drawing.Size(718, 785)
Me.TabControl1.TabIndex = 186
'
'TabPage1
@@ -498,7 +498,7 @@ Partial Class frmKundenblatt
Me.TabPage1.Location = New System.Drawing.Point(4, 22)
Me.TabPage1.Name = "TabPage1"
Me.TabPage1.Padding = New System.Windows.Forms.Padding(3)
Me.TabPage1.Size = New System.Drawing.Size(710, 742)
Me.TabPage1.Size = New System.Drawing.Size(710, 759)
Me.TabPage1.TabIndex = 0
Me.TabPage1.Text = "Offene Posten"
Me.TabPage1.UseVisualStyleBackColor = True
@@ -557,7 +557,7 @@ Partial Class frmKundenblatt
Me.dgvOffenePosten.RowHeadersDefaultCellStyle = DataGridViewCellStyle4
Me.dgvOffenePosten.RowHeadersVisible = False
Me.dgvOffenePosten.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect
Me.dgvOffenePosten.Size = New System.Drawing.Size(707, 707)
Me.dgvOffenePosten.Size = New System.Drawing.Size(707, 724)
Me.dgvOffenePosten.TabIndex = 175
'
'Label10
@@ -1100,7 +1100,7 @@ Partial Class frmKundenblatt
Me.dgvSperrliste.Name = "dgvSperrliste"
Me.dgvSperrliste.ReadOnly = True
Me.dgvSperrliste.RowHeadersDefaultCellStyle = DataGridViewCellStyle15
Me.dgvSperrliste.Size = New System.Drawing.Size(446, 1312)
Me.dgvSperrliste.Size = New System.Drawing.Size(446, 1329)
Me.dgvSperrliste.TabIndex = 23
'
'PictureBox2
@@ -2419,7 +2419,7 @@ Partial Class frmKundenblatt
Me.tbFIBU.Controls.Add(Me.txtFIBUKuerzel)
Me.tbFIBU.Location = New System.Drawing.Point(4, 25)
Me.tbFIBU.Name = "tbFIBU"
Me.tbFIBU.Size = New System.Drawing.Size(1644, 1356)
Me.tbFIBU.Size = New System.Drawing.Size(1644, 1373)
Me.tbFIBU.TabIndex = 13
Me.tbFIBU.Text = "FIBU"
Me.tbFIBU.UseVisualStyleBackColor = True
@@ -2446,7 +2446,7 @@ Partial Class frmKundenblatt
'
Me.btnFirmendatenFormularSpeichern.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btnFirmendatenFormularSpeichern.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btnFirmendatenFormularSpeichern.Location = New System.Drawing.Point(38, 21)
Me.btnFirmendatenFormularSpeichern.Location = New System.Drawing.Point(1514, 18)
Me.btnFirmendatenFormularSpeichern.Name = "btnFirmendatenFormularSpeichern"
Me.btnFirmendatenFormularSpeichern.Size = New System.Drawing.Size(71, 52)
Me.btnFirmendatenFormularSpeichern.TabIndex = 17
@@ -2478,7 +2478,7 @@ Partial Class frmKundenblatt
Me.tbRechnungen.Controls.Add(Me.MyPanel1)
Me.tbRechnungen.Location = New System.Drawing.Point(4, 25)
Me.tbRechnungen.Name = "tbRechnungen"
Me.tbRechnungen.Size = New System.Drawing.Size(1644, 1356)
Me.tbRechnungen.Size = New System.Drawing.Size(1644, 1373)
Me.tbRechnungen.TabIndex = 14
Me.tbRechnungen.Text = "Rechnungen"
Me.tbRechnungen.UseVisualStyleBackColor = True
@@ -2497,7 +2497,7 @@ Partial Class frmKundenblatt
Me.dgvRg.ReadOnly = True
Me.dgvRg.RowHeadersVisible = False
Me.dgvRg.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect
Me.dgvRg.Size = New System.Drawing.Size(1644, 1296)
Me.dgvRg.Size = New System.Drawing.Size(1644, 1313)
Me.dgvRg.TabIndex = 3
'
'MyPanel1
@@ -2892,7 +2892,7 @@ Partial Class frmKundenblatt
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.AutoScroll = True
Me.BackColor = System.Drawing.Color.White
Me.ClientSize = New System.Drawing.Size(1595, 1514)
Me.ClientSize = New System.Drawing.Size(1595, 1531)
Me.Controls.Add(Me.lblAbfVerb)
Me.Controls.Add(Me.btnAbfVerb)
Me.Controls.Add(Me.tbcntrMain)

View File

@@ -2213,8 +2213,11 @@ Public Class frmKundenblatt
KUNDE_ERW.kde_BezFIBU = checkNullStr(txtFIBUKuerzel.Text)
KUNDE_ERW.SAVE()
KUNDE.Gesprächsbericht = checkNullStr(rtbGespreachsbericht.Text)
KUNDE.SAVE()
If KUNDE.Gesprächsbericht <> "" AndAlso checkNullStr(rtbGespreachsbericht.Text) = "" OrElse KUNDE.Gesprächsbericht = "" AndAlso checkNullStr(rtbGespreachsbericht.Text) <> "" Then
KUNDE.Gesprächsbericht = checkNullStr(rtbGespreachsbericht.Text)
KUNDE.SAVE()
End If
End Sub
Private Sub ToolStripMenuItem10_Click(sender As Object, e As EventArgs) Handles ToolStripMenuItem10.Click

View File

@@ -3120,7 +3120,7 @@ Public Class usrCntlKundenuebersicht
setCreditSafeEntry(company, pdfObject, kdNr, forecedReqest, beforeRequestCount, afterRequestCount, limit, country)
End If
If beforeRequestCount = (limit - 100) Or afterRequestCount = (limit - 100) Then 'Benachrichtigung
If beforeRequestCount > (limit - 100) Then 'Benachrichtigung
VERAG_PROG_ALLGEMEIN.cProgramFunctions.sendMail("al@verag.ag; d.breimaier@verag.ag", "Creditsafe-Limit", "ACHTUNG, das Creditsafe-Limit für " & country & " ist fast erreicht!" & vbNewLine & vbNewLine & "Limit: " & limit & " , aktuelle Stand: " & afterRequestCount & vbNewLine & vbNewLine & "*Automatic generated e-mail*",,,,,)
End If

View File

@@ -119,7 +119,7 @@ Public Class usrCntlMDMAuswertungen
Dim sqlstr = " SELECT CASE [BelegartenNr] WHEN 71 THEN 'GS' " &
" WHEN 70 THEN 'RG' " &
" END AS [BelegArt] " &
" ,[RechnungsNr] " &
" ,Rechnungsausgang.[RK_ID] ,[RechnungsNr] " &
" ,CONVERT(VARCHAR(10), [RechnungsDatum], 104) as [RechnungsDatum] " &
" ,[FilialenNr],[AbfertigungsNr],[UnterNr] " &
" ,CONVERT(VARCHAR(10), [Abfertigungsdatum], 104) as [Abfertigungsdatum] " &
@@ -156,40 +156,72 @@ Public Class usrCntlMDMAuswertungen
Dim antragsID As Integer = CInt(SQL.getValueTxtBySql("SELECT UStVAn_ID FROM tblUStVAntrag WHERE FilialenNr = " & r.Item("FilialenNr").ToString & " AND AbfertigungsNr = " & r.Item("AbfertigungsNr").ToString, "FMZOLL"))
Dim listVZMonth As New List(Of Integer)
If antragsID > 0 Then
Dim MWSTAntrag As New cUSTVAntrag(antragsID)
Dim MonthStart As String = IIf(CDate(MWSTAntrag.UStVAn_ReDatVon).Month < 10, "0", "") & CDate(MWSTAntrag.UStVAn_ReDatVon).Month
Dim MonthEnd As String = IIf(CDate(MWSTAntrag.UStVAn_ReDatBis).Month < 10, "0", "") & CDate(MWSTAntrag.UStVAn_ReDatBis).Month
Dim LeistungsBez As String = ""
LeistungsBez = r.Item("LeistungsBez").ToString()
If MonthStart = MonthEnd Then MonthEnd = ""
If r.Item("RK_ID") > 0 Then
For Each pos As cUStVPositionen In MWSTAntrag.POSITIONEN.OrderBy(Function(x) If(IsDate(x.UStVPo_ReDat), CDate(x.UStVPo_ReDat), Nothing))
If Not IsDBNull(pos.UStVPo_VZ) AndAlso pos.UStVPo_VZ AndAlso pos.UStVPo_VZ_RKID = r.Item("RK_ID") AndAlso IsDate(pos.UStVPo_ReDat) Then
If Not listVZMonth.Contains(CDate(pos.UStVPo_ReDat).Month) Then listVZMonth.Add(CDate(pos.UStVPo_ReDat).Month)
End If
Next
End If
If listVZMonth.Count > 0 Then
If listVZMonth.Count = 1 Then
MonthStart = IIf(CDate(MWSTAntrag.UStVAn_ReDatVon).Month < 10, "0", "") & listVZMonth(0).ToString
MonthEnd = ""
Else
MonthStart = IIf(CDate(MWSTAntrag.UStVAn_ReDatVon).Month < 10, "0", "") & listVZMonth(0).ToString
MonthEnd = IIf(CDate(MWSTAntrag.UStVAn_ReDatBis).Month < 10, "0", "") & listVZMonth(listVZMonth.Count - 1).ToString
End If
End If
Dim LeistungsBez As String = ""
LeistungsBez = r.Item("LeistungsBez").ToString()
If LeistungsBez.Contains("00-00/23") Then
LeistungsBez = LeistungsBez.Replace("00/23", "/" & CDate(MWSTAntrag.UStVAn_ReDatBis).Year.ToString.Substring(2))
ElseIf LeistungsBez.Contains("DL/23") Then
LeistungsBez = LeistungsBez.Replace("DL/23", "/" & CDate(MWSTAntrag.UStVAn_ReDatBis).Year.ToString.Substring(2))
Else
LeistungsBez = LeistungsBez.Replace("/23", "/" & CDate(MWSTAntrag.UStVAn_ReDatBis).Year.ToString.Substring(2))
End If
If LeistungsBez.Contains("-00") Then
LeistungsBez = LeistungsBez.Replace("-00", MonthStart & IIf(MonthEnd <> "", "-" & MonthEnd, ""))
ElseIf LeistungsBez.Contains("00-") Then
LeistungsBez = LeistungsBez.Replace("00-", MonthStart & IIf(MonthEnd <> "", "-" & MonthEnd, ""))
ElseIf LeistungsBez.Contains("00") Then
LeistungsBez = LeistungsBez.Replace("00", MonthStart & IIf(MonthEnd <> "", "-" & MonthEnd, ""))
End If
If LeistungsBez.Length > 30 Then
r.Item("LeistungsBez") = LeistungsBez.Substring(0, 30)
Else
r.Item("LeistungsBez") = LeistungsBez
End If
If LeistungsBez.Contains("00-00/23") Then
LeistungsBez = LeistungsBez.Replace("00/23", "/" & CDate(MWSTAntrag.UStVAn_ReDatBis).Year.ToString.Substring(2))
ElseIf LeistungsBez.Contains("DL/23") Then
LeistungsBez = LeistungsBez.Replace("DL/23", "/" & CDate(MWSTAntrag.UStVAn_ReDatBis).Year.ToString.Substring(2))
Else
LeistungsBez = LeistungsBez.Replace("/23", "/" & CDate(MWSTAntrag.UStVAn_ReDatBis).Year.ToString.Substring(2))
End If
If LeistungsBez.Contains("-00") Then
LeistungsBez = LeistungsBez.Replace("-00", MonthStart & "-" & MonthEnd)
ElseIf LeistungsBez.Contains("00-") Then
LeistungsBez = LeistungsBez.Replace("00-", MonthStart & "-" & MonthEnd)
ElseIf LeistungsBez.Contains("00") Then
LeistungsBez = LeistungsBez.Replace("00", MonthStart & "-" & MonthEnd)
End If
r.Item("LeistungsBez") = LeistungsBez
End If
End If
Next
If dt.Columns.Contains("RK_ID") Then dt.Columns.Remove("RK_ID")
For i = 0 To dt.Columns.Count - 1
clmns &= dt.Columns(i).ColumnName.ToString().Replace(";", ",") & ";"