diff --git a/SDL/Fakturierung/cFakturierung.vb b/SDL/Fakturierung/cFakturierung.vb index 60dc04b9..3a8c7bef 100644 --- a/SDL/Fakturierung/cFakturierung.vb +++ b/SDL/Fakturierung/cFakturierung.vb @@ -2130,17 +2130,17 @@ Public Class cFakturierung Select Case FIRMA.Firma_ID Case 21, 22, 23 '"UNISPED" - desc.AddCreditorFinancialAccount(IIf(FIRMA.Firma_IBAN1 IsNot Nothing, FIRMA.Firma_IBAN1.ToString.Replace("IBAN: ", ""), ""), IIf(FIRMA.Firma_BIC1 IsNot Nothing, FIRMA.Firma_BIC1.ToString.Replace("BIC: ", ""), ""),,, IIf(FIRMA.Firma_Bankverbindung1 IsNot Nothing, FIRMA.Firma_Bankverbindung1, "")) - desc.AddCreditorFinancialAccount(IIf(FIRMA.Firma_IBAN2 IsNot Nothing, FIRMA.Firma_IBAN2.ToString.Replace("IBAN: ", ""), ""), IIf(FIRMA.Firma_BIC2 IsNot Nothing, FIRMA.Firma_BIC2.ToString.Replace("BIC: ", ""), ""),,, IIf(FIRMA.Firma_Bankverbindung2 IsNot Nothing, FIRMA.Firma_Bankverbindung2, "")) + If FIRMA.Firma_IBAN1 IsNot Nothing AndAlso FIRMA.Firma_BIC1 IsNot Nothing AndAlso FIRMA.Firma_Bankverbindung1 IsNot Nothing Then desc.AddCreditorFinancialAccount(IIf(FIRMA.Firma_IBAN1 IsNot Nothing, FIRMA.Firma_IBAN1.ToString.Replace("IBAN: ", ""), ""), IIf(FIRMA.Firma_BIC1 IsNot Nothing, FIRMA.Firma_BIC1.ToString.Replace("BIC: ", ""), ""),,, IIf(FIRMA.Firma_Bankverbindung1 IsNot Nothing, FIRMA.Firma_Bankverbindung1, "")) + If FIRMA.Firma_IBAN2 IsNot Nothing AndAlso FIRMA.Firma_BIC2 IsNot Nothing AndAlso FIRMA.Firma_Bankverbindung2 IsNot Nothing Then desc.AddCreditorFinancialAccount(IIf(FIRMA.Firma_IBAN2 IsNot Nothing, FIRMA.Firma_IBAN2.ToString.Replace("IBAN: ", ""), ""), IIf(FIRMA.Firma_BIC2 IsNot Nothing, FIRMA.Firma_BIC2.ToString.Replace("BIC: ", ""), ""),,, IIf(FIRMA.Firma_Bankverbindung2 IsNot Nothing, FIRMA.Firma_Bankverbindung2, "")) Case 26 'VERAG-UNISPED" - desc.AddCreditorFinancialAccount(IIf(FIRMA.Firma_IBAN1 IsNot Nothing, FIRMA.Firma_IBAN1.ToString.Replace("IBAN: ", ""), ""), IIf(FIRMA.Firma_BIC1 IsNot Nothing, FIRMA.Firma_BIC1.ToString.Replace("BIC: ", ""), ""),,, IIf(FIRMA.Firma_Bankverbindung1 IsNot Nothing, FIRMA.Firma_Bankverbindung1, "")) - desc.AddCreditorFinancialAccount(IIf(FIRMA.Firma_IBAN2 IsNot Nothing, FIRMA.Firma_IBAN2.ToString.Replace("IBAN: ", ""), ""), IIf(FIRMA.Firma_BIC2 IsNot Nothing, FIRMA.Firma_BIC2.ToString.Replace("BIC: ", ""), ""),,, IIf(FIRMA.Firma_Bankverbindung2 IsNot Nothing, FIRMA.Firma_Bankverbindung2, "")) + If FIRMA.Firma_IBAN1 IsNot Nothing AndAlso FIRMA.Firma_BIC1 IsNot Nothing AndAlso FIRMA.Firma_Bankverbindung1 IsNot Nothing Then desc.AddCreditorFinancialAccount(IIf(FIRMA.Firma_IBAN1 IsNot Nothing, FIRMA.Firma_IBAN1.ToString.Replace("IBAN: ", ""), ""), IIf(FIRMA.Firma_BIC1 IsNot Nothing, FIRMA.Firma_BIC1.ToString.Replace("BIC: ", ""), ""),,, IIf(FIRMA.Firma_Bankverbindung1 IsNot Nothing, FIRMA.Firma_Bankverbindung1, "")) + If FIRMA.Firma_IBAN2 IsNot Nothing AndAlso FIRMA.Firma_BIC2 IsNot Nothing AndAlso FIRMA.Firma_Bankverbindung2 IsNot Nothing Then desc.AddCreditorFinancialAccount(IIf(FIRMA.Firma_IBAN2 IsNot Nothing, FIRMA.Firma_IBAN2.ToString.Replace("IBAN: ", ""), ""), IIf(FIRMA.Firma_BIC2 IsNot Nothing, FIRMA.Firma_BIC2.ToString.Replace("BIC: ", ""), ""),,, IIf(FIRMA.Firma_Bankverbindung2 IsNot Nothing, FIRMA.Firma_Bankverbindung2, "")) Case 24 'AMBAR" - desc.AddCreditorFinancialAccount(IIf(FIRMA.Firma_IBAN1 IsNot Nothing, FIRMA.Firma_IBAN1.ToString.Replace("IBAN: ", ""), ""), IIf(FIRMA.Firma_BIC1 IsNot Nothing, FIRMA.Firma_BIC1.ToString.Replace("BIC: ", ""), ""),,, IIf(FIRMA.Firma_Bankverbindung1 IsNot Nothing, FIRMA.Firma_Bankverbindung1, "")) - desc.AddCreditorFinancialAccount(IIf(FIRMA.Firma_IBAN2 IsNot Nothing, FIRMA.Firma_IBAN2.ToString.Replace("IBAN: ", ""), ""), IIf(FIRMA.Firma_BIC2 IsNot Nothing, FIRMA.Firma_BIC2.ToString.Replace("BIC: ", ""), ""),,, IIf(FIRMA.Firma_Bankverbindung2 IsNot Nothing, FIRMA.Firma_Bankverbindung2, "")) + If FIRMA.Firma_IBAN1 IsNot Nothing AndAlso FIRMA.Firma_BIC1 IsNot Nothing AndAlso FIRMA.Firma_Bankverbindung1 IsNot Nothing Then desc.AddCreditorFinancialAccount(IIf(FIRMA.Firma_IBAN1 IsNot Nothing, FIRMA.Firma_IBAN1.ToString.Replace("IBAN: ", ""), ""), IIf(FIRMA.Firma_BIC1 IsNot Nothing, FIRMA.Firma_BIC1.ToString.Replace("BIC: ", ""), ""),,, IIf(FIRMA.Firma_Bankverbindung1 IsNot Nothing, FIRMA.Firma_Bankverbindung1, "")) + If FIRMA.Firma_IBAN2 IsNot Nothing AndAlso FIRMA.Firma_BIC2 IsNot Nothing AndAlso FIRMA.Firma_Bankverbindung2 IsNot Nothing Then desc.AddCreditorFinancialAccount(IIf(FIRMA.Firma_IBAN2 IsNot Nothing, FIRMA.Firma_IBAN2.ToString.Replace("IBAN: ", ""), ""), IIf(FIRMA.Firma_BIC2 IsNot Nothing, FIRMA.Firma_BIC2.ToString.Replace("BIC: ", ""), ""),,, IIf(FIRMA.Firma_Bankverbindung2 IsNot Nothing, FIRMA.Firma_Bankverbindung2, "")) desc.AddCreditorFinancialAccount("TR90 0006 2001 6040 0009 0804 66", "TGBATRISXXX",,, "Garanti Bank Türkei – Euro Konto") @@ -2161,11 +2161,11 @@ Public Class cFakturierung End If Case 19 - desc.AddCreditorFinancialAccount(IIf(FIRMA.Firma_IBAN1 IsNot Nothing, FIRMA.Firma_IBAN1.ToString.Replace("IBAN: ", ""), ""), IIf(FIRMA.Firma_BIC1 IsNot Nothing, FIRMA.Firma_BIC1.ToString.Replace("BIC: ", ""), ""),,, IIf(FIRMA.Firma_Bankverbindung1 IsNot Nothing, FIRMA.Firma_Bankverbindung1, "")) + If FIRMA.Firma_IBAN1 IsNot Nothing AndAlso FIRMA.Firma_BIC1 IsNot Nothing AndAlso FIRMA.Firma_Bankverbindung1 IsNot Nothing Then desc.AddCreditorFinancialAccount(IIf(FIRMA.Firma_IBAN1 IsNot Nothing, FIRMA.Firma_IBAN1.ToString.Replace("IBAN: ", ""), ""), IIf(FIRMA.Firma_BIC1 IsNot Nothing, FIRMA.Firma_BIC1.ToString.Replace("BIC: ", ""), ""),,, IIf(FIRMA.Firma_Bankverbindung1 IsNot Nothing, FIRMA.Firma_Bankverbindung1, "")) Case Else 'VERAG,ATILLA - desc.AddCreditorFinancialAccount(IIf(FIRMA.Firma_IBAN1 IsNot Nothing, FIRMA.Firma_IBAN1.ToString.Replace("IBAN: ", ""), ""), IIf(FIRMA.Firma_BIC1 IsNot Nothing, FIRMA.Firma_BIC1.ToString.Replace("BIC: ", ""), ""),,, IIf(FIRMA.Firma_Bankverbindung1 IsNot Nothing, FIRMA.Firma_Bankverbindung1, "")) - desc.AddCreditorFinancialAccount(IIf(FIRMA.Firma_IBAN2 IsNot Nothing, FIRMA.Firma_IBAN2.ToString.Replace("IBAN: ", ""), ""), IIf(FIRMA.Firma_BIC2 IsNot Nothing, FIRMA.Firma_BIC2.ToString.Replace("BIC: ", ""), ""),,, IIf(FIRMA.Firma_Bankverbindung2 IsNot Nothing, FIRMA.Firma_Bankverbindung2, "")) + If FIRMA.Firma_IBAN1 IsNot Nothing AndAlso FIRMA.Firma_BIC1 IsNot Nothing AndAlso FIRMA.Firma_Bankverbindung1 IsNot Nothing Then desc.AddCreditorFinancialAccount(IIf(FIRMA.Firma_IBAN1 IsNot Nothing, FIRMA.Firma_IBAN1.ToString.Replace("IBAN: ", ""), ""), IIf(FIRMA.Firma_BIC1 IsNot Nothing, FIRMA.Firma_BIC1.ToString.Replace("BIC: ", ""), ""),,, IIf(FIRMA.Firma_Bankverbindung1 IsNot Nothing, FIRMA.Firma_Bankverbindung1, "")) + If FIRMA.Firma_IBAN2 IsNot Nothing AndAlso FIRMA.Firma_BIC2 IsNot Nothing AndAlso FIRMA.Firma_Bankverbindung2 IsNot Nothing Then desc.AddCreditorFinancialAccount(IIf(FIRMA.Firma_IBAN2 IsNot Nothing, FIRMA.Firma_IBAN2.ToString.Replace("IBAN: ", ""), ""), IIf(FIRMA.Firma_BIC2 IsNot Nothing, FIRMA.Firma_BIC2.ToString.Replace("BIC: ", ""), ""),,, IIf(FIRMA.Firma_Bankverbindung2 IsNot Nothing, FIRMA.Firma_Bankverbindung2, "")) End Select @@ -3435,7 +3435,15 @@ Public Class cFakturierung If ROW("RechnungsOrt") IsNot DBNull.Value AndAlso ROW("RechnungsOrt") <> "" Then rpt.lblRechnungAn.Text &= ROW("RechnungsOrt") & vbNewLine If ROW("RechnungsLandKz") IsNot DBNull.Value AndAlso ROW("RechnungsLandKz") <> "" Then rpt.lblRechnungAn.Text &= cProgramFunctions.getLandBez_fromISO1Land(ROW("RechnungsLandKz"), "", ROW("RechnungSprache")).ToString.ToUpper - If Rechnugnsdruck = 7 Then If ROW("Text") IsNot DBNull.Value AndAlso ROW("Text") <> "" Then rpt.txtInfo.Text = vbNewLine & vbNewLine & ROW("Text") + If Rechnugnsdruck = 7 Then + If ROW("Text") IsNot DBNull.Value AndAlso ROW("Text") <> "" Then + rpt.txtInfo.Text = vbNewLine & vbNewLine & ROW("Text") + Else + rpt.txtInfo.Text = "" + End If + Else + rpt.txtInfo.Text = "" + End If 'If If(ROW("RechnungsName 2") IsNot DBNull.Value, ROW("RechnungsName 2"), "") = "" Then ' rpt.lblRechnung_Name1.Text = "" diff --git a/SDL/Formulare/KDFormulare/frmFormulare.vb b/SDL/Formulare/KDFormulare/frmFormulare.vb index 1289b297..96815af3 100644 --- a/SDL/Formulare/KDFormulare/frmFormulare.vb +++ b/SDL/Formulare/KDFormulare/frmFormulare.vb @@ -1869,6 +1869,8 @@ Public Class FormularManagerNEU Case "name4" : odoc.FormFields(fieldName).Range.Text = usrCntl.txtFirma.Text Case "name5" : odoc.FormFields(fieldName).Range.Text = usrCntl.txtFirma.Text + Case "steuernrbez_hr" : odoc.FormFields(fieldName).Range.Text = IIf(usrCntl.cbxLandKz._value = "BIH", "PDV BROJ ", "PIB ") 'nur bei HR-Vollmacht! + Case "address" : odoc.FormFields(fieldName).Range.Text = IIf(usrCntl.txtAdresse1.Text <> "", usrCntl.txtAdresse1.Text & ", ", "") & usrCntl.cbxLandKz._value & "-" & usrCntl.txtAdresse2.Text & " " & usrCntl.txtAdresse3.Text ' Case "address1" : odoc.FormFields(fieldName).Range.Text = IIf(usrCntl.txtAdresse1.Text <> "", usrCntl.txtAdresse1.Text & ", ", "") & usrCntl.cbxLandKz._value & "-" & usrCntl.txtAdresse2.Text & " " & usrCntl.txtAdresse3.Text ' Case "address2" : odoc.FormFields(fieldName).Range.Text = IIf(usrCntl.txtAdresse1.Text <> "", usrCntl.txtAdresse1.Text & ", ", "") & usrCntl.cbxLandKz._value & "-" & usrCntl.txtAdresse2.Text & " " & usrCntl.txtAdresse3.Text ' diff --git a/SDL/My Project/AssemblyInfo.vb b/SDL/My Project/AssemblyInfo.vb index 52c13e7a..121ba28e 100644 --- a/SDL/My Project/AssemblyInfo.vb +++ b/SDL/My Project/AssemblyInfo.vb @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices ' übernehmen, indem Sie "*" eingeben: ' - - + + diff --git a/SDL/mdm/usrcntlFremdrechnungen.Designer.vb b/SDL/mdm/usrcntlFremdrechnungen.Designer.vb index 71a6888a..b2b439c6 100644 --- a/SDL/mdm/usrcntlFremdrechnungen.Designer.vb +++ b/SDL/mdm/usrcntlFremdrechnungen.Designer.vb @@ -23,7 +23,7 @@ Partial Class usrcntlFremdrechnungen 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() Me.DetailsAnzeigenToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.FlowLayoutPanel = New System.Windows.Forms.FlowLayoutPanel() Me.btnSDL_Alle = New System.Windows.Forms.Button() @@ -34,6 +34,7 @@ Partial Class usrcntlFremdrechnungen Me.btnSDL_UTA = New System.Windows.Forms.Button() Me.btnVERAGCardNew = New System.Windows.Forms.Button() Me.btnSDL_PLOSE = New System.Windows.Forms.Button() + Me.btnSDL_RMC = New System.Windows.Forms.Button() Me.btnFilter = New System.Windows.Forms.Button() Me.ContextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components) Me.KundenblattAnzeigenToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() @@ -48,14 +49,13 @@ Partial Class usrcntlFremdrechnungen Me.Panel3 = New System.Windows.Forms.Panel() Me.SplitContainer1 = New System.Windows.Forms.SplitContainer() Me.dgvSDL = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components) - Me.UsrCntlDatenDetails1 = New SDL.usrCntlDatenDetails() Me.Panel4 = New System.Windows.Forms.Panel() Me.pnlTest = New System.Windows.Forms.Panel() Me.dgvFILTER = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components) Me.cntxtExcel = New System.Windows.Forms.ContextMenuStrip(Me.components) Me.ToolStripMenuItem3 = New System.Windows.Forms.ToolStripMenuItem() Me.ToolStripMenuItem6 = New System.Windows.Forms.ToolStripMenuItem() - Me.btnSDL_RMC = New System.Windows.Forms.Button() + Me.UsrCntlDatenDetails1 = New SDL.usrCntlDatenDetails() Me.FlowLayoutPanel.SuspendLayout() Me.ContextMenuStrip1.SuspendLayout() Me.Panel1.SuspendLayout() @@ -236,6 +236,23 @@ Partial Class usrcntlFremdrechnungen Me.btnSDL_PLOSE.TextAlign = System.Drawing.ContentAlignment.BottomCenter Me.btnSDL_PLOSE.UseVisualStyleBackColor = True ' + 'btnSDL_RMC + ' + Me.btnSDL_RMC.Cursor = System.Windows.Forms.Cursors.Default + Me.btnSDL_RMC.FlatAppearance.BorderSize = 0 + Me.btnSDL_RMC.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.btnSDL_RMC.ForeColor = System.Drawing.Color.Black + Me.btnSDL_RMC.Image = Global.SDL.My.Resources.Resources.rechnung1 + Me.btnSDL_RMC.ImageAlign = System.Drawing.ContentAlignment.TopCenter + Me.btnSDL_RMC.Location = New System.Drawing.Point(638, 0) + Me.btnSDL_RMC.Margin = New System.Windows.Forms.Padding(0) + Me.btnSDL_RMC.Name = "btnSDL_RMC" + Me.btnSDL_RMC.Size = New System.Drawing.Size(92, 64) + Me.btnSDL_RMC.TabIndex = 46 + Me.btnSDL_RMC.Text = "RMC" + Me.btnSDL_RMC.TextAlign = System.Drawing.ContentAlignment.BottomCenter + Me.btnSDL_RMC.UseVisualStyleBackColor = True + ' 'btnFilter ' Me.btnFilter.FlatStyle = System.Windows.Forms.FlatStyle.Flat @@ -329,13 +346,13 @@ Partial Class usrcntlFremdrechnungen 'Button5 ' Me.Button5.FlatStyle = System.Windows.Forms.FlatStyle.Flat - Me.Button5.Image = Global.SDL.My.Resources.Resources.kunden + Me.Button5.Image = Global.SDL.My.Resources.Resources.email_big1 Me.Button5.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft Me.Button5.Location = New System.Drawing.Point(7, 68) Me.Button5.Name = "Button5" Me.Button5.Size = New System.Drawing.Size(118, 44) Me.Button5.TabIndex = 22 - Me.Button5.Text = "Gehe zum" & Global.Microsoft.VisualBasic.ChrW(10) & "Kundenblatt" + Me.Button5.Text = "Mail" Me.Button5.TextAlign = System.Drawing.ContentAlignment.MiddleRight Me.Button5.UseVisualStyleBackColor = True ' @@ -400,23 +417,14 @@ Partial Class usrcntlFremdrechnungen Me.dgvSDL.AllowUserToAddRows = False Me.dgvSDL.AllowUserToDeleteRows = False Me.dgvSDL.AllowUserToResizeColumns = 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 + DataGridViewCellStyle2.BackColor = System.Drawing.Color.FromArgb(CType(CType(240, Byte), Integer), CType(CType(245, Byte), Integer), CType(CType(255, Byte), Integer)) + Me.dgvSDL.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle2 Me.dgvSDL.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize Me.dgvSDL.Location = New System.Drawing.Point(0, -1) Me.dgvSDL.Name = "dgvSDL" Me.dgvSDL.Size = New System.Drawing.Size(1354, 599) Me.dgvSDL.TabIndex = 29 ' - 'UsrCntlDatenDetails1 - ' - Me.UsrCntlDatenDetails1.Dock = System.Windows.Forms.DockStyle.Fill - Me.UsrCntlDatenDetails1.Location = New System.Drawing.Point(0, 0) - Me.UsrCntlDatenDetails1.Name = "UsrCntlDatenDetails1" - Me.UsrCntlDatenDetails1.Size = New System.Drawing.Size(1354, 234) - Me.UsrCntlDatenDetails1.TabIndex = 0 - Me.UsrCntlDatenDetails1.Visible = False - ' 'Panel4 ' Me.Panel4.BackColor = System.Drawing.Color.White @@ -475,22 +483,14 @@ Partial Class usrcntlFremdrechnungen Me.ToolStripMenuItem6.Size = New System.Drawing.Size(210, 22) Me.ToolStripMenuItem6.Text = "Formatiert (dauert länger)" ' - 'btnSDL_RMC + 'UsrCntlDatenDetails1 ' - Me.btnSDL_RMC.Cursor = System.Windows.Forms.Cursors.Default - Me.btnSDL_RMC.FlatAppearance.BorderSize = 0 - Me.btnSDL_RMC.FlatStyle = System.Windows.Forms.FlatStyle.Flat - Me.btnSDL_RMC.ForeColor = System.Drawing.Color.Black - Me.btnSDL_RMC.Image = Global.SDL.My.Resources.Resources.rechnung1 - Me.btnSDL_RMC.ImageAlign = System.Drawing.ContentAlignment.TopCenter - Me.btnSDL_RMC.Location = New System.Drawing.Point(638, 0) - Me.btnSDL_RMC.Margin = New System.Windows.Forms.Padding(0) - Me.btnSDL_RMC.Name = "btnSDL_RMC" - Me.btnSDL_RMC.Size = New System.Drawing.Size(92, 64) - Me.btnSDL_RMC.TabIndex = 46 - Me.btnSDL_RMC.Text = "RMC" - Me.btnSDL_RMC.TextAlign = System.Drawing.ContentAlignment.BottomCenter - Me.btnSDL_RMC.UseVisualStyleBackColor = True + Me.UsrCntlDatenDetails1.Dock = System.Windows.Forms.DockStyle.Fill + Me.UsrCntlDatenDetails1.Location = New System.Drawing.Point(0, 0) + Me.UsrCntlDatenDetails1.Name = "UsrCntlDatenDetails1" + Me.UsrCntlDatenDetails1.Size = New System.Drawing.Size(1354, 234) + Me.UsrCntlDatenDetails1.TabIndex = 0 + Me.UsrCntlDatenDetails1.Visible = False ' 'usrcntlFremdrechnungen ' diff --git a/SDL/mdm/usrcntlFremdrechnungen.vb b/SDL/mdm/usrcntlFremdrechnungen.vb index 3570460e..bae26c7b 100644 --- a/SDL/mdm/usrcntlFremdrechnungen.vb +++ b/SDL/mdm/usrcntlFremdrechnungen.vb @@ -1,5 +1,5 @@ Imports System.Reflection - +Imports Microsoft.Office.Interop Public Class usrcntlFremdrechnungen Dim KUNDE As New cKunden @@ -68,6 +68,8 @@ Public Class usrcntlFremdrechnungen End If + KUNDE = kundenSQL.getKundeByKdNr(kdNr) + SET_SDL(-1) dgvInitWait = False @@ -310,13 +312,13 @@ Public Class usrcntlFremdrechnungen 'IDS Case 100 : SQL_STR = "SELECT " & IIf(cbxMax200Eintrage.Checked, " top 200 ", "") & - " [YearMonthDay] as Rechnungsdatum,[Invoicenumber] as Rechnungsnummer,[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 PDF FROM tblIDSInvoicesNew WHERE [CustomerCode] = (SELECT TOP 1 [CustomerCode] FROM [VERAG].[dbo].[tbl_IDS_Kunden] WHERE [KdNrVERAG]=" & kdNr & " AND KdNrAlt =0 ORDER BY Zeitstempel DESC) order by [YearMonthDay], [Invoicenumber]" + " [YearMonthDay] as Rechnungsdatum,[Invoicenumber] as Rechnungsnummer,[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 PDF FROM tblIDSInvoicesNew WHERE [CustomerCode] = (SELECT TOP 1 [CustomerCode] FROM [VERAG].[dbo].[tbl_IDS_Kunden] WHERE [KdNrVERAG]=" & kdNr & " AND KdNrAlt =0 ORDER BY Zeitstempel DESC) order by [YearMonthDay] desc, [Invoicenumber]" 'UTA Case 212 : SQL_STR = "SELECT " & IIf(cbxMax200Eintrage.Checked, " top 200 ", "") & - " [Rechnungsdatum],[Abrechnungsnummer] as Rechnungsnummer,Kundennummer,[daId],[Lieferland_ISO2] as Land, 'RE' as Art, cast(case when [daId] is not null then 1 else 0 end as bit) as PDF FROM [VERAG].[dbo].[tblUTAImportNew] inner join adressen on Kundennummer = UTAKundenNr where AdressenNr = " & kdNr & " group by [Abrechnungsnummer],[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 PDF FROM [VERAG].[dbo].[tblUTAImportNew] inner join adressen on Kundennummer = UTAKundenNr where AdressenNr = " & kdNr & " group by [Rechnungsnummer_pro_Lieferland],[Rechnungsdatum],Kundennummer,[daId],[Lieferland_ISO2]" - SQL_STR &= " UNION ALL SELECT " & IIf(cbxMax200Eintrage.Checked, " top 200 ", "") & " [Datum], [RechnungsNr],[KundenNr],[daId],'',[DocumentTyp], cast(case when [daId] is not null then 1 else 0 end as bit) as PDF FROM [VERAG].[dbo].[tblUTADocuments]inner join adressen on KundenNr = UTAKundenNr where AdressenNr = " & kdNr + SQL_STR &= " UNION ALL SELECT " & IIf(cbxMax200Eintrage.Checked, " top 200 ", "") & " [Datum], [RechnungsNr],[KundenNr],0,0,0,[daId],'',[DocumentTyp], cast(case when [daId] is not null then 1 else 0 end as bit) as PDF FROM [VERAG].[dbo].[tblUTADocuments]inner join adressen on KundenNr = UTAKundenNr where AdressenNr = " & kdNr 'PLOSE Case 214 : SQL_STR = "SELECT " & IIf(cbxMax200Eintrage.Checked, " top 200 ", "") & @@ -328,10 +330,47 @@ Public Class usrcntlFremdrechnungen 'VERAG Case 502 : SQL_STR = "SELECT " & IIf(cbxMax200Eintrage.Checked, " top 200 ", "") & - " tblTrdinInvoice.Rechnungsdatum, tblTrdinInvoice.Rechnungsnummer , tblTrdinInvoice.SteuerbetragLokal, cast( 1 as bit) as PDF FROM tblTrdinInvoice WHERE tblTrdinInvoice.RechnungsKundenNr=" & kdNr & " ORDER BY tblTrdinInvoice.Rechnungsdatum, tblTrdinInvoice.Rechnungsnummer" + " tblTrdinInvoice.Rechnungsdatum, tblTrdinInvoice.Rechnungsnummer , tblTrdinInvoice.SteuerbetragLokal, cast( 1 as bit) as PDF FROM tblTrdinInvoice WHERE tblTrdinInvoice.RechnungsKundenNr=" & kdNr & " ORDER BY tblTrdinInvoice.Rechnungsdatum desc, tblTrdinInvoice.Rechnungsnummer" 'RMC Case 999 : SQL_STR = "SELECT " & IIf(cbxMax200Eintrage.Checked, " top 200 ", "") & "[rmc_reDatum] as Rechnungsdatum,[rmc_reNr] as Rechnungsnummer,[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, cast(case when [rmc_daId] is not null then 1 else 0 end as bit) as PDF FROM [VERAG].[dbo].[tblRMCImport] where rmc_kdNr = " & kdNr & " order by rmc_reDatum, rmc_reNr" + + Case -1 : SQL_STR = "SELECT " & IIf(cbxMax200Eintrage.Checked, " top 200 ", "") & + " + --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], cast(case when [daId] is not null then 1 else 0 end as bit) as PDF FROM tblIDSInvoicesNew WHERE [CustomerCode] = (SELECT TOP 1 [CustomerCode] FROM [VERAG].[dbo].[tbl_IDS_Kunden] WHERE [KdNrVERAG]=" & kdNr & " AND KdNrAlt =0 ORDER BY Zeitstempel DESC) --order by [YearMonthDay], [Invoicenumber] + + UNION ALL + + + --MSE + SELECT '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 PDF FROM tblMSEInvoices where customer_number = (select top 1 customer_id from tblMSECustomers where partner_customer_number = " & kdNr & ") --order by invoice_date, invoice_id + + UNION ALL + + --UTA + SELECT '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 PDF FROM [VERAG].[dbo].[tblUTAImportNew] inner join adressen on Kundennummer = UTAKundenNr where AdressenNr = " & kdNr & " 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 PDF FROM [VERAG].[dbo].[tblUTADocuments]inner join adressen on KundenNr = UTAKundenNr where AdressenNr = 401026 + + UNION ALL + --VERA + + SELECT '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) as PDF FROM tblTrdinInvoice WHERE tblTrdinInvoice.RechnungsKundenNr=" & kdNr & " -- ORDER BY tblTrdinInvoice.Rechnungsdatum, tblTrdinInvoice.Rechnungsnummer + + + UNION ALL + --PLOSE + + SELECT '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 PDF FROM tblPLOSE_Inv_Data where plInv_PLOSEKundennummer = " & kdNr & " + + UNION ALL + + --RMC + SELECT '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, 'X' 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 PDF FROM [VERAG].[dbo].[tblRMCImport] where rmc_kdNr = " & kdNr & " --order by rmc_reDatum, rmc_reNr + + order by Rechnungsdatum desc" + + + Case Else Exit Sub @@ -347,6 +386,9 @@ Public Class usrcntlFremdrechnungen If .Columns("daId") IsNot Nothing Then .Columns("daId").Visible = False End If + + + End If End With @@ -545,13 +587,128 @@ Public Class usrcntlFremdrechnungen Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click - If Not kdNr_filter Then - If dgvSDL.SelectedCells.Count > 0 Then - If IsNumeric(dgvSDL.CurrentRow.Cells("KundenNr").Value) Then - cProgramFunctions.openKundenblatt(dgvSDL.CurrentRow.Cells("KundenNr").Value, Me.FindForm, True) + 'TODO CREATE EMAIL + + If dgvSDL.SelectedRows.Count > 0 Then + + Dim TextHTMLtable = "" + + TextHTMLtable &= "" + TextHTMLtable &= "" + + Dim pdflist As New List(Of String) + For Each row In dgvSDL.SelectedRows + + + Dim Lieferant = row.Cells("Lieferant").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 + + Else + + TextHTMLtable &= "" + TextHTMLtable &= "" + TextHTMLtable &= "" + TextHTMLtable &= "" + TextHTMLtable &= "" + + + + Dim daId = 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 &= "
LieferantLandDatum
" & row.Cells("Lieferant").Value & "" & row.Cells("Land").Value & "" & row.Cells("Rechnungsdatum").Value & "
" + + Dim outl As New Outlook.Application + Dim Mail As Microsoft.Office.Interop.Outlook.MailItem + Mail = outl.CreateItem(0) + + + + Select Case KUNDE.LandKz + Case "TR" + Mail.Subject = KUNDE.Kurzname & "ORIJINAL FATURA " + + + Mail.HTMLBody = "Bayanlar ve Baylar!,

Ekte izlere orijinal faturalarinizi gönderiyoruz.

" + + Mail.HTMLBody &= TextHTMLtable + + Mail.HTMLBody &= "


Iyi calismalar dileriz.

" + + Case "A", "AT", "D", "DE", "CH" + + Mail.Subject = KUNDE.Kurzname & "ORIGINAL RECHNUNG " + + Mail.HTMLBody = "Sehr geehrte Damen und Herren,

im Anhang senden wir Ihnen die Originalrechnungen.

" + + Mail.HTMLBody &= TextHTMLtable + + Mail.HTMLBody &= "


Mit freundlichen Grüßen

" + Case "RO" + + Mail.Subject = KUNDE.Kurzname & "FACTURI RETURNATE " + + Mail.HTMLBody = "Stimati domni, stimate doamne,

Va returnam facturile originale care nu au fost utilizate spre recuperare TVA.

Va multumim pentru colaborarea.

" + + Mail.HTMLBody &= TextHTMLtable + + Mail.HTMLBody &= "


Cu stima

" + + Case "HR", "BIH", "SLO", "SRB", "BIH" + Mail.Subject = KUNDE.Kurzname & "ORGINALNI RACUNI " + + + Mail.HTMLBody = "Postovanje,

prilozeno Vam dostavljamo orginalne racune za Vasu daljnu upotrebu.

Za pitanja stojimo na raspolaganju.

" + + Mail.HTMLBody &= TextHTMLtable + + Mail.HTMLBody &= "


Srdacan pozdrav

" + + Case Else + Mail.Subject = KUNDE.Kurzname & "Invoice No." + + Mail.HTMLBody = TextHTMLtable + + Mail.HTMLBody = "Dear Sir or Madam,

attached we send you the original invoice mentioned above.

" + + Mail.HTMLBody &= TextHTMLtable + + Mail.HTMLBody &= "


Best regards

" + + + End Select + If pdflist.Count > 0 Then + For Each pdf In pdflist + Mail.Attachments.Add(pdf, Microsoft.Office.Interop.Outlook.OlAttachmentType.olByValue, , ) + Next End If + + Mail.To &= KUNDE.EMail + Mail.CC &= KUNDE.EMail2 + + + Mail.Display() + End If + End Sub @@ -651,6 +808,21 @@ Public Class usrcntlFremdrechnungen End If Case Else + Dim Lieferant = dgvSDL.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 + + 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 + + + End If + Dim daId = dgvSDL.Rows(e.RowIndex).Cells("daId").Value If daId > 0 Then Me.Cursor = Cursors.WaitCursor