diff --git a/SDL/USTV/frmMDM_USTVAntrag.vb b/SDL/USTV/frmMDM_USTVAntrag.vb index 9d072336..07dda763 100644 --- a/SDL/USTV/frmMDM_USTVAntrag.vb +++ b/SDL/USTV/frmMDM_USTVAntrag.vb @@ -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 diff --git a/SDL/USTV/usrCntlUSTV.Designer.vb b/SDL/USTV/usrCntlUSTV.Designer.vb index 0caedc8a..dd8c6ec8 100644 --- a/SDL/USTV/usrCntlUSTV.Designer.vb +++ b/SDL/USTV/usrCntlUSTV.Designer.vb @@ -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 diff --git a/SDL/USTV/usrCntlUSTV.vb b/SDL/USTV/usrCntlUSTV.vb index cc21463d..c25bb9ee 100644 --- a/SDL/USTV/usrCntlUSTV.vb +++ b/SDL/USTV/usrCntlUSTV.vb @@ -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 diff --git a/SDL/USTV/ustCntlUSTV_AntragPosition.vb b/SDL/USTV/ustCntlUSTV_AntragPosition.vb index 80e78c08..4c035502 100644 --- a/SDL/USTV/ustCntlUSTV_AntragPosition.vb +++ b/SDL/USTV/ustCntlUSTV_AntragPosition.vb @@ -1,4 +1,5 @@ -Imports java.awt.print + + Imports VERAG_PROG_ALLGEMEIN Public Class ustCntlUSTV_AntragPosition diff --git a/SDL/mdm/frmMDMDatenverarbetiung.vb b/SDL/mdm/frmMDMDatenverarbetiung.vb index 3ca05232..0ede3f90 100644 --- a/SDL/mdm/frmMDMDatenverarbetiung.vb +++ b/SDL/mdm/frmMDMDatenverarbetiung.vb @@ -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")) diff --git a/VERAG_PROG_ALLGEMEIN/Classes/SQL.vb b/VERAG_PROG_ALLGEMEIN/Classes/SQL.vb index 470a16b1..651d6f57 100644 --- a/VERAG_PROG_ALLGEMEIN/Classes/SQL.vb +++ b/VERAG_PROG_ALLGEMEIN/Classes/SQL.vb @@ -1,4 +1,5 @@ Imports System.Data.SqlClient +Imports DocumentFormat.OpenXml.Bibliography Public Class SQL Public Const LeerDatum As Date = #12/30/1899# @@ -21,9 +22,20 @@ Public Class SQL Public Shared Function GetADMINConnectionString() As String If VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM Then - Return My.MySettings.Default.ADMINConnectionString_DEV + Try + Return My.MySettings.Default.ADMINConnectionString_DEV + Catch ex As Exception + Return "Data Source=SQLGUIDE01.verag.ost.dmn;Initial Catalog=ADMIN;Integrated Security=false;User ID=AppUser;Password=yp/THDd?xM+pZ$;" + + End Try + Else - Return My.MySettings.Default.ADMINConnectionString_DEV + Try + Return My.MySettings.Default.ADMINConnectionString_DEV + Catch ex As Exception + Return "Data Source=SQLGUIDE01.verag.ost.dmn;Initial Catalog=ADMIN;Integrated Security=false;User ID=AppUser;Password=yp/THDd?xM+pZ$;" + + End Try End If End Function Public Shared Function GetFMZOLLConnectionString() As String diff --git a/VERAG_PROG_ALLGEMEIN/DATENSERVER/cDATENSERVER.vb b/VERAG_PROG_ALLGEMEIN/DATENSERVER/cDATENSERVER.vb index ba3a0e08..d49ceaef 100644 --- a/VERAG_PROG_ALLGEMEIN/DATENSERVER/cDATENSERVER.vb +++ b/VERAG_PROG_ALLGEMEIN/DATENSERVER/cDATENSERVER.vb @@ -11,10 +11,9 @@ Imports Spire.Pdf Imports Spire.Pdf.HtmlConverter Imports System.Threading Imports System.Net -Imports Spire.Pdf.Tables -Imports System.Windows.Forms.VisualStyles + Imports System.Text.RegularExpressions -Imports System.Runtime.InteropServices.ComTypes +Imports System.Runtime.DesignerServices Public Class cDATENSERVER @@ -1249,6 +1248,7 @@ Public Class cFormularManager Public Shared Sub PrintViaSpirePDF(PDFFile As String(), Optional printerName As String = "") Try + Dim printerPaperSizeA4 As Boolean = False If printerName = "" Then Dim sPrinters As ArrayList @@ -1263,9 +1263,22 @@ Public Class cFormularManager If VERAG_PROG_ALLGEMEIN.cAllgemein.PRINTER_STANDARD <> String.Empty Then - For i As Integer = 0 To sPrinters.Count - 1 - If i.ToString.ToLower.Contains(VERAG_PROG_ALLGEMEIN.cAllgemein.PRINTER_STANDARD.ToLower) Then - printerName = i + For Each printer In sPrinters + + If printer.ToString.ToLower.Contains(VERAG_PROG_ALLGEMEIN.cAllgemein.PRINTER_STANDARD.ToLower) Then + printerName = printer + For Each installedPrinter In System.Drawing.Printing.PrinterSettings.InstalledPrinters + If printerName = installedPrinter.ToString Then + Dim currentInstalledPrinter As New System.Drawing.Printing.PrinterSettings + currentInstalledPrinter.PrinterName = printerName + For Each sizes In currentInstalledPrinter.PaperSizes + If sizes.PaperName = "A4" Then printerPaperSizeA4 = True + Exit For + Next + Exit For + End If + Next + Exit For End If Next End If @@ -1273,14 +1286,35 @@ Public Class cFormularManager If printerName = "" Then Dim oPS As New System.Drawing.Printing.PrinterSettings printerName = oPS.PrinterName + For Each sizes In oPS.PaperSizes + If sizes.PaperName = "A4" Then printerPaperSizeA4 = True + Exit For + Next + Else + If Not printerPaperSizeA4 Then + Dim currentInstalledPrinter As New System.Drawing.Printing.PrinterSettings + currentInstalledPrinter.PrinterName = printerName + For Each sizes In currentInstalledPrinter.PaperSizes + If sizes.PaperName = "A4" Then printerPaperSizeA4 = True + Exit For + Next + End If + End If - End If + End If 'Dim docs As Spire.Pdf.PdfDocument() = {New Spire.Pdf.PdfDocument("C:\Users\DEVELOPER1\Desktop\Agrotel.pdf")} If printerName = "" Then MsgBox("Drucker konnte nicht ermittelt werden!") + Exit Sub End If + + If Not printerPaperSizeA4 Then + MsgBox("Der ermittelte Drucker " & printerName & " unterstützt keinen A4 Ausdrucke!" & vbNewLine & "Vorang wird abgebrochen!") + Exit Sub + End If + VERAG_PROG_ALLGEMEIN.cProgramFunctions.spireLoadLicense() For Each pdfPath In PDFFile Dim doc As New Spire.Pdf.PdfDocument(pdfPath) @@ -1290,7 +1324,14 @@ Public Class cFormularManager doc.PageSettings.Orientation = Spire.Pdf.PdfPageOrientation.Landscape doc.PrintSettings.SelectSinglePageLayout(PdfSinglePageScalingMode.FitSize, True) doc.PrintSettings.PrinterName = printerName - doc.Print() + + If doc.PrintSettings.IsValid Then + doc.Print() + Else + MsgBox("Druckereinstellungen ungültig!") + Exit Sub + End If + 'doc.PrintDocument.DefaultPageSettings.Landscape = True @@ -1485,8 +1526,9 @@ Public Class cFormularManager If openFileAfterDownload Then - End If End If + End If + End Using End Using diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MSE/cMSEAPI.vb b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MSE/cMSEAPI.vb index 4a992b2b..8acb2ae0 100644 --- a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MSE/cMSEAPI.vb +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MSE/cMSEAPI.vb @@ -11,7 +11,7 @@ Public Class cMSEAPI Dim SQL As New SQL Dim apiSettingsloaded As Boolean = False Dim test As Boolean = False - Public PDFRECHNUNGENPFAD As String + Dim PDFRECHNUNGENPFAD As String = "" Sub New(program As String) @@ -159,6 +159,103 @@ Public Class cMSEAPI End Function + Public Function getNewestSettlements(jwt As String, dt As DataTable, ByRef batchNr As Integer, ByRef totalPages As Integer, ByRef currentPage As Integer) As String + Try + Dim returnText As String = "" + Dim failureText As String = "" + + Dim success As Boolean + + rest.DebugMode = test + + Dim bTls As Boolean = True + Dim port As Integer = 443 + Dim bAutoReconnect As Boolean = True + success = rest.Connect(API_STRING, port, bTls, bAutoReconnect) + If (success <> True) Then + Debug.WriteLine("ConnectFailReason: " & rest.ConnectFailReason) + Debug.WriteLine(rest.LastErrorText) + failureText = rest.LastErrorText + Return False + End If + + If (success <> True) Then + Debug.WriteLine("BAFailReason: " & rest.ConnectFailReason) + Debug.WriteLine(rest.LastErrorText) + failureText = rest.LastErrorText + Return False + End If + + rest.ClearAllQueryParams() + + rest.AddHeader("X-API-Key", jwt) + + rest.IdleTimeoutMs = 1000000 + + Dim responseJson As String = rest.FullRequestNoBody("GET", "/v1/settlements/new") + If (rest.LastMethodSuccess <> True) Then + Debug.WriteLine(rest.LastErrorText) + rest.IdleTimeoutMs = 30000 'defualt + Return rest.LastErrorText + End If + + If (rest.ResponseStatusCode <> IIf(rest.DebugMode = True, 201, 200) And rest.ResponseStatusCode <> 404) Then + Debug.WriteLine(rest.ResponseHeader) + Return rest.LastErrorText + End If + + Debug.WriteLine(responseJson) + + 'Newest Settlements werden nicht benötigt, erst beim Abrufen der RECHNUNG sollen die dazugehörigen Settlements abgerufen werden, allerdings müssen diese initial 1x per API abgerufen werden (mittels getNewSettlements , ansonsten können Sie nicht gefunden werden)! + + 'sollten sie dennoch gespeichert werden, dann fogenden Return-Statement auskommentieren (damit nachfolgender Code ausgeführt werden kann): + + '-------------START--- + + Return "" + + '-------------ENDE--- + + + If test Then + responseJson = "" + End If + + Dim json As New Chilkat.JsonObject + success = json.Load(responseJson) + If (success <> True) Then + Debug.WriteLine(json.LastErrorText) + End If + + Debug.WriteLine(json) + + batchNr = json.StringOf("batch_seq_nr") + totalPages = json.IntOf("total_pages") + currentPage = json.IntOf("page_nr") + + If json.StringOf("message") <> "" AndAlso json.StringOf("message") <> "OK" Then Return json.StringOf("message") + + Dim settlements As New Chilkat.JsonArray + settlements = json.ArrayOf("settlements") + If (json.LastMethodSuccess = False) Then + Debug.WriteLine("settlements member not found.") + End If + + + Dim num As Integer = settlements.Size + If num = -1 Then + Return "FEHLER im settlementsArray" + End If + + If json.StringOf("receiver") = "10738" Then saveSettlements(num, dt, settlements, json.StringOf("receiver")) + + + Catch ex As WebException + VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) + End Try + + End Function + Public Function getCustomers(jwt As String, dt As DataTable) As String Try Dim returnText As String = "" @@ -324,6 +421,8 @@ Public Class cMSEAPI Try Dim returnText As String = "" Dim failureText As String = "" + Dim missingcounter As Integer = 0 + Dim listOfMissingTransactions As New List(Of String) Dim success As Boolean @@ -387,26 +486,40 @@ Public Class cMSEAPI End If Debug.WriteLine(json) + Dim saveTransaction As Boolean = True + If json.StringOf("message") <> "" AndAlso json.StringOf("message") <> "OK" Then + If Not json.StringOf("message").ToString.Contains("No transaction found for") Then + Return json.StringOf("message") + Else + saveTransaction = False + transactionID.Columns("found").ReadOnly = False + row.Item("found") = False + transactionID.Columns("found").ReadOnly = True - If json.StringOf("message") <> "" AndAlso json.StringOf("message") <> "OK" Then Return json.StringOf("message") - Dim transactions As New Chilkat.JsonArray - transactions = json.ArrayOf("transactions") - If (json.LastMethodSuccess = False) Then - Debug.WriteLine("transactions member not found.") + End If + End If + If saveTransaction Then + Dim transactions As New Chilkat.JsonArray + transactions = json.ArrayOf("transactions") + If (json.LastMethodSuccess = False) Then + Debug.WriteLine("transactions member not found.") + End If - Dim num As Integer = transactions.Size - If num = -1 Then - Return "FEHLER Array Transaktions ist leer" + + Dim num As Integer = transactions.Size + If num = -1 Then + Return "FEHLER Array Transaktions ist leer" + End If + + + 'If json.StringOf("receiver") = "10738" Then saveTransactions(num, dt, transactions, json.StringOf("receiver")) + saveTransactions(num, dt, transactions, json.StringOf("receiver"), True) ' wenn ID explizit aufgerufen keine Prüfung auf receivcer und purchaseDate End If - 'If json.StringOf("receiver") = "10738" Then saveTransactions(num, dt, transactions, json.StringOf("receiver")) - saveTransactions(num, dt, transactions, json.StringOf("receiver"), True) ' wenn ID explizit aufgerufen keine Prüfung auf receivcer und purchaseDate - - Next row diff --git a/VERAG_PROG_ALLGEMEIN/VERAG_PROG_ALLGEMEIN.vbproj b/VERAG_PROG_ALLGEMEIN/VERAG_PROG_ALLGEMEIN.vbproj index 16a10d93..5fbbf0e4 100644 --- a/VERAG_PROG_ALLGEMEIN/VERAG_PROG_ALLGEMEIN.vbproj +++ b/VERAG_PROG_ALLGEMEIN/VERAG_PROG_ALLGEMEIN.vbproj @@ -24,6 +24,7 @@ bin\Debug\ VERAG_PROG_ALLGEMEIN.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + Off AnyCPU @@ -34,6 +35,7 @@ bin\Release\ VERAG_PROG_ALLGEMEIN.xml 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + Off On @@ -70,7 +72,7 @@ false - ProgAllg.pfx + Sebastian.pfx @@ -886,6 +888,7 @@ Designer + Designer @@ -1269,10 +1272,10 @@ 13.0.3 - 7.2.4 + 8.4.1 - 110.2.0 + 111.4.1