fremdrechnungen, mdmUstvAntrag
This commit is contained in:
@@ -245,7 +245,7 @@ Public Class frmMDM_USTVAntrag
|
||||
|
||||
If KUNDE_ERW IsNot Nothing Then
|
||||
|
||||
If KUNDE_ERW.kde_MWStAbrechnung IsNot Nothing Then
|
||||
If KUNDE_ERW.kde_MWStAbrechnung <> "" Then
|
||||
lblMWSTAntrag.Text = KUNDE_ERW.kde_MWStAbrechnung
|
||||
Else
|
||||
lblMWSTAntrag.Text = ""
|
||||
|
||||
51
SDL/mdm/usrcntlFremdrechnungen.Designer.vb
generated
51
SDL/mdm/usrcntlFremdrechnungen.Designer.vb
generated
@@ -38,6 +38,7 @@ 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.Button2 = New System.Windows.Forms.Button()
|
||||
Me.cbx = New System.Windows.Forms.CheckBox()
|
||||
Me.Label4 = New System.Windows.Forms.Label()
|
||||
Me.Label2 = New System.Windows.Forms.Label()
|
||||
@@ -53,7 +54,7 @@ Partial Class usrcntlFremdrechnungen
|
||||
Me.Button8 = New System.Windows.Forms.Button()
|
||||
Me.Panel3 = New System.Windows.Forms.Panel()
|
||||
Me.SplitContainer1 = New System.Windows.Forms.SplitContainer()
|
||||
Me.dgvSDL = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components)
|
||||
Me.dgvLFRechnung = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components)
|
||||
Me.Panel4 = New System.Windows.Forms.Panel()
|
||||
Me.cntxtExcel = New System.Windows.Forms.ContextMenuStrip(Me.components)
|
||||
Me.ToolStripMenuItem3 = New System.Windows.Forms.ToolStripMenuItem()
|
||||
@@ -65,7 +66,7 @@ Partial Class usrcntlFremdrechnungen
|
||||
CType(Me.SplitContainer1, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.SplitContainer1.Panel1.SuspendLayout()
|
||||
Me.SplitContainer1.SuspendLayout()
|
||||
CType(Me.dgvSDL, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
CType(Me.dgvLFRechnung, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.Panel4.SuspendLayout()
|
||||
Me.cntxtExcel.SuspendLayout()
|
||||
Me.SuspendLayout()
|
||||
@@ -269,6 +270,7 @@ 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.Button2)
|
||||
Me.Panel1.Controls.Add(Me.cbx)
|
||||
Me.Panel1.Controls.Add(Me.Label4)
|
||||
Me.Panel1.Controls.Add(Me.Label2)
|
||||
@@ -288,6 +290,18 @@ Partial Class usrcntlFremdrechnungen
|
||||
Me.Panel1.Size = New System.Drawing.Size(260, 907)
|
||||
Me.Panel1.TabIndex = 23
|
||||
'
|
||||
'Button2
|
||||
'
|
||||
Me.Button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat
|
||||
Me.Button2.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
|
||||
Me.Button2.Location = New System.Drawing.Point(132, 203)
|
||||
Me.Button2.Name = "Button2"
|
||||
Me.Button2.Size = New System.Drawing.Size(47, 44)
|
||||
Me.Button2.TabIndex = 53
|
||||
Me.Button2.Text = "Test"
|
||||
Me.Button2.TextAlign = System.Drawing.ContentAlignment.MiddleRight
|
||||
Me.Button2.UseVisualStyleBackColor = True
|
||||
'
|
||||
'cbx
|
||||
'
|
||||
Me.cbx.AutoSize = True
|
||||
@@ -448,26 +462,28 @@ Partial Class usrcntlFremdrechnungen
|
||||
'SplitContainer1.Panel1
|
||||
'
|
||||
Me.SplitContainer1.Panel1.AutoScroll = True
|
||||
Me.SplitContainer1.Panel1.Controls.Add(Me.dgvSDL)
|
||||
Me.SplitContainer1.Panel1.Controls.Add(Me.dgvLFRechnung)
|
||||
Me.SplitContainer1.Panel2MinSize = 0
|
||||
Me.SplitContainer1.Size = New System.Drawing.Size(1356, 799)
|
||||
Me.SplitContainer1.SplitterDistance = 559
|
||||
Me.SplitContainer1.TabIndex = 13
|
||||
'
|
||||
'dgvSDL
|
||||
'dgvLFRechnung
|
||||
'
|
||||
Me.dgvSDL.AKTUALISIERUNGS_INTERVALL = 1000
|
||||
Me.dgvSDL.AllowUserToAddRows = False
|
||||
Me.dgvSDL.AllowUserToDeleteRows = False
|
||||
Me.dgvLFRechnung.AKTUALISIERUNGS_INTERVALL = 1000
|
||||
Me.dgvLFRechnung.AllowUserToAddRows = False
|
||||
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.dgvSDL.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle1
|
||||
Me.dgvSDL.BackgroundColor = System.Drawing.Color.White
|
||||
Me.dgvSDL.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
|
||||
Me.dgvSDL.Location = New System.Drawing.Point(4, 3)
|
||||
Me.dgvSDL.Name = "dgvSDL"
|
||||
Me.dgvSDL.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect
|
||||
Me.dgvSDL.Size = New System.Drawing.Size(1354, 770)
|
||||
Me.dgvSDL.TabIndex = 29
|
||||
Me.dgvLFRechnung.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle1
|
||||
Me.dgvLFRechnung.BackgroundColor = System.Drawing.Color.White
|
||||
Me.dgvLFRechnung.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
|
||||
Me.dgvLFRechnung.Location = New System.Drawing.Point(4, 3)
|
||||
Me.dgvLFRechnung.Name = "dgvLFRechnung"
|
||||
Me.dgvLFRechnung.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect
|
||||
Me.dgvLFRechnung.Size = New System.Drawing.Size(1354, 770)
|
||||
Me.dgvLFRechnung.TabIndex = 29
|
||||
'
|
||||
'Panel4
|
||||
'
|
||||
@@ -515,7 +531,7 @@ Partial Class usrcntlFremdrechnungen
|
||||
Me.SplitContainer1.Panel1.ResumeLayout(False)
|
||||
CType(Me.SplitContainer1, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.SplitContainer1.ResumeLayout(False)
|
||||
CType(Me.dgvSDL, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
CType(Me.dgvLFRechnung, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.Panel4.ResumeLayout(False)
|
||||
Me.cntxtExcel.ResumeLayout(False)
|
||||
Me.ResumeLayout(False)
|
||||
@@ -548,11 +564,12 @@ Partial Class usrcntlFremdrechnungen
|
||||
Friend WithEvents btnSDL_PLOSE As Button
|
||||
Friend WithEvents btnVERAGCardNew As Button
|
||||
Friend WithEvents btnSDL_RMC As Button
|
||||
Friend WithEvents dgvSDL As VERAG_PROG_ALLGEMEIN.MyDatagridview
|
||||
Friend WithEvents dgvLFRechnung As VERAG_PROG_ALLGEMEIN.MyDatagridview
|
||||
Friend WithEvents Label4 As Label
|
||||
Friend WithEvents Label2 As Label
|
||||
Friend WithEvents Label1 As Label
|
||||
Friend WithEvents cbx As CheckBox
|
||||
Friend WithEvents dat_Sum_Bis As DateTimePicker
|
||||
Friend WithEvents dat_Sum_Von As DateTimePicker
|
||||
Friend WithEvents Button2 As Button
|
||||
End Class
|
||||
|
||||
@@ -14,14 +14,13 @@ Public Class usrcntlFremdrechnungen
|
||||
Dim fullyPainted = False
|
||||
|
||||
|
||||
' Dim show200 = True
|
||||
Private Sub usrCntlDaten_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
|
||||
dat_Sum_Von.Value = New Date(Today.Year, 1, 1)
|
||||
dat_Sum_Bis.Value = New Date(Today.Year, 12, 31)
|
||||
|
||||
|
||||
EnableDoubleBuffered(dgvSDL)
|
||||
EnableDoubleBuffered(dgvLFRechnung)
|
||||
|
||||
init()
|
||||
|
||||
@@ -32,6 +31,8 @@ Public Class usrcntlFremdrechnungen
|
||||
|
||||
SplitContainer1.Panel2Collapsed = True
|
||||
|
||||
'setPDFImages()
|
||||
|
||||
End Sub
|
||||
|
||||
Public Shared Sub EnableDoubleBuffered(ByRef dgv As DataGridView)
|
||||
@@ -66,7 +67,7 @@ Public Class usrcntlFremdrechnungen
|
||||
'End If
|
||||
|
||||
SplitContainer1.Panel2Collapsed = False
|
||||
dgvSDL_SelectionChanged(dgvSDL, New System.EventArgs)
|
||||
dgvSDL_SelectionChanged(dgvLFRechnung, New System.EventArgs)
|
||||
|
||||
End If
|
||||
|
||||
@@ -92,10 +93,10 @@ Public Class usrcntlFremdrechnungen
|
||||
initAllg()
|
||||
|
||||
|
||||
dgvSDL.RELOAD()
|
||||
dgvLFRechnung.RELOAD()
|
||||
txtchanged = False
|
||||
dgvSDL.ClearSelection()
|
||||
If dgvSDL.RowCount > 0 Then dgvSDL.Rows(0).Cells(0).Selected = True
|
||||
dgvLFRechnung.ClearSelection()
|
||||
If dgvLFRechnung.RowCount > 0 Then dgvLFRechnung.Rows(0).Cells(0).Selected = True
|
||||
'dgvSDL_SelectionChanged(dgvSDL, New EventArgs)
|
||||
End Sub
|
||||
|
||||
@@ -114,7 +115,7 @@ Public Class usrcntlFremdrechnungen
|
||||
If Not fullyPainted Then Exit Sub ' nur wenn die usrcntl komplett gelden wurde...
|
||||
Try
|
||||
|
||||
With dgvSDL
|
||||
With dgvLFRechnung
|
||||
.RowTemplate.Height = 20
|
||||
.AllowUserToOrderColumns = False
|
||||
.AllowUserToResizeRows = False
|
||||
@@ -123,10 +124,9 @@ Public Class usrcntlFremdrechnungen
|
||||
|
||||
.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells
|
||||
|
||||
'redRows()
|
||||
|
||||
End With
|
||||
|
||||
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message)
|
||||
End Try
|
||||
@@ -136,28 +136,30 @@ Public Class usrcntlFremdrechnungen
|
||||
Sub initDGVWidth()
|
||||
Dim DGVwidth = 0
|
||||
Dim reduceWidth = 0
|
||||
For Each c As DataGridViewColumn In dgvSDL.Columns
|
||||
For Each c As DataGridViewColumn In dgvLFRechnung.Columns
|
||||
DGVwidth += c.Width
|
||||
Next
|
||||
Dim DGVheight = 0
|
||||
For Each r As DataGridViewRow In dgvSDL.Rows
|
||||
For Each r As DataGridViewRow In dgvLFRechnung.Rows
|
||||
DGVheight += r.Height
|
||||
Next
|
||||
DGVheight += 50
|
||||
'
|
||||
|
||||
If DGVheight > (SplitContainer1.Panel1.Height) Then
|
||||
dgvSDL.Height = DGVheight
|
||||
dgvLFRechnung.Height = DGVheight
|
||||
reduceWidth = 25 ' Scrollbar
|
||||
Else
|
||||
dgvSDL.Height = SplitContainer1.Panel1.Height - 25
|
||||
dgvLFRechnung.Height = SplitContainer1.Panel1.Height - 25
|
||||
End If
|
||||
If DGVwidth > SplitContainer1.Panel1.Width Then
|
||||
dgvSDL.Width = DGVwidth - reduceWidth
|
||||
dgvLFRechnung.Width = DGVwidth - reduceWidth
|
||||
Else
|
||||
dgvSDL.Width = SplitContainer1.Panel1.Width - reduceWidth
|
||||
dgvLFRechnung.Width = SplitContainer1.Panel1.Width - reduceWidth
|
||||
End If
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Sub ifContainsAndTrueRed(r As DataGridViewRow, t As String)
|
||||
@@ -183,12 +185,12 @@ Public Class usrcntlFremdrechnungen
|
||||
b.ForeColor = Color.Black
|
||||
aktbtn = b.Name
|
||||
|
||||
If dgvSDL.Columns("SDLNr") IsNot Nothing Then
|
||||
If dgvLFRechnung.Columns("SDLNr") IsNot Nothing Then
|
||||
|
||||
If aktbtn = "btnSDL_Alle" Then
|
||||
dgvSDL.Columns("SDLNr").Visible = True
|
||||
dgvLFRechnung.Columns("SDLNr").Visible = True
|
||||
Else
|
||||
dgvSDL.Columns("SDLNr").Visible = False
|
||||
dgvLFRechnung.Columns("SDLNr").Visible = False
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -206,60 +208,60 @@ Public Class usrcntlFremdrechnungen
|
||||
|
||||
'IDS
|
||||
Case 100 : SQL_STR = "SELECT " & IIf(cbxMax1000Eintrage.Checked, " top " & anzahlTop, "") &
|
||||
" [YearMonthDay] as Rechnungsdatum,[Invoicenumber] as Rechnungsnummer, CustomerCode as Kundennummer,[daId],[TransactionVolume] as Transaktionsmenge,[AmminclVAT] as Bruttobetrag,[TotalNetAmount] as Nettobetrag,[VATAmount] as MWSt FROM tblIDSInvoicesNew WHERE [CustomerCode] in (SELECT distinct([CustomerCode]) FROM [VERAG].[dbo].[tbl_IDS_Kunden] WHERE 1 = 1 " & IIf(kdNr > 0, " AND [KdNrVERAG]=" & kdNr, "") & ") and [YearMonthDay] " & setSQLWhere(SDLNrTmp, "") & " order by [YearMonthDay] desc, [Invoicenumber]"
|
||||
" [YearMonthDay] as Rechnungsdatum,[Invoicenumber] as Rechnungsnummer, 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 WHERE [CustomerCode] in (SELECT distinct([CustomerCode]) FROM [VERAG].[dbo].[tbl_IDS_Kunden] WHERE 1 = 1 " & IIf(kdNr > 0, " AND [KdNrVERAG]=" & kdNr, "") & ") and [YearMonthDay] " & setSQLWhere(SDLNrTmp, "") & " order by [YearMonthDay] desc, [Invoicenumber]"
|
||||
|
||||
'UTA
|
||||
Case 212 : SQL_STR = "SELECT " & IIf(cbxMax1000Eintrage.Checked, " top " & anzahlTop, "") &
|
||||
" [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 FROM [VERAG].[dbo].[tblUTAImportNew] inner join adressen on Kundennummer = UTAKundenNr where 1 = 1 " & IIf(kdNr > 0, " AND [AdressenNr]=" & kdNr, "") & " AND [Rechnungsdatum] " & setSQLWhere(SDLNrTmp, "Land") & " group by [Rechnungsnummer_pro_Lieferland],[Rechnungsdatum],Kundennummer,[daId],[Lieferland_ISO2]"
|
||||
" [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 FROM [VERAG].[dbo].[tblUTAImportNew] inner join adressen on Kundennummer = UTAKundenNr where 1 = 1 " & IIf(kdNr > 0, " AND [AdressenNr]=" & kdNr, "") & " AND [Rechnungsdatum] " & setSQLWhere(SDLNrTmp, "Land") & " group by [Rechnungsnummer_pro_Lieferland],[Rechnungsdatum],Kundennummer,[daId],[Lieferland_ISO2]"
|
||||
|
||||
SQL_STR &= " UNION ALL SELECT " & IIf(cbxMax1000Eintrage.Checked, " top " & anzahlTop, "") & " [Datum], [RechnungsNr],[KundenNr],0,0,0,[daId],'',[DocumentTyp] FROM [VERAG].[dbo].[tblUTADocuments]inner join adressen on KundenNr = UTAKundenNr where 1 = 1 " & IIf(kdNr > 0, " AND [AdressenNr]=" & kdNr, "") & " and [Datum] " & setSQLWhere(SDLNrTmp, "") & " order by Rechnungsdatum desc"
|
||||
SQL_STR &= " UNION ALL SELECT " & IIf(cbxMax1000Eintrage.Checked, " top " & anzahlTop, "") & " [Datum], [RechnungsNr],[KundenNr],0,0,0,[daId],'',[DocumentTyp], 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 1 = 1 " & IIf(kdNr > 0, " AND [AdressenNr]=" & kdNr, "") & " and [Datum] " & setSQLWhere(SDLNrTmp, "") & " order by Rechnungsdatum desc"
|
||||
|
||||
'PLOSE
|
||||
Case 214 : SQL_STR = "SELECT " & IIf(cbxMax1000Eintrage.Checked, " top " & anzahlTop, "") &
|
||||
" [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 FROM tblPLOSE_Inv_Data inner join Adressen on Adressen.PLOSEKundenNr = plInv_PLOSEKundennummer where 1 = 1 " & IIf(kdNr > 0, " AND Adressen.AdressenNr=" & kdNr, "") & " and [plInv_SupplierRechnungsDatum] " & setSQLWhere(SDLNrTmp, "plInv_SupplierCountry") & " Order by plInv_SupplierRechnungsDatum desc, [plInv_SupplierRechnungsNr]"
|
||||
" [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 FROM tblPLOSE_Inv_Data inner join Adressen on Adressen.PLOSEKundenNr = plInv_PLOSEKundennummer where 1 = 1 " & IIf(kdNr > 0, " AND Adressen.AdressenNr=" & kdNr, "") & " and [plInv_SupplierRechnungsDatum] " & setSQLWhere(SDLNrTmp, "plInv_SupplierCountry") & " Order by plInv_SupplierRechnungsDatum desc, [plInv_SupplierRechnungsNr]"
|
||||
|
||||
'MSE
|
||||
Case 208 : SQL_STR = "SELECT " & IIf(cbxMax1000Eintrage.Checked, " top " & anzahlTop, "") &
|
||||
" [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 FROM tblMSEInvoices where customer_number in (select customer_id from tblMSECustomers where 1 = 1 " & IIf(kdNr > 0, " AND [partner_customer_number]=" & kdNr, "") & " and [invoice_date] " & setSQLWhere(SDLNrTmp, "country") & " ) order by invoice_date desc, invoice_id"
|
||||
" [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 FROM tblMSEInvoices where customer_number in (select customer_id from tblMSECustomers where 1 = 1 " & IIf(kdNr > 0, " AND [partner_customer_number]=" & kdNr, "") & " and [invoice_date] " & setSQLWhere(SDLNrTmp, "country") & " ) order by invoice_date desc, invoice_id"
|
||||
|
||||
'VERAG
|
||||
Case 502 : SQL_STR = "SELECT " & IIf(cbxMax1000Eintrage.Checked, " top " & anzahlTop, "") &
|
||||
" tblTrdinInvoice.Rechnungsdatum, tblTrdinInvoice.Rechnungsnummer , tblTrdinInvoice.SteuerbetragLokal, 1 as daId FROM tblTrdinInvoice 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"
|
||||
" tblTrdinInvoice.Rechnungsdatum, tblTrdinInvoice.Rechnungsnummer , tblTrdinInvoice.SteuerbetragLokal, 1 as daId, cast(1 as bit) as PDFvorhanden FROM tblTrdinInvoice 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"
|
||||
'RMC
|
||||
Case 999 : SQL_STR = "SELECT " & IIf(cbxMax1000Eintrage.Checked, " top " & anzahlTop, "") &
|
||||
"[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 FROM [VERAG].[dbo].[tblRMCImport] inner join Adressen on Adressen.WölflKundenNr = rmc_kdNr where 1 = 1 " & IIf(kdNr > 0, " AND AdressenNr=" & kdNr, "") & " and [rmc_reDatum] " & setSQLWhere(SDLNrTmp, "rmc_landKZ") & " order by rmc_reDatum desc, rmc_reNr"
|
||||
"[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 FROM [VERAG].[dbo].[tblRMCImport] inner join Adressen on Adressen.WölflKundenNr = rmc_kdNr where 1 = 1 " & IIf(kdNr > 0, " AND AdressenNr=" & kdNr, "") & " and [rmc_reDatum] " & setSQLWhere(SDLNrTmp, "rmc_landKZ") & " order by rmc_reDatum desc, rmc_reNr"
|
||||
|
||||
Case -1 : Dim anzahl As Integer = anzahlTop / 6 : SQL_STR = "SELECT " & IIf(cbxMax1000Eintrage.Checked, " top " & anzahl, "") &
|
||||
"
|
||||
--IDS
|
||||
'IDS' as Lieferant, [YearMonthDay] as Rechnungsdatum,[Invoicenumber] as Rechnungsnummer,CustomerCode as Kundennummer,[AmminclVAT] as Bruttobetrag,[TotalNetAmount] as Nettobetrag,[VATAmount] as MWSt,'' as Land, 'RE' as Art,[daId] FROM tblIDSInvoicesNew WHERE [CustomerCode] = (SELECT TOP 1 [CustomerCode] FROM [VERAG].[dbo].[tbl_IDS_Kunden] WHERE 1 = 1 " & IIf(kdNr > 0, " AND [KdNrVERAG]=" & kdNr, "") & " ORDER BY Zeitstempel DESC) and [YearMonthDay] " & setSQLWhere(SDLNrTmp, "") & " --order by [YearMonthDay], [Invoicenumber]
|
||||
'IDS' as Lieferant, [YearMonthDay] as Rechnungsdatum,[Invoicenumber] as Rechnungsnummer,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 WHERE [CustomerCode] = (SELECT TOP 1 [CustomerCode] FROM [VERAG].[dbo].[tbl_IDS_Kunden] WHERE 1 = 1 " & IIf(kdNr > 0, " AND [KdNrVERAG]=" & kdNr, "") & " ORDER BY Zeitstempel DESC) and [YearMonthDay] " & setSQLWhere(SDLNrTmp, "") & " --order by [YearMonthDay], [Invoicenumber]
|
||||
|
||||
UNION ALL
|
||||
|
||||
|
||||
--MSE
|
||||
SELECT " & IIf(cbxMax1000Eintrage.Checked, " top " & anzahl, "") & " 'MSE' as Lieferant, [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 FROM tblMSEInvoices where customer_number = (select top 1 customer_id from tblMSECustomers where 1 = 1 " & IIf(kdNr > 0, " AND [partner_customer_number]=" & kdNr, "") & " and [invoice_date] " & setSQLWhere(SDLNrTmp, "country") & " ) --order by invoice_date, invoice_id
|
||||
SELECT " & IIf(cbxMax1000Eintrage.Checked, " top " & anzahl, "") & " 'MSE' as Lieferant, [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 where customer_number = (select top 1 customer_id from tblMSECustomers where 1 = 1 " & IIf(kdNr > 0, " AND [partner_customer_number]=" & kdNr, "") & " and [invoice_date] " & setSQLWhere(SDLNrTmp, "country") & " ) --order by invoice_date, invoice_id
|
||||
|
||||
UNION ALL
|
||||
|
||||
--UTA
|
||||
SELECT " & IIf(cbxMax1000Eintrage.Checked, " top " & anzahl, "") & " 'UTA' as Lieferant, [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] FROM [VERAG].[dbo].[tblUTAImportNew] inner join adressen on Kundennummer = UTAKundenNr where 1 = 1 " & IIf(kdNr > 0, " AND [AdressenNr]=" & kdNr, "") & " and [Rechnungsdatum] " & setSQLWhere(SDLNrTmp, "Lieferland_ISO2") & " group by [Rechnungsnummer_pro_Lieferland],[Rechnungsdatum],Kundennummer,[daId],[Lieferland_ISO2] UNION ALL SELECT 'UTA', [Datum], cast([RechnungsNr] as nvarchar) ,[KundenNr],0,0,0,'',[DocumentTyp],[daId] FROM [VERAG].[dbo].[tblUTADocuments] inner join adressen on KundenNr = UTAKundenNr where AdressenNr = " & kdNr & " AND Datum " & setSQLWhere(SDLNrTmp, "") & "
|
||||
SELECT " & IIf(cbxMax1000Eintrage.Checked, " top " & anzahl, "") & " 'UTA' as Lieferant, [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 " & IIf(kdNr > 0, " AND [AdressenNr]=" & kdNr, "") & " and [Rechnungsdatum] " & setSQLWhere(SDLNrTmp, "Lieferland_ISO2") & " group by [Rechnungsnummer_pro_Lieferland],[Rechnungsdatum],Kundennummer,[daId],[Lieferland_ISO2] UNION ALL SELECT 'UTA', [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(SDLNrTmp, "") & "
|
||||
|
||||
UNION ALL
|
||||
--VERAG
|
||||
|
||||
SELECT " & IIf(cbxMax1000Eintrage.Checked, " top " & anzahl, "") & " 'VERAG' as Lieferant, 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 FROM tblTrdinInvoice WHERE 1 = 1 " & IIf(kdNr > 0, " AND tblTrdinInvoice.RechnungsKundenNr=" & kdNr, "") & " and tblTrdinInvoice.Rechnungsdatum " & setSQLWhere(SDLNrTmp, "'AT'") & " AND tblTrdinInvoice.FilialenNr = 4814 -- ORDER BY tblTrdinInvoice.Rechnungsdatum, tblTrdinInvoice.Rechnungsnummer
|
||||
SELECT " & IIf(cbxMax1000Eintrage.Checked, " top " & anzahl, "") & " 'VERAG' as Lieferant, 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 WHERE 1 = 1 " & IIf(kdNr > 0, " AND tblTrdinInvoice.RechnungsKundenNr=" & kdNr, "") & " and tblTrdinInvoice.Rechnungsdatum " & setSQLWhere(SDLNrTmp, "'AT'") & " AND tblTrdinInvoice.FilialenNr = 4814 -- ORDER BY tblTrdinInvoice.Rechnungsdatum, tblTrdinInvoice.Rechnungsnummer
|
||||
|
||||
|
||||
UNION ALL
|
||||
--PLOSE
|
||||
|
||||
SELECT " & IIf(cbxMax1000Eintrage.Checked, " top " & anzahl, "") & " 'PLOSE' as Lieferant, [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 FROM tblPLOSE_Inv_Data inner join Adressen on Adressen.PLOSEKundenNr = plInv_PLOSEKundennummer where 1 = 1 " & IIf(kdNr > 0, " AND Adressen.AdressenNr=" & kdNr, "") & " and [plInv_SupplierRechnungsDatum] " & setSQLWhere(SDLNrTmp, "plInv_SupplierCountry") & "
|
||||
SELECT " & IIf(cbxMax1000Eintrage.Checked, " top " & anzahl, "") & " 'PLOSE' as Lieferant, [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 " & IIf(kdNr > 0, " AND Adressen.AdressenNr=" & kdNr, "") & " and [plInv_SupplierRechnungsDatum] " & setSQLWhere(SDLNrTmp, "plInv_SupplierCountry") & "
|
||||
|
||||
UNION ALL
|
||||
|
||||
--RMC
|
||||
SELECT " & IIf(cbxMax1000Eintrage.Checked, " top " & anzahl, "") & " 'RMC' as Lieferant, [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 FROM [VERAG].[dbo].[tblRMCImport] inner join Adressen on Adressen.WölflKundenNr = rmc_kdNr where 1 = 1 " & IIf(kdNr > 0, " AND AdressenNr=" & kdNr, "") & " and [rmc_reDatum] " & setSQLWhere(SDLNrTmp, "rmc_landKZ") & " --order by rmc_reDatum, rmc_reNr
|
||||
SELECT " & IIf(cbxMax1000Eintrage.Checked, " top " & anzahl, "") & " 'RMC' as Lieferant, [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 " & IIf(kdNr > 0, " AND AdressenNr=" & kdNr, "") & " and [rmc_reDatum] " & setSQLWhere(SDLNrTmp, "rmc_landKZ") & " --order by rmc_reDatum, rmc_reNr
|
||||
|
||||
order by Rechnungsdatum desc"
|
||||
|
||||
@@ -273,27 +275,22 @@ Public Class usrcntlFremdrechnungen
|
||||
newBinding(SDLNrTmp, SQL_STR)
|
||||
initBtnClick(getSDLNrButton(SDLNrTmp))
|
||||
|
||||
With dgvSDL
|
||||
|
||||
With dgvLFRechnung
|
||||
|
||||
|
||||
Dim c As New DataGridViewImageColumn
|
||||
c.Name = "PDF" : c.HeaderText = "PDF"
|
||||
c.DefaultCellStyle.NullValue = Nothing
|
||||
c.ImageLayout = DataGridViewImageCellLayout.Zoom
|
||||
c.Width = 40 : c.DefaultCellStyle.Padding = New Padding(2) : c.DefaultCellStyle.BackColor = Color.White
|
||||
c.Width = 40
|
||||
c.DefaultCellStyle.Padding = New Padding(2)
|
||||
c.DefaultCellStyle.BackColor = Color.White
|
||||
c.Image = My.Resources.pdf_gray
|
||||
|
||||
|
||||
If Not .Columns.Contains("PDF") Then .Columns.Add(c)
|
||||
|
||||
For Each r As DataGridViewRow In .Rows
|
||||
|
||||
If Not IsDBNull(r.Cells("daId").Value) AndAlso r.Cells("daId").Value <> 0 Then
|
||||
DirectCast(r.Cells("PDF"), DataGridViewImageCell).Value = My.Resources.pdf
|
||||
End If
|
||||
|
||||
|
||||
Next
|
||||
|
||||
|
||||
If .Columns.Count > 0 Then
|
||||
|
||||
@@ -306,13 +303,15 @@ Public Class usrcntlFremdrechnungen
|
||||
|
||||
End With
|
||||
|
||||
|
||||
initAllg()
|
||||
dgvSDL.Width = 100
|
||||
dgvSDL.Height = 100
|
||||
dgvSDL.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells
|
||||
dgvLFRechnung.Width = 100
|
||||
dgvLFRechnung.Height = 100
|
||||
dgvLFRechnung.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells
|
||||
|
||||
initDGVWidth() 'vor Filter, damit richtige Größe
|
||||
|
||||
setPDFImages()
|
||||
End Sub
|
||||
|
||||
Private Function setSQLWhere(SDLNrTmp As Integer, land As String) As String
|
||||
@@ -395,28 +394,28 @@ Public Class usrcntlFremdrechnungen
|
||||
Sub newBinding(sdlNr As Integer, ByVal sql As String)
|
||||
dgvInitWait = True
|
||||
' bindingSDL = Nothing
|
||||
dgvSDL.Columns.Clear()
|
||||
dgvSDL.VirtualMode = True
|
||||
dgvLFRechnung.Columns.Clear()
|
||||
dgvLFRechnung.VirtualMode = True
|
||||
txtchanged = True
|
||||
dgvInitWait = True
|
||||
|
||||
|
||||
dgvSDL.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells
|
||||
dgvLFRechnung.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells
|
||||
|
||||
dgvSDL.SET_SQL(sql, "FMZOLL")
|
||||
dgvSDL.LOAD()
|
||||
dgvLFRechnung.SET_SQL(sql, "FMZOLL")
|
||||
dgvLFRechnung.LOAD()
|
||||
|
||||
lblEinträge.Text = dgvSDL.RowCount & " Einträge"
|
||||
If dgvSDL.RowCount >= 200 Then lblEinträge.Text = dgvSDL.RowCount & " Einträge " & IIf(cbxMax1000Eintrage.Checked, "(Anzeige auf 200 beschränkt)", "")
|
||||
lblEinträge.Text = dgvLFRechnung.RowCount & " Einträge"
|
||||
If dgvLFRechnung.RowCount >= 200 Then lblEinträge.Text = dgvLFRechnung.RowCount & " Einträge " & IIf(cbxMax1000Eintrage.Checked, "(Anzeige auf 200 beschränkt)", "")
|
||||
|
||||
dgvInitWait = False
|
||||
|
||||
txtchanged = False
|
||||
dgvInitWait = False
|
||||
dgvSDL.ClearSelection()
|
||||
dgvLFRechnung.ClearSelection()
|
||||
|
||||
If dgvSDL.RowCount > 0 Then
|
||||
dgvSDL.Rows(0).Cells(0).Selected = True
|
||||
If dgvLFRechnung.RowCount > 0 Then
|
||||
dgvLFRechnung.Rows(0).Cells(0).Selected = True
|
||||
Else
|
||||
End If
|
||||
|
||||
@@ -430,7 +429,7 @@ Public Class usrcntlFremdrechnungen
|
||||
Private Sub Button4_Click_1(sender As Object, e As EventArgs) Handles Button4.Click
|
||||
If SplitContainer1.Panel2Collapsed Then
|
||||
SplitContainer1.Panel2Collapsed = False
|
||||
dgvSDL_SelectionChanged(dgvSDL, New System.EventArgs)
|
||||
dgvSDL_SelectionChanged(dgvLFRechnung, New System.EventArgs)
|
||||
Else
|
||||
SplitContainer1.Panel2Collapsed = True
|
||||
End If
|
||||
@@ -444,9 +443,9 @@ Public Class usrcntlFremdrechnungen
|
||||
Sub refreshDgv(kdNr, SDLNr, Optional Kfz = "", Optional History = "")
|
||||
SET_SDL(aktSDLNr)
|
||||
|
||||
dgvSDL.ClearSelection()
|
||||
dgvLFRechnung.ClearSelection()
|
||||
If Kfz <> "" And History <> "" Then
|
||||
For Each r As DataGridViewRow In dgvSDL.Rows
|
||||
For Each r As DataGridViewRow In dgvLFRechnung.Rows
|
||||
If r.Cells("KundenNr").Value = kdNr And
|
||||
r.Cells("SDLNr").Value = SDLNr And
|
||||
r.Cells("KfzKennzeichen").Value = Kfz And
|
||||
@@ -463,26 +462,26 @@ Public Class usrcntlFremdrechnungen
|
||||
|
||||
Private Sub UsrCntlDatenDetails1_Changed(kdNr, Kfz, SDLNr, History)
|
||||
'refreshDgv(kdNr, SDLNr, Kfz, History)'?????????????? ausgebelndet,was das ein VErsuch? 31.07.2017
|
||||
dgvSDL.VALUE_CHANGED = True
|
||||
dgvLFRechnung.VALUE_CHANGED = True
|
||||
End Sub
|
||||
|
||||
Private Sub datadgvSDL_SelectionChanged(kdNr, Kfz, SDLNr, History)
|
||||
' refreshDgv(kdNr, SDLNr, Kfz, History)
|
||||
dgvSDL.VALUE_CHANGED = True
|
||||
dgvLFRechnung.VALUE_CHANGED = True
|
||||
Exit Sub
|
||||
|
||||
dgvInitWait = True
|
||||
dgvSDL.RELOAD()
|
||||
dgvLFRechnung.RELOAD()
|
||||
dgvInitWait = False
|
||||
End Sub
|
||||
' Private Sub dgvSDL_SelectionChanged(sender As Object, e As EventArgs) Handles dgvSDL.SelectionChanged
|
||||
|
||||
Private Sub dgvSDL_KeyDown(sender As Object, e As KeyEventArgs) Handles dgvSDL.KeyUp
|
||||
Private Sub dgvSDL_KeyDown(sender As Object, e As KeyEventArgs) Handles dgvLFRechnung.KeyUp
|
||||
If e.KeyCode = Keys.Up Or e.KeyCode = Keys.Down Or e.KeyCode = Keys.End Or e.KeyCode = Keys.Home Then '?POS1
|
||||
' ReloadLeistung()
|
||||
End If
|
||||
End Sub
|
||||
Private Sub dgvSDL_SelectionChanged(sender As Object, e As EventArgs) Handles dgvSDL.Click
|
||||
Private Sub dgvSDL_SelectionChanged(sender As Object, e As EventArgs) Handles dgvLFRechnung.Click
|
||||
'ReloadLeistung()
|
||||
End Sub
|
||||
|
||||
@@ -490,7 +489,7 @@ Public Class usrcntlFremdrechnungen
|
||||
Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
|
||||
|
||||
|
||||
If dgvSDL.SelectedRows.Count > 0 Then
|
||||
If dgvLFRechnung.SelectedRows.Count > 0 Then
|
||||
|
||||
Dim TextHTMLtable = ""
|
||||
|
||||
@@ -498,12 +497,12 @@ Public Class usrcntlFremdrechnungen
|
||||
TextHTMLtable &= "<tr><td>Lieferant</td><td>Land</td><td>Datum</td></tr>"
|
||||
|
||||
Dim pdflist As New List(Of String)
|
||||
For Each row In dgvSDL.SelectedRows
|
||||
For Each row In dgvLFRechnung.SelectedRows
|
||||
|
||||
|
||||
Dim Lieferant = ""
|
||||
|
||||
If dgvSDL.Columns.Contains("Lieferant") Then
|
||||
If dgvLFRechnung.Columns.Contains("Lieferant") Then
|
||||
Lieferant = row.Cells("Lieferant").Value
|
||||
Else
|
||||
Select Case aktSDLNr
|
||||
@@ -531,7 +530,7 @@ Public Class usrcntlFremdrechnungen
|
||||
Else
|
||||
|
||||
TextHTMLtable &= "<tr>"
|
||||
TextHTMLtable &= "<td><b>" & IIf(dgvSDL.Columns.Contains("Lieferant"), row.Cells("Lieferant").Value, Lieferant) & "</b></td>"
|
||||
TextHTMLtable &= "<td><b>" & IIf(dgvLFRechnung.Columns.Contains("Lieferant"), row.Cells("Lieferant").Value, Lieferant) & "</b></td>"
|
||||
TextHTMLtable &= "<td><b>" & row.Cells("Land").Value & "</b></td>"
|
||||
TextHTMLtable &= "<td><b>" & row.Cells("Rechnungsdatum").Value & "</b></td>"
|
||||
TextHTMLtable &= "</tr>"
|
||||
@@ -648,20 +647,20 @@ Public Class usrcntlFremdrechnungen
|
||||
|
||||
Private Sub ToolStripMenuItem3_Click(sender As Object, e As EventArgs) Handles ToolStripMenuItem3.Click
|
||||
Me.Cursor = Cursors.WaitCursor
|
||||
cProgramFunctions.genExcelFromDGV(dgvSDL, True)
|
||||
cProgramFunctions.genExcelFromDGV(dgvLFRechnung, True)
|
||||
Me.Cursor = Cursors.Default
|
||||
End Sub
|
||||
|
||||
Private Sub ToolStripMenuItem6_Click(sender As Object, e As EventArgs) Handles ToolStripMenuItem6.Click
|
||||
Me.Cursor = Cursors.WaitCursor
|
||||
cProgramFunctions.genExcelFromDGV_NEW(dgvSDL, True)
|
||||
cProgramFunctions.genExcelFromDGV_NEW(dgvLFRechnung, True)
|
||||
Me.Cursor = Cursors.Default
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub Button8_Click_1(sender As Object, e As EventArgs) Handles Button8.Click
|
||||
Me.Cursor = Cursors.WaitCursor
|
||||
cProgramFunctions.genExcelFromDGV_NEW(dgvSDL, True, True)
|
||||
cProgramFunctions.genExcelFromDGV_NEW(dgvLFRechnung, True, True)
|
||||
Me.Cursor = Cursors.Default
|
||||
End Sub
|
||||
|
||||
@@ -671,7 +670,7 @@ Public Class usrcntlFremdrechnungen
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub dgvSDL_RELOADED() Handles dgvSDL.RELOADED
|
||||
Private Sub dgvSDL_RELOADED() Handles dgvLFRechnung.RELOADED
|
||||
' redRows()
|
||||
End Sub
|
||||
|
||||
@@ -681,24 +680,24 @@ Public Class usrcntlFremdrechnungen
|
||||
|
||||
|
||||
Dim vval As Integer
|
||||
Private Sub dgvSDL_GotFocus(sender As Object, e As EventArgs) Handles dgvSDL.GotFocus
|
||||
Private Sub dgvSDL_GotFocus(sender As Object, e As EventArgs) Handles dgvLFRechnung.GotFocus
|
||||
'dgvSDL.VerticalScrollingOffset = vval
|
||||
SplitContainer1.Panel1.VerticalScroll.Value = vval
|
||||
End Sub
|
||||
|
||||
Private Sub dgvSDL_Enter(sender As Object, e As EventArgs) Handles dgvSDL.Enter
|
||||
Private Sub dgvSDL_Enter(sender As Object, e As EventArgs) Handles dgvLFRechnung.Enter
|
||||
vval = SplitContainer1.Panel1.VerticalScroll.Value
|
||||
End Sub
|
||||
|
||||
Private Sub dgvSDL_CellContentDoubleClick(sender As Object, e As DataGridViewCellEventArgs) Handles dgvSDL.CellContentDoubleClick
|
||||
Private Sub dgvSDL_CellContentDoubleClick(sender As Object, e As DataGridViewCellEventArgs) Handles dgvLFRechnung.CellContentDoubleClick
|
||||
|
||||
Try
|
||||
If e.RowIndex >= 0 AndAlso e.ColumnIndex >= 0 Then
|
||||
|
||||
Select Case aktSDLNr
|
||||
Case 502 'VERAG
|
||||
Dim ReDat = dgvSDL.Rows(e.RowIndex).Cells("Rechnungsdatum").Value
|
||||
Dim ReNr = dgvSDL.Rows(e.RowIndex).Cells("Rechnungsnummer").Value
|
||||
Dim ReDat = dgvLFRechnung.Rows(e.RowIndex).Cells("Rechnungsdatum").Value
|
||||
Dim ReNr = dgvLFRechnung.Rows(e.RowIndex).Cells("Rechnungsnummer").Value
|
||||
|
||||
If ReDat IsNot Nothing AndAlso ReNr > 0 Then
|
||||
Me.Cursor = Cursors.WaitCursor
|
||||
@@ -707,11 +706,11 @@ Public Class usrcntlFremdrechnungen
|
||||
End If
|
||||
|
||||
Case -1 'ALLE
|
||||
Dim Lieferant = dgvSDL.Rows(e.RowIndex).Cells("Lieferant").Value
|
||||
Dim Lieferant = dgvLFRechnung.Rows(e.RowIndex).Cells("Lieferant").Value
|
||||
|
||||
If Lieferant = "VERAG" Then
|
||||
Dim ReDat = dgvSDL.Rows(e.RowIndex).Cells("Rechnungsdatum").Value
|
||||
Dim ReNr = dgvSDL.Rows(e.RowIndex).Cells("Rechnungsnummer").Value
|
||||
Dim ReDat = dgvLFRechnung.Rows(e.RowIndex).Cells("Rechnungsdatum").Value
|
||||
Dim ReNr = dgvLFRechnung.Rows(e.RowIndex).Cells("Rechnungsnummer").Value
|
||||
|
||||
If ReDat IsNot Nothing AndAlso ReNr > 0 Then
|
||||
Me.Cursor = Cursors.WaitCursor
|
||||
@@ -722,7 +721,7 @@ Public Class usrcntlFremdrechnungen
|
||||
|
||||
End If
|
||||
|
||||
Dim daId = dgvSDL.Rows(e.RowIndex).Cells("daId").Value
|
||||
Dim daId = dgvLFRechnung.Rows(e.RowIndex).Cells("daId").Value
|
||||
If daId > 0 Then
|
||||
Me.Cursor = Cursors.WaitCursor
|
||||
Dim DS As New VERAG_PROG_ALLGEMEIN.cDATENSERVER(daId)
|
||||
@@ -733,7 +732,7 @@ Public Class usrcntlFremdrechnungen
|
||||
Case Else
|
||||
|
||||
|
||||
Dim daId = dgvSDL.Rows(e.RowIndex).Cells("daId").Value
|
||||
Dim daId = dgvLFRechnung.Rows(e.RowIndex).Cells("daId").Value
|
||||
If daId > 0 Then
|
||||
Me.Cursor = Cursors.WaitCursor
|
||||
Dim DS As New VERAG_PROG_ALLGEMEIN.cDATENSERVER(daId)
|
||||
@@ -764,4 +763,75 @@ Public Class usrcntlFremdrechnungen
|
||||
Private Sub cbx_CheckedChanged(sender As Object, e As EventArgs) Handles cbx.CheckedChanged
|
||||
SET_SDL(aktSDLNr)
|
||||
End Sub
|
||||
|
||||
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
|
||||
|
||||
With dgvLFRechnung
|
||||
|
||||
|
||||
Dim c As New DataGridViewImageColumn
|
||||
c.Name = "PDF" : c.HeaderText = "PDF"
|
||||
c.DefaultCellStyle.NullValue = Nothing
|
||||
c.ImageLayout = DataGridViewImageCellLayout.Zoom
|
||||
c.Width = 40 : c.DefaultCellStyle.Padding = New Padding(2) : c.DefaultCellStyle.BackColor = Color.White
|
||||
|
||||
|
||||
If Not .Columns.Contains("PDF") Then .Columns.Add(c)
|
||||
|
||||
For Each r As DataGridViewRow In .Rows
|
||||
|
||||
If IsDBNull(r.Cells("daId").Value) OrElse r.Cells("daId").Value = 0 Then
|
||||
DirectCast(r.Cells("PDF"), DataGridViewImageCell).Value = My.Resources.pdf_gray
|
||||
|
||||
End If
|
||||
|
||||
|
||||
Next
|
||||
|
||||
|
||||
If .Columns.Count > 0 Then
|
||||
|
||||
If .Columns.Contains("daId") Then
|
||||
If .Columns("daId") IsNot Nothing Then .Columns("daId").Visible = False
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End With
|
||||
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub setPDFImages()
|
||||
|
||||
Exit Sub 'langsam!!!!
|
||||
|
||||
With dgvLFRechnung
|
||||
|
||||
If Not .Columns.Contains("PDF") Then Exit Sub
|
||||
|
||||
For Each r As DataGridViewRow In .Rows
|
||||
|
||||
If r.Cells("pdfVorhanden").Value Then
|
||||
Try
|
||||
'DirectCast(r.Cells("PDF"), DataGridViewImageCell).Value = Nothing
|
||||
DirectCast(r.Cells("PDF"), DataGridViewImageCell).Value = My.Resources.pdf
|
||||
|
||||
Catch ex As Exception
|
||||
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
|
||||
End Try
|
||||
|
||||
|
||||
End If
|
||||
|
||||
|
||||
Next
|
||||
|
||||
|
||||
|
||||
End With
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
@@ -88,7 +88,7 @@ Public Class cKundenErweitert
|
||||
Property kde_WechselBlanko As Boolean = False
|
||||
Property kde_UStV_SummeVorschaubetragEUR_PLOSE As Object = Nothing
|
||||
Property kde_keineMWSt As Boolean = False
|
||||
Property kde_MWStAbrechnung As Object = Nothing
|
||||
Property kde_MWStAbrechnung As String = "Q"
|
||||
Property kde_AnmerkungVZ As Object = Nothing
|
||||
Property kde_VZ As Boolean = False
|
||||
Property kde_AnmerkungAntrag As Object = Nothing
|
||||
|
||||
Reference in New Issue
Block a user