From 3e4167775b3b0a4b42404a5e1cc366310b73192d Mon Sep 17 00:00:00 2001 From: "d.breimaier" Date: Wed, 12 Mar 2025 16:47:15 +0100 Subject: [PATCH] Fremdrechnungen --- SDL/My Project/Resources.Designer.vb | 30 ++++++++++++++++++++++++++++ SDL/My Project/Resources.resx | 9 +++++++++ SDL/mdm/usrcntlFremdrechnungen.vb | 18 +++++++++-------- 3 files changed, 49 insertions(+), 8 deletions(-) diff --git a/SDL/My Project/Resources.Designer.vb b/SDL/My Project/Resources.Designer.vb index ca43f1d1..8b0e1f7f 100644 --- a/SDL/My Project/Resources.Designer.vb +++ b/SDL/My Project/Resources.Designer.vb @@ -1034,6 +1034,36 @@ Namespace My.Resources End Get End Property + ''' + ''' Sucht eine lokalisierte Ressource vom Typ System.Byte[]. + ''' + Friend ReadOnly Property Kostenkalkulation_AG() As Byte() + Get + Dim obj As Object = ResourceManager.GetObject("Kostenkalkulation_AG", resourceCulture) + Return CType(obj,Byte()) + End Get + End Property + + ''' + ''' Sucht eine lokalisierte Ressource vom Typ System.Byte[]. + ''' + Friend ReadOnly Property Kostenkalkulation_CS() As Byte() + Get + Dim obj As Object = ResourceManager.GetObject("Kostenkalkulation_CS", resourceCulture) + Return CType(obj,Byte()) + End Get + End Property + + ''' + ''' Sucht eine lokalisierte Ressource vom Typ System.Byte[]. + ''' + Friend ReadOnly Property Kostenkalkulation_IMEX() As Byte() + Get + Dim obj As Object = ResourceManager.GetObject("Kostenkalkulation_IMEX", resourceCulture) + Return CType(obj,Byte()) + End Get + End Property + ''' ''' Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. ''' diff --git a/SDL/My Project/Resources.resx b/SDL/My Project/Resources.resx index 9fc039a8..c55f43ed 100644 --- a/SDL/My Project/Resources.resx +++ b/SDL/My Project/Resources.resx @@ -934,4 +934,13 @@ ..\Resources\Kostenkalkulation.xlsx;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + ..\Resources\Kostenkalkulation_AG.xlsx;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ..\Resources\Kostenkalkulation_CS.xlsx;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ..\Resources\Kostenkalkulation_IMEX.xlsx;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + \ No newline at end of file diff --git a/SDL/mdm/usrcntlFremdrechnungen.vb b/SDL/mdm/usrcntlFremdrechnungen.vb index 53e17b5b..1bd6516e 100644 --- a/SDL/mdm/usrcntlFremdrechnungen.vb +++ b/SDL/mdm/usrcntlFremdrechnungen.vb @@ -76,7 +76,7 @@ Public Class usrcntlFremdrechnungen KUNDE = kundenSQL.getKundeByKdNr(kdNr) If KUNDE IsNot Nothing Then - dtkeineMWST = (New SQL).loadDgvBySql("select Land, Erstattungsland from tblKeineMWSTErstattung", "FMZOLL") + dtkeineMWST = (New SQL).loadDgvBySql("select Land, Erstattungsland, Lieferant from tblKeineMWSTErstattung", "FMZOLL") dtKundeMWST = (New SQL).loadDgvBySql("select LandKz from tblKundenMWST where KdNr = " & KUNDE.KundenNr, "FMZOLL") End If @@ -355,7 +355,7 @@ Public Class usrcntlFremdrechnungen '2. wenn die Rechnung die Summe NULL aufweist Select Case aktLieferant - Case "UTA" : If Not alle Then SQLWhere &= " AND Gesamtbetrag_Brutto_in_Darstellwährung <> 0" 'UTA + Case "UTA" : If Not alle Then SQLWhere &= " AND Gesamtbetrag_Brutto_in_Darstellwährung <> 0 AND Art = 'RE'" 'UTA bei UTA auch EPN ausblenden! Case "PLOSE" : If Not alle Then SQLWhere &= " AND plInv_Bruttobetrag <> 0" 'PLOSE Case "VERAG" : If Not alle Then SQLWhere &= " AND (tblTrdinInvoice.SteuerpflichtigerBetragLokal + tblTrdinInvoice.SteuerfreierBetragLokal) <> 0" 'VERAG Case "MSE" : If Not alle Then SQLWhere &= " AND total_amount_euro <> 0" 'MSE @@ -376,12 +376,13 @@ Public Class usrcntlFremdrechnungen '3. Rechnungen der Länder in denen der Kunde keine MWST erstattet bekommt If land <> "" AndAlso dtkeineMWST.Rows.Count > 0 Then + Dim dtkeineMWST_ohneContraint As DataTable = dtkeineMWST.Select("Lieferant = ''").CopyToDataTable Dim counter = 0 Dim landBez As String = "" - For Each row As DataRow In dtkeineMWST.Rows + For Each row As DataRow In dtkeineMWST_ohneContraint.Rows landBez = "'" & row.Item("Erstattungsland") & "'" counter = counter + 1 - If (dtkeineMWST.Rows.Count <> 0 And counter <> dtkeineMWST.Rows.Count) Then landBez &= "," + If (dtkeineMWST_ohneContraint.Rows.Count <> 0 And counter <> dtkeineMWST_ohneContraint.Rows.Count) Then landBez &= "," Next SQLWhere &= " AND " & land & " not in (" & landBez & ")" End If @@ -447,12 +448,13 @@ Public Class usrcntlFremdrechnungen '3. Rechnungen der Länder in denen der Kunde keine MWST erstattet bekommt If land <> "" AndAlso dtkeineMWST.Rows.Count > 0 Then + Dim dtkeineMWST_IDS As DataTable = dtkeineMWST.Select("Lieferant = 'IDS'").CopyToDataTable Dim counter = 0 Dim landBez As String = "" - For Each row As DataRow In dtkeineMWST.Rows + For Each row As DataRow In dtkeineMWST_IDS.Rows landBez = "'" & row.Item("Erstattungsland") & "'" counter = counter + 1 - If (dtkeineMWST.Rows.Count <> 0 And counter <> dtkeineMWST.Rows.Count) Then landBez &= "," + If (dtkeineMWST_IDS.Rows.Count <> 0 And counter <> dtkeineMWST_IDS.Rows.Count) Then landBez &= "," Next SQLWhere &= " AND " & land & " not in (" & landBez & ")" End If @@ -687,7 +689,7 @@ Public Class usrcntlFremdrechnungen TextHTMLtable &= "" & r.Item("Rechnungsdatum") & "" TextHTMLtable &= "" - Dim daId = r.Item("daId") + 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()) @@ -704,7 +706,7 @@ Public Class usrcntlFremdrechnungen TextHTMLtable &= "" & row.Cells("Rechnungsdatum").Value & "" TextHTMLtable &= "" - Dim daId = row.Cells("daId").Value + 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())