Mailsender, tradeinvoice, etc.
This commit is contained in:
147
SDL/mdm/usrcntlFremdrechnungen.Designer.vb
generated
147
SDL/mdm/usrcntlFremdrechnungen.Designer.vb
generated
@@ -23,8 +23,8 @@ Partial Class usrcntlFremdrechnungen
|
||||
<System.Diagnostics.DebuggerStepThrough()>
|
||||
Private Sub InitializeComponent()
|
||||
Me.components = New System.ComponentModel.Container()
|
||||
Dim DataGridViewCellStyle1 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
|
||||
Dim DataGridViewCellStyle2 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
|
||||
Dim DataGridViewCellStyle3 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
|
||||
Dim DataGridViewCellStyle4 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
|
||||
Me.DetailsAnzeigenToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.FlowLayoutPanel = New System.Windows.Forms.FlowLayoutPanel()
|
||||
Me.btnSDL_Alle = New System.Windows.Forms.Button()
|
||||
@@ -39,6 +39,8 @@ Partial Class usrcntlFremdrechnungen
|
||||
Me.ContextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components)
|
||||
Me.KundenblattAnzeigenToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.Panel1 = New System.Windows.Forms.Panel()
|
||||
Me.lblSumBto = New System.Windows.Forms.Label()
|
||||
Me.Label5 = New System.Windows.Forms.Label()
|
||||
Me.cbxMailoeffnen = New System.Windows.Forms.CheckBox()
|
||||
Me.cbxPDFhinterlegt = New System.Windows.Forms.CheckBox()
|
||||
Me.cbx = New System.Windows.Forms.CheckBox()
|
||||
@@ -62,8 +64,11 @@ Partial Class usrcntlFremdrechnungen
|
||||
Me.cntxtExcel = New System.Windows.Forms.ContextMenuStrip(Me.components)
|
||||
Me.ToolStripMenuItem3 = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.ToolStripMenuItem6 = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.Label5 = New System.Windows.Forms.Label()
|
||||
Me.lblSumBto = New System.Windows.Forms.Label()
|
||||
Me.Label6 = New System.Windows.Forms.Label()
|
||||
Me.ContextMenuStrip2 = New System.Windows.Forms.ContextMenuStrip(Me.components)
|
||||
Me.txtKundenNrvon = New VERAG_PROG_ALLGEMEIN.MyTextBox()
|
||||
Me.txtKundenNrbis = New VERAG_PROG_ALLGEMEIN.MyTextBox()
|
||||
Me.Label7 = New System.Windows.Forms.Label()
|
||||
Me.FlowLayoutPanel.SuspendLayout()
|
||||
Me.ContextMenuStrip1.SuspendLayout()
|
||||
Me.Panel1.SuspendLayout()
|
||||
@@ -277,6 +282,10 @@ Partial Class usrcntlFremdrechnungen
|
||||
Me.Panel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink
|
||||
Me.Panel1.BackColor = System.Drawing.SystemColors.ControlLightLight
|
||||
Me.Panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
|
||||
Me.Panel1.Controls.Add(Me.Label7)
|
||||
Me.Panel1.Controls.Add(Me.txtKundenNrbis)
|
||||
Me.Panel1.Controls.Add(Me.txtKundenNrvon)
|
||||
Me.Panel1.Controls.Add(Me.Label6)
|
||||
Me.Panel1.Controls.Add(Me.lblSumBto)
|
||||
Me.Panel1.Controls.Add(Me.Label5)
|
||||
Me.Panel1.Controls.Add(Me.cbxMailoeffnen)
|
||||
@@ -300,12 +309,31 @@ Partial Class usrcntlFremdrechnungen
|
||||
Me.Panel1.Size = New System.Drawing.Size(260, 907)
|
||||
Me.Panel1.TabIndex = 23
|
||||
'
|
||||
'lblSumBto
|
||||
'
|
||||
Me.lblSumBto.AutoSize = True
|
||||
Me.lblSumBto.BackColor = System.Drawing.Color.White
|
||||
Me.lblSumBto.Location = New System.Drawing.Point(190, 20)
|
||||
Me.lblSumBto.Name = "lblSumBto"
|
||||
Me.lblSumBto.Size = New System.Drawing.Size(13, 13)
|
||||
Me.lblSumBto.TabIndex = 56
|
||||
Me.lblSumBto.Text = "0"
|
||||
'
|
||||
'Label5
|
||||
'
|
||||
Me.Label5.AutoSize = True
|
||||
Me.Label5.Location = New System.Drawing.Point(4, 20)
|
||||
Me.Label5.Name = "Label5"
|
||||
Me.Label5.Size = New System.Drawing.Size(76, 13)
|
||||
Me.Label5.TabIndex = 55
|
||||
Me.Label5.Text = "Summe Brutto:"
|
||||
'
|
||||
'cbxMailoeffnen
|
||||
'
|
||||
Me.cbxMailoeffnen.AutoSize = True
|
||||
Me.cbxMailoeffnen.Checked = True
|
||||
Me.cbxMailoeffnen.CheckState = System.Windows.Forms.CheckState.Checked
|
||||
Me.cbxMailoeffnen.Location = New System.Drawing.Point(146, 183)
|
||||
Me.cbxMailoeffnen.Location = New System.Drawing.Point(146, 237)
|
||||
Me.cbxMailoeffnen.Name = "cbxMailoeffnen"
|
||||
Me.cbxMailoeffnen.Size = New System.Drawing.Size(91, 17)
|
||||
Me.cbxMailoeffnen.TabIndex = 54
|
||||
@@ -317,7 +345,7 @@ Partial Class usrcntlFremdrechnungen
|
||||
Me.cbxPDFhinterlegt.AutoSize = True
|
||||
Me.cbxPDFhinterlegt.Checked = True
|
||||
Me.cbxPDFhinterlegt.CheckState = System.Windows.Forms.CheckState.Indeterminate
|
||||
Me.cbxPDFhinterlegt.Location = New System.Drawing.Point(8, 125)
|
||||
Me.cbxPDFhinterlegt.Location = New System.Drawing.Point(8, 179)
|
||||
Me.cbxPDFhinterlegt.Name = "cbxPDFhinterlegt"
|
||||
Me.cbxPDFhinterlegt.Size = New System.Drawing.Size(101, 17)
|
||||
Me.cbxPDFhinterlegt.TabIndex = 53
|
||||
@@ -328,7 +356,7 @@ Partial Class usrcntlFremdrechnungen
|
||||
'cbx
|
||||
'
|
||||
Me.cbx.AutoSize = True
|
||||
Me.cbx.Location = New System.Drawing.Point(8, 107)
|
||||
Me.cbx.Location = New System.Drawing.Point(8, 161)
|
||||
Me.cbx.Name = "cbx"
|
||||
Me.cbx.Size = New System.Drawing.Size(169, 17)
|
||||
Me.cbx.TabIndex = 52
|
||||
@@ -338,7 +366,7 @@ Partial Class usrcntlFremdrechnungen
|
||||
'Label4
|
||||
'
|
||||
Me.Label4.AutoSize = True
|
||||
Me.Label4.Location = New System.Drawing.Point(5, 35)
|
||||
Me.Label4.Location = New System.Drawing.Point(2, 35)
|
||||
Me.Label4.Name = "Label4"
|
||||
Me.Label4.Size = New System.Drawing.Size(91, 13)
|
||||
Me.Label4.TabIndex = 51
|
||||
@@ -384,7 +412,7 @@ Partial Class usrcntlFremdrechnungen
|
||||
Me.Button1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch
|
||||
Me.Button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat
|
||||
Me.Button1.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
|
||||
Me.Button1.Location = New System.Drawing.Point(5, 268)
|
||||
Me.Button1.Location = New System.Drawing.Point(5, 322)
|
||||
Me.Button1.Name = "Button1"
|
||||
Me.Button1.Size = New System.Drawing.Size(50, 44)
|
||||
Me.Button1.TabIndex = 45
|
||||
@@ -396,7 +424,7 @@ Partial Class usrcntlFremdrechnungen
|
||||
Me.cbxMax1000Eintrage.AutoSize = True
|
||||
Me.cbxMax1000Eintrage.Checked = True
|
||||
Me.cbxMax1000Eintrage.CheckState = System.Windows.Forms.CheckState.Checked
|
||||
Me.cbxMax1000Eintrage.Location = New System.Drawing.Point(8, 145)
|
||||
Me.cbxMax1000Eintrage.Location = New System.Drawing.Point(8, 199)
|
||||
Me.cbxMax1000Eintrage.Name = "cbxMax1000Eintrage"
|
||||
Me.cbxMax1000Eintrage.Size = New System.Drawing.Size(117, 17)
|
||||
Me.cbxMax1000Eintrage.TabIndex = 41
|
||||
@@ -418,7 +446,7 @@ Partial Class usrcntlFremdrechnungen
|
||||
Me.Button4.FlatStyle = System.Windows.Forms.FlatStyle.Flat
|
||||
Me.Button4.Image = Global.SDL.My.Resources.Resources.checklist
|
||||
Me.Button4.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
|
||||
Me.Button4.Location = New System.Drawing.Point(8, 218)
|
||||
Me.Button4.Location = New System.Drawing.Point(8, 272)
|
||||
Me.Button4.Name = "Button4"
|
||||
Me.Button4.Size = New System.Drawing.Size(118, 44)
|
||||
Me.Button4.TabIndex = 21
|
||||
@@ -431,7 +459,7 @@ Partial Class usrcntlFremdrechnungen
|
||||
Me.Button5.FlatStyle = System.Windows.Forms.FlatStyle.Flat
|
||||
Me.Button5.Image = Global.SDL.My.Resources.Resources.email_big1
|
||||
Me.Button5.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
|
||||
Me.Button5.Location = New System.Drawing.Point(8, 168)
|
||||
Me.Button5.Location = New System.Drawing.Point(8, 222)
|
||||
Me.Button5.Name = "Button5"
|
||||
Me.Button5.Size = New System.Drawing.Size(118, 44)
|
||||
Me.Button5.TabIndex = 22
|
||||
@@ -453,7 +481,7 @@ Partial Class usrcntlFremdrechnungen
|
||||
Me.Button8.FlatStyle = System.Windows.Forms.FlatStyle.Flat
|
||||
Me.Button8.Image = Global.SDL.My.Resources.Resources.Excel_logo
|
||||
Me.Button8.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
|
||||
Me.Button8.Location = New System.Drawing.Point(132, 218)
|
||||
Me.Button8.Location = New System.Drawing.Point(132, 272)
|
||||
Me.Button8.Name = "Button8"
|
||||
Me.Button8.Size = New System.Drawing.Size(118, 44)
|
||||
Me.Button8.TabIndex = 31
|
||||
@@ -501,8 +529,8 @@ Partial Class usrcntlFremdrechnungen
|
||||
Me.dgvLFRechnung.AllowUserToDeleteRows = False
|
||||
Me.dgvLFRechnung.AllowUserToResizeColumns = False
|
||||
Me.dgvLFRechnung.AllowUserToResizeRows = False
|
||||
DataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(CType(CType(240, Byte), Integer), CType(CType(245, Byte), Integer), CType(CType(255, Byte), Integer))
|
||||
Me.dgvLFRechnung.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle1
|
||||
DataGridViewCellStyle3.BackColor = System.Drawing.Color.FromArgb(CType(CType(240, Byte), Integer), CType(CType(245, Byte), Integer), CType(CType(255, Byte), Integer))
|
||||
Me.dgvLFRechnung.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle3
|
||||
Me.dgvLFRechnung.BackgroundColor = System.Drawing.Color.White
|
||||
Me.dgvLFRechnung.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
|
||||
Me.dgvLFRechnung.Location = New System.Drawing.Point(4, 3)
|
||||
@@ -518,8 +546,8 @@ Partial Class usrcntlFremdrechnungen
|
||||
Me.dgvDetails.AllowUserToDeleteRows = False
|
||||
Me.dgvDetails.AllowUserToResizeColumns = False
|
||||
Me.dgvDetails.AllowUserToResizeRows = False
|
||||
DataGridViewCellStyle2.BackColor = System.Drawing.Color.FromArgb(CType(CType(240, Byte), Integer), CType(CType(245, Byte), Integer), CType(CType(255, Byte), Integer))
|
||||
Me.dgvDetails.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle2
|
||||
DataGridViewCellStyle4.BackColor = System.Drawing.Color.FromArgb(CType(CType(240, Byte), Integer), CType(CType(245, Byte), Integer), CType(CType(255, Byte), Integer))
|
||||
Me.dgvDetails.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle4
|
||||
Me.dgvDetails.BackgroundColor = System.Drawing.Color.White
|
||||
Me.dgvDetails.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
|
||||
Me.dgvDetails.Location = New System.Drawing.Point(-1, 3)
|
||||
@@ -557,24 +585,74 @@ Partial Class usrcntlFremdrechnungen
|
||||
Me.ToolStripMenuItem6.Size = New System.Drawing.Size(210, 22)
|
||||
Me.ToolStripMenuItem6.Text = "Formatiert (dauert länger)"
|
||||
'
|
||||
'Label5
|
||||
'Label6
|
||||
'
|
||||
Me.Label5.AutoSize = True
|
||||
Me.Label5.Location = New System.Drawing.Point(4, 20)
|
||||
Me.Label5.Name = "Label5"
|
||||
Me.Label5.Size = New System.Drawing.Size(76, 13)
|
||||
Me.Label5.TabIndex = 55
|
||||
Me.Label5.Text = "Summe Brutto:"
|
||||
Me.Label6.AutoSize = True
|
||||
Me.Label6.Location = New System.Drawing.Point(8, 107)
|
||||
Me.Label6.Name = "Label6"
|
||||
Me.Label6.Size = New System.Drawing.Size(58, 13)
|
||||
Me.Label6.TabIndex = 57
|
||||
Me.Label6.Text = "KundenNr."
|
||||
'
|
||||
'lblSumBto
|
||||
'ContextMenuStrip2
|
||||
'
|
||||
Me.lblSumBto.AutoSize = True
|
||||
Me.lblSumBto.BackColor = System.Drawing.Color.White
|
||||
Me.lblSumBto.Location = New System.Drawing.Point(190, 20)
|
||||
Me.lblSumBto.Name = "lblSumBto"
|
||||
Me.lblSumBto.Size = New System.Drawing.Size(13, 13)
|
||||
Me.lblSumBto.TabIndex = 56
|
||||
Me.lblSumBto.Text = "0"
|
||||
Me.ContextMenuStrip2.Name = "ContextMenuStrip2"
|
||||
Me.ContextMenuStrip2.Size = New System.Drawing.Size(61, 4)
|
||||
'
|
||||
'txtKundenNrvon
|
||||
'
|
||||
Me.txtKundenNrvon._DateTimeOnly = False
|
||||
Me.txtKundenNrvon._numbersOnly = True
|
||||
Me.txtKundenNrvon._numbersOnlyKommastellen = ""
|
||||
Me.txtKundenNrvon._numbersOnlyTrennzeichen = False
|
||||
Me.txtKundenNrvon._Prozent = False
|
||||
Me.txtKundenNrvon._ShortDateNew = False
|
||||
Me.txtKundenNrvon._ShortDateOnly = False
|
||||
Me.txtKundenNrvon._TimeOnly = False
|
||||
Me.txtKundenNrvon._TimeOnly_Seconds = False
|
||||
Me.txtKundenNrvon._value = ""
|
||||
Me.txtKundenNrvon._Waehrung = False
|
||||
Me.txtKundenNrvon._WaehrungZeichen = False
|
||||
Me.txtKundenNrvon.ForeColor = System.Drawing.Color.Black
|
||||
Me.txtKundenNrvon.Location = New System.Drawing.Point(11, 123)
|
||||
Me.txtKundenNrvon.MaxLineLength = -1
|
||||
Me.txtKundenNrvon.MaxLines_Warning = ""
|
||||
Me.txtKundenNrvon.MaxLines_Warning_Label = Nothing
|
||||
Me.txtKundenNrvon.Name = "txtKundenNrvon"
|
||||
Me.txtKundenNrvon.Size = New System.Drawing.Size(98, 20)
|
||||
Me.txtKundenNrvon.TabIndex = 58
|
||||
'
|
||||
'txtKundenNrbis
|
||||
'
|
||||
Me.txtKundenNrbis._DateTimeOnly = False
|
||||
Me.txtKundenNrbis._numbersOnly = True
|
||||
Me.txtKundenNrbis._numbersOnlyKommastellen = ""
|
||||
Me.txtKundenNrbis._numbersOnlyTrennzeichen = False
|
||||
Me.txtKundenNrbis._Prozent = False
|
||||
Me.txtKundenNrbis._ShortDateNew = False
|
||||
Me.txtKundenNrbis._ShortDateOnly = False
|
||||
Me.txtKundenNrbis._TimeOnly = False
|
||||
Me.txtKundenNrbis._TimeOnly_Seconds = False
|
||||
Me.txtKundenNrbis._value = ""
|
||||
Me.txtKundenNrbis._Waehrung = False
|
||||
Me.txtKundenNrbis._WaehrungZeichen = False
|
||||
Me.txtKundenNrbis.ForeColor = System.Drawing.Color.Black
|
||||
Me.txtKundenNrbis.Location = New System.Drawing.Point(146, 123)
|
||||
Me.txtKundenNrbis.MaxLineLength = -1
|
||||
Me.txtKundenNrbis.MaxLines_Warning = ""
|
||||
Me.txtKundenNrbis.MaxLines_Warning_Label = Nothing
|
||||
Me.txtKundenNrbis.Name = "txtKundenNrbis"
|
||||
Me.txtKundenNrbis.Size = New System.Drawing.Size(98, 20)
|
||||
Me.txtKundenNrbis.TabIndex = 59
|
||||
'
|
||||
'Label7
|
||||
'
|
||||
Me.Label7.AutoSize = True
|
||||
Me.Label7.Location = New System.Drawing.Point(121, 126)
|
||||
Me.Label7.Name = "Label7"
|
||||
Me.Label7.Size = New System.Drawing.Size(10, 13)
|
||||
Me.Label7.TabIndex = 60
|
||||
Me.Label7.Text = "-"
|
||||
'
|
||||
'usrcntlFremdrechnungen
|
||||
'
|
||||
@@ -640,4 +718,9 @@ Partial Class usrcntlFremdrechnungen
|
||||
Friend WithEvents cbxMailoeffnen As CheckBox
|
||||
Friend WithEvents lblSumBto As Label
|
||||
Friend WithEvents Label5 As Label
|
||||
Friend WithEvents Label7 As Label
|
||||
Friend WithEvents txtKundenNrbis As VERAG_PROG_ALLGEMEIN.MyTextBox
|
||||
Friend WithEvents txtKundenNrvon As VERAG_PROG_ALLGEMEIN.MyTextBox
|
||||
Friend WithEvents Label6 As Label
|
||||
Friend WithEvents ContextMenuStrip2 As ContextMenuStrip
|
||||
End Class
|
||||
|
||||
@@ -123,4 +123,7 @@
|
||||
<metadata name="cntxtExcel.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>807, 17</value>
|
||||
</metadata>
|
||||
<metadata name="ContextMenuStrip2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>913, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
@@ -50,6 +50,10 @@ Public Class usrcntlFremdrechnungen
|
||||
|
||||
dgvInitWait = True
|
||||
|
||||
txtKundenNrvon.Enabled = kdNr <= 0
|
||||
txtKundenNrbis.Enabled = kdNr <= 0
|
||||
|
||||
|
||||
Dim kdNr_WHERE = ""
|
||||
If kdNr_filter Then
|
||||
kdNr_WHERE = ""
|
||||
@@ -203,85 +207,99 @@ Public Class usrcntlFremdrechnungen
|
||||
End Sub
|
||||
|
||||
|
||||
Sub SET_SDL(SDLNrTmp)
|
||||
Sub SET_SDL(SDLNrTmp As String, Optional kdNrvon As Integer = -1, Optional kdNrbis As Integer = -1)
|
||||
aktLieferant = SDLNrTmp
|
||||
|
||||
|
||||
|
||||
Dim anzahlTop = 1000
|
||||
Dim sqlfehlendePDF As String = ""
|
||||
Dim sqlfehlendePDF_PLOSE As String = ""
|
||||
Dim sqlfehlendePDF_RMC As String = ""
|
||||
Dim sqlfehlendePDF_VERAG As String = "" 'veragPDF sind immer da (können nie fehlen)!
|
||||
|
||||
|
||||
Select Case cbxPDFhinterlegt.CheckState
|
||||
Case CheckState.Unchecked : sqlfehlendePDF = " AND [daId] is null" : sqlfehlendePDF_PLOSE = " AND plInv_daId is null" : sqlfehlendePDF_RMC = " AND rmc_daId is null"
|
||||
Case CheckState.Checked : sqlfehlendePDF = " AND not [daId] is null" : sqlfehlendePDF_PLOSE = " AND plInv_daId is not null" : sqlfehlendePDF_RMC = " AND rmc_daId is not null"
|
||||
Case CheckState.Unchecked : sqlfehlendePDF = " AND [daId] is null" : sqlfehlendePDF_PLOSE = " AND plInv_daId is null" : sqlfehlendePDF_RMC = " AND rmc_daId is null" : sqlfehlendePDF_VERAG = " AND 1 = 0"
|
||||
Case CheckState.Checked : sqlfehlendePDF = " AND not [daId] is null" : sqlfehlendePDF_PLOSE = " AND plInv_daId is not null" : sqlfehlendePDF_RMC = " AND rmc_daId is not null" : sqlfehlendePDF_VERAG = " AND 1 = 1"
|
||||
End Select
|
||||
|
||||
Dim whereKundennrKreisAlle As String = ""
|
||||
Dim whereKundennrKreisLieferanten As String = ""
|
||||
|
||||
If kdNrvon > 0 AndAlso kdNrbis > 0 Then
|
||||
Select Case SDLNrTmp
|
||||
Case "IDS" : whereKundennrKreisLieferanten = " and KdNrVERAG between " & kdNrvon & " and " & kdNrbis
|
||||
Case "MSE" : whereKundennrKreisLieferanten = " and partner_customer_number between " & kdNrvon & " and " & kdNrbis
|
||||
Case "ALLE" : whereKundennrKreisAlle = " and temp.AdressenNr between " & kdNrvon & " and " & kdNrbis
|
||||
Case Else
|
||||
whereKundennrKreisLieferanten = " and AdressenNr between " & kdNrvon & " and " & kdNrbis
|
||||
End Select
|
||||
|
||||
|
||||
End If
|
||||
|
||||
Dim SQL_STR = ""
|
||||
Select Case SDLNrTmp
|
||||
|
||||
'IDS
|
||||
Case "IDS" : SQL_STR = "SELECT " & IIf(cbxMax1000Eintrage.Checked, " top " & anzahlTop, "") &
|
||||
" invoice_id,[tbl_IDS_Kunden].KdNrVERAG as AdressenNr, [YearMonthDay] as Rechnungsdatum,[Invoicenumber] as Rechnungsnummer, tblIDSInvoicesNew.CustomerCode as Kundennummer,[daId],[TransactionVolume] as Transaktionsmenge,[AmminclVAT] as Bruttobetrag,[TotalNetAmount] as Nettobetrag,[VATAmount] as MWSt, cast(case when [daId] is not null then 1 else 0 end as bit) as PDFvorhanden FROM tblIDSInvoicesNew inner join [VERAG].[dbo].[tbl_IDS_Kunden] on tblIDSInvoicesNew.CustomerCode = tbl_IDS_Kunden.CustomerCode WHERE tblIDSInvoicesNew.[CustomerCode] in (SELECT distinct([CustomerCode]) FROM [VERAG].[dbo].[tbl_IDS_Kunden] WHERE 1 = 1 AND isnull([tbl_IDS_Kunden].KdNrAlt, 0) = 0 " & sqlfehlendePDF & IIf(kdNr > 0, " AND [KdNrVERAG]=" & kdNr, "") & ") and [YearMonthDay] " & setSQLWhere(SDLNrTmp, "") & " order by [YearMonthDay] desc, [Invoicenumber]"
|
||||
" invoice_id,[tbl_IDS_Kunden].KdNrVERAG as AdressenNr, [YearMonthDay] as Rechnungsdatum,[Invoicenumber] as Rechnungsnummer, tblIDSInvoicesNew.CustomerCode as Kundennummer,[daId],[TransactionVolume] as Transaktionsmenge,[AmminclVAT] as Bruttobetrag,[TotalNetAmount] as Nettobetrag,[VATAmount] as MWSt, cast(case when [daId] is not null then 1 else 0 end as bit) as PDFvorhanden FROM tblIDSInvoicesNew inner join [VERAG].[dbo].[tbl_IDS_Kunden] on tblIDSInvoicesNew.CustomerCode = tbl_IDS_Kunden.CustomerCode WHERE tblIDSInvoicesNew.[CustomerCode] in (SELECT distinct([CustomerCode]) FROM [VERAG].[dbo].[tbl_IDS_Kunden] WHERE 1 = 1 AND isnull([tbl_IDS_Kunden].KdNrAlt, 0) = 0 " & sqlfehlendePDF & IIf(kdNr > 0, " AND [KdNrVERAG]=" & kdNr, "") & ") and [YearMonthDay] " & setSQLWhere(SDLNrTmp, "") & whereKundennrKreisLieferanten & " order by [YearMonthDay] desc, [Invoicenumber]"
|
||||
|
||||
'UTA
|
||||
Case "UTA" : SQL_STR = "SELECT " & IIf(cbxMax1000Eintrage.Checked, " top " & anzahlTop, "") &
|
||||
" Adressen.AdressenNr, Adressen.[Name 1], [Rechnungsdatum],[Rechnungsnummer_pro_Lieferland] as Rechnungsnummer,Kundennummer,SUM(Gesamtbetrag_Brutto_in_Darstellwährung) as Bruttobetrag,SUM(Gesamtbetrag_Netto_in_Darstellwährung) as Nettobetrag, SUM(Gesamtbetrag_Umsatzsteuer_in_Darstellwährung) as MWSt,[daId],[Lieferland_ISO2] as Land, 'RE' as Art, cast(case when [daId] is not null then 1 else 0 end as bit) as PDFvorhanden, cast(archiv as bit) as archiv FROM [VERAG].[dbo].[tblUTAImportNew] inner join adressen on Kundennummer = UTAKundenNr where 1 = 1 " & sqlfehlendePDF & IIf(kdNr > 0, " AND [AdressenNr]=" & kdNr, "") & " AND [Rechnungsdatum] " & setSQLWhere(SDLNrTmp, "Lieferland_ISO2") & " group by Adressen.AdressenNr, Adressen.[Name 1],[Rechnungsnummer_pro_Lieferland],[Rechnungsdatum],Kundennummer,[daId],[Lieferland_ISO2], archiv"
|
||||
" Adressen.AdressenNr, Adressen.[Name 1], [Rechnungsdatum],[Rechnungsnummer_pro_Lieferland] as Rechnungsnummer,Kundennummer,SUM(Gesamtbetrag_Brutto_in_Darstellwährung) as Bruttobetrag,SUM(Gesamtbetrag_Netto_in_Darstellwährung) as Nettobetrag, SUM(Gesamtbetrag_Umsatzsteuer_in_Darstellwährung) as MWSt,[daId],[Lieferland_ISO2] as Land, 'RE' as Art, cast(case when [daId] is not null then 1 else 0 end as bit) as PDFvorhanden, cast(archiv as bit) as archiv FROM [VERAG].[dbo].[tblUTAImportNew] inner join adressen on Kundennummer = UTAKundenNr where 1 = 1 " & sqlfehlendePDF & IIf(kdNr > 0, " AND [AdressenNr]=" & kdNr, "") & " AND [Rechnungsdatum] " & setSQLWhere(SDLNrTmp, "Lieferland_ISO2") & whereKundennrKreisLieferanten & " group by Adressen.AdressenNr, Adressen.[Name 1],[Rechnungsnummer_pro_Lieferland],[Rechnungsdatum],Kundennummer,[daId],[Lieferland_ISO2], archiv"
|
||||
|
||||
SQL_STR &= " UNION ALL SELECT " & IIf(cbxMax1000Eintrage.Checked, " top " & anzahlTop, "") & " Adressen.AdressenNr, Adressen.[Name 1],[Datum], [RechnungsNr],[KundenNr],0,0,0,[daId],'',[DocumentTyp], cast(case when [daId] is not null then 1 else 0 end as bit) as PDFvorhanden, cast(0 as bit) as archiv FROM [VERAG].[dbo].[tblUTADocuments] inner join adressen on KundenNr = UTAKundenNr where 1 = 1 " & IIf(kdNr > 0, " AND [AdressenNr]=" & kdNr, "") & " and [Datum] " & setSQLWhere("_", "") & " order by Rechnungsdatum desc"
|
||||
SQL_STR &= " UNION ALL SELECT " & IIf(cbxMax1000Eintrage.Checked, " top " & anzahlTop, "") & " Adressen.AdressenNr, Adressen.[Name 1],[Datum], [RechnungsNr],[KundenNr],0,0,0,[daId],'',[DocumentTyp], cast(case when [daId] is not null then 1 else 0 end as bit) as PDFvorhanden, cast(0 as bit) as archiv FROM [VERAG].[dbo].[tblUTADocuments] inner join adressen on KundenNr = UTAKundenNr where 1 = 1 " & IIf(kdNr > 0, " AND [AdressenNr]=" & kdNr, "") & " and [Datum] " & setSQLWhere("_", "") & whereKundennrKreisLieferanten & " order by Rechnungsdatum desc"
|
||||
|
||||
'PLOSE
|
||||
Case "PLOSE" : SQL_STR = "SELECT " & IIf(cbxMax1000Eintrage.Checked, " top " & anzahlTop, "") &
|
||||
" Adressen.AdressenNr, Adressen.[Name 1],[plInv_SupplierRechnungsDatum] as Rechnungsdatum, [plInv_SupplierRechnungsNr] as Rechnungsnummer,[plInv_PLOSEKundennummer] as Kundennummer,[plInv_Nettobetrag] as Nettobetrag,[plInv_MWSTBetrag] as MWST,[plInv_Bruttobetrag] as Bruttobetrag,[plInv_daId] as daId, [plInv_SupplierCountry] as Land, cast(case when [plInv_daId] is not null then 1 else 0 end as bit) as PDFvorhanden, plInv_Archiv as archiv FROM tblPLOSE_Inv_Data inner join Adressen on Adressen.PLOSEKundenNr = plInv_PLOSEKundennummer where 1 = 1 " & sqlfehlendePDF_PLOSE & IIf(kdNr > 0, " AND Adressen.AdressenNr=" & kdNr, "") & " and [plInv_SupplierRechnungsDatum] " & setSQLWhere(SDLNrTmp, "plInv_SupplierCountry") & " Order by plInv_SupplierRechnungsDatum desc, [plInv_SupplierRechnungsNr]"
|
||||
" Adressen.AdressenNr, Adressen.[Name 1],[plInv_SupplierRechnungsDatum] as Rechnungsdatum, [plInv_SupplierRechnungsNr] as Rechnungsnummer,[plInv_PLOSEKundennummer] as Kundennummer,[plInv_Nettobetrag] as Nettobetrag,[plInv_MWSTBetrag] as MWST,[plInv_Bruttobetrag] as Bruttobetrag,[plInv_daId] as daId, [plInv_SupplierCountry] as Land, cast(case when [plInv_daId] is not null then 1 else 0 end as bit) as PDFvorhanden, plInv_Archiv as archiv FROM tblPLOSE_Inv_Data inner join Adressen on Adressen.PLOSEKundenNr = plInv_PLOSEKundennummer where 1 = 1 " & sqlfehlendePDF_PLOSE & IIf(kdNr > 0, " AND Adressen.AdressenNr=" & kdNr, "") & " and [plInv_SupplierRechnungsDatum] " & setSQLWhere(SDLNrTmp, "plInv_SupplierCountry") & whereKundennrKreisLieferanten & " Order by plInv_SupplierRechnungsDatum desc, [plInv_SupplierRechnungsNr]"
|
||||
|
||||
'MSE
|
||||
Case "MSE" : SQL_STR = "SELECT " & IIf(cbxMax1000Eintrage.Checked, " top " & anzahlTop, "") &
|
||||
" partner_customer_number as AdressenNr, customer_name as [Name 1], [invoice_date] as Rechnungsdatum, [invoice_id] as Rechnungsnummer/*,[invoice_nr]*/,[customer_number] as Kundennummer, daId, [total_amount_euro] as Brutto_EUR ,[total_vat_amount_euro] as MWST,[country] as Land, cast(case when [daId] is not null then 1 else 0 end as bit) as PDFvorhanden, archiv FROM tblMSEInvoices inner join tblMSECustomers on customer_id = [customer_number] where 1 = 1 " & sqlfehlendePDF & IIf(kdNr > 0, " AND [partner_customer_number]=" & kdNr, "") & " and [invoice_date] " & setSQLWhere(SDLNrTmp, "country") & " order by invoice_date desc, invoice_id"
|
||||
" partner_customer_number as AdressenNr, customer_name as [Name 1], [invoice_date] as Rechnungsdatum, [invoice_id] as Rechnungsnummer/*,[invoice_nr]*/,[customer_number] as Kundennummer, daId, [total_amount_euro] as Bruttobetrag ,[total_vat_amount_euro] as MWST,[country] as Land, cast(case when [daId] is not null then 1 else 0 end as bit) as PDFvorhanden, archiv FROM tblMSEInvoices inner join tblMSECustomers on customer_id = [customer_number] where 1 = 1 " & sqlfehlendePDF & IIf(kdNr > 0, " AND [partner_customer_number]=" & kdNr, "") & " and [invoice_date] " & setSQLWhere(SDLNrTmp, "country") & whereKundennrKreisLieferanten & " order by invoice_date desc, invoice_id"
|
||||
|
||||
'VERAG
|
||||
Case "VERAG" : SQL_STR = "SELECT " & IIf(cbxMax1000Eintrage.Checked, " top " & anzahlTop, "") &
|
||||
" Adressen.AdressenNr, Adressen.[Name 1], tblTrdinInvoice.Rechnungsdatum, tblTrdinInvoice.Rechnungsnummer , tblTrdinInvoice.SteuerbetragLokal, 1 as daId, cast(1 as bit) as PDFvorhanden FROM tblTrdinInvoice inner join Adressen on KundenNrZentrale = AdressenNr WHERE 1 = 1 " & IIf(kdNr > 0, " AND tblTrdinInvoice.RechnungsKundenNr=" & kdNr, "") & " AND tblTrdinInvoice.FilialenNr = 4814 and tblTrdinInvoice.Rechnungsdatum " & setSQLWhere(SDLNrTmp, "'AT'") & " ORDER BY tblTrdinInvoice.Rechnungsdatum desc, tblTrdinInvoice.Rechnungsnummer"
|
||||
" Adressen.AdressenNr, Adressen.[Name 1], tblTrdinInvoice.Rechnungsdatum, tblTrdinInvoice.Rechnungsnummer , tblTrdinInvoice.RechnungsbetragLokal as Bruttobetrag, 1 as daId, cast(1 as bit) as PDFvorhanden FROM tblTrdinInvoice inner join Adressen on KundenNrZentrale = AdressenNr WHERE 1 = 1 " & sqlfehlendePDF_VERAG & IIf(kdNr > 0, " AND tblTrdinInvoice.RechnungsKundenNr=" & kdNr, "") & " AND tblTrdinInvoice.FilialenNr = 4814 and tblTrdinInvoice.Rechnungsdatum " & setSQLWhere(SDLNrTmp, "'AT'") & " ORDER BY tblTrdinInvoice.Rechnungsdatum desc, tblTrdinInvoice.Rechnungsnummer"
|
||||
'RMC
|
||||
Case "RMC" : SQL_STR = "SELECT " & IIf(cbxMax1000Eintrage.Checked, " top " & anzahlTop, "") &
|
||||
"Adressen.AdressenNr, Adressen.[Name 1],[rmc_reDatum] as Rechnungsdatum,[rmc_reNr] as Rechnungsnummer,rmc_kdNr as Kundennummer,[rmc_betragNetto] as Nettobetrag,[rmc_betragBrutto] as Bruttobetrag,[rmc_waehrung] as Währung ,[rmc_euroBrutto] as Brutto_EUR,[rmc_daId] as daId,[rmc_betragMWST] as MWST,rmc_landKZ as Land, cast(case when [rmc_daId] is not null then 1 else 0 end as bit) as PDFvorhanden, rmc_archiv as archiv FROM [VERAG].[dbo].[tblRMCImport] inner join Adressen on Adressen.WölflKundenNr = rmc_kdNr where 1 = 1 " & sqlfehlendePDF_RMC & IIf(kdNr > 0, " AND AdressenNr=" & kdNr, "") & " and [rmc_reDatum] " & setSQLWhere(SDLNrTmp, "rmc_landKZ") & " order by rmc_reDatum desc, rmc_reNr"
|
||||
"Adressen.AdressenNr, Adressen.[Name 1],[rmc_reDatum] as Rechnungsdatum,[rmc_reNr] as Rechnungsnummer,rmc_kdNr as Kundennummer,[rmc_betragNetto] as Nettobetrag,[rmc_betragBrutto] as Bruttobetrag,[rmc_waehrung] as Währung ,[rmc_euroBrutto] as Bruttobetrag,[rmc_daId] as daId,[rmc_betragMWST] as MWST,rmc_landKZ as Land, cast(case when [rmc_daId] is not null then 1 else 0 end as bit) as PDFvorhanden, rmc_archiv as archiv FROM [VERAG].[dbo].[tblRMCImport] inner join Adressen on Adressen.WölflKundenNr = rmc_kdNr where 1 = 1 " & sqlfehlendePDF_RMC & IIf(kdNr > 0, " AND AdressenNr=" & kdNr, "") & " and [rmc_reDatum] " & setSQLWhere(SDLNrTmp, "rmc_landKZ") & whereKundennrKreisLieferanten & " order by rmc_reDatum desc, rmc_reNr"
|
||||
|
||||
Case "ALLE" : Dim anzahl As Integer = anzahlTop / 6 : SQL_STR = " select * from (SELECT " & IIf(cbxMax1000Eintrage.Checked, " top " & anzahl, "") &
|
||||
"
|
||||
--IDS
|
||||
'IDS' as Lieferant,invoice_id,[tbl_IDS_Kunden].KdNrVERAG as AdressenNr, [YearMonthDay] as Rechnungsdatum,[Invoicenumber] as Rechnungsnummer,tblIDSInvoicesNew.CustomerCode as Kundennummer,[AmminclVAT] as Bruttobetrag,[TotalNetAmount] as Nettobetrag,[VATAmount] as MWSt,'' as Land, 'RE' as Art,[daId], cast(case when [daId] is not null then 1 else 0 end as bit) as PDFvorhanden FROM tblIDSInvoicesNew inner join [VERAG].[dbo].[tbl_IDS_Kunden] on tblIDSInvoicesNew.CustomerCode = tbl_IDS_Kunden.CustomerCode WHERE tblIDSInvoicesNew.[CustomerCode] in (SELECT [CustomerCode] FROM [VERAG].[dbo].[tbl_IDS_Kunden] WHERE 1 = 1 and isnull([tbl_IDS_Kunden].KdNrAlt, 1) = 0 " & sqlfehlendePDF & IIf(kdNr > 0, " AND [KdNrVERAG]=" & kdNr, "") & " ) and [YearMonthDay] " & setSQLWhere("IDS", "") & " -- order by [YearMonthDay], [Invoicenumber]
|
||||
'IDS' as Lieferant,invoice_id,[tbl_IDS_Kunden].KdNrVERAG as AdressenNr, [YearMonthDay] as Rechnungsdatum,[Invoicenumber] as Rechnungsnummer,tblIDSInvoicesNew.CustomerCode as Kundennummer,[AmminclVAT] as Bruttobetrag,[TotalNetAmount] as Nettobetrag,[VATAmount] as MWSt,'' as Land, 'RE' as Art,[daId], cast(case when [daId] is not null then 1 else 0 end as bit) as PDFvorhanden FROM tblIDSInvoicesNew inner join [VERAG].[dbo].[tbl_IDS_Kunden] on tblIDSInvoicesNew.CustomerCode = tbl_IDS_Kunden.CustomerCode WHERE tblIDSInvoicesNew.[CustomerCode] in (SELECT [CustomerCode] FROM [VERAG].[dbo].[tbl_IDS_Kunden] WHERE 1 = 1 and isnull([tbl_IDS_Kunden].KdNrAlt, 1) = 0 " & sqlfehlendePDF & IIf(kdNr > 0, " AND [KdNrVERAG]=" & kdNr, "") & " ) and [YearMonthDay] " & setSQLWhere("IDS", "") & whereKundennrKreisLieferanten & " -- order by [YearMonthDay], [Invoicenumber]
|
||||
|
||||
UNION ALL
|
||||
|
||||
|
||||
--MSE
|
||||
SELECT " & IIf(cbxMax1000Eintrage.Checked, " top " & anzahl, "") & " 'MSE' as Lieferant,-1 as invoice_id,partner_customer_number as AdressenNr, [invoice_date] as Rechnungsdatum, cast([invoice_id] as nvarchar) as Rechnungsnummer,[customer_number] as Kundennummer, [total_amount_euro] as Bruttobetrag ,(total_amount_euro - [total_vat_amount_euro]) as Nettobetrag ,[total_vat_amount_euro] as MWST,[country] as Land,'RE' as Art,daId, cast(case when [daId] is not null then 1 else 0 end as bit) as PDFvorhanden FROM tblMSEInvoices inner join tblMSECustomers on customer_id = [customer_number] where 1 = 1 " & sqlfehlendePDF & IIf(kdNr > 0, " AND [partner_customer_number]=" & kdNr, "") & " and [invoice_date] " & setSQLWhere("MSE", "country") & " --order by invoice_date, invoice_id
|
||||
SELECT " & IIf(cbxMax1000Eintrage.Checked, " top " & anzahl, "") & " 'MSE' as Lieferant,-1 as invoice_id,partner_customer_number as AdressenNr, [invoice_date] as Rechnungsdatum, cast([invoice_id] as nvarchar) as Rechnungsnummer,[customer_number] as Kundennummer, [total_amount_euro] as Bruttobetrag ,(total_amount_euro - [total_vat_amount_euro]) as Nettobetrag ,[total_vat_amount_euro] as MWST,[country] as Land,'RE' as Art,daId, cast(case when [daId] is not null then 1 else 0 end as bit) as PDFvorhanden FROM tblMSEInvoices inner join tblMSECustomers on customer_id = [customer_number] where 1 = 1 " & sqlfehlendePDF & IIf(kdNr > 0, " AND [partner_customer_number]=" & kdNr, "") & " and [invoice_date] " & setSQLWhere("MSE", "country") & whereKundennrKreisLieferanten & " --order by invoice_date, invoice_id
|
||||
|
||||
UNION ALL
|
||||
|
||||
--UTA
|
||||
SELECT " & IIf(cbxMax1000Eintrage.Checked, " top " & anzahl, "") & " 'UTA' as Lieferant,-1 as invoice_id,Adressen.AdressenNr, [Rechnungsdatum],STR([Rechnungsnummer_pro_Lieferland]) as Rechnungsnummer,Kundennummer,SUM(Gesamtbetrag_Brutto_in_Darstellwährung) as Bruttobetrag,SUM(Gesamtbetrag_Netto_in_Darstellwährung) as Nettobetrag, SUM(Gesamtbetrag_Umsatzsteuer_in_Darstellwährung) as MWSt,[Lieferland_ISO2] as Land, 'RE' as Art,[daId], cast(case when [daId] is not null then 1 else 0 end as bit) as PDFvorhanden FROM [VERAG].[dbo].[tblUTAImportNew] inner join adressen on Kundennummer = UTAKundenNr where 1 = 1 " & sqlfehlendePDF & IIf(kdNr > 0, " AND [AdressenNr]=" & kdNr, "") & " and [Rechnungsdatum] " & setSQLWhere("UTA", "Lieferland_ISO2") & " group by [Rechnungsnummer_pro_Lieferland],[Rechnungsdatum],Kundennummer,AdressenNr,[daId],[Lieferland_ISO2] UNION ALL SELECT 'UTA',-1,AdressenNr, [Datum], cast([RechnungsNr] as nvarchar) ,[KundenNr],0,0,0,'',[DocumentTyp],[daId], cast(case when [daId] is not null then 1 else 0 end as bit) as PDFvorhanden FROM [VERAG].[dbo].[tblUTADocuments] inner join adressen on KundenNr = UTAKundenNr where AdressenNr = " & kdNr & " AND Datum " & setSQLWhere("UTA_", "") & " --order by Rechnungsnummer desc
|
||||
SELECT " & IIf(cbxMax1000Eintrage.Checked, " top " & anzahl, "") & " 'UTA' as Lieferant,-1 as invoice_id,Adressen.AdressenNr, [Rechnungsdatum],STR([Rechnungsnummer_pro_Lieferland]) as Rechnungsnummer,Kundennummer,SUM(Gesamtbetrag_Brutto_in_Darstellwährung) as Bruttobetrag,SUM(Gesamtbetrag_Netto_in_Darstellwährung) as Nettobetrag, SUM(Gesamtbetrag_Umsatzsteuer_in_Darstellwährung) as MWSt,[Lieferland_ISO2] as Land, 'RE' as Art,[daId], cast(case when [daId] is not null then 1 else 0 end as bit) as PDFvorhanden FROM [VERAG].[dbo].[tblUTAImportNew] inner join adressen on Kundennummer = UTAKundenNr where 1 = 1 " & sqlfehlendePDF & IIf(kdNr > 0, " AND [AdressenNr]=" & kdNr, "") & " and [Rechnungsdatum] " & setSQLWhere("UTA", "Lieferland_ISO2") & whereKundennrKreisLieferanten & " group by [Rechnungsnummer_pro_Lieferland],[Rechnungsdatum],Kundennummer,AdressenNr,[daId],[Lieferland_ISO2] UNION ALL SELECT 'UTA',-1,AdressenNr, [Datum], cast([RechnungsNr] as nvarchar) ,[KundenNr],0,0,0,'',[DocumentTyp],[daId], cast(case when [daId] is not null then 1 else 0 end as bit) as PDFvorhanden FROM [VERAG].[dbo].[tblUTADocuments] inner join adressen on KundenNr = UTAKundenNr where AdressenNr = " & kdNr & " AND Datum " & setSQLWhere("UTA_", "") & whereKundennrKreisLieferanten & " --order by Rechnungsnummer desc
|
||||
|
||||
UNION ALL
|
||||
--VERAG
|
||||
|
||||
SELECT " & IIf(cbxMax1000Eintrage.Checked, " top " & anzahl, "") & " 'VERAG' as Lieferant,-1 as invoice_id,Adressen.AdressenNr, tblTrdinInvoice.Rechnungsdatum, cast(tblTrdinInvoice.Rechnungsnummer as nvarchar) as Rechnungsnummer ,tblTrdinInvoice.KundenNrZentrale as Kundennummer, tblTrdinInvoice.SteuerpflichtigerBetragLokal + tblTrdinInvoice.SteuerfreierBetragLokal as Bruttobetrag ,tblTrdinInvoice.SteuerpflichtigerBetragLokal + tblTrdinInvoice.SteuerfreierBetragLokal - tblTrdinInvoice.SteuerbetragLokal as Nettobetrag ,tblTrdinInvoice.SteuerbetragLokal as MWST, 'AT' as Land, 'RE' as Art, 1 as daId, cast(1 as bit) PDFvorhanden FROM tblTrdinInvoice inner join Adressen on KundenNrZentrale = AdressenNr WHERE 1 = 1 " & IIf(kdNr > 0, " AND tblTrdinInvoice.RechnungsKundenNr=" & kdNr, "") & " and tblTrdinInvoice.Rechnungsdatum " & setSQLWhere("VERAG", "'AT'") & " AND tblTrdinInvoice.FilialenNr = 4814 --ORDER BY tblTrdinInvoice.Rechnungsdatum, tblTrdinInvoice.Rechnungsnummer
|
||||
SELECT " & IIf(cbxMax1000Eintrage.Checked, " top " & anzahl, "") & " 'VERAG' as Lieferant,-1 as invoice_id,Adressen.AdressenNr, tblTrdinInvoice.Rechnungsdatum, cast(tblTrdinInvoice.Rechnungsnummer as nvarchar) as Rechnungsnummer ,tblTrdinInvoice.KundenNrZentrale as Kundennummer, tblTrdinInvoice.SteuerpflichtigerBetragLokal + tblTrdinInvoice.SteuerfreierBetragLokal as Bruttobetrag ,tblTrdinInvoice.SteuerpflichtigerBetragLokal + tblTrdinInvoice.SteuerfreierBetragLokal - tblTrdinInvoice.SteuerbetragLokal as Nettobetrag ,tblTrdinInvoice.SteuerbetragLokal as MWST, 'AT' as Land, 'RE' as Art, 1 as daId, cast(1 as bit) PDFvorhanden FROM tblTrdinInvoice inner join Adressen on KundenNrZentrale = AdressenNr WHERE 1 = 1 " & sqlfehlendePDF_VERAG & IIf(kdNr > 0, " AND tblTrdinInvoice.RechnungsKundenNr=" & kdNr, "") & " and tblTrdinInvoice.Rechnungsdatum " & setSQLWhere("VERAG", "'AT'") & whereKundennrKreisLieferanten & " AND tblTrdinInvoice.FilialenNr = 4814 --ORDER BY tblTrdinInvoice.Rechnungsdatum, tblTrdinInvoice.Rechnungsnummer
|
||||
|
||||
|
||||
UNION ALL
|
||||
--PLOSE
|
||||
|
||||
SELECT " & IIf(cbxMax1000Eintrage.Checked, " top " & anzahl, "") & " 'PLOSE' as Lieferant,-1 as invoice_id,Adressen.AdressenNr, [plInv_SupplierRechnungsDatum] as Rechnungsdatum, cast([plInv_SupplierRechnungsNr] as nvarchar) as Rechnungsnummer,[plInv_PLOSEKundennummer] as Kundennummer,[plInv_Bruttobetrag] as Bruttobetrag,[plInv_Nettobetrag] as Nettobetrag,[plInv_MWSTBetrag] as MWST, [plInv_SupplierCountry] as Land, 'RE' as Art,[plInv_daId] as daId, cast(case when [plInv_daId] is not null then 1 else 0 end as bit) as PDFvorhanden FROM tblPLOSE_Inv_Data inner join Adressen on Adressen.PLOSEKundenNr = plInv_PLOSEKundennummer where 1 = 1 " & sqlfehlendePDF_PLOSE & IIf(kdNr > 0, " AND Adressen.AdressenNr=" & kdNr, "") & " and [plInv_SupplierRechnungsDatum] " & setSQLWhere("PLOSE", "plInv_SupplierCountry") & "-- Order by plInv_SupplierRechnungsDatum desc, [plInv_SupplierRechnungsNr]
|
||||
SELECT " & IIf(cbxMax1000Eintrage.Checked, " top " & anzahl, "") & " 'PLOSE' as Lieferant,-1 as invoice_id,Adressen.AdressenNr, [plInv_SupplierRechnungsDatum] as Rechnungsdatum, cast([plInv_SupplierRechnungsNr] as nvarchar) as Rechnungsnummer,[plInv_PLOSEKundennummer] as Kundennummer,[plInv_Bruttobetrag] as Bruttobetrag,[plInv_Nettobetrag] as Nettobetrag,[plInv_MWSTBetrag] as MWST, [plInv_SupplierCountry] as Land, 'RE' as Art,[plInv_daId] as daId, cast(case when [plInv_daId] is not null then 1 else 0 end as bit) as PDFvorhanden FROM tblPLOSE_Inv_Data inner join Adressen on Adressen.PLOSEKundenNr = plInv_PLOSEKundennummer where 1 = 1 " & sqlfehlendePDF_PLOSE & IIf(kdNr > 0, " AND Adressen.AdressenNr=" & kdNr, "") & " and [plInv_SupplierRechnungsDatum] " & setSQLWhere("PLOSE", "plInv_SupplierCountry") & whereKundennrKreisLieferanten & "-- Order by plInv_SupplierRechnungsDatum desc, [plInv_SupplierRechnungsNr]
|
||||
|
||||
UNION ALL
|
||||
|
||||
--RMC
|
||||
SELECT " & IIf(cbxMax1000Eintrage.Checked, " top " & anzahl, "") & " 'RMC' as Lieferant,-1 as invoice_id,Adressen.AdressenNr, [rmc_reDatum] as Rechnungsdatum,cast([rmc_reNr] as nvarchar) as Rechnungsnummer,rmc_kdNr as Kundennummer ,[rmc_betragBrutto] as Bruttobetrag,[rmc_betragNetto] as Nettobetrag,[rmc_betragMWST] as MWST, rmc_landKZ as Land, 'RE' as Art, [rmc_daId] as daId, cast(case when [rmc_daId] is not null then 1 else 0 end as bit) as PDFvorhanden FROM [VERAG].[dbo].[tblRMCImport] inner join Adressen on Adressen.WölflKundenNr = rmc_kdNr where 1 = 1 " & sqlfehlendePDF_RMC & IIf(kdNr > 0, " AND AdressenNr=" & kdNr, "") & " and [rmc_reDatum] " & setSQLWhere("RMC", "rmc_landKZ") & "-- order by rmc_reDatum, rmc_reNr
|
||||
SELECT " & IIf(cbxMax1000Eintrage.Checked, " top " & anzahl, "") & " 'RMC' as Lieferant,-1 as invoice_id,Adressen.AdressenNr, [rmc_reDatum] as Rechnungsdatum,cast([rmc_reNr] as nvarchar) as Rechnungsnummer,rmc_kdNr as Kundennummer ,[rmc_betragBrutto] as Bruttobetrag,[rmc_betragNetto] as Nettobetrag,[rmc_betragMWST] as MWST, rmc_landKZ as Land, 'RE' as Art, [rmc_daId] as daId, cast(case when [rmc_daId] is not null then 1 else 0 end as bit) as PDFvorhanden FROM [VERAG].[dbo].[tblRMCImport] inner join Adressen on Adressen.WölflKundenNr = rmc_kdNr where 1 = 1 " & sqlfehlendePDF_RMC & IIf(kdNr > 0, " AND AdressenNr=" & kdNr, "") & " and [rmc_reDatum] " & setSQLWhere("RMC", "rmc_landKZ") & whereKundennrKreisLieferanten & "-- order by rmc_reDatum, rmc_reNr
|
||||
|
||||
) as temp where 1=1 and temp.Rechnungsdatum" & setSQLWhere(SDLNrTmp, "temp.Land") & " order by Rechnungsdatum desc"
|
||||
) as temp where 1=1 and temp.Rechnungsdatum" & setSQLWhere(SDLNrTmp, "temp.Land") & whereKundennrKreisAlle & " order by Rechnungsdatum desc"
|
||||
|
||||
|
||||
|
||||
@@ -513,44 +531,141 @@ Public Class usrcntlFremdrechnungen
|
||||
End Select
|
||||
End Function
|
||||
Private Sub btnSDL_Alle_Click(sender As Object, e As EventArgs) Handles btnSDL_Alle.Click
|
||||
SET_SDL("ALLE")
|
||||
'SET_SDL("ALLE")
|
||||
|
||||
If txtKundenNrvon.Text <> "" AndAlso txtKundenNrvon.Text.Length = 6 AndAlso IsNumeric(txtKundenNrvon.Text) AndAlso txtKundenNrbis.Text <> "" AndAlso txtKundenNrbis.Text.Length = 6 AndAlso IsNumeric(txtKundenNrbis.Text) Then
|
||||
SET_SDL("ALLE", txtKundenNrvon.Text, txtKundenNrbis.Text)
|
||||
|
||||
ElseIf txtKundenNrvon.Text = "" AndAlso txtKundenNrbis.Text = "" Then
|
||||
|
||||
SET_SDL("ALLE")
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub btnSDL_IDS_Click(sender As Object, e As EventArgs) Handles btnSDL_IDS.Click
|
||||
SET_SDL("IDS")
|
||||
'SET_SDL("IDS")
|
||||
|
||||
If txtKundenNrvon.Text <> "" AndAlso txtKundenNrvon.Text.Length = 6 AndAlso IsNumeric(txtKundenNrvon.Text) AndAlso txtKundenNrbis.Text <> "" AndAlso txtKundenNrbis.Text.Length = 6 AndAlso IsNumeric(txtKundenNrbis.Text) Then
|
||||
SET_SDL("IDS", txtKundenNrvon.Text, txtKundenNrbis.Text)
|
||||
|
||||
ElseIf txtKundenNrvon.Text = "" AndAlso txtKundenNrbis.Text = "" Then
|
||||
|
||||
SET_SDL("IDS")
|
||||
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub btnSDL_UTA_Click(sender As Object, e As EventArgs) Handles btnSDL_UTA.Click
|
||||
SET_SDL("UTA")
|
||||
'SET_SDL("UTA")
|
||||
|
||||
|
||||
If txtKundenNrvon.Text <> "" AndAlso txtKundenNrvon.Text.Length = 6 AndAlso IsNumeric(txtKundenNrvon.Text) AndAlso txtKundenNrbis.Text <> "" AndAlso txtKundenNrbis.Text.Length = 6 AndAlso IsNumeric(txtKundenNrbis.Text) Then
|
||||
SET_SDL("UTA", txtKundenNrvon.Text, txtKundenNrbis.Text)
|
||||
|
||||
ElseIf txtKundenNrvon.Text = "" AndAlso txtKundenNrbis.Text = "" Then
|
||||
|
||||
SET_SDL("UTA")
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub btnSDL_Hugo_Click(sender As Object, e As EventArgs) Handles btnSDL_Hugo.Click
|
||||
SET_SDL("HUGO")
|
||||
'SET_SDL("HUGO")
|
||||
|
||||
|
||||
If txtKundenNrvon.Text <> "" AndAlso txtKundenNrvon.Text.Length = 6 AndAlso IsNumeric(txtKundenNrvon.Text) AndAlso txtKundenNrbis.Text <> "" AndAlso txtKundenNrbis.Text.Length = 6 AndAlso IsNumeric(txtKundenNrbis.Text) Then
|
||||
SET_SDL("HUGO", txtKundenNrvon.Text, txtKundenNrbis.Text)
|
||||
|
||||
ElseIf txtKundenNrvon.Text = "" AndAlso txtKundenNrbis.Text = "" Then
|
||||
|
||||
SET_SDL("HUGO")
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub btnSDL_PLOSE_Click(sender As Object, e As EventArgs) Handles btnSDL_PLOSE.Click
|
||||
SET_SDL("PLOSE")
|
||||
'SET_SDL("PLOSE")
|
||||
|
||||
|
||||
If txtKundenNrvon.Text <> "" AndAlso txtKundenNrvon.Text.Length = 6 AndAlso IsNumeric(txtKundenNrvon.Text) AndAlso txtKundenNrbis.Text <> "" AndAlso txtKundenNrbis.Text.Length = 6 AndAlso IsNumeric(txtKundenNrbis.Text) Then
|
||||
SET_SDL("PLOSE", txtKundenNrvon.Text, txtKundenNrbis.Text)
|
||||
|
||||
ElseIf txtKundenNrvon.Text = "" AndAlso txtKundenNrbis.Text = "" Then
|
||||
|
||||
SET_SDL("PLOSE")
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub btnSDL_MautMSE_Click(sender As Object, e As EventArgs) Handles btnSDL_MautMSE.Click
|
||||
SET_SDL("MSE")
|
||||
'SET_SDL("MSE")
|
||||
|
||||
|
||||
If txtKundenNrvon.Text <> "" AndAlso txtKundenNrvon.Text.Length = 6 AndAlso IsNumeric(txtKundenNrvon.Text) AndAlso txtKundenNrbis.Text <> "" AndAlso txtKundenNrbis.Text.Length = 6 AndAlso IsNumeric(txtKundenNrbis.Text) Then
|
||||
SET_SDL("MSE", txtKundenNrvon.Text, txtKundenNrbis.Text)
|
||||
|
||||
ElseIf txtKundenNrvon.Text = "" AndAlso txtKundenNrbis.Text = "" Then
|
||||
|
||||
SET_SDL("MSE")
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub btnSDL_MotorWay_Click(sender As Object, e As EventArgs)
|
||||
SET_SDL("MW")
|
||||
'SET_SDL("MW")
|
||||
|
||||
If txtKundenNrvon.Text <> "" AndAlso txtKundenNrvon.Text.Length = 6 AndAlso IsNumeric(txtKundenNrvon.Text) AndAlso txtKundenNrbis.Text <> "" AndAlso txtKundenNrbis.Text.Length = 6 AndAlso IsNumeric(txtKundenNrbis.Text) Then
|
||||
SET_SDL("MW", txtKundenNrvon.Text, txtKundenNrbis.Text)
|
||||
|
||||
ElseIf txtKundenNrvon.Text = "" AndAlso txtKundenNrbis.Text = "" Then
|
||||
|
||||
SET_SDL("MW")
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub btnSDL_FREJUS_Click(sender As Object, e As EventArgs) Handles btnSDL_FREJUS.Click
|
||||
SET_SDL("FREJUS")
|
||||
'SET_SDL("FREJUS")
|
||||
|
||||
|
||||
If txtKundenNrvon.Text <> "" AndAlso txtKundenNrvon.Text.Length = 6 AndAlso IsNumeric(txtKundenNrvon.Text) AndAlso txtKundenNrbis.Text <> "" AndAlso txtKundenNrbis.Text.Length = 6 AndAlso IsNumeric(txtKundenNrbis.Text) Then
|
||||
SET_SDL("FREJUS", txtKundenNrvon.Text, txtKundenNrbis.Text)
|
||||
|
||||
ElseIf txtKundenNrvon.Text = "" AndAlso txtKundenNrbis.Text = "" Then
|
||||
|
||||
SET_SDL("FREJUS")
|
||||
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub btnVERAGCardNew_Click(sender As Object, e As EventArgs) Handles btnVERAGCardNew.Click
|
||||
SET_SDL("VERAG")
|
||||
'SET_SDL("VERAG")
|
||||
|
||||
If txtKundenNrvon.Text <> "" AndAlso txtKundenNrvon.Text.Length = 6 AndAlso IsNumeric(txtKundenNrvon.Text) AndAlso txtKundenNrbis.Text <> "" AndAlso txtKundenNrbis.Text.Length = 6 AndAlso IsNumeric(txtKundenNrbis.Text) Then
|
||||
SET_SDL("VERAG", txtKundenNrvon.Text, txtKundenNrbis.Text)
|
||||
|
||||
ElseIf txtKundenNrvon.Text = "" AndAlso txtKundenNrbis.Text = "" Then
|
||||
|
||||
SET_SDL("VERAG")
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub btnSDL_RMC_Click(sender As Object, e As EventArgs) Handles btnSDL_RMC.Click
|
||||
SET_SDL("RMC")
|
||||
|
||||
If txtKundenNrvon.Text <> "" AndAlso txtKundenNrvon.Text.Length = 6 AndAlso IsNumeric(txtKundenNrvon.Text) AndAlso txtKundenNrbis.Text <> "" AndAlso txtKundenNrbis.Text.Length = 6 AndAlso IsNumeric(txtKundenNrbis.Text) Then
|
||||
SET_SDL("RMC", txtKundenNrvon.Text, txtKundenNrbis.Text)
|
||||
|
||||
ElseIf txtKundenNrvon.Text = "" AndAlso txtKundenNrbis.Text = "" Then
|
||||
|
||||
SET_SDL("RMC")
|
||||
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -666,7 +781,7 @@ Public Class usrcntlFremdrechnungen
|
||||
Next
|
||||
|
||||
If aktLieferant = "ALLE" And cbxMax1000Eintrage.Checked Then
|
||||
MsgBox("Entferne die MAX 1000 Einträge Beschänkung, da ansonsten können nicht alle Daten ermittelt werden!")
|
||||
MsgBox("Entferne die MAX 1000 Einträge Beschänkung, da ansonsten nicht alle Daten ermittelt werden können!")
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
@@ -680,87 +795,87 @@ Public Class usrcntlFremdrechnungen
|
||||
|
||||
For Each kvp In groups
|
||||
|
||||
Dim TextHTMLtable = ""
|
||||
Dim TextHTMLtable = ""
|
||||
|
||||
TextHTMLtable &= "<table border=1>"
|
||||
TextHTMLtable &= "<tr><td>Supplier</td><td>Country</td><td>Date</td></tr>"
|
||||
TextHTMLtable &= "<table border=1>"
|
||||
TextHTMLtable &= "<tr><td>Supplier</td><td>Country</td><td>Date</td></tr>"
|
||||
|
||||
Dim pdflist As New List(Of String)
|
||||
Dim pdflist As New List(Of String)
|
||||
|
||||
For Each row In kvp.Value
|
||||
For Each row In kvp.Value
|
||||
|
||||
|
||||
Dim Lieferant = ""
|
||||
Dim Lieferant = ""
|
||||
|
||||
If dgvLFRechnung.Columns.Contains("Lieferant") Then
|
||||
Lieferant = row.Cells("Lieferant").Value
|
||||
Else
|
||||
Lieferant = aktLieferant
|
||||
End If
|
||||
If dgvLFRechnung.Columns.Contains("Lieferant") Then
|
||||
Lieferant = row.Cells("Lieferant").Value
|
||||
Else
|
||||
Lieferant = aktLieferant
|
||||
End If
|
||||
|
||||
If Lieferant = "VERAG" Then
|
||||
'VERAG IGNORIEREN
|
||||
'Dim ReDat = row.Cells("Rechnungsdatum").Value
|
||||
'Dim ReNr = row.Cells("Rechnungsnummer").Value
|
||||
If Lieferant = "VERAG" Then
|
||||
'VERAG IGNORIEREN
|
||||
'Dim ReDat = row.Cells("Rechnungsdatum").Value
|
||||
'Dim ReNr = row.Cells("Rechnungsnummer").Value
|
||||
|
||||
'If ReDat IsNot Nothing AndAlso ReNr > 0 Then
|
||||
' Me.Cursor = Cursors.WaitCursor
|
||||
' Dim da_id = SQL.getValueTxtBySql("SELECT TOP(1) RK_ID FROM Rechnungsausgang where cast(Rechnungsausgang.RechnungsDatum as Date) ='" & ReDat & "' and Rechnungsausgang.RechnungsNr='" & ReNr & "' AND FilialenNr = 4814 AND RK_ID is not null", "FMZOLL")
|
||||
' cFakturierung.doRechnungsDruck_SRorER(da_id,, False, 3)
|
||||
'End If
|
||||
'If ReDat IsNot Nothing AndAlso ReNr > 0 Then
|
||||
' Me.Cursor = Cursors.WaitCursor
|
||||
' Dim da_id = SQL.getValueTxtBySql("SELECT TOP(1) RK_ID FROM Rechnungsausgang where cast(Rechnungsausgang.RechnungsDatum as Date) ='" & ReDat & "' and Rechnungsausgang.RechnungsNr='" & ReNr & "' AND FilialenNr = 4814 AND RK_ID is not null", "FMZOLL")
|
||||
' cFakturierung.doRechnungsDruck_SRorER(da_id,, False, 3)
|
||||
'End If
|
||||
|
||||
Else
|
||||
Else
|
||||
|
||||
If Lieferant = "IDS" Then
|
||||
If Lieferant = "IDS" Then
|
||||
|
||||
Dim dt As New DataTable
|
||||
dt = initDGVRechnungsdetails(row.Cells("invoice_id").Value, True)
|
||||
Dim dt As New DataTable
|
||||
dt = initDGVRechnungsdetails(row.Cells("invoice_id").Value, True)
|
||||
|
||||
For Each r As DataRow In dt.Rows
|
||||
For Each r As DataRow In dt.Rows
|
||||
|
||||
TextHTMLtable &= "<tr>"
|
||||
TextHTMLtable &= "<td><b>" & Lieferant & "</b></td>"
|
||||
TextHTMLtable &= "<td><b>" & r.Item("Land") & "</b></td>"
|
||||
TextHTMLtable &= "<td><b>" & r.Item("Rechnungsdatum") & "</b></td>"
|
||||
TextHTMLtable &= "</tr>"
|
||||
|
||||
Dim daId As Integer = IIf(IsDBNull(r.Item("daId")), -1, r.Item("daId"))
|
||||
If daId > 0 Then
|
||||
Dim DS As New VERAG_PROG_ALLGEMEIN.cDATENSERVER(daId)
|
||||
pdflist.Add(DS.GET_TOP1_PATH())
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
|
||||
|
||||
Else
|
||||
TextHTMLtable &= "<tr>"
|
||||
TextHTMLtable &= "<td><b>" & Lieferant & "</b></td>"
|
||||
TextHTMLtable &= "<td><b>" & row.Cells("Land").Value & "</b></td>"
|
||||
TextHTMLtable &= "<td><b>" & row.Cells("Rechnungsdatum").Value & "</b></td>"
|
||||
TextHTMLtable &= "<td><b>" & r.Item("Land") & "</b></td>"
|
||||
TextHTMLtable &= "<td><b>" & r.Item("Rechnungsdatum") & "</b></td>"
|
||||
TextHTMLtable &= "</tr>"
|
||||
|
||||
Dim daId As Integer = IIf(IsDBNull(row.Cells("daId").Value), -1, row.Cells("daId").Value)
|
||||
Dim daId As Integer = IIf(IsDBNull(r.Item("daId")), -1, r.Item("daId"))
|
||||
If daId > 0 Then
|
||||
Dim DS As New VERAG_PROG_ALLGEMEIN.cDATENSERVER(daId)
|
||||
pdflist.Add(DS.GET_TOP1_PATH())
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
|
||||
|
||||
Else
|
||||
TextHTMLtable &= "<tr>"
|
||||
TextHTMLtable &= "<td><b>" & Lieferant & "</b></td>"
|
||||
TextHTMLtable &= "<td><b>" & row.Cells("Land").Value & "</b></td>"
|
||||
TextHTMLtable &= "<td><b>" & row.Cells("Rechnungsdatum").Value & "</b></td>"
|
||||
TextHTMLtable &= "</tr>"
|
||||
|
||||
Dim daId As Integer = IIf(IsDBNull(row.Cells("daId").Value), -1, row.Cells("daId").Value)
|
||||
If daId > 0 Then
|
||||
Dim DS As New VERAG_PROG_ALLGEMEIN.cDATENSERVER(daId)
|
||||
pdflist.Add(DS.GET_TOP1_PATH())
|
||||
End If
|
||||
|
||||
|
||||
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
|
||||
TextHTMLtable &= "</table>"
|
||||
End If
|
||||
|
||||
Dim outl As New Outlook.Application
|
||||
Dim Mail As Microsoft.Office.Interop.Outlook.MailItem
|
||||
Mail = outl.CreateItem(0)
|
||||
Next
|
||||
|
||||
|
||||
TextHTMLtable &= "</table>"
|
||||
|
||||
Dim outl As New Outlook.Application
|
||||
Dim Mail As Microsoft.Office.Interop.Outlook.MailItem
|
||||
Mail = outl.CreateItem(0)
|
||||
|
||||
Dim kundeMail As New cKunden()
|
||||
kundeMail = kundenSQL.getKundeByKdNr(kvp.Key)
|
||||
@@ -818,53 +933,68 @@ Public Class usrcntlFremdrechnungen
|
||||
|
||||
|
||||
End Select
|
||||
|
||||
Mail.HTMLBody &= VERAG_PROG_ALLGEMEIN.cAllgemein.USRNAME & "<br>"
|
||||
Mail.HTMLBody &= "<br>"
|
||||
Mail.HTMLBody &= cFakturierung.getSignature("DE", 19, True, True)
|
||||
|
||||
If pdflist.Count > 0 Then
|
||||
For Each pdf In pdflist
|
||||
Mail.Attachments.Add(pdf, Microsoft.Office.Interop.Outlook.OlAttachmentType.olByValue, , )
|
||||
Next
|
||||
End If
|
||||
For Each pdf In pdflist
|
||||
Mail.Attachments.Add(pdf, Microsoft.Office.Interop.Outlook.OlAttachmentType.olByValue, , )
|
||||
Next
|
||||
End If
|
||||
|
||||
Mail.To &= kundeMail.EMail
|
||||
Mail.CC &= kundeMail.EMail2
|
||||
|
||||
If cbxMailoeffnen.Checked Then
|
||||
Try
|
||||
Mail.Display()
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message)
|
||||
End Try
|
||||
|
||||
Mail.Display()
|
||||
|
||||
Else
|
||||
|
||||
If Mail IsNot Nothing Then
|
||||
|
||||
|
||||
Dim API = VERAG_PROG_ALLGEMEIN.cAPI.INSERT_API(VERAG_PROG_ALLGEMEIN.cAPI_INOUT.OUT, VERAG_PROG_ALLGEMEIN.cAPI_Type.MAIL, VERAG_PROG_ALLGEMEIN.cAPI_ART.SDL_OUT_SAMMELRECHNUNG, "MAIL-ORIG-RG",,, kvp.Key)
|
||||
|
||||
API.api_EMail = Mail.To
|
||||
API.api_EMailCC = Mail.CC
|
||||
API.api_EMailBCC = Mail.BCC
|
||||
API.api_EMailSubject = Mail.Subject
|
||||
API.api_EMailText = Mail.HTMLBody
|
||||
API.api_EMailAttCnt = Mail.Attachments.Count
|
||||
Try
|
||||
|
||||
If Mail IsNot Nothing Then
|
||||
|
||||
If VERAG_PROG_ALLGEMEIN.cProgramFunctions.sendMail(API.api_EMail, API.api_EMailSubject, API.api_EMailText, "mmdabrechnung@verag.ag", False, False, API.api_EMailCC, API.api_EMailBCC, pdflist,, "mmdabrechnung@verag.ag") Then
|
||||
API.UPDTAE_OK()
|
||||
|
||||
Else
|
||||
API.UPDTAE_ERR()
|
||||
Dim API = VERAG_PROG_ALLGEMEIN.cAPI.INSERT_API(VERAG_PROG_ALLGEMEIN.cAPI_INOUT.OUT, VERAG_PROG_ALLGEMEIN.cAPI_Type.MAIL, VERAG_PROG_ALLGEMEIN.cAPI_ART.SDL_OUT_SAMMELRECHNUNG, "MAIL-ORIG-RG",,, kvp.Key)
|
||||
|
||||
API.api_EMail = Mail.To
|
||||
API.api_EMailCC = Mail.CC
|
||||
API.api_EMailBCC = IIf(Mail.BCC <> "", Mail.BCC & ";mmdabrechnung@verag.ag", "mmdabrechnung@verag.ag")
|
||||
API.api_EMailSubject = Mail.Subject
|
||||
API.api_EMailText = Mail.HTMLBody
|
||||
API.api_EMailAttCnt = Mail.Attachments.Count
|
||||
|
||||
If Mail IsNot Nothing Then
|
||||
|
||||
If VERAG_PROG_ALLGEMEIN.cProgramFunctions.sendMail(API.api_EMail, API.api_EMailSubject, API.api_EMailText, "mmdabrechnung@verag.ag", False, False, API.api_EMailCC, API.api_EMailBCC, pdflist,, "mmdabrechnung@verag.ag") Then
|
||||
API.UPDTAE_OK()
|
||||
|
||||
Else
|
||||
API.UPDTAE_ERR()
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
Catch ex As Exception
|
||||
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
|
||||
Me.Cursor = Cursors.Default
|
||||
End Try
|
||||
|
||||
End If
|
||||
|
||||
|
||||
Next
|
||||
Next
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
@@ -1000,11 +1130,25 @@ Public Class usrcntlFremdrechnungen
|
||||
End Sub
|
||||
|
||||
Private Sub dat_Sum_Von_Leave(sender As Object, e As EventArgs) Handles dat_Sum_Von.Leave, dat_Sum_Bis.Leave
|
||||
SET_SDL(aktLieferant)
|
||||
If txtKundenNrvon.Text <> "" AndAlso txtKundenNrvon.Text.Length = 6 AndAlso IsNumeric(txtKundenNrvon.Text) AndAlso txtKundenNrbis.Text <> "" AndAlso txtKundenNrbis.Text.Length = 6 AndAlso IsNumeric(txtKundenNrbis.Text) Then
|
||||
SET_SDL(aktLieferant, txtKundenNrvon.Text, txtKundenNrbis.Text)
|
||||
|
||||
ElseIf txtKundenNrvon.Text = "" AndAlso txtKundenNrbis.Text = "" Then
|
||||
|
||||
SET_SDL(aktLieferant)
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub cbx_CheckedChanged(sender As Object, e As EventArgs) Handles cbx.CheckedChanged
|
||||
SET_SDL(aktLieferant)
|
||||
If txtKundenNrvon.Text <> "" AndAlso txtKundenNrvon.Text.Length = 6 AndAlso IsNumeric(txtKundenNrvon.Text) AndAlso txtKundenNrbis.Text <> "" AndAlso txtKundenNrbis.Text.Length = 6 AndAlso IsNumeric(txtKundenNrbis.Text) Then
|
||||
SET_SDL(aktLieferant, txtKundenNrvon.Text, txtKundenNrbis.Text)
|
||||
|
||||
ElseIf txtKundenNrvon.Text = "" AndAlso txtKundenNrbis.Text = "" Then
|
||||
|
||||
SET_SDL(aktLieferant)
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub Button2_Click(sender As Object, e As EventArgs)
|
||||
@@ -1210,11 +1354,37 @@ Public Class usrcntlFremdrechnungen
|
||||
End Sub
|
||||
|
||||
Private Sub cbxMax1000Eintrage_CheckedChanged(sender As Object, e As EventArgs) Handles cbxMax1000Eintrage.CheckedChanged
|
||||
SET_SDL(aktLieferant)
|
||||
If txtKundenNrvon.Text <> "" AndAlso txtKundenNrvon.Text.Length = 6 AndAlso IsNumeric(txtKundenNrvon.Text) AndAlso txtKundenNrbis.Text <> "" AndAlso txtKundenNrbis.Text.Length = 6 AndAlso IsNumeric(txtKundenNrbis.Text) Then
|
||||
SET_SDL(aktLieferant, txtKundenNrvon.Text, txtKundenNrbis.Text)
|
||||
|
||||
ElseIf txtKundenNrvon.Text = "" AndAlso txtKundenNrbis.Text = "" Then
|
||||
|
||||
SET_SDL(aktLieferant)
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub chxfehlendePDFs_CheckedChanged(sender As Object, e As EventArgs) Handles cbxPDFhinterlegt.CheckStateChanged
|
||||
|
||||
SET_SDL(aktLieferant)
|
||||
If txtKundenNrvon.Text <> "" AndAlso txtKundenNrvon.Text.Length = 6 AndAlso IsNumeric(txtKundenNrvon.Text) AndAlso txtKundenNrbis.Text <> "" AndAlso txtKundenNrbis.Text.Length = 6 AndAlso IsNumeric(txtKundenNrbis.Text) Then
|
||||
SET_SDL(aktLieferant, txtKundenNrvon.Text, txtKundenNrbis.Text)
|
||||
|
||||
ElseIf txtKundenNrvon.Text = "" AndAlso txtKundenNrbis.Text = "" Then
|
||||
|
||||
SET_SDL(aktLieferant)
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub txtKundenNrvon_TextChanged(sender As Object, e As EventArgs) Handles txtKundenNrvon.TextChanged, txtKundenNrbis.TextChanged
|
||||
If txtKundenNrvon.Text <> "" AndAlso txtKundenNrvon.Text.Length = 6 AndAlso IsNumeric(txtKundenNrvon.Text) AndAlso txtKundenNrbis.Text <> "" AndAlso txtKundenNrbis.Text.Length = 6 AndAlso IsNumeric(txtKundenNrbis.Text) Then
|
||||
SET_SDL(aktLieferant, txtKundenNrvon.Text, txtKundenNrbis.Text)
|
||||
|
||||
ElseIf txtKundenNrvon.Text = "" AndAlso txtKundenNrbis.Text = "" Then
|
||||
|
||||
SET_SDL(aktLieferant)
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user