This commit is contained in:
2024-08-22 13:52:38 +02:00
9 changed files with 428 additions and 62 deletions

View File

@@ -122,7 +122,7 @@ Public Class frmMDM_USTVAntrag
Select Case If(r.Cells("UStVPo_SchnittstellenNr").Value, -1)
Case 6, 0 : da_id = SQL.getValueTxtBySql("SELECT TOP(1) [plInv_daId] FROM [tblPLOSE_Inv_Data] where plInv_SupplierRechnungsDatum='" & r.Cells("UStVPo_ReDat").Value & "' and plInv_SupplierRechnungsNr='" & r.Cells("UStVPo_ReNr").Value & "' and plInv_SupplierCountry='" & Antrag_LandKz & "' AND [plInv_daId] is not null", "FMZOLL",,, -1)
Case 7 : da_id = SQL.getValueTxtBySql("SELECT TOP(1) [rmc_daId] FROM [tblRMCImport] where rmc_reDatum='" & r.Cells("UStVPo_ReDat").Value & "' and rmc_reNr='" & r.Cells("UStVPo_ReNr") & "' and rmc_landKZ='" & Antrag_LandKz & "' AND [rmc_daId] is not null", "FMZOLL",,, -1)
Case 7 : da_id = SQL.getValueTxtBySql("SELECT TOP(1) [rmc_daId] FROM [tblRMCImport] where rmc_reDatum='" & r.Cells("UStVPo_ReDat").Value & "' and rmc_reNr='" & r.Cells("UStVPo_ReNr").Value & "' and rmc_landKZ='" & Antrag_LandKz & "' AND [rmc_daId] is not null", "FMZOLL",,, -1)
End Select
If da_id > 0 Then

View File

@@ -28,6 +28,7 @@ Partial Class usrCntlUSTV
Me.dgvUSTV = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components)
Me.Label1 = New System.Windows.Forms.Label()
Me.Panel1 = New System.Windows.Forms.Panel()
Me.cbxDifferenzbetrag = New System.Windows.Forms.CheckBox()
Me.cbxEingereicht = New System.Windows.Forms.CheckBox()
Me.cbxTopMax = New System.Windows.Forms.CheckBox()
Me.txtMaxSrch = New VERAG_PROG_ALLGEMEIN.MyTextBox()
@@ -41,12 +42,18 @@ Partial Class usrCntlUSTV
Me.FlatButton2 = New System.Windows.Forms.Button()
Me.Panel2 = New System.Windows.Forms.Panel()
Me.Panel3 = New System.Windows.Forms.Panel()
Me.btnRMCalle = New System.Windows.Forms.Button()
Me.btnMail = New System.Windows.Forms.Button()
Me.btnPLOSEAlle = New System.Windows.Forms.Button()
Me.Button5 = New System.Windows.Forms.Button()
Me.Button8 = New System.Windows.Forms.Button()
Me.ContextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components)
Me.btnRMCalle = New System.Windows.Forms.Button()
Me.Label3 = New System.Windows.Forms.Label()
Me.Label4 = New System.Windows.Forms.Label()
Me.Label5 = New System.Windows.Forms.Label()
Me.txtSumUst = New VERAG_PROG_ALLGEMEIN.MyTextBox()
Me.txtSumErst = New VERAG_PROG_ALLGEMEIN.MyTextBox()
Me.txtSumDiff = New VERAG_PROG_ALLGEMEIN.MyTextBox()
CType(Me.dgvUSTV, System.ComponentModel.ISupportInitialize).BeginInit()
Me.Panel1.SuspendLayout()
Me.Panel2.SuspendLayout()
@@ -60,7 +67,7 @@ Partial Class usrCntlUSTV
Me.pnlFilter.Dock = System.Windows.Forms.DockStyle.Bottom
Me.pnlFilter.Location = New System.Drawing.Point(0, 53)
Me.pnlFilter.Name = "pnlFilter"
Me.pnlFilter.Size = New System.Drawing.Size(1072, 31)
Me.pnlFilter.Size = New System.Drawing.Size(1627, 31)
Me.pnlFilter.TabIndex = 6
'
'dgvUSTV
@@ -77,7 +84,7 @@ Partial Class usrCntlUSTV
Me.dgvUSTV.Name = "dgvUSTV"
Me.dgvUSTV.ReadOnly = True
Me.dgvUSTV.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect
Me.dgvUSTV.Size = New System.Drawing.Size(1072, 457)
Me.dgvUSTV.Size = New System.Drawing.Size(1627, 455)
Me.dgvUSTV.TabIndex = 1
'
'Label1
@@ -94,6 +101,7 @@ Partial Class usrCntlUSTV
'Panel1
'
Me.Panel1.BackColor = System.Drawing.Color.FromArgb(CType(CType(240, Byte), Integer), CType(CType(245, Byte), Integer), CType(CType(255, Byte), Integer))
Me.Panel1.Controls.Add(Me.cbxDifferenzbetrag)
Me.Panel1.Controls.Add(Me.cbxEingereicht)
Me.Panel1.Controls.Add(Me.cbxTopMax)
Me.Panel1.Controls.Add(Me.txtMaxSrch)
@@ -107,9 +115,22 @@ Partial Class usrCntlUSTV
Me.Panel1.Dock = System.Windows.Forms.DockStyle.Top
Me.Panel1.Location = New System.Drawing.Point(0, 0)
Me.Panel1.Name = "Panel1"
Me.Panel1.Size = New System.Drawing.Size(1072, 84)
Me.Panel1.Size = New System.Drawing.Size(1627, 84)
Me.Panel1.TabIndex = 0
'
'cbxDifferenzbetrag
'
Me.cbxDifferenzbetrag.AutoSize = True
Me.cbxDifferenzbetrag.Checked = True
Me.cbxDifferenzbetrag.CheckState = System.Windows.Forms.CheckState.Indeterminate
Me.cbxDifferenzbetrag.Location = New System.Drawing.Point(503, 35)
Me.cbxDifferenzbetrag.Name = "cbxDifferenzbetrag"
Me.cbxDifferenzbetrag.Size = New System.Drawing.Size(132, 17)
Me.cbxDifferenzbetrag.TabIndex = 47
Me.cbxDifferenzbetrag.Text = "nur mit Differenzbetrag"
Me.cbxDifferenzbetrag.ThreeState = True
Me.cbxDifferenzbetrag.UseVisualStyleBackColor = True
'
'cbxEingereicht
'
Me.cbxEingereicht.AutoSize = True
@@ -236,7 +257,7 @@ Partial Class usrCntlUSTV
Me.Button1.ForeColor = System.Drawing.Color.Black
Me.Button1.Image = Global.SDL.My.Resources.Resources.Excel_logo
Me.Button1.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.Button1.Location = New System.Drawing.Point(955, 6)
Me.Button1.Location = New System.Drawing.Point(1510, 6)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(114, 39)
Me.Button1.TabIndex = 5
@@ -279,15 +300,21 @@ Partial Class usrCntlUSTV
Me.Panel2.BackColor = System.Drawing.Color.White
Me.Panel2.Controls.Add(Me.Panel3)
Me.Panel2.Dock = System.Windows.Forms.DockStyle.Bottom
Me.Panel2.Location = New System.Drawing.Point(0, 541)
Me.Panel2.Location = New System.Drawing.Point(0, 539)
Me.Panel2.MinimumSize = New System.Drawing.Size(0, 50)
Me.Panel2.Name = "Panel2"
Me.Panel2.Size = New System.Drawing.Size(1072, 66)
Me.Panel2.Size = New System.Drawing.Size(1627, 77)
Me.Panel2.TabIndex = 2
'
'Panel3
'
Me.Panel3.AutoSize = True
Me.Panel3.Controls.Add(Me.txtSumDiff)
Me.Panel3.Controls.Add(Me.txtSumErst)
Me.Panel3.Controls.Add(Me.txtSumUst)
Me.Panel3.Controls.Add(Me.Label5)
Me.Panel3.Controls.Add(Me.Label4)
Me.Panel3.Controls.Add(Me.Label3)
Me.Panel3.Controls.Add(Me.btnRMCalle)
Me.Panel3.Controls.Add(Me.btnMail)
Me.Panel3.Controls.Add(Me.btnPLOSEAlle)
@@ -299,9 +326,24 @@ Partial Class usrCntlUSTV
Me.Panel3.Dock = System.Windows.Forms.DockStyle.Fill
Me.Panel3.Location = New System.Drawing.Point(0, 0)
Me.Panel3.Name = "Panel3"
Me.Panel3.Size = New System.Drawing.Size(1072, 66)
Me.Panel3.Size = New System.Drawing.Size(1627, 77)
Me.Panel3.TabIndex = 0
'
'btnRMCalle
'
Me.btnRMCalle.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btnRMCalle.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!)
Me.btnRMCalle.ForeColor = System.Drawing.Color.Black
Me.btnRMCalle.Image = Global.SDL.My.Resources.Resources.plus
Me.btnRMCalle.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.btnRMCalle.Location = New System.Drawing.Point(545, 6)
Me.btnRMCalle.Name = "btnRMCalle"
Me.btnRMCalle.Size = New System.Drawing.Size(172, 40)
Me.btnRMCalle.TabIndex = 26
Me.btnRMCalle.Text = "RMC für offene " & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "Anträge übernehmen"
Me.btnRMCalle.TextAlign = System.Drawing.ContentAlignment.MiddleRight
Me.btnRMCalle.UseVisualStyleBackColor = True
'
'btnMail
'
Me.btnMail.FlatStyle = System.Windows.Forms.FlatStyle.Flat
@@ -335,7 +377,7 @@ Partial Class usrCntlUSTV
Me.Button5.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.Button5.Image = Global.SDL.My.Resources.Resources.kunden
Me.Button5.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.Button5.Location = New System.Drawing.Point(831, 5)
Me.Button5.Location = New System.Drawing.Point(1386, 5)
Me.Button5.Name = "Button5"
Me.Button5.Size = New System.Drawing.Size(118, 40)
Me.Button5.TabIndex = 23
@@ -362,20 +404,110 @@ Partial Class usrCntlUSTV
Me.ContextMenuStrip1.Name = "ContextMenuStrip1"
Me.ContextMenuStrip1.Size = New System.Drawing.Size(61, 4)
'
'btnRMCalle
'Label3
'
Me.btnRMCalle.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btnRMCalle.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!)
Me.btnRMCalle.ForeColor = System.Drawing.Color.Black
Me.btnRMCalle.Image = Global.SDL.My.Resources.Resources.plus
Me.btnRMCalle.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.btnRMCalle.Location = New System.Drawing.Point(545, 6)
Me.btnRMCalle.Name = "btnRMCalle"
Me.btnRMCalle.Size = New System.Drawing.Size(172, 40)
Me.btnRMCalle.TabIndex = 26
Me.btnRMCalle.Text = "RMC für offene " & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "Anträge übernehmen"
Me.btnRMCalle.TextAlign = System.Drawing.ContentAlignment.MiddleRight
Me.btnRMCalle.UseVisualStyleBackColor = True
Me.Label3.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.Label3.AutoSize = True
Me.Label3.Location = New System.Drawing.Point(1074, 8)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(59, 13)
Me.Label3.TabIndex = 27
Me.Label3.Text = "USt-Betrag"
'
'Label4
'
Me.Label4.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.Label4.AutoSize = True
Me.Label4.Location = New System.Drawing.Point(1074, 29)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(90, 13)
Me.Label4.TabIndex = 28
Me.Label4.Text = "Erstattungsbetrag"
'
'Label5
'
Me.Label5.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.Label5.AutoSize = True
Me.Label5.Location = New System.Drawing.Point(1074, 49)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(79, 13)
Me.Label5.TabIndex = 29
Me.Label5.Text = "Differenzbetrag"
'
'txtSumUst
'
Me.txtSumUst._DateTimeOnly = False
Me.txtSumUst._numbersOnly = False
Me.txtSumUst._numbersOnlyKommastellen = ""
Me.txtSumUst._numbersOnlyTrennzeichen = True
Me.txtSumUst._Prozent = False
Me.txtSumUst._ShortDateNew = False
Me.txtSumUst._ShortDateOnly = False
Me.txtSumUst._TimeOnly = False
Me.txtSumUst._TimeOnly_Seconds = False
Me.txtSumUst._value = ""
Me.txtSumUst._Waehrung = True
Me.txtSumUst._WaehrungZeichen = True
Me.txtSumUst.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.txtSumUst.ForeColor = System.Drawing.Color.Black
Me.txtSumUst.Location = New System.Drawing.Point(1179, 6)
Me.txtSumUst.MaxLineLength = -1
Me.txtSumUst.MaxLines_Warning = ""
Me.txtSumUst.MaxLines_Warning_Label = Nothing
Me.txtSumUst.Name = "txtSumUst"
Me.txtSumUst.ReadOnly = True
Me.txtSumUst.Size = New System.Drawing.Size(107, 20)
Me.txtSumUst.TabIndex = 30
'
'txtSumErst
'
Me.txtSumErst._DateTimeOnly = False
Me.txtSumErst._numbersOnly = False
Me.txtSumErst._numbersOnlyKommastellen = ""
Me.txtSumErst._numbersOnlyTrennzeichen = True
Me.txtSumErst._Prozent = False
Me.txtSumErst._ShortDateNew = False
Me.txtSumErst._ShortDateOnly = False
Me.txtSumErst._TimeOnly = False
Me.txtSumErst._TimeOnly_Seconds = False
Me.txtSumErst._value = ""
Me.txtSumErst._Waehrung = True
Me.txtSumErst._WaehrungZeichen = True
Me.txtSumErst.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.txtSumErst.ForeColor = System.Drawing.Color.Black
Me.txtSumErst.Location = New System.Drawing.Point(1179, 26)
Me.txtSumErst.MaxLineLength = -1
Me.txtSumErst.MaxLines_Warning = ""
Me.txtSumErst.MaxLines_Warning_Label = Nothing
Me.txtSumErst.Name = "txtSumErst"
Me.txtSumErst.ReadOnly = True
Me.txtSumErst.Size = New System.Drawing.Size(107, 20)
Me.txtSumErst.TabIndex = 31
'
'txtSumDiff
'
Me.txtSumDiff._DateTimeOnly = False
Me.txtSumDiff._numbersOnly = False
Me.txtSumDiff._numbersOnlyKommastellen = ""
Me.txtSumDiff._numbersOnlyTrennzeichen = True
Me.txtSumDiff._Prozent = False
Me.txtSumDiff._ShortDateNew = False
Me.txtSumDiff._ShortDateOnly = False
Me.txtSumDiff._TimeOnly = False
Me.txtSumDiff._TimeOnly_Seconds = False
Me.txtSumDiff._value = ""
Me.txtSumDiff._Waehrung = True
Me.txtSumDiff._WaehrungZeichen = True
Me.txtSumDiff.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.txtSumDiff.ForeColor = System.Drawing.Color.Black
Me.txtSumDiff.Location = New System.Drawing.Point(1179, 46)
Me.txtSumDiff.MaxLineLength = -1
Me.txtSumDiff.MaxLines_Warning = ""
Me.txtSumDiff.MaxLines_Warning_Label = Nothing
Me.txtSumDiff.Name = "txtSumDiff"
Me.txtSumDiff.ReadOnly = True
Me.txtSumDiff.Size = New System.Drawing.Size(107, 20)
Me.txtSumDiff.TabIndex = 32
'
'usrCntlUSTV
'
@@ -385,13 +517,14 @@ Partial Class usrCntlUSTV
Me.Controls.Add(Me.Panel2)
Me.Controls.Add(Me.Panel1)
Me.Name = "usrCntlUSTV"
Me.Size = New System.Drawing.Size(1072, 607)
Me.Size = New System.Drawing.Size(1627, 616)
CType(Me.dgvUSTV, System.ComponentModel.ISupportInitialize).EndInit()
Me.Panel1.ResumeLayout(False)
Me.Panel1.PerformLayout()
Me.Panel2.ResumeLayout(False)
Me.Panel2.PerformLayout()
Me.Panel3.ResumeLayout(False)
Me.Panel3.PerformLayout()
Me.ResumeLayout(False)
End Sub
@@ -418,4 +551,11 @@ Partial Class usrCntlUSTV
Friend WithEvents txtMaxSrch As VERAG_PROG_ALLGEMEIN.MyTextBox
Friend WithEvents cbxEingereicht As CheckBox
Friend WithEvents btnRMCalle As Button
Friend WithEvents cbxDifferenzbetrag As CheckBox
Friend WithEvents Label5 As Label
Friend WithEvents Label4 As Label
Friend WithEvents Label3 As Label
Friend WithEvents txtSumDiff As VERAG_PROG_ALLGEMEIN.MyTextBox
Friend WithEvents txtSumErst As VERAG_PROG_ALLGEMEIN.MyTextBox
Friend WithEvents txtSumUst As VERAG_PROG_ALLGEMEIN.MyTextBox
End Class

View File

@@ -2,7 +2,7 @@
Imports System.Data.SqlClient
Imports Microsoft.Office.Interop
Imports VERAG_PROG_ALLGEMEIN
Imports VERAG_PROG_ALLGEMEIN.CBAM_QReport_17
Public Class usrCntlUSTV
@@ -39,7 +39,7 @@ Public Class usrCntlUSTV
End If
End If
.SET_SQL("SELECT " & topMax & " [UStVAn_ID],UStVAn_AntragArt,[UStVAn_KuNr],[UStVAn_Name],LandKz,[UStVAn_ReDatVon],[UStVAn_ReDatBis] ,UStVAn_AntragEingereichtAm,[UStVAn_3470] ,[UStVAn_Währungscode],[UStVAn_USteuerbetrag],[UStVAn_Erstattungsbetrag],[UStVAn_USteuerbetragEUR],[UStVAn_ErstattungsbetragEUR],[UStVAn_Sachbearbeiter]
.SET_SQL("SELECT " & topMax & " [UStVAn_ID],UStVAn_AntragArt,[UStVAn_KuNr],[UStVAn_Name],LandKz, UStVAn_BezugsNr, [UStVAn_ReDatVon], [UStVAn_ReDatBis] ,UStVAn_AntragEingereichtAm,[UStVAn_3470] ,[UStVAn_Währungscode],[UStVAn_USteuerbetrag],[UStVAn_Erstattungsbetrag],([UStVAn_USteuerbetrag] - [UStVAn_Erstattungsbetrag]) as UStVAn_Differenzbetrag,[UStVAn_USteuerbetragEUR],[UStVAn_ErstattungsbetragEUR],([UStVAn_USteuerbetragEUR] - [UStVAn_ErstattungsbetragEUR]) as UStVAn_DifferenzbetragEUR,[UStVAn_VZBetrag],[UStVAn_VZDatum],[UStVAn_Sachbearbeiter]
FROM [tblUStVAntrag] inner join [Länderverzeichnis für die Außenhandelsstatistik] on UStVAn_LandNr=Landnr
where 1=1 " & getWhere() & "
order by UStVAn_KuNr,UStVAn_Name,datepart(year,[UStVAn_ReDatVon] ) desc,LandKz,[UStVAn_ReDatVon] desc", "FMZOLL")
@@ -53,6 +53,10 @@ Public Class usrCntlUSTV
If .Columns.Count > 0 Then
Dim DataGridViewCellStyleDate = New DataGridViewCellStyle()
DataGridViewCellStyleDate.Format = "MM/yyyy"
.Columns("UStVAn_ID").Visible = False
.Columns("UStVAn_AntragArt").HeaderText = "Art"
.Columns("UStVAn_AntragArt").MinimumWidth = 50
@@ -69,11 +73,15 @@ Public Class usrCntlUSTV
.Columns("LandKz").Width = 60
.Columns("UStVAn_ReDatVon").HeaderText = "Von"
.Columns("UStVAn_ReDatVon").DefaultCellStyle = DataGridViewCellStyleDate
.Columns("UStVAn_ReDatVon").Width = 100
.Columns("UStVAn_ReDatBis").HeaderText = "Bis"
.Columns("UStVAn_ReDatBis").DefaultCellStyle = DataGridViewCellStyleDate
.Columns("UStVAn_ReDatBis").Width = 100
.Columns("UStVAn_BezugsNr").HeaderText = "BezugsNr"
.Columns("UStVAn_BezugsNr").Width = 100
.Columns("UStVAn_AntragEingereichtAm").HeaderText = "EingereichtAm"
.Columns("UStVAn_AntragEingereichtAm").Width = 100
@@ -96,6 +104,12 @@ Public Class usrCntlUSTV
.Columns("UStVAn_Erstattungsbetrag").DefaultCellStyle.Format = "N2"
.Columns("UStVAn_Erstattungsbetrag").DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
.Columns("UStVAn_Differenzbetrag").HeaderText = "Differenz-Betrag"
.Columns("UStVAn_Differenzbetrag").Width = 150
.Columns("UStVAn_Differenzbetrag").DefaultCellStyle.Format = "N2"
.Columns("UStVAn_Differenzbetrag").DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
.Columns("UStVAn_ErstattungsbetragEUR").HeaderText = "Erstattung-Betrag EUR"
.Columns("UStVAn_ErstattungsbetragEUR").Width = 150
.Columns("UStVAn_ErstattungsbetragEUR").DefaultCellStyle.Format = "N2"
@@ -106,11 +120,45 @@ Public Class usrCntlUSTV
.Columns("UStVAn_USteuerbetragEUR").DefaultCellStyle.Format = "N2"
.Columns("UStVAn_USteuerbetragEUR").DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
.Columns("UStVAn_DifferenzbetragEUR").HeaderText = "Differenz-Betrag EUR"
.Columns("UStVAn_DifferenzbetragEUR").Width = 150
.Columns("UStVAn_DifferenzbetragEUR").DefaultCellStyle.Format = "N2"
.Columns("UStVAn_DifferenzbetragEUR").DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
.Columns("UStVAn_VZDatum").HeaderText = "Vorauszahlung Am"
.Columns("UStVAn_VZDatum").Width = 100
.Columns("UStVAn_VZBetrag").HeaderText = "Vorauszahlung-Betrag"
.Columns("UStVAn_VZBetrag").Width = 150
.Columns("UStVAn_VZBetrag").DefaultCellStyle.Format = "N2"
.Columns("UStVAn_VZBetrag").DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
.Columns("UStVAn_Sachbearbeiter").HeaderText = "Sachbearbeiter"
.Columns("UStVAn_Sachbearbeiter").MinimumWidth = 150
.Columns("UStVAn_Sachbearbeiter").AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill
End If
Dim GesamtUSteuer As Double
Dim GesamtErstattung As Double
Dim Differnezbetrag As Double
If KdSearchBox1.KdNr > 0 Then
GesamtUSteuer = SQL.DLookup("isnull(sum(UStVAn_USteuerbetragEUR),0)", "tblUStVAntrag", "UStVAn_KuNr='" & KdSearchBox1.KdNr & "'", "FMZOLL", "0")
GesamtErstattung = SQL.DLookup("isnull(sum(UStVAn_ErstattungsbetragEUR),0)", "tblUStVAntrag", "UStVAn_KuNr='" & KdSearchBox1.KdNr & "'", "FMZOLL", "0")
Else
For Each rows As DataGridViewRow In .Rows
If IsNumeric(rows.Cells("UStVAn_USteuerbetragEUR").Value) Then GesamtUSteuer += rows.Cells("UStVAn_USteuerbetragEUR").Value
If IsNumeric(rows.Cells("UStVAn_ErstattungsbetragEUR").Value) Then GesamtErstattung += rows.Cells("UStVAn_ErstattungsbetragEUR").Value
Next
End If
Differnezbetrag = GesamtUSteuer - GesamtErstattung
txtSumUst.Text = GesamtUSteuer.ToString("C2")
txtSumErst.Text = GesamtErstattung.ToString("C2")
txtSumDiff.Text = Differnezbetrag.ToString("C2")
End With
@@ -139,6 +187,14 @@ Public Class usrCntlUSTV
Case CheckState.Indeterminate
End Select
Select Case cbxDifferenzbetrag.CheckState
Case CheckState.Checked
whereStr &= " AND ([UStVAn_USteuerbetrag]-[UStVAn_Erstattungsbetrag]) <> 0"
Case CheckState.Unchecked
whereStr &= " AND ([UStVAn_USteuerbetrag]-[UStVAn_Erstattungsbetrag]) = 0 "
Case CheckState.Indeterminate
End Select
If KdSearchBox1.KdNr > 0 Then whereStr &= " AND UStVAn_KuNr=" & KdSearchBox1.KdNr & " "
Return whereStr
End Function
@@ -434,7 +490,7 @@ Public Class usrCntlUSTV
init()
End Sub
Private Sub cbxEingereicht_CheckedChanged(sender As Object, e As EventArgs) Handles cbxEingereicht.CheckStateChanged
Private Sub cbxEingereicht_CheckedChanged(sender As Object, e As EventArgs) Handles cbxEingereicht.CheckStateChanged, cbxDifferenzbetrag.CheckStateChanged
If loaded = False Then Exit Sub
init()
End Sub

View File

@@ -1,4 +1,5 @@
Imports java.awt.print

Imports VERAG_PROG_ALLGEMEIN
Public Class ustCntlUSTV_AntragPosition

View File

@@ -448,14 +448,14 @@ Public Class frmMDMDatenverarbetiung
Dim displayFilter = False
Dim sqlstr As String = ""
sqlstr &= " SELECT Adressen.AdressenNr, Adressen.[Name 1], trans.transaction_country AS Country,trans.device_product_type AS CardType, Sum(trans.transaction_gross_amount) AS [Transaction Amount], Sum(trans.total_gross_amount) AS [Total Amount]
sqlstr &= " SELECT Adressen.AdressenNr as KundenNr, Adressen.[Name 1] as Name, trans.transaction_country AS Country,trans.device_product_type AS CardType, trans.device_product_number AS CardNr,Sum(trans.transaction_gross_amount) AS [Transaction Amount], Sum(trans.total_gross_amount) AS [Total Amount]
FROM [VERAG].[dbo].[tblMSESettlements] as bills
inner join [VERAG].[dbo].[tblMSETransactions] as trans on bills.[transaction_id] = trans.[transaction_id]
inner join [VERAG].[dbo].[tblMSECustomers] as cust on cust.partner_customer_number = trans.partner_haulier_id
inner join [VERAG].[dbo].[tblMSEInvoices] as inv on inv.[invoice_id] = bills.[invoice_number] and inv.customer_number = cust.[customer_id] and trans.transaction_country = inv.country
left join adressen ON cust.[customer_id] = Adressen.MSEKundenNr
where bills.invoice_date = '" & DateTimePicker2.Text & "' and trans.charged <> 1
GROUP BY Adressen.AdressenNr, Adressen.[Name 1], trans.transaction_country, trans.device_product_type order by cust.customer_id"
GROUP BY Adressen.AdressenNr, Adressen.[Name 1], trans.transaction_country, trans.device_product_type, trans.device_product_number "
Dim dt As DataTable = SQL.loadDgvBySql_Param(sqlstr, "FMZOLL")
'DataGridView.DataSource = dt
@@ -468,9 +468,8 @@ Public Class frmMDMDatenverarbetiung
rpt.DataSource = dt
'If cbxProdukt.Checked Then
' rpt.GroupHeader2.DataField = "prod_descr"
'Else
' rpt.GroupHeader2.Visible = False
' rpt.GroupFooter2.Visible = False
@@ -503,7 +502,7 @@ Public Class frmMDMDatenverarbetiung
rpt.lblKundennr.Text = SQL.isDbnullEmpty(rpt.Fields.Item("KundenNr").Value, "")
rpt.lblName1.Text = SQL.isDbnullEmpty(rpt.Fields.Item("Name").Value, "")
rpt.lblKartennr.Text = SQL.isDbnullEmpty(rpt.Fields.Item("Country").Value, "") & " " & SQL.isDbnullEmpty(rpt.Fields.Item("CardType").Value, "")
rpt.lblKartennr.Text = SQL.isDbnullEmpty(rpt.Fields.Item("CardType").Value, "") & " - " & SQL.isDbnullEmpty(rpt.Fields.Item("Country").Value, "") & " - " & SQL.isDbnullEmpty(rpt.Fields.Item("CardNr").Value, "")
rpt.lblNetto.Text = SQL.isDbnullEmptyDbl(rpt.Fields.Item("Transaction Amount").Value, 2, "")
rpt.lblMWST.Text = "" 'SQL.isDbnullEmptyDbl(CDbl(rpt.Fields.Item("SummevonGesamtbetrag_Brutto_in_Darstellwährung").Value) - CDbl(rpt.Fields.Item("SummevonGesamtbetrag_Netto_in_Darstellwährung").Value), 2, "")
@@ -525,7 +524,7 @@ Public Class frmMDMDatenverarbetiung
AddHandler rpt.ReportFooter1.Format, Sub()
rpt.lblSumNetto.Text = sumNetto.ToString("N2")
'rpt.lblSumMwst.Text = sumMWST.ToString("N2")
rpt.lblSumMwst.Text = "" 'sumMWST.ToString("N2")
rpt.lblSumBrutto.Text = sumBrutto.ToString("N2")
End Sub
@@ -3443,7 +3442,7 @@ Public Class frmMDMDatenverarbetiung
Dim fehlendeTransactionen As Integer = 0
fehlendeTransactionen = CInt((New SQL).getValueTxtBySql("select count(*) FROM [VERAG].[dbo].[tblMSESettlements] where [invoice_date] = '" & DateTimePicker2.Text & "' AND [transaction_id] not in (select [transaction_id] from [VERAG].[dbo].[tblMSETransactions]) ", "AVISO"))
fehlendeTransactionen = CInt((New SQL).getValueTxtBySql("select count(*) FROM [VERAG].[dbo].[tblMSESettlements] where [invoice_date] = '" & DateTimePicker2.Text & "' AND [transaction_id] not in (select [transaction_id] from [VERAG].[dbo].[tblMSETransactions]) ", "FMZOLL"))