cbam, mdmverarbeitung, ustva, etc.

This commit is contained in:
2024-12-18 11:53:34 +01:00
parent bdf6272bbb
commit e3c341ae16
8 changed files with 343 additions and 65 deletions

View File

@@ -75,13 +75,23 @@ Partial Class frmMDM_USTVAntrag
Me.dgvUSTVPositionen = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components) Me.dgvUSTVPositionen = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components)
Me.pnl = New System.Windows.Forms.Panel() Me.pnl = New System.Windows.Forms.Panel()
Me.Panel2 = 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.Panel4 = New System.Windows.Forms.Panel()
Me.btnEintragloeschen = New System.Windows.Forms.Button() Me.btnEintragloeschen = New System.Windows.Forms.Button()
Me.btnNeuerEintrag = New System.Windows.Forms.Button() Me.btnNeuerEintrag = New System.Windows.Forms.Button()
Me.ContextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components) Me.ContextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components)
Me.ContextMenuStrip2 = New System.Windows.Forms.ContextMenuStrip(Me.components) Me.ContextMenuStrip2 = New System.Windows.Forms.ContextMenuStrip(Me.components)
Me.lblWarnung = New System.Windows.Forms.Label() Me.lblWarnung = New System.Windows.Forms.Label()
Me.Label2 = New System.Windows.Forms.Label()
Me.txtBezugsNr = New VERAG_PROG_ALLGEMEIN.MyTextBox()
Me.cbxFiliale = New VERAG_PROG_ALLGEMEIN.MyComboBox()
Me.Label4 = New System.Windows.Forms.Label()
Me.Label8 = New System.Windows.Forms.Label()
Me.txtAbfNr = New VERAG_PROG_ALLGEMEIN.MyTextBox()
Me.Label9 = New System.Windows.Forms.Label()
Me.txtVZ = New VERAG_PROG_ALLGEMEIN.MyTextBox()
Me.Label11 = New System.Windows.Forms.Label()
Me.txtStNr = New VERAG_PROG_ALLGEMEIN.MyTextBox()
Me.UstCntlUSTV_AntragPosition1 = New SDL.ustCntlUSTV_AntragPosition()
Me.Panel3.SuspendLayout() Me.Panel3.SuspendLayout()
Me.Panel1.SuspendLayout() Me.Panel1.SuspendLayout()
Me.Panel9.SuspendLayout() Me.Panel9.SuspendLayout()
@@ -296,6 +306,16 @@ Partial Class frmMDM_USTVAntrag
' '
Me.Panel8.BackColor = System.Drawing.Color.WhiteSmoke Me.Panel8.BackColor = System.Drawing.Color.WhiteSmoke
Me.Panel8.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.Panel8.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.Panel8.Controls.Add(Me.Label11)
Me.Panel8.Controls.Add(Me.txtStNr)
Me.Panel8.Controls.Add(Me.Label9)
Me.Panel8.Controls.Add(Me.txtVZ)
Me.Panel8.Controls.Add(Me.txtAbfNr)
Me.Panel8.Controls.Add(Me.Label8)
Me.Panel8.Controls.Add(Me.cbxFiliale)
Me.Panel8.Controls.Add(Me.Label4)
Me.Panel8.Controls.Add(Me.Label2)
Me.Panel8.Controls.Add(Me.txtBezugsNr)
Me.Panel8.Controls.Add(Me.cbxWahrung) Me.Panel8.Controls.Add(Me.cbxWahrung)
Me.Panel8.Controls.Add(Me.lblWahrung) Me.Panel8.Controls.Add(Me.lblWahrung)
Me.Panel8.Controls.Add(Me.Label1) Me.Panel8.Controls.Add(Me.Label1)
@@ -317,9 +337,9 @@ Partial Class frmMDM_USTVAntrag
Me.cbxWahrung._value = "" Me.cbxWahrung._value = ""
Me.cbxWahrung.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.cbxWahrung.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.cbxWahrung.FormattingEnabled = True Me.cbxWahrung.FormattingEnabled = True
Me.cbxWahrung.Location = New System.Drawing.Point(439, 9) Me.cbxWahrung.Location = New System.Drawing.Point(447, 9)
Me.cbxWahrung.Name = "cbxWahrung" Me.cbxWahrung.Name = "cbxWahrung"
Me.cbxWahrung.Size = New System.Drawing.Size(79, 24) Me.cbxWahrung.Size = New System.Drawing.Size(71, 24)
Me.cbxWahrung.TabIndex = 12 Me.cbxWahrung.TabIndex = 12
' '
'lblWahrung 'lblWahrung
@@ -822,14 +842,6 @@ Partial Class frmMDM_USTVAntrag
Me.Panel2.Size = New System.Drawing.Size(1300, 269) Me.Panel2.Size = New System.Drawing.Size(1300, 269)
Me.Panel2.TabIndex = 1 Me.Panel2.TabIndex = 1
' '
'UstCntlUSTV_AntragPosition1
'
Me.UstCntlUSTV_AntragPosition1.Dock = System.Windows.Forms.DockStyle.Fill
Me.UstCntlUSTV_AntragPosition1.Location = New System.Drawing.Point(0, 0)
Me.UstCntlUSTV_AntragPosition1.Name = "UstCntlUSTV_AntragPosition1"
Me.UstCntlUSTV_AntragPosition1.Size = New System.Drawing.Size(1298, 267)
Me.UstCntlUSTV_AntragPosition1.TabIndex = 0
'
'Panel4 'Panel4
' '
Me.Panel4.BackColor = System.Drawing.Color.WhiteSmoke Me.Panel4.BackColor = System.Drawing.Color.WhiteSmoke
@@ -893,6 +905,192 @@ Partial Class frmMDM_USTVAntrag
Me.lblWarnung.Size = New System.Drawing.Size(183, 18) Me.lblWarnung.Size = New System.Drawing.Size(183, 18)
Me.lblWarnung.TabIndex = 23 Me.lblWarnung.TabIndex = 23
' '
'Label2
'
Me.Label2.AutoSize = True
Me.Label2.BackColor = System.Drawing.Color.Transparent
Me.Label2.Cursor = System.Windows.Forms.Cursors.Hand
Me.Label2.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label2.ForeColor = System.Drawing.Color.Black
Me.Label2.Location = New System.Drawing.Point(524, 13)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(111, 17)
Me.Label2.TabIndex = 13
Me.Label2.Text = "Bezugs/Pos-Nr.:"
'
'txtBezugsNr
'
Me.txtBezugsNr._DateTimeOnly = False
Me.txtBezugsNr._numbersOnly = True
Me.txtBezugsNr._numbersOnlyKommastellen = ""
Me.txtBezugsNr._numbersOnlyTrennzeichen = False
Me.txtBezugsNr._Prozent = False
Me.txtBezugsNr._ShortDateNew = False
Me.txtBezugsNr._ShortDateOnly = False
Me.txtBezugsNr._TimeOnly = False
Me.txtBezugsNr._TimeOnly_Seconds = False
Me.txtBezugsNr._value = ""
Me.txtBezugsNr._Waehrung = False
Me.txtBezugsNr._WaehrungZeichen = False
Me.txtBezugsNr.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!)
Me.txtBezugsNr.ForeColor = System.Drawing.Color.Black
Me.txtBezugsNr.Location = New System.Drawing.Point(654, 9)
Me.txtBezugsNr.MaxLength = 10
Me.txtBezugsNr.MaxLineLength = -1
Me.txtBezugsNr.MaxLines_Warning = ""
Me.txtBezugsNr.MaxLines_Warning_Label = Nothing
Me.txtBezugsNr.Name = "txtBezugsNr"
Me.txtBezugsNr.Size = New System.Drawing.Size(146, 23)
Me.txtBezugsNr.TabIndex = 14
'
'cbxFiliale
'
Me.cbxFiliale._allowedValuesFreiText = Nothing
Me.cbxFiliale._allowFreiText = False
Me.cbxFiliale._value = ""
Me.cbxFiliale.DropDownWidth = 120
Me.cbxFiliale.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.cbxFiliale.FormattingEnabled = True
Me.cbxFiliale.Location = New System.Drawing.Point(429, 39)
Me.cbxFiliale.Name = "cbxFiliale"
Me.cbxFiliale.Size = New System.Drawing.Size(89, 24)
Me.cbxFiliale.TabIndex = 16
'
'Label4
'
Me.Label4.AutoSize = True
Me.Label4.BackColor = System.Drawing.Color.Transparent
Me.Label4.Cursor = System.Windows.Forms.Cursors.Hand
Me.Label4.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label4.ForeColor = System.Drawing.Color.Black
Me.Label4.Location = New System.Drawing.Point(363, 44)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(48, 17)
Me.Label4.TabIndex = 15
Me.Label4.Text = "Filiale:"
'
'Label8
'
Me.Label8.AutoSize = True
Me.Label8.BackColor = System.Drawing.Color.Transparent
Me.Label8.Cursor = System.Windows.Forms.Cursors.Hand
Me.Label8.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label8.ForeColor = System.Drawing.Color.Black
Me.Label8.Location = New System.Drawing.Point(524, 44)
Me.Label8.Name = "Label8"
Me.Label8.Size = New System.Drawing.Size(112, 17)
Me.Label8.TabIndex = 17
Me.Label8.Text = "Abfertigungs-Nr:"
'
'txtAbfNr
'
Me.txtAbfNr._DateTimeOnly = False
Me.txtAbfNr._numbersOnly = True
Me.txtAbfNr._numbersOnlyKommastellen = ""
Me.txtAbfNr._numbersOnlyTrennzeichen = False
Me.txtAbfNr._Prozent = False
Me.txtAbfNr._ShortDateNew = False
Me.txtAbfNr._ShortDateOnly = False
Me.txtAbfNr._TimeOnly = False
Me.txtAbfNr._TimeOnly_Seconds = False
Me.txtAbfNr._value = ""
Me.txtAbfNr._Waehrung = False
Me.txtAbfNr._WaehrungZeichen = False
Me.txtAbfNr.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!)
Me.txtAbfNr.ForeColor = System.Drawing.Color.Black
Me.txtAbfNr.Location = New System.Drawing.Point(654, 40)
Me.txtAbfNr.MaxLength = 10
Me.txtAbfNr.MaxLineLength = -1
Me.txtAbfNr.MaxLines_Warning = ""
Me.txtAbfNr.MaxLines_Warning_Label = Nothing
Me.txtAbfNr.Name = "txtAbfNr"
Me.txtAbfNr.Size = New System.Drawing.Size(146, 23)
Me.txtAbfNr.TabIndex = 18
'
'Label9
'
Me.Label9.AutoSize = True
Me.Label9.BackColor = System.Drawing.Color.Transparent
Me.Label9.Cursor = System.Windows.Forms.Cursors.Hand
Me.Label9.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label9.ForeColor = System.Drawing.Color.Black
Me.Label9.Location = New System.Drawing.Point(815, 44)
Me.Label9.Name = "Label9"
Me.Label9.Size = New System.Drawing.Size(30, 17)
Me.Label9.TabIndex = 19
Me.Label9.Text = "VZ:"
'
'txtVZ
'
Me.txtVZ._DateTimeOnly = False
Me.txtVZ._numbersOnly = True
Me.txtVZ._numbersOnlyKommastellen = ""
Me.txtVZ._numbersOnlyTrennzeichen = True
Me.txtVZ._Prozent = False
Me.txtVZ._ShortDateNew = False
Me.txtVZ._ShortDateOnly = False
Me.txtVZ._TimeOnly = False
Me.txtVZ._TimeOnly_Seconds = False
Me.txtVZ._value = ""
Me.txtVZ._Waehrung = True
Me.txtVZ._WaehrungZeichen = True
Me.txtVZ.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!)
Me.txtVZ.ForeColor = System.Drawing.Color.Black
Me.txtVZ.Location = New System.Drawing.Point(865, 38)
Me.txtVZ.MaxLength = 10
Me.txtVZ.MaxLineLength = -1
Me.txtVZ.MaxLines_Warning = ""
Me.txtVZ.MaxLines_Warning_Label = Nothing
Me.txtVZ.Name = "txtVZ"
Me.txtVZ.Size = New System.Drawing.Size(100, 23)
Me.txtVZ.TabIndex = 20
'
'Label11
'
Me.Label11.AutoSize = True
Me.Label11.BackColor = System.Drawing.Color.Transparent
Me.Label11.Cursor = System.Windows.Forms.Cursors.Hand
Me.Label11.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label11.ForeColor = System.Drawing.Color.Black
Me.Label11.Location = New System.Drawing.Point(10, 47)
Me.Label11.Name = "Label11"
Me.Label11.Size = New System.Drawing.Size(74, 17)
Me.Label11.TabIndex = 21
Me.Label11.Text = "Steuer-Nr:"
'
'txtStNr
'
Me.txtStNr._DateTimeOnly = False
Me.txtStNr._numbersOnly = False
Me.txtStNr._numbersOnlyKommastellen = ""
Me.txtStNr._numbersOnlyTrennzeichen = False
Me.txtStNr._Prozent = False
Me.txtStNr._ShortDateNew = False
Me.txtStNr._ShortDateOnly = False
Me.txtStNr._TimeOnly = False
Me.txtStNr._TimeOnly_Seconds = False
Me.txtStNr._value = ""
Me.txtStNr._Waehrung = False
Me.txtStNr._WaehrungZeichen = False
Me.txtStNr.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!)
Me.txtStNr.ForeColor = System.Drawing.Color.Black
Me.txtStNr.Location = New System.Drawing.Point(101, 44)
Me.txtStNr.MaxLength = 10
Me.txtStNr.MaxLineLength = -1
Me.txtStNr.MaxLines_Warning = ""
Me.txtStNr.MaxLines_Warning_Label = Nothing
Me.txtStNr.Name = "txtStNr"
Me.txtStNr.Size = New System.Drawing.Size(100, 23)
Me.txtStNr.TabIndex = 22
'
'UstCntlUSTV_AntragPosition1
'
Me.UstCntlUSTV_AntragPosition1.Dock = System.Windows.Forms.DockStyle.Fill
Me.UstCntlUSTV_AntragPosition1.Location = New System.Drawing.Point(0, 0)
Me.UstCntlUSTV_AntragPosition1.Name = "UstCntlUSTV_AntragPosition1"
Me.UstCntlUSTV_AntragPosition1.Size = New System.Drawing.Size(1298, 267)
Me.UstCntlUSTV_AntragPosition1.TabIndex = 0
'
'frmMDM_USTVAntrag 'frmMDM_USTVAntrag
' '
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
@@ -986,4 +1184,14 @@ Partial Class frmMDM_USTVAntrag
Friend WithEvents cbxWahrung As VERAG_PROG_ALLGEMEIN.MyComboBox Friend WithEvents cbxWahrung As VERAG_PROG_ALLGEMEIN.MyComboBox
Friend WithEvents lblWahrung As Label Friend WithEvents lblWahrung As Label
Friend WithEvents lblWarnung As Label Friend WithEvents lblWarnung As Label
Friend WithEvents Label11 As Label
Friend WithEvents txtStNr As VERAG_PROG_ALLGEMEIN.MyTextBox
Friend WithEvents Label9 As Label
Friend WithEvents txtVZ As VERAG_PROG_ALLGEMEIN.MyTextBox
Friend WithEvents txtAbfNr As VERAG_PROG_ALLGEMEIN.MyTextBox
Friend WithEvents Label8 As Label
Friend WithEvents cbxFiliale As VERAG_PROG_ALLGEMEIN.MyComboBox
Friend WithEvents Label4 As Label
Friend WithEvents Label2 As Label
Friend WithEvents txtBezugsNr As VERAG_PROG_ALLGEMEIN.MyTextBox
End Class End Class

View File

@@ -231,6 +231,12 @@ Public Class frmMDM_USTVAntrag
rtbStatusText.Text = If(USTV_ANTRAG.UStVAn_StatusText, "") rtbStatusText.Text = If(USTV_ANTRAG.UStVAn_StatusText, "")
txt3470.Text = If(USTV_ANTRAG.UStVAn_3470, "") txt3470.Text = If(USTV_ANTRAG.UStVAn_3470, "")
txtVZ.Text = If(USTV_ANTRAG.UStVAn_VZBetrag, "")
txtBezugsNr.Text = If(USTV_ANTRAG.UStVAn_BezugsNr, "")
txtAbfNr.Text = If(USTV_ANTRAG.AbfertigungsNr, "")
cbxFiliale.changeItem(If(USTV_ANTRAG.FilialenNr, ""))
cbxWahrung.changeItem(If(USTV_ANTRAG.UStVAn_Währungscode, ""))
End Sub End Sub
Sub getValue(ByRef USTV_ANTRAG As VERAG_PROG_ALLGEMEIN.cUSTVAntrag, Optional ADR As cAdressen = Nothing, Optional FIRMA As cFirmen = Nothing) Sub getValue(ByRef USTV_ANTRAG As VERAG_PROG_ALLGEMEIN.cUSTVAntrag, Optional ADR As cAdressen = Nothing, Optional FIRMA As cFirmen = Nothing)
@@ -253,6 +259,31 @@ Public Class frmMDM_USTVAntrag
USTV_ANTRAG.UStVAn_3470 = Nothing USTV_ANTRAG.UStVAn_3470 = Nothing
End If End If
If txtVZ.Text <> "" AndAlso IsNumeric(txtVZ.Text) Then
USTV_ANTRAG.UStVAn_RZBetragVZ = CDbl(txtVZ.Text)
Else
USTV_ANTRAG.UStVAn_RZBetragVZ = Nothing
End If
If txtBezugsNr.Text <> "" Then
USTV_ANTRAG.UStVAn_BezugsNr = txtBezugsNr
Else
USTV_ANTRAG.UStVAn_BezugsNr = ""
End If
If txtAbfNr.Text <> "" Then
USTV_ANTRAG.AbfertigungsNr = txtAbfNr
Else
USTV_ANTRAG.AbfertigungsNr = ""
End If
If txtAbfNr.Text <> "" Then
USTV_ANTRAG.AbfertigungsNr = txtAbfNr
Else
USTV_ANTRAG.AbfertigungsNr = ""
End If
If ADR IsNot Nothing Then If ADR IsNot Nothing Then
USTV_ANTRAG.UStVAn_KuNr = ADR.AdressenNr USTV_ANTRAG.UStVAn_KuNr = ADR.AdressenNr
USTV_ANTRAG.UStVAn_Name = ADR.Name_1 USTV_ANTRAG.UStVAn_Name = ADR.Name_1
@@ -328,20 +359,31 @@ Public Class frmMDM_USTVAntrag
cboAntragArt.changeItem("MWST") cboAntragArt.changeItem("MWST")
cbxWahrung.fillWithSQL("SELECT [Länderverzeichnis für die Außenhandelsstatistik].Währungscode FROM [Länderverzeichnis für die Außenhandelsstatistik] WHERE ((([Länderverzeichnis für die Außenhandelsstatistik].Umsatzsteuervergütungsverfahren)=1)) GROUP BY [Länderverzeichnis für die Außenhandelsstatistik].Währungscode
ORDER BY [Länderverzeichnis für die Außenhandelsstatistik].Währungscode", False, "FMZOLL", True)
cboAntragArt.changeItem(" ")
cbxFiliale.fillWithSQL("SELECT Filialen.FilialenNr, Filialen.Grenzstelle FROM Filialen WHERE Filialen.FilialenNr>=4800 AND Filialen.Fil_Status='A' ORDER BY Filialen.FilialenNr",, "FMZOLL", True)
cboAntragArt.changeItem(" ")
lbl_EintrageVerarbetiet.Text = "" lbl_EintrageVerarbetiet.Text = ""
If UStVAn_ID > 0 Then If UStVAn_ID > 0 Then
cbxWahrung.Enabled = False
KdSearchBox1.Visible = False KdSearchBox1.Visible = False
USTV_ANTRAG = New VERAG_PROG_ALLGEMEIN.cUSTVAntrag(UStVAn_ID) USTV_ANTRAG = New VERAG_PROG_ALLGEMEIN.cUSTVAntrag(UStVAn_ID)
Antrag_LandKz = SQL.DLookup("LandKz", "[Länderverzeichnis für die Außenhandelsstatistik]", "Landnr='" & USTV_ANTRAG.UStVAn_LandNr & "'", "FMZOLL") Antrag_LandKz = SQL.DLookup("LandKz", "[Länderverzeichnis für die Außenhandelsstatistik]", "Landnr='" & USTV_ANTRAG.UStVAn_LandNr & "'", "FMZOLL")
setValue(USTV_ANTRAG) setValue(USTV_ANTRAG)
Else Else
Dim sqlWhere As String = "" Dim sqlWhere As String = ""
'neuer USTVA-Antrag 'neuer USTVA-Antrag
KdSearchBox1.Visible = True KdSearchBox1.Visible = True
cbxWahrung.Enabled = True
KdSearchBox1.initKdBox(Me) KdSearchBox1.initKdBox(Me)
@@ -357,7 +399,7 @@ Public Class frmMDM_USTVAntrag
lblFirma.Text = ADR.Name_1 lblFirma.Text = ADR.Name_1
cbxLand.DataSource = SQL.loadCboBySqlWithListItem("SELECT [Länderverzeichnis für die Außenhandelsstatistik].LandNr, [Länderverzeichnis für die Außenhandelsstatistik].LandKz cbxLand.fillWithSQL("SELECT [Länderverzeichnis für die Außenhandelsstatistik].LandNr, [Länderverzeichnis für die Außenhandelsstatistik].LandKz
FROM [Länderverzeichnis für die Außenhandelsstatistik] INNER JOIN tblSteuernummern On [Länderverzeichnis für die Außenhandelsstatistik].LandNr = tblSteuernummern.LandNr FROM [Länderverzeichnis für die Außenhandelsstatistik] INNER JOIN tblSteuernummern On [Länderverzeichnis für die Außenhandelsstatistik].LandNr = tblSteuernummern.LandNr
WHERE[Länderverzeichnis für die Außenhandelsstatistik].Umsatzsteuervergütungsverfahren = 1 And (tblSteuernummern.AdressenNr)=" & KdSearchBox1.KdNr & " And tblSteuernummern.UStV = 1 WHERE[Länderverzeichnis für die Außenhandelsstatistik].Umsatzsteuervergütungsverfahren = 1 And (tblSteuernummern.AdressenNr)=" & KdSearchBox1.KdNr & " And tblSteuernummern.UStV = 1
group by [Länderverzeichnis für die Außenhandelsstatistik].LandKz,[Länderverzeichnis für die Außenhandelsstatistik].LandNr group by [Länderverzeichnis für die Außenhandelsstatistik].LandKz,[Länderverzeichnis für die Außenhandelsstatistik].LandNr
@@ -375,20 +417,18 @@ Public Class frmMDM_USTVAntrag
End If End If
cbxLand.Visible = True cbxLand.Visible = True
cbxLand.DataSource = SQL.loadCboBySqlWithListItem("SELECT [Länderverzeichnis für die Außenhandelsstatistik].LandNr, [Länderverzeichnis für die Außenhandelsstatistik].LandKz cbxLand.fillWithSQL("SELECT [Länderverzeichnis für die Außenhandelsstatistik].LandNr, [Länderverzeichnis für die Außenhandelsstatistik].LandKz
FROM [Länderverzeichnis für die Außenhandelsstatistik] INNER JOIN tblSteuernummern On [Länderverzeichnis für die Außenhandelsstatistik].LandNr = tblSteuernummern.LandNr FROM [Länderverzeichnis für die Außenhandelsstatistik] INNER JOIN tblSteuernummern On [Länderverzeichnis für die Außenhandelsstatistik].LandNr = tblSteuernummern.LandNr
WHERE[Länderverzeichnis für die Außenhandelsstatistik].Umsatzsteuervergütungsverfahren = 1 And tblSteuernummern.UStV = 1 " & sqlWhere & WHERE[Länderverzeichnis für die Außenhandelsstatistik].Umsatzsteuervergütungsverfahren = 1 And tblSteuernummern.UStV = 1 " & sqlWhere &
"group by [Länderverzeichnis für die Außenhandelsstatistik].LandKz,[Länderverzeichnis für die Außenhandelsstatistik].LandNr "group by [Länderverzeichnis für die Außenhandelsstatistik].LandKz,[Länderverzeichnis für die Außenhandelsstatistik].LandNr
order by [Länderverzeichnis für die Außenhandelsstatistik].LandKz,[Länderverzeichnis für die Außenhandelsstatistik].LandNr", False, "FMZOLL") order by [Länderverzeichnis für die Außenhandelsstatistik].LandKz,[Länderverzeichnis für die Außenhandelsstatistik].LandNr", False, "FMZOLL")
cbxLand.changeItem(Antrag_LandKz) cbxLand.changeItem(Antrag_LandKz)
'lblKdNr.Text = KdSearchBox1.KdNr
'lblFirma.Text = IIf(KdSearchBox1.KdName Is Nothing, "", KdSearchBox1.KdName)
txtVon._value = von txtVon._value = von
txtBis._value = bis txtBis._value = bis
If Antrag_LandKz <> cbxLand.SelectedValue.ToString Then If cbxLand.SelectedValue IsNot Nothing AndAlso Antrag_LandKz <> cbxLand.SelectedValue.ToString Then
lblWarnung.Text = "keine StNr für " & Antrag_LandKz lblWarnung.Text = "keine StNr für " & Antrag_LandKz
Else Else
lblWarnung.Text = "" lblWarnung.Text = ""
@@ -534,6 +574,9 @@ Public Class frmMDM_USTVAntrag
If GET_Antraege IsNot Nothing Then If GET_Antraege IsNot Nothing Then
Return True
For Each ANTRAG In GET_Antraege For Each ANTRAG In GET_Antraege
Dim USTV_POS As New VERAG_PROG_ALLGEMEIN.cUStVPositionen Dim USTV_POS As New VERAG_PROG_ALLGEMEIN.cUStVPositionen
@@ -760,6 +803,8 @@ Public Class frmMDM_USTVAntrag
If GET_Antraege Then If GET_Antraege Then
Return True
For Each r As DataRow In dt.Rows For Each r As DataRow In dt.Rows
Dim kdNr = r.Item("customer_id") Dim kdNr = r.Item("customer_id")
@@ -780,7 +825,7 @@ Public Class frmMDM_USTVAntrag
USTV_POS.UStVPo_Zeitstempel = Now() USTV_POS.UStVPo_Zeitstempel = Now()
' Berechnungen ' Berechnungen
'von MSE bekommen wir Fremdwährung und EUR, d.b. wir können und den Umrechnungskurs selbst berechnen! 'von MSE bekommen wir Fremdwährung und EUR, d.b. wir können den Umrechnungskurs selbst berechnen!
Dim umrechKurs As Double = 1 Dim umrechKurs As Double = 1
Dim UST_EUR = CDbl(r.Item("UST_EUR")) Dim UST_EUR = CDbl(r.Item("UST_EUR"))
@@ -1267,10 +1312,6 @@ Public Class frmMDM_USTVAntrag
End If End If
End Sub End Sub
Private Sub Panel1_Paint(sender As Object, e As PaintEventArgs) Handles Panel1.Paint
End Sub
Private Sub btnMail_Click(sender As Object, e As EventArgs) Handles btnMail.Click Private Sub btnMail_Click(sender As Object, e As EventArgs) Handles btnMail.Click
If Not ContextMenuStrip1.Items.ContainsKey("excel") Then If Not ContextMenuStrip1.Items.ContainsKey("excel") Then
@@ -1390,7 +1431,7 @@ Public Class frmMDM_USTVAntrag
Private Sub dgvUSTVPositionen_CellContentDoubleClick(sender As Object, e As DataGridViewCellEventArgs) Handles dgvUSTVPositionen.CellContentDoubleClick Private Sub dgvUSTVPositionen_CellContentDoubleClick(sender As Object, e As DataGridViewCellEventArgs) Handles dgvUSTVPositionen.CellContentDoubleClick
Try Try
If e.RowIndex >= 0 AndAlso e.ColumnIndex = 17 Then If e.RowIndex >= 0 AndAlso e.ColumnIndex >= 0 Then
Dim schnnittstellenNr = dgvUSTVPositionen.Rows(e.RowIndex).Cells("UStVPo_SchnittstellenNr").Value Dim schnnittstellenNr = dgvUSTVPositionen.Rows(e.RowIndex).Cells("UStVPo_SchnittstellenNr").Value

View File

@@ -23,9 +23,9 @@ Partial Class frmUSTVoffeneAntraege
<System.Diagnostics.DebuggerStepThrough()> _ <System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent() Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container() Me.components = New System.ComponentModel.Container()
Dim DataGridViewCellStyle4 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle1 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
Dim DataGridViewCellStyle5 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle2 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
Dim DataGridViewCellStyle6 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle3 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
Me.FlowLayoutPanel = New System.Windows.Forms.FlowLayoutPanel() Me.FlowLayoutPanel = New System.Windows.Forms.FlowLayoutPanel()
Me.btn = New System.Windows.Forms.Button() Me.btn = New System.Windows.Forms.Button()
Me.Button7 = New System.Windows.Forms.Button() Me.Button7 = New System.Windows.Forms.Button()
@@ -236,6 +236,8 @@ Partial Class frmUSTVoffeneAntraege
' '
Me.cbxAlleoffenen.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.cbxAlleoffenen.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.cbxAlleoffenen.AutoSize = True Me.cbxAlleoffenen.AutoSize = True
Me.cbxAlleoffenen.Checked = True
Me.cbxAlleoffenen.CheckState = System.Windows.Forms.CheckState.Checked
Me.cbxAlleoffenen.Location = New System.Drawing.Point(1137, 62) Me.cbxAlleoffenen.Location = New System.Drawing.Point(1137, 62)
Me.cbxAlleoffenen.Name = "cbxAlleoffenen" Me.cbxAlleoffenen.Name = "cbxAlleoffenen"
Me.cbxAlleoffenen.Size = New System.Drawing.Size(128, 17) Me.cbxAlleoffenen.Size = New System.Drawing.Size(128, 17)
@@ -396,34 +398,34 @@ Partial Class frmUSTVoffeneAntraege
Me.MyDatagridview1.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ Me.MyDatagridview1.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
DataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft DataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft
DataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control DataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control
DataGridViewCellStyle4.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) DataGridViewCellStyle1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
DataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText DataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText
DataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight DataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight
DataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText DataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText
DataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.[True] DataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.[True]
Me.MyDatagridview1.ColumnHeadersDefaultCellStyle = DataGridViewCellStyle4 Me.MyDatagridview1.ColumnHeadersDefaultCellStyle = DataGridViewCellStyle1
Me.MyDatagridview1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize Me.MyDatagridview1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
DataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft DataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft
DataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Window DataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Window
DataGridViewCellStyle5.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) DataGridViewCellStyle2.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
DataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.ControlText DataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.ControlText
DataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight DataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight
DataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText DataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText
DataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.[False] DataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.[False]
Me.MyDatagridview1.DefaultCellStyle = DataGridViewCellStyle5 Me.MyDatagridview1.DefaultCellStyle = DataGridViewCellStyle2
Me.MyDatagridview1.Location = New System.Drawing.Point(12, 98) Me.MyDatagridview1.Location = New System.Drawing.Point(12, 98)
Me.MyDatagridview1.Name = "MyDatagridview1" Me.MyDatagridview1.Name = "MyDatagridview1"
Me.MyDatagridview1.ReadOnly = True Me.MyDatagridview1.ReadOnly = True
DataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft DataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft
DataGridViewCellStyle6.BackColor = System.Drawing.SystemColors.Control DataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Control
DataGridViewCellStyle6.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) DataGridViewCellStyle3.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
DataGridViewCellStyle6.ForeColor = System.Drawing.SystemColors.WindowText DataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.WindowText
DataGridViewCellStyle6.SelectionBackColor = System.Drawing.SystemColors.Highlight DataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight
DataGridViewCellStyle6.SelectionForeColor = System.Drawing.SystemColors.HighlightText DataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText
DataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.[True] DataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.[True]
Me.MyDatagridview1.RowHeadersDefaultCellStyle = DataGridViewCellStyle6 Me.MyDatagridview1.RowHeadersDefaultCellStyle = DataGridViewCellStyle3
Me.MyDatagridview1.RowHeadersWidth = 62 Me.MyDatagridview1.RowHeadersWidth = 62
Me.MyDatagridview1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect Me.MyDatagridview1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect
Me.MyDatagridview1.Size = New System.Drawing.Size(1409, 528) Me.MyDatagridview1.Size = New System.Drawing.Size(1409, 528)
@@ -433,6 +435,8 @@ Partial Class frmUSTVoffeneAntraege
' '
Me.cbxSteuerNr.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.cbxSteuerNr.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.cbxSteuerNr.AutoSize = True Me.cbxSteuerNr.AutoSize = True
Me.cbxSteuerNr.Checked = True
Me.cbxSteuerNr.CheckState = System.Windows.Forms.CheckState.Checked
Me.cbxSteuerNr.Location = New System.Drawing.Point(1137, 78) Me.cbxSteuerNr.Location = New System.Drawing.Point(1137, 78)
Me.cbxSteuerNr.Name = "cbxSteuerNr" Me.cbxSteuerNr.Name = "cbxSteuerNr"
Me.cbxSteuerNr.Size = New System.Drawing.Size(105, 17) Me.cbxSteuerNr.Size = New System.Drawing.Size(105, 17)

View File

@@ -92,9 +92,11 @@ Public Class frmUSTVoffeneAntraege
sqlwhere &= " and plose_POLSEKundennummer = " & kdnr sqlwhere &= " and plose_POLSEKundennummer = " & kdnr
End If End If
.SET_SQL("select " & top & " plose_POLSEKundennummer, Adressen.[Name 1] ,[plose_Lieferant],[plose_RechnungsDatum],[plose_RechnungsNr], sum([plose_MWSTBetrag])[plose_MWSTBetrag] FROM [tblPLOSE_Details] INNER JOIN Adressen on PLOSEKundenNr=plose_POLSEKundennummer .SET_SQL("select " & top & " plose_POLSEKundennummer, Adressen.[Name 1] ,[plose_Lieferant],[plose_RechnungsDatum],[plose_RechnungsNr],plp_Land, sum([plose_MWSTBetrag])[plose_MWSTBetrag] FROM [tblPLOSE_Details]
INNER JOIN Adressen on PLOSEKundenNr=plose_POLSEKundennummer
INNER JOIN [tblPLOSE_Produktbeschreibung] ON [plp_ProductCode]=[plose_ProduktCode]
WHERE plose_Archiv <> 1 AND plose_LieferantCode IN (0,1,7) AND cast(plose_RechnungsDatum as date) between '" & dat_Sum_Von.Value & "' and '" & dat_Sum_Bis.Value & "' and plose_RechnungsNr is not null " & sqlwhere & WHERE plose_Archiv <> 1 AND plose_LieferantCode IN (0,1,7) AND cast(plose_RechnungsDatum as date) between '" & dat_Sum_Von.Value & "' and '" & dat_Sum_Bis.Value & "' and plose_RechnungsNr is not null " & sqlwhere &
"group by plose_POLSEKundennummer, Adressen.[Name 1] ,[plose_RechnungsDatum],[plose_RechnungsNr],[plose_Lieferant] "group by plose_POLSEKundennummer, Adressen.[Name 1] ,[plose_RechnungsDatum],[plose_RechnungsNr],[plose_Lieferant], plp_Land
having sum(plose_MWSTBetrag)>0", "FMZOLL") having sum(plose_MWSTBetrag)>0", "FMZOLL")
.LOAD() .LOAD()
If .Columns.Count > 0 Then If .Columns.Count > 0 Then
@@ -104,6 +106,7 @@ Public Class frmUSTVoffeneAntraege
.Columns("plose_Lieferant").HeaderText = "PLOSE-Lieferant" .Columns("plose_Lieferant").HeaderText = "PLOSE-Lieferant"
.Columns("plose_RechnungsDatum").HeaderText = "RE-Datum" .Columns("plose_RechnungsDatum").HeaderText = "RE-Datum"
.Columns("plose_RechnungsNr").HeaderText = "RE-Nr" .Columns("plose_RechnungsNr").HeaderText = "RE-Nr"
.Columns("plp_Land").HeaderText = "Land"
.Columns("Name 1").AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill .Columns("Name 1").AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill
.Columns("plose_MWSTBetrag").HeaderText = "MWST" .Columns("plose_MWSTBetrag").HeaderText = "MWST"
@@ -447,14 +450,15 @@ Public Class frmUSTVoffeneAntraege
'PLOSE' as Lieferant, 'PLOSE' as Lieferant,
plose_POLSEKundennummer as KdNr, plose_POLSEKundennummer as KdNr,
Adressen.[Name 1] as Kundenname, Adressen.[Name 1] as Kundenname,
'' as Land, plp_Land as Land,
[plose_RechnungsDatum] AS Rechnungsdatum, [plose_RechnungsDatum] AS Rechnungsdatum,
sum([plose_MWSTBetrag]) as MWST sum([plose_MWSTBetrag]) as MWST
FROM [tblPLOSE_Details] FROM [tblPLOSE_Details]
INNER JOIN Adressen on PLOSEKundenNr=plose_POLSEKundennummer INNER JOIN Adressen on PLOSEKundenNr=plose_POLSEKundennummer
INNER JOIN [tblPLOSE_Produktbeschreibung] ON [plp_ProductCode]=[plose_ProduktCode]
WHERE plose_Archiv <> 1 AND plose_LieferantCode IN (0,1,7) AND WHERE plose_Archiv <> 1 AND plose_LieferantCode IN (0,1,7) AND
cast(plose_RechnungsDatum as date) between '" & dat_Sum_Von.Value & "' and '" & dat_Sum_Bis.Value & "' and plose_RechnungsNr is not null " & sqlwherePLOSE & " cast(plose_RechnungsDatum as date) between '" & dat_Sum_Von.Value & "' and '" & dat_Sum_Bis.Value & "' and plose_RechnungsNr is not null " & sqlwherePLOSE & "
group by plose_POLSEKundennummer, Adressen.[Name 1] ,[plose_RechnungsDatum] group by plose_POLSEKundennummer, Adressen.[Name 1] ,[plose_RechnungsDatum],plp_Land
having sum(plose_MWSTBetrag)>0 having sum(plose_MWSTBetrag)>0
UNION ALL UNION ALL
@@ -617,7 +621,7 @@ Public Class frmUSTVoffeneAntraege
initLieferant("IDS", sender) initLieferant("IDS", sender)
End Sub End Sub
Private Sub cbxAlleoffenen_CheckedChanged(sender As Object, e As EventArgs) Handles cbxAlleoffenen.CheckedChanged, cbxSteuerNr.CheckedChanged Private Sub cbxAlleoffenen_CheckedChanged(sender As Object, e As EventArgs) Handles cbxAlleoffenen.CheckedChanged, cbxSteuerNr.CheckedChanged, cbxNichtEroeffneteAntraege.CheckedChanged
init() init()
End Sub End Sub
@@ -703,5 +707,4 @@ Public Class frmUSTVoffeneAntraege
End Sub End Sub
End Class End Class

View File

@@ -1,7 +1,4 @@
Imports System.ComponentModel Imports System.ComponentModel
Imports System.Data.SqlClient
Imports GrapeCity.DataVisualization.Options
Imports MDM_Worker
Imports Microsoft.Office.Interop Imports Microsoft.Office.Interop
Imports VERAG_PROG_ALLGEMEIN Imports VERAG_PROG_ALLGEMEIN

View File

@@ -59,9 +59,17 @@ Public Class usrCntlCBAM
and eza_VertretungsVerhaeltnisCode=2 and eza_VertretungsVerhaeltnisCode=2
" "
Else Else
'Die Unterabfrage hat mehr als einen Wert zurückgegeben. Das ist nicht zulässig, wenn die Unterabfrage auf =, !=, <, <=, > oder >= folgt oder als Ausdruck verwendet wird.
'SQLSTR &= "
' and (select isnull([ezaAd_NameFirma1],[ezaAd_TeilnehmerEORI]) FROM tblDakosy_EZA_Adressen WHERE ezaAd_EZAId=eza_Id and [ezaAd_AdressTyp]='CN')='" & EORI & "'
' "
'korrigierte Query:
SQLSTR &= " SQLSTR &= "
and (select isnull([ezaAd_NameFirma1],[ezaAd_TeilnehmerEORI]) FROM tblDakosy_EZA_Adressen WHERE ezaAd_EZAId=eza_Id and [ezaAd_AdressTyp]='CN')='" & EORI & "' and EXISTS (SELECT 1 FROM tblDakosy_EZA_Adressen WHERE ezaAd_EZAId = eza_Id AND [ezaAd_AdressTyp] = 'CN' AND isnull([ezaAd_NameFirma1], [ezaAd_TeilnehmerEORI]) ='" & EORI & "')
" "
End If End If
Dim dt = SQL.loadDgvBySql(SQLSTR, "FMZOLL", 600) Dim dt = SQL.loadDgvBySql(SQLSTR, "FMZOLL", 600)
@@ -389,8 +397,14 @@ Public Class usrCntlCBAM
and eza_VertretungsVerhaeltnisCode=2 and eza_VertretungsVerhaeltnisCode=2
" "
Else Else
'Das ist nicht zulässig, wenn die Unterabfrage auf =, !=, <, <=, > oder >= folgt oder als Ausdruck verwendet wird.
'SQLSTR &= "
' and (select isnull([ezaAd_NameFirma1],[ezaAd_TeilnehmerEORI]) FROM tblDakosy_EZA_Adressen WHERE ezaAd_EZAId=eza_Id and [ezaAd_AdressTyp]='CN')='" & EORI & "'
' "
SQLSTR &= " SQLSTR &= "
and (select isnull([ezaAd_NameFirma1],[ezaAd_TeilnehmerEORI]) FROM tblDakosy_EZA_Adressen WHERE ezaAd_EZAId=eza_Id and [ezaAd_AdressTyp]='CN')='" & EORI & "' and EXISTS (select 1 FROM tblDakosy_EZA_Adressen WHERE ezaAd_EZAId=eza_Id and [ezaAd_AdressTyp]='CN' AND isnull([ezaAd_NameFirma1],[ezaAd_TeilnehmerEORI])='" & EORI & "')
" "
End If End If
@@ -466,9 +480,15 @@ Public Class usrCntlCBAM
and eza_VertretungsVerhaeltnisCode=2 and eza_VertretungsVerhaeltnisCode=2
" "
Else Else
'Die Unterabfrage hat mehr als einen Wert zurückgegeben. Das ist nicht zulässig, wenn die Unterabfrage auf =, !=, <, <=, > oder >= folgt oder als Ausdruck verwendet wird.
'SQLSTR &= "
' and (select isnull([ezaAd_NameFirma1],[ezaAd_TeilnehmerEORI]) FROM tblDakosy_EZA_Adressen WHERE ezaAd_EZAId=eza_Id and [ezaAd_AdressTyp]='CN')='" & EORI & "'
' "
SQLSTR &= " SQLSTR &= "
and (select isnull([ezaAd_NameFirma1],[ezaAd_TeilnehmerEORI]) FROM tblDakosy_EZA_Adressen WHERE ezaAd_EZAId=eza_Id and [ezaAd_AdressTyp]='CN')='" & EORI & "' and EXISTS (select 1 FROM tblDakosy_EZA_Adressen WHERE ezaAd_EZAId=eza_Id and [ezaAd_AdressTyp]='CN' and isnull([ezaAd_NameFirma1],[ezaAd_TeilnehmerEORI])='" & EORI & "')
" "
End If End If
If SQLSTR_WHERE_FIRMEN <> "" Then SQLSTR &= " and EZA_firma in ( " & SQLSTR_WHERE_FIRMEN & ")" If SQLSTR_WHERE_FIRMEN <> "" Then SQLSTR &= " and EZA_firma in ( " & SQLSTR_WHERE_FIRMEN & ")"
@@ -570,8 +590,13 @@ Public Class usrCntlCBAM
and eza_VertretungsVerhaeltnisCode=2 and eza_VertretungsVerhaeltnisCode=2
" "
Else Else
''Die Unterabfrage hat mehr als einen Wert zurückgegeben. Das ist nicht zulässig, wenn die Unterabfrage auf =, !=, <, <=, > oder >= folgt oder als Ausdruck verwendet wird.
'SQLSTR &= "
' and (select isnull([ezaAd_NameFirma1],[ezaAd_TeilnehmerEORI]) FROM tblDakosy_EZA_Adressen WHERE ezaAd_EZAId=eza_Id and [ezaAd_AdressTyp]='CN')='" & EORI & "'
' "
SQLSTR &= " SQLSTR &= "
and (select isnull([ezaAd_NameFirma1],[ezaAd_TeilnehmerEORI]) FROM tblDakosy_EZA_Adressen WHERE ezaAd_EZAId=eza_Id and [ezaAd_AdressTyp]='CN')='" & EORI & "' and EXISTS(select 1 FROM tblDakosy_EZA_Adressen WHERE ezaAd_EZAId=eza_Id and [ezaAd_AdressTyp]='CN' AND isnull([ezaAd_NameFirma1],[ezaAd_TeilnehmerEORI])='" & EORI & "')
" "
End If End If

View File

@@ -554,7 +554,7 @@ Public Class frmMDMDatenverarbetiung
sqlstr &= "SELECT Adressen.AdressenNr, Adressen.[Name 1] as Name, tblIDSTransactionsNew.[CustomerCode], Sum(tblIDSTransactionsNew.[TransactionVolume]) AS Liter, Sum(tblIDSTransactionsNew.AmminclVAT) AS Brutto, Sum(tblIDSTransactionsNew.[TotalNetAmount]) AS Netto, Sum(tblIDSTransactionsNew.Rabattbetrag) AS Rabatt sqlstr &= "SELECT Adressen.AdressenNr, Adressen.[Name 1] as Name, tblIDSTransactionsNew.[CustomerCode], Sum(tblIDSTransactionsNew.[TransactionVolume]) AS Liter, Sum(tblIDSTransactionsNew.AmminclVAT) AS Brutto, Sum(tblIDSTransactionsNew.[TotalNetAmount]) AS Netto, Sum(tblIDSTransactionsNew.Rabattbetrag) AS Rabatt
FROM ((tblIDSTransactionsNew INNER JOIN tbl_IDS_Länder ON tblIDSTransactionsNew.[OutletCountryCode] = tbl_IDS_Länder.OutletCountryCode) INNER JOIN tbl_IDS_Produkte ON tblIDSTransactionsNew.[ProductTypeCode] = tbl_IDS_Produkte.ProductTypeCode) INNER JOIN Adressen ON tblIDSTransactionsNew.KdNrVERAG = Adressen.AdressenNr FROM ((tblIDSTransactionsNew INNER JOIN tbl_IDS_Länder ON tblIDSTransactionsNew.[OutletCountryCode] = tbl_IDS_Länder.OutletCountryCode) INNER JOIN tbl_IDS_Produkte ON tblIDSTransactionsNew.[ProductTypeCode] = tbl_IDS_Produkte.ProductTypeCode) INNER JOIN Adressen ON tblIDSTransactionsNew.KdNrVERAG = Adressen.AdressenNr
WHERE tblIDSTransactionsNew.[OutletCountryCode]" & sqlwhere & WHERE cast(tblIDSTransactionsNew.YearMonthDay as Date) = '" & DateTimePicker2.Text & "' AND tblIDSTransactionsNew.[OutletCountryCode]" & sqlwhere &
"GROUP BY Adressen.AdressenNr, Adressen.[Name 1], tblIDSTransactionsNew.[CustomerCode];" "GROUP BY Adressen.AdressenNr, Adressen.[Name 1], tblIDSTransactionsNew.[CustomerCode];"
Dim dt As DataTable = SQL.loadDgvBySql_Param(sqlstr, "FMZOLL") Dim dt As DataTable = SQL.loadDgvBySql_Param(sqlstr, "FMZOLL")

View File

@@ -1376,7 +1376,7 @@ Public Class cMSEAPI
cmd.Parameters.AddWithValue("@von", von) cmd.Parameters.AddWithValue("@von", von)
cmd.Parameters.AddWithValue("@bis", bis) cmd.Parameters.AddWithValue("@bis", bis)
cmd.Parameters.AddWithValue("@AdressenNr", KundenNr) cmd.Parameters.AddWithValue("@AdressenNr", KundenNr)
If Archiv IsNot Nothing Then cmd.Parameters.AddWithValue("@Archiv", If(Archiv, 1, 0)) If Archiv IsNot Nothing Then cmd.Parameters.AddWithValue("@Archiv", If(Archiv, "=", "<>"))
Dim dr = cmd.ExecuteReader() Dim dr = cmd.ExecuteReader()
dt.Load(dr) dt.Load(dr)