From f7c0a296760f14ec638997d439df965a9931249b Mon Sep 17 00:00:00 2001 From: Developer01 Date: Fri, 5 Sep 2025 10:59:39 +0200 Subject: [PATCH] =?UTF-8?q?v3.1.=20=C3=84nderung=20Sichtbeleg=20Version=20?= =?UTF-8?q?1=20vor=20Abstimmung=20WISAG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jobs/My Project/AssemblyInfo.vb | 4 ++-- Jobs/ZUGFeRD/XRechnungViewDocument.vb | 34 ++++++++++++++++----------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/Jobs/My Project/AssemblyInfo.vb b/Jobs/My Project/AssemblyInfo.vb index 6df459e7..49811d3f 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 971db15b..9c99b9f2 100644 --- a/Jobs/ZUGFeRD/XRechnungViewDocument.vb +++ b/Jobs/ZUGFeRD/XRechnungViewDocument.vb @@ -143,6 +143,8 @@ Public Class XRechnungViewDocument ElseIf oArea = "POSITION" Then oAREACaption = "Positionen / Positions:" oIsPosition = True + ElseIf oArea = "ALLOWANCE" Then + oAREACaption = "Zu- oder Abschlag/Surcharge or Discount:" ElseIf oArea = "AMOUNT" Then oAREACaption = "Beträge / Amounts:" oCreateTextBox = True @@ -310,10 +312,7 @@ Public Class XRechnungViewDocument ElseIf oItemSPECNAME = "INVOICE_POSITION_TAX_AMOUNT" Then 'Tabellendarstellung Dim oYPos = yPosition - 3.5 - Dim oBetrag As Decimal = oItemValue - Dim oFormatiert As String = oBetrag.ToString("N2", New Globalization.CultureInfo("de-DE")) - - Dim TAXTERM = $"{oFormatiert} {oCurrencySymbol}" + Dim TAXTERM = FormatCurrency(oItemValue, oCurrencySymbol) MyGDPicturePDF.DrawTextBox(fontResName, 177, oYPos, 198, YCoo_TextBoxPlus5(oYPos), TextAlignment.TextAlignmentFar, TextAlignment.TextAlignmentNear, TAXTERM) @@ -332,10 +331,7 @@ Public Class XRechnungViewDocument oPosTerm = $"{oItemValue} %:" oDisplay = False ElseIf oItemSPECNAME = "INVOICE_TAXPOS_AMOUNT" Then - Dim oBetrag As Decimal = oItemValue - Dim oFormatiert As String = oBetrag.ToString("N2", New Globalization.CultureInfo("de-DE")) - oFormatiert += $" {oCurrencySymbol}" - oPosTerm += $" {oFormatiert}" + oPosTerm += FormatCurrency(oItemValue, oCurrencySymbol) oDisplay = False ElseIf oItemSPECNAME = "INVOICE_TAXPOS_TYPE" Then oPosTerm += $" {oItemValue}" @@ -350,12 +346,12 @@ Public Class XRechnungViewDocument If Y_eq_lastrow = False And oAreaSwitch = False Then yPosition += 5 End If - If oArea = "AMOUNT" Then - If oItemSPECNAME = "INVOICE_TOTAL_TAX" Or oItemSPECNAME = "INVOICE_TOTAL_NET" Or oItemSPECNAME = "INVOICE_TOTAL_GROSS" Then - Dim oBetrag As Decimal = oItemValue - Dim oFormatiert As String = oBetrag.ToString("N2", New Globalization.CultureInfo("de-DE")) - oFormatiert += $" {oCurrencySymbol}" - oItemValue = oFormatiert + If oArea = "AMOUNT" Or oArea = "ALLOWANCE" Then + + Dim oCURRENCYFORMAT = {"INVOICE_TOTAL_TAX", "INVOICE_TOTAL_NET", "INVOICE_TOTAL_GROSS", "RECEIPT_ALLOWANCE_ACTUAL_AMOUNT", + "RECEIPT_ALLOWANCE_CALCULATION_PERCENT"} + If oCURRENCYFORMAT.Contains(oItemSPECNAME) Then + oItemValue = FormatCurrency(oItemValue, oCurrencySymbol) End If End If @@ -437,6 +433,16 @@ Public Class XRechnungViewDocument Return Nothing End Try End Function + Private Function FormatCurrency(ByVal pValue As String, pCurrencySymbol As String) As String + pValue = pValue.replace(".", ",") + Dim oBetrag As Decimal = pValue + Dim oFormatiert As String = oBetrag.ToString("N2", New Globalization.CultureInfo("de-DE")) + oFormatiert = $"{oFormatiert} {pCurrencySymbol}" + Return oFormatiert + End Function + Private Function FormatStringT(ByVal text As String) As String + Return text.Replace(vbCr, " - ").Replace(vbLf, "").Replace(vbTab, " ") + End Function Private Function RemoveNewlinesAndTabs(ByVal text As String) As String Return text.Replace(vbCr, " - ").Replace(vbLf, "").Replace(vbTab, " ") End Function