MDMFunctions, etc.

This commit is contained in:
2025-10-08 15:38:48 +02:00
parent a3d6069226
commit ce29fa679d
6 changed files with 39 additions and 31 deletions

View File

@@ -1117,21 +1117,21 @@ Public Class cMDMFunctionsAllgemein
AND leist.[UStV_Leistender]= [tblUStVPositionen].[UStVPo_Leistender])
where UStVAn_ID=" & USTV_ANTRAG.UStVAn_ID & sqlWHere & " ORDER BY UStVPo_ID"
Dim dtNew As DataTable = sql.loadDgvBySql(StringSQL, " FMZOLL")
Dim dtNew As DataTable = sql.loadDgvBySql(StringSQL, "FMZOLL")
If dtNew IsNot Nothing AndAlso dtNew.Rows.Count > 0 Then
If type = " excel" Then
If type = "excel" Then
Dim sumVAT As Double = 0
For Each row In dtNew.Rows
If Not IsDBNull(row(" Amount of tax refund")) AndAlso IsNumeric(row(" Amount of tax refund")) Then sumVAT += CDbl(row(" Amount of tax refund"))
If Not IsDBNull(row(" Amount of tax refund")) AndAlso IsNumeric(row(" Amount of tax refund")) Then row(" Amount of tax refund") = CDbl(row(" Amount of tax refund"))
If Not IsDBNull(row(" Name of supplier")) AndAlso row(" Name of supplier") <> "" AndAlso Not IsDBNull(row("VAT")) AndAlso row("VAT") <> "" Then
If Not IsDBNull(row("Amount of tax refund")) AndAlso IsNumeric(row("Amount of tax refund")) Then sumVAT += CDbl(row("Amount of tax refund"))
If Not IsDBNull(row("Amount of tax refund")) AndAlso IsNumeric(row("Amount of tax refund")) Then row("Amount of tax refund") = CDbl(row("Amount of tax refund"))
If Not IsDBNull(row("Name of supplier")) AndAlso row("Name of supplier") <> "" AndAlso Not IsDBNull(row("VAT")) AndAlso row("VAT") <> "" Then
row("Name of supplier") = row("Name of supplier").ToString.Replace(" " & row("VAT").ToString.Substring(0, 2), "")
End If
Next