MDM_USTVA, etc.

This commit is contained in:
2025-03-31 12:05:44 +02:00
parent 47459d90cd
commit 3d1a26c644
4 changed files with 143 additions and 65 deletions

View File

@@ -45,6 +45,8 @@ Partial Class frmMDM_USTVAntrag
Me.cbxLand = New VERAG_PROG_ALLGEMEIN.MyComboBox()
Me.lblLand = New System.Windows.Forms.Label()
Me.Panel8 = New System.Windows.Forms.Panel()
Me.Label14 = New System.Windows.Forms.Label()
Me.txtEingereichtAm = New VERAG_PROG_ALLGEMEIN.MyTextBox()
Me.lblMWSTAntrag = New System.Windows.Forms.Label()
Me.Label13 = New System.Windows.Forms.Label()
Me.txtGueltig = New VERAG_PROG_ALLGEMEIN.MyTextBox()
@@ -97,6 +99,7 @@ Partial Class frmMDM_USTVAntrag
Me.dgvUSTVPositionen = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components)
Me.pnlAntragsPosDetails = New System.Windows.Forms.Panel()
Me.Panel2 = New System.Windows.Forms.Panel()
Me.UstCntlUSTV_AntragPosition1 = New SDL.ustCntlUSTV_AntragPosition()
Me.Panel4 = New System.Windows.Forms.Panel()
Me.btnEintragloeschen = New System.Windows.Forms.Button()
Me.btnNeuerEintrag = New System.Windows.Forms.Button()
@@ -104,15 +107,13 @@ Partial Class frmMDM_USTVAntrag
Me.Panel3 = New System.Windows.Forms.Panel()
Me.dgvErstattungspositionen = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components)
Me.pnlErstattungsdetails = New System.Windows.Forms.Panel()
Me.UstCntlUSTV_AntragErstattungen1 = New SDL.ustCntlUSTV_ErstattungPosition()
Me.Panel1 = New System.Windows.Forms.Panel()
Me.Button2 = New System.Windows.Forms.Button()
Me.Button3 = New System.Windows.Forms.Button()
Me.ContextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components)
Me.ContextMenuStrip2 = New System.Windows.Forms.ContextMenuStrip(Me.components)
Me.UstCntlUSTV_AntragPosition1 = New SDL.ustCntlUSTV_AntragPosition()
Me.UstCntlUSTV_AntragErstattungen1 = New SDL.ustCntlUSTV_ErstattungPosition()
Me.Label14 = New System.Windows.Forms.Label()
Me.txtEingereichtAm = New VERAG_PROG_ALLGEMEIN.MyTextBox()
Me.picExcel = New System.Windows.Forms.PictureBox()
Me.pnlBottom.SuspendLayout()
CType(Me.picPDF, System.ComponentModel.ISupportInitialize).BeginInit()
Me.pnlHeader.SuspendLayout()
@@ -133,12 +134,14 @@ Partial Class frmMDM_USTVAntrag
CType(Me.dgvErstattungspositionen, System.ComponentModel.ISupportInitialize).BeginInit()
Me.pnlErstattungsdetails.SuspendLayout()
Me.Panel1.SuspendLayout()
CType(Me.picExcel, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'pnlBottom
'
Me.pnlBottom.BackColor = System.Drawing.Color.FromArgb(CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer))
Me.pnlBottom.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.pnlBottom.Controls.Add(Me.picExcel)
Me.pnlBottom.Controls.Add(Me.Button4)
Me.pnlBottom.Controls.Add(Me.picPDF)
Me.pnlBottom.Controls.Add(Me.btnMail)
@@ -157,7 +160,7 @@ Partial Class frmMDM_USTVAntrag
Me.Button4.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.Button4.ForeColor = System.Drawing.Color.Black
Me.Button4.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.Button4.Location = New System.Drawing.Point(979, 30)
Me.Button4.Location = New System.Drawing.Point(1126, 13)
Me.Button4.Name = "Button4"
Me.Button4.Size = New System.Drawing.Size(103, 39)
Me.Button4.TabIndex = 28
@@ -167,10 +170,10 @@ Partial Class frmMDM_USTVAntrag
'picPDF
'
Me.picPDF.Image = Global.SDL.My.Resources.Resources.pdf
Me.picPDF.Location = New System.Drawing.Point(865, 30)
Me.picPDF.Location = New System.Drawing.Point(1067, 39)
Me.picPDF.Name = "picPDF"
Me.picPDF.Size = New System.Drawing.Size(50, 50)
Me.picPDF.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize
Me.picPDF.Size = New System.Drawing.Size(35, 35)
Me.picPDF.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom
Me.picPDF.TabIndex = 27
Me.picPDF.TabStop = False
'
@@ -179,9 +182,9 @@ Partial Class frmMDM_USTVAntrag
Me.btnMail.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btnMail.ForeColor = System.Drawing.Color.Black
Me.btnMail.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.btnMail.Location = New System.Drawing.Point(1109, 30)
Me.btnMail.Location = New System.Drawing.Point(1126, 55)
Me.btnMail.Name = "btnMail"
Me.btnMail.Size = New System.Drawing.Size(103, 39)
Me.btnMail.Size = New System.Drawing.Size(103, 28)
Me.btnMail.TabIndex = 26
Me.btnMail.Text = "Anträge"
Me.btnMail.UseVisualStyleBackColor = True
@@ -433,6 +436,44 @@ Partial Class frmMDM_USTVAntrag
Me.Panel8.Size = New System.Drawing.Size(973, 87)
Me.Panel8.TabIndex = 19
'
'Label14
'
Me.Label14.AutoSize = True
Me.Label14.BackColor = System.Drawing.Color.Transparent
Me.Label14.Cursor = System.Windows.Forms.Cursors.Hand
Me.Label14.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label14.ForeColor = System.Drawing.Color.Black
Me.Label14.Location = New System.Drawing.Point(524, 64)
Me.Label14.Name = "Label14"
Me.Label14.Size = New System.Drawing.Size(101, 17)
Me.Label14.TabIndex = 27
Me.Label14.Text = "eingereicht am"
'
'txtEingereichtAm
'
Me.txtEingereichtAm._DateTimeOnly = False
Me.txtEingereichtAm._numbersOnly = False
Me.txtEingereichtAm._numbersOnlyKommastellen = ""
Me.txtEingereichtAm._numbersOnlyTrennzeichen = False
Me.txtEingereichtAm._Prozent = False
Me.txtEingereichtAm._ShortDateNew = False
Me.txtEingereichtAm._ShortDateOnly = True
Me.txtEingereichtAm._TimeOnly = False
Me.txtEingereichtAm._TimeOnly_Seconds = False
Me.txtEingereichtAm._value = ""
Me.txtEingereichtAm._Waehrung = False
Me.txtEingereichtAm._WaehrungZeichen = False
Me.txtEingereichtAm.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!)
Me.txtEingereichtAm.ForeColor = System.Drawing.Color.Black
Me.txtEingereichtAm.Location = New System.Drawing.Point(654, 60)
Me.txtEingereichtAm.MaxLength = 10
Me.txtEingereichtAm.MaxLineLength = -1
Me.txtEingereichtAm.MaxLines_Warning = ""
Me.txtEingereichtAm.MaxLines_Warning_Label = Nothing
Me.txtEingereichtAm.Name = "txtEingereichtAm"
Me.txtEingereichtAm.Size = New System.Drawing.Size(100, 23)
Me.txtEingereichtAm.TabIndex = 26
'
'lblMWSTAntrag
'
Me.lblMWSTAntrag.AutoSize = True
@@ -1213,6 +1254,14 @@ Partial Class frmMDM_USTVAntrag
Me.Panel2.Size = New System.Drawing.Size(1438, 263)
Me.Panel2.TabIndex = 1
'
'UstCntlUSTV_AntragPosition1
'
Me.UstCntlUSTV_AntragPosition1.Dock = System.Windows.Forms.DockStyle.Fill
Me.UstCntlUSTV_AntragPosition1.Location = New System.Drawing.Point(154, 0)
Me.UstCntlUSTV_AntragPosition1.Name = "UstCntlUSTV_AntragPosition1"
Me.UstCntlUSTV_AntragPosition1.Size = New System.Drawing.Size(1282, 261)
Me.UstCntlUSTV_AntragPosition1.TabIndex = 0
'
'Panel4
'
Me.Panel4.BackColor = System.Drawing.Color.WhiteSmoke
@@ -1309,6 +1358,14 @@ Partial Class frmMDM_USTVAntrag
Me.pnlErstattungsdetails.Size = New System.Drawing.Size(1436, 261)
Me.pnlErstattungsdetails.TabIndex = 0
'
'UstCntlUSTV_AntragErstattungen1
'
Me.UstCntlUSTV_AntragErstattungen1.Dock = System.Windows.Forms.DockStyle.Fill
Me.UstCntlUSTV_AntragErstattungen1.Location = New System.Drawing.Point(154, 0)
Me.UstCntlUSTV_AntragErstattungen1.Name = "UstCntlUSTV_AntragErstattungen1"
Me.UstCntlUSTV_AntragErstattungen1.Size = New System.Drawing.Size(1280, 259)
Me.UstCntlUSTV_AntragErstattungen1.TabIndex = 2
'
'Panel1
'
Me.Panel1.BackColor = System.Drawing.Color.WhiteSmoke
@@ -1359,59 +1416,15 @@ Partial Class frmMDM_USTVAntrag
Me.ContextMenuStrip2.Name = "ContextMenuStrip1"
Me.ContextMenuStrip2.Size = New System.Drawing.Size(61, 4)
'
'UstCntlUSTV_AntragPosition1
'picExcel
'
Me.UstCntlUSTV_AntragPosition1.Dock = System.Windows.Forms.DockStyle.Fill
Me.UstCntlUSTV_AntragPosition1.Location = New System.Drawing.Point(154, 0)
Me.UstCntlUSTV_AntragPosition1.Name = "UstCntlUSTV_AntragPosition1"
Me.UstCntlUSTV_AntragPosition1.Size = New System.Drawing.Size(1282, 261)
Me.UstCntlUSTV_AntragPosition1.TabIndex = 0
'
'UstCntlUSTV_AntragErstattungen1
'
Me.UstCntlUSTV_AntragErstattungen1.Dock = System.Windows.Forms.DockStyle.Fill
Me.UstCntlUSTV_AntragErstattungen1.Location = New System.Drawing.Point(154, 0)
Me.UstCntlUSTV_AntragErstattungen1.Name = "UstCntlUSTV_AntragErstattungen1"
Me.UstCntlUSTV_AntragErstattungen1.Size = New System.Drawing.Size(1280, 259)
Me.UstCntlUSTV_AntragErstattungen1.TabIndex = 2
'
'Label14
'
Me.Label14.AutoSize = True
Me.Label14.BackColor = System.Drawing.Color.Transparent
Me.Label14.Cursor = System.Windows.Forms.Cursors.Hand
Me.Label14.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label14.ForeColor = System.Drawing.Color.Black
Me.Label14.Location = New System.Drawing.Point(524, 64)
Me.Label14.Name = "Label14"
Me.Label14.Size = New System.Drawing.Size(101, 17)
Me.Label14.TabIndex = 27
Me.Label14.Text = "eingereicht am"
'
'txtEingereichtAm
'
Me.txtEingereichtAm._DateTimeOnly = False
Me.txtEingereichtAm._numbersOnly = False
Me.txtEingereichtAm._numbersOnlyKommastellen = ""
Me.txtEingereichtAm._numbersOnlyTrennzeichen = False
Me.txtEingereichtAm._Prozent = False
Me.txtEingereichtAm._ShortDateNew = False
Me.txtEingereichtAm._ShortDateOnly = True
Me.txtEingereichtAm._TimeOnly = False
Me.txtEingereichtAm._TimeOnly_Seconds = False
Me.txtEingereichtAm._value = ""
Me.txtEingereichtAm._Waehrung = False
Me.txtEingereichtAm._WaehrungZeichen = False
Me.txtEingereichtAm.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!)
Me.txtEingereichtAm.ForeColor = System.Drawing.Color.Black
Me.txtEingereichtAm.Location = New System.Drawing.Point(654, 60)
Me.txtEingereichtAm.MaxLength = 10
Me.txtEingereichtAm.MaxLineLength = -1
Me.txtEingereichtAm.MaxLines_Warning = ""
Me.txtEingereichtAm.MaxLines_Warning_Label = Nothing
Me.txtEingereichtAm.Name = "txtEingereichtAm"
Me.txtEingereichtAm.Size = New System.Drawing.Size(100, 23)
Me.txtEingereichtAm.TabIndex = 26
Me.picExcel.Image = Global.SDL.My.Resources.Resources.Excel_logo
Me.picExcel.Location = New System.Drawing.Point(1014, 39)
Me.picExcel.Name = "picExcel"
Me.picExcel.Size = New System.Drawing.Size(35, 35)
Me.picExcel.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom
Me.picExcel.TabIndex = 29
Me.picExcel.TabStop = False
'
'frmMDM_USTVAntrag
'
@@ -1452,6 +1465,7 @@ Partial Class frmMDM_USTVAntrag
CType(Me.dgvErstattungspositionen, System.ComponentModel.ISupportInitialize).EndInit()
Me.pnlErstattungsdetails.ResumeLayout(False)
Me.Panel1.ResumeLayout(False)
CType(Me.picExcel, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
@@ -1543,4 +1557,5 @@ Partial Class frmMDM_USTVAntrag
Friend WithEvents Button4 As Button
Friend WithEvents Label14 As Label
Friend WithEvents txtEingereichtAm As VERAG_PROG_ALLGEMEIN.MyTextBox
Friend WithEvents picExcel As PictureBox
End Class

View File

@@ -3,6 +3,7 @@ Imports System.IO
Imports System.Reflection
Imports System.Windows.Documents
Imports com.sun.tools.corba.se.idl.constExpr
Imports GrapeCity.Enterprise.Data.Expressions.Tools
Imports IKVM.internal
Imports itextsharp.text.pdf
Imports itextsharp.text.pdf.parser
@@ -2158,6 +2159,67 @@ Public Class frmMDM_USTVAntrag
End With
End Sub
Private Sub picExcel_Click(sender As Object, e As EventArgs) Handles picExcel.Click
Dim dtNew As DataTable = cProgramFunctions.dgridViewTods(dgvUSTVPositionen, True)
If dtNew IsNot Nothing AndAlso dtNew.Rows.Count > 0 Then
If dtNew.Columns.Contains("UStVPo_Schnittstelle") Then dtNew.Columns.Remove("UStVPo_Schnittstelle")
If dtNew.Columns.Contains("UStVPo_SchnittstellenNr") Then dtNew.Columns.Remove("UStVPo_SchnittstellenNr")
If dtNew.Columns.Contains("UStVPo_USteuerbetragEUR") Then dtNew.Columns.Remove("UStVPo_USteuerbetragEUR")
If dtNew.Columns.Contains("UStVPo_Umrechnungskurs") Then dtNew.Columns.Remove("UStVPo_Umrechnungskurs")
If dtNew.Columns.Contains("UStVPo_Sachbearbeiter") Then dtNew.Columns.Remove("UStVPo_Sachbearbeiter")
If dtNew.Columns.Contains("UStVPo_daId") Then dtNew.Columns.Remove("UStVPo_daId")
If dtNew.Columns.Contains("UStVAn_ID") Then dtNew.Columns.Remove("UStVAn_ID")
If dtNew.Columns.Contains("clmnPDF") Then dtNew.Columns.Remove("clmnPDF")
Dim sumVAT As Double = 0
For Each row In dtNew.Rows
If Not IsDBNull(row("UStVPo_USteuerbetrag")) AndAlso IsNumeric(row("UStVPo_USteuerbetrag")) Then sumVAT += CDbl(row("UStVPo_USteuerbetrag"))
Next
Dim drLast = dtNew.NewRow
If dtNew.Columns.Contains("UStVPo_ID") Then drLast.Item("UStVPo_ID") = DBNull.Value
If dtNew.Columns.Contains("UStVPo_ReDat") Then drLast.Item("UStVPo_ReDat") = DBNull.Value
If dtNew.Columns.Contains("UStVPo_ReNr") Then drLast.Item("UStVPo_ReNr") = DBNull.Value
If dtNew.Columns.Contains("UStVPo_USteuerbetrag") Then drLast.Item("UStVPo_USteuerbetrag") = sumVAT
If dtNew.Columns.Contains("UStVPo_Leistender") Then drLast.Item("UStVPo_Leistender") = DBNull.Value
If dtNew.Columns.Contains("UstV_Leistender_Strasse") Then drLast.Item("UstV_Leistender_Strasse") = DBNull.Value
If dtNew.Columns.Contains("UstV_Leistender_Stadt") Then drLast.Item("UstV_Leistender_Stadt") = DBNull.Value
If dtNew.Columns.Contains("UstV_Leistender_Land") Then drLast.Item("UstV_Leistender_Land") = DBNull.Value
If dtNew.Columns.Contains("UstV_Leistender_PLZ") Then drLast.Item("UstV_Leistender_PLZ") = DBNull.Value
If dtNew.Columns.Contains("UstV_Leistender_UstNr") Then drLast.Item("UstV_Leistender_UstNr") = DBNull.Value
If dtNew.Columns.Contains("UStVPo_Leistungsbezeichnung") Then drLast.Item("UStVPo_Leistungsbezeichnung") = DBNull.Value
dtNew.Rows.InsertAt(drLast, dtNew.Rows.Count)
For Each col As DataColumn In dtNew.Columns
If col.ColumnName = "UStVPo_ID" Then col.ColumnName = col.ColumnName.Replace("UStVPo_ID", "Number")
If col.ColumnName = "UStVPo_ReDat" Then col.ColumnName = col.ColumnName.Replace("UStVPo_ReDat", "Date of invoice/import document")
If col.ColumnName = "UStVPo_ReNr" Then col.ColumnName = col.ColumnName.Replace("UStVPo_ReNr", "Number of invoice/import document")
If col.ColumnName = "UStVPo_USteuerbetrag" Then col.ColumnName = col.ColumnName.Replace("UStVPo_USteuerbetrag", "Amount of tax refund applied for")
If col.ColumnName = "UStVPo_Leistender" Then col.ColumnName = col.ColumnName.Replace("UStVPo_Leistender", "Name of supplier")
If col.ColumnName = "UstV_Leistender_Strasse" Then col.ColumnName = col.ColumnName.Replace("UstV_Leistender_Strasse", "Street")
If col.ColumnName = "UstV_Leistender_Stadt" Then col.ColumnName = col.ColumnName.Replace("UstV_Leistender_Stadt", "City")
If col.ColumnName = "UstV_Leistender_Land" Then col.ColumnName = col.ColumnName.Replace("UstV_Leistender_Land", "Country")
If col.ColumnName = "UstV_Leistender_PLZ" Then col.ColumnName = col.ColumnName.Replace("UstV_Leistender_PLZ", "Postal Code")
If col.ColumnName = "UstV_Leistender_UstNr" Then col.ColumnName = col.ColumnName.Replace("UstV_Leistender_UstNr", "VAT")
If col.ColumnName = "UStVPo_Leistungsbezeichnung" Then col.ColumnName = col.ColumnName.Replace("UStVPo_Leistungsbezeichnung", "Name of service")
Next
cProgramFunctions.genExcelFromDT_NEW(dtNew, {"K1:K" & (dtNew.Rows.Count + 1)},, "Statement itemising VAT amounts relating to the period covered by this application", "VAT NO.: " & USTV_ANTRAG.UStVAn_Steuernummer & vbNewLine & "Name/Company: " & USTV_ANTRAG.UStVAn_Name, IIf(USTV_ANTRAG.UStVAn_Währungscode = "EUR", "", ""), True)
End If
End Sub
Private Sub initdgvErstattungen()

View File

@@ -1337,7 +1337,8 @@ Public Class cProgramFunctions
If valueTmp Is DBNull.Value Then
row.Item(column.Index) = ""
Else
If replaceZeroDate AndAlso Not IsNumeric(valueTmp) Then valueTmp = valueTmp.ToString.Replace(" 00:00:00", "")
If replaceZeroDate AndAlso valueTmp IsNot Nothing AndAlso Not IsNumeric(valueTmp) Then valueTmp = valueTmp.ToString.Replace(" 00:00:00", "")
row.Item(column.Index) = valueTmp
End If
Next

View File

@@ -301,7 +301,7 @@ Public Class cUStVPositionen
Property UStVPo_Sachbearbeiter As Object = Nothing ' NVARCHAR(15) NULL,
Property UStVPo_Zeitstempel As Object = Nothing ' DATETIME Default (getdate()) NULL,
Property UStVPo_daId As Object = Nothing
Property UStVPo_daId_loeschbar As Object = Nothing
Property UStVPo_daId_loeschbar As Boolean = True
Dim SQL As New SQL