From 1d31298d8d8891ef6a3bccbf8e52cd1f976b08fb Mon Sep 17 00:00:00 2001 From: Developer01 Date: Wed, 28 May 2025 15:40:44 +0200 Subject: [PATCH] MS Sichtbeleg Jobs --- Jobs/My Project/AssemblyInfo.vb | 4 +- Jobs/ZUGFeRD/XRechnungViewDocument.vb | 89 +++++++++------------------ 2 files changed, 32 insertions(+), 61 deletions(-) diff --git a/Jobs/My Project/AssemblyInfo.vb b/Jobs/My Project/AssemblyInfo.vb index db6b730d..09da980a 100644 --- a/Jobs/My Project/AssemblyInfo.vb +++ b/Jobs/My Project/AssemblyInfo.vb @@ -30,5 +30,5 @@ Imports System.Runtime.InteropServices ' Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern ' übernehmen, indem Sie "*" eingeben: - - + + diff --git a/Jobs/ZUGFeRD/XRechnungViewDocument.vb b/Jobs/ZUGFeRD/XRechnungViewDocument.vb index 688ecabd..19b37fbf 100644 --- a/Jobs/ZUGFeRD/XRechnungViewDocument.vb +++ b/Jobs/ZUGFeRD/XRechnungViewDocument.vb @@ -87,6 +87,7 @@ Public Class XRechnungViewDocument Dim oIndex As Integer = 0 Dim oYPlus As Integer = 0 Dim oCreateTextBox As Boolean = False + Dim oPosRowY As Integer = 0 For Each oRow As DataRow In pDTItemValues.Rows Dim Y_eq_lastrow As Boolean = CBool(oRow.Item("Y_eq_lastrow")) Dim oRowCaption As String = oRow.Item("Row_Caption") @@ -150,6 +151,9 @@ Public Class XRechnungViewDocument End If If Not oAREACaption = String.Empty Then + If oArea = "AMOUNT" Then + Dim oY = yPosition + End If 'erste Area-Linie yPosition += 5 MyGDPicturePDF.DrawLine(10, yPosition, oWidthLine, yPosition) @@ -186,20 +190,12 @@ Public Class XRechnungViewDocument oIsPosition = True If oItemSPECNAME = "INVOICE_POSITION_AMOUNT" Then oPosCount += 1 - 'oPosTerm = $"{oPosCount}. {oItemValue} * " - 'oItemValue = oPosTerm - 'Tabellendarstellung oPosTerm = "" + oPosRowY = yPosition MyGDPicturePDF.DrawText(fontResName, 10, yPosition, oPosCount) - ' - 'Dim otextBoxYPos As Integer = yPosition - 3.5 - 'MyGDPicturePDF.DrawTextBox(fontResName, 10, otextBoxYPos, 16, YCoo_TextBoxPlus5(otextBoxYPos), - ' TextAlignment.TextAlignmentFar, TextAlignment.TextAlignmentNear, - ' oPosCount) + MyGDPicturePDF.DrawText(fontResName, 19, yPosition, oItemValue) - 'Tabellendarstellung Ende oDisplay = False - ' yPosition -= 5 End If ElseIf oArea = "TAXPOS" Then oIsPosition = True @@ -219,17 +215,13 @@ Public Class XRechnungViewDocument If oArea = "POSITION" Then If oItemSPECNAME = "INVOICE_POSITION_AMOUNT" Then oPosCount += 1 - oYPlus = 0 - 'Tabellendarstellung yPosition += 5 + oYPlus = 0 + oPosTerm = "" MyGDPicturePDF.DrawText(fontResName, 10, yPosition, oPosCount) - 'otextBoxYPos = yPosition - 3.5 - 'MyGDPicturePDF.DrawTextBox(fontResName, 10, otextBoxYPos, 16, YCoo_TextBoxPlus5(otextBoxYPos), - ' TextAlignment.TextAlignmentFar, TextAlignment.TextAlignmentNear, - ' oPosCount) + oPosRowY = yPosition MyGDPicturePDF.DrawText(fontResName, 19, yPosition, oItemValue) - 'Tabellendarstellung Ende oDisplay = False ElseIf oItemSPECNAME = "INVOICE_POSITION_UNIT_TYPE" Then oYPlus = 0 @@ -237,11 +229,11 @@ Public Class XRechnungViewDocument MyGDPicturePDF.DrawText(fontResName, 35, yPosition, oUnit) oDisplay = False ElseIf oItemSPECNAME = "INVOICE_POSITION_ARTICLE" Then - 'Tabellendarstellung oYPlus = 0 oPosDesc = "" oPosDesc = oItemValue Dim oYDyn As Integer = yPosition - 5 + Dim oPartsNL As List(Of String) = StringFunctions.SplitTextByNewLine(oItemValue) For Each olinepart As String In oPartsNL Dim oParts As List(Of String) = StringFunctions.SplitText_Length(olinepart, 67) @@ -252,33 +244,15 @@ Public Class XRechnungViewDocument MyGDPicturePDF.DrawText(fontResName, 50, oYDyn, part) Next Next - 'Tabellendarstellung Ende - ' oPosTerm += $" {oItemValue}" + yPosition = oYDyn oDisplay = False - ElseIf oItemSPECNAME = "INVOICE_POSITION_NOTE" Then - 'Tabellendarstellung - Dim cleanedText As String = RemoveNewlinesAndTabs(oItemValue) - Dim oParts As List(Of String) = StringFunctions.SplitText_Length(cleanedText, 70) - ' Durchlaufen der einzelnen Teile in einer Schleife - Dim oYDyn As Integer = yPosition - Dim oPartsNL As List(Of String) = StringFunctions.SplitTextByNewLine(oItemValue) - For Each olinepart As String In oPartsNL - Dim oPartsPN As List(Of String) = StringFunctions.SplitText_Length(olinepart, 70) - ' Durchlaufen der einzelnen Teile in einer Schleife - For Each part As String In oPartsPN - oYDyn += 5 - oYPlus += 5 - MyGDPicturePDF.DrawText(fontResName, 50, oYDyn, part) - Next - Next + ElseIf oItemSPECNAME = "INVOICE_POSITION_ARTICLE_DESCRIPTION" Or + oItemSPECNAME = "INVOICE_POSITION_NOTE" Then + _logger.Debug($"oItemSPECNAME: {oItemSPECNAME}") - 'oPosTerm += $" {oItemValue}" - oDisplay = False - ElseIf oItemSPECNAME = "INVOICE_POSITION_ARTICLE_DESCRIPTION" Then - 'Tabellendarstellung - Dim cleanedText As String = RemoveNewlinesAndTabs(oItemValue) - Dim oParts As List(Of String) = StringFunctions.SplitText_Length(cleanedText, 70) - ' Durchlaufen der einzelnen Teile in einer Schleife + 'Dim cleanedText As String = RemoveNewlinesAndTabs(oItemValue) + 'Dim oParts As List(Of String) = StringFunctions.SplitText_Length(cleanedText, 70) + '' Durchlaufen der einzelnen Teile in einer Schleife Dim oYDyn As Integer = yPosition Dim oPartsNL As List(Of String) = StringFunctions.SplitTextByNewLine(oItemValue) For Each olinepart As String In oPartsNL @@ -290,18 +264,17 @@ Public Class XRechnungViewDocument MyGDPicturePDF.DrawText(fontResName, 50, oYDyn, part) Next Next + yPosition = oYDyn - 'oPosTerm += $" {oItemValue}" oDisplay = False + ElseIf oItemSPECNAME = "INVOICE_TAXPOS_TAX_RATE" Or oItemSPECNAME = "INVOICE_TAXPOS_RATE" Then - 'Tabellendarstellung - MyGDPicturePDF.DrawText(fontResName, 164, yPosition, $"{oItemValue} %") - 'Tabellendarstellung ENDE - ' oPosTerm += $" - {oItemValue} %" + + MyGDPicturePDF.DrawText(fontResName, 164, oPosRowY, $"{oItemValue} %") oDisplay = False ElseIf oItemSPECNAME = "INVOICE_POSITION_TAX_AMOUNT" Then - 'Tabellendarstellung - Dim oYPos = yPosition - 3.5 + + Dim oYPos = oPosRowY - 3.5 Dim oBetrag As Decimal = oItemValue Dim oFormatiert As String = oBetrag.ToString("N2", New Globalization.CultureInfo("de-DE")) @@ -309,9 +282,7 @@ Public Class XRechnungViewDocument MyGDPicturePDF.DrawTextBox(fontResName, 177, oYPos, 198, YCoo_TextBoxPlus5(oYPos), TextAlignment.TextAlignmentFar, TextAlignment.TextAlignmentNear, TAXTERM) - ' MyGDPicturePDF.DrawText(fontResName, 180, yPosition, $"{oItemValue} {oCurrencySymbol}") - - 'Tabellendarstellung Ende + oDisplay = False End If oItemValue = oPosTerm ElseIf oArea = "HEAD" Then @@ -391,12 +362,12 @@ Public Class XRechnungViewDocument End If End If - Else - 'Tabellendarstellung - If oItemSPECNAME = "INVOICE_POSITION_TAX_AMOUNT" And oYPlus > 0 Then - yPosition += oYPlus - 5 - End If - 'Tabellendarstellung Ende + 'Else + ' 'Tabellendarstellung + ' If oItemSPECNAME = "INVOICE_POSITION_TAX_AMOUNT" And oYPlus > 0 Then + ' yPosition += oYPlus - 5 + ' End If + ' 'Tabellendarstellung Ende End If oIndex += 1 Next