ustva-Antrag, HR-Refunds
This commit is contained in:
@@ -7,178 +7,160 @@ Public Class GlobalVATRefundApplication_HR
|
||||
Public Property RefundPeriod As RefundPeriod_
|
||||
Public Property BankAccount As BankAccount_
|
||||
Public Property RefundRequest As RefundRequest_
|
||||
Public Property BusinessDescription As BusinessDescription_
|
||||
|
||||
Public Function ToXml() As Chilkat.Xml
|
||||
|
||||
Dim xml As New Chilkat.Xml
|
||||
|
||||
' =========================================================
|
||||
' 🔥 CRITICAL FIX: Encoding exakt wie Portal erwartet
|
||||
' =========================================================
|
||||
xml.Encoding = "UTF-8"
|
||||
xml.EmitBom = False
|
||||
|
||||
' =========================================================
|
||||
' ROOT (NICHT ÄNDERN – entspricht funktionierendem XML)
|
||||
' =========================================================
|
||||
xml.Tag = "p:GlobalVATRefundApplication"
|
||||
|
||||
xml.AddAttribute("xmlns:p", "http://VATRefund/")
|
||||
xml.AddAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance")
|
||||
xml.AddAttribute("xsi:type", "p:GlobalVATRefundApplication")
|
||||
xml.AddAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance")
|
||||
xml.AddAttribute("xmlns:p", "http://VATRefund/")
|
||||
|
||||
' ---------------------------
|
||||
' Applicant
|
||||
' ---------------------------
|
||||
xml.UpdateChildContent("applicant|nameType", Applicant.NameType)
|
||||
xml.UpdateChildContent("applicant|nameFree", Applicant.NameFree)
|
||||
xml.UpdateChildContent("applicant|addressFree", Applicant.AddressFree)
|
||||
xml.UpdateChildContent("applicant|telephone", Applicant.Telephone)
|
||||
|
||||
xml.UpdateChildContent("applicant|country|countryISOCode",
|
||||
Applicant.CountryISOCode)
|
||||
xml.UpdateChildContent("applicant|country|countryISOCode", Applicant.CountryISOCode)
|
||||
xml.UpdateChildContent("applicant|country|memberStatePreferences|countryMSCode", Applicant.CountryISOCode)
|
||||
|
||||
xml.UpdateChildContent("applicant|country|memberStatePreferences|countryMSCode",
|
||||
Applicant.CountryISOCode)
|
||||
xml.UpdateChildContent("applicant|identification|VATId", Applicant.VATId)
|
||||
xml.UpdateChildContent("applicant|identification|identificationCountry|countryISOCode", Applicant.CountryISOCode)
|
||||
xml.UpdateChildContent("applicant|identification|identificationCountry|memberStatePreferences|countryMSCode", Applicant.CountryISOCode)
|
||||
|
||||
xml.UpdateChildContent("applicant|identification|VATId",
|
||||
Applicant.VATId)
|
||||
|
||||
xml.UpdateChildContent("applicant|identification|identificationCountry|countryISOCode",
|
||||
Applicant.CountryISOCode)
|
||||
|
||||
xml.UpdateChildContent("applicant|identification|identificationCountry|memberStatePreferences|countryMSCode",
|
||||
Applicant.CountryISOCode)
|
||||
|
||||
xml.UpdateChildContent("applicant|email",
|
||||
Applicant.Email)
|
||||
xml.UpdateChildContent("applicant|email", Applicant.Email)
|
||||
|
||||
' ---------------------------
|
||||
' Representative
|
||||
xml.UpdateChildContent("representative|nameFree",
|
||||
Representative.Name)
|
||||
' ---------------------------
|
||||
xml.UpdateChildContent("representative|nameFree", Representative.Name)
|
||||
xml.UpdateChildContent("representative|addressFree", Representative.Address)
|
||||
xml.UpdateChildContent("representative|telephone", Representative.Telephone)
|
||||
|
||||
xml.UpdateChildContent("representative|addressFree",
|
||||
Representative.Address)
|
||||
xml.UpdateChildContent("representative|country|countryISOCode", Representative.CountryISOCode)
|
||||
|
||||
xml.UpdateChildContent("representative|telephone",
|
||||
Representative.Telephone)
|
||||
xml.UpdateChildContent("representative|identification|identificationType", Representative.IdentificationType)
|
||||
xml.UpdateChildContent("representative|identification|identificationNumber", Representative.IdentificationNumber)
|
||||
xml.UpdateChildContent("representative|identification|identificationCountry|countryISOCode", Representative.CountryISOCode)
|
||||
|
||||
xml.UpdateChildContent("representative|country|countryISOCode",
|
||||
Representative.CountryISOCode)
|
||||
|
||||
xml.UpdateChildContent("representative|identification|identificationType",
|
||||
Representative.IdentificationType)
|
||||
|
||||
xml.UpdateChildContent("representative|identification|identificationNumber",
|
||||
Representative.IdentificationNumber)
|
||||
|
||||
xml.UpdateChildContent("representative|identification|identificationCountry|countryISOCode",
|
||||
Representative.CountryISOCode)
|
||||
|
||||
xml.UpdateChildContent("representative|email",
|
||||
Representative.Email)
|
||||
xml.UpdateChildContent("representative|email", Representative.Email)
|
||||
|
||||
' ---------------------------
|
||||
' RefundPeriod
|
||||
xml.UpdateChildContent("refundPeriod|fromDate",
|
||||
RefundPeriod.FromDate)
|
||||
' ---------------------------
|
||||
xml.UpdateChildContent("refundPeriod|fromDate", RefundPeriod.FromDate)
|
||||
xml.UpdateChildContent("refundPeriod|toDate", RefundPeriod.ToDate)
|
||||
|
||||
xml.UpdateChildContent("refundPeriod|toDate",
|
||||
RefundPeriod.ToDate)
|
||||
' ---------------------------
|
||||
' BusinessDescription
|
||||
' ---------------------------
|
||||
xml.UpdateChildContent("businessDescription|businessActivity|code", BusinessDescription.code.ToString())
|
||||
xml.UpdateChildContent("businessDescription|businessActivity|names|name", BusinessDescription.name)
|
||||
|
||||
' businessDescription
|
||||
xml.UpdateChildContent("businessDescription", "")
|
||||
|
||||
' Bank
|
||||
xml.UpdateChildContent("defaultBankAccount|IBAN",
|
||||
BankAccount.IBAN)
|
||||
|
||||
xml.UpdateChildContent("defaultBankAccount|BIC",
|
||||
BankAccount.BIC)
|
||||
|
||||
xml.UpdateChildContent("defaultBankAccount|ownerName",
|
||||
BankAccount.OwnerName)
|
||||
|
||||
xml.UpdateChildContent("defaultBankAccount|details|ownerType",
|
||||
BankAccount.OwnerType)
|
||||
|
||||
xml.UpdateChildContent("defaultBankAccount|details|currency|currencyISO",
|
||||
BankAccount.CurrencyISO)
|
||||
' ---------------------------
|
||||
' BankAccount
|
||||
' ---------------------------
|
||||
xml.UpdateChildContent("defaultBankAccount|IBAN", BankAccount.IBAN)
|
||||
xml.UpdateChildContent("defaultBankAccount|BIC", BankAccount.BIC)
|
||||
xml.UpdateChildContent("defaultBankAccount|ownerName", BankAccount.OwnerName)
|
||||
xml.UpdateChildContent("defaultBankAccount|details|ownerType", BankAccount.OwnerType)
|
||||
xml.UpdateChildContent("defaultBankAccount|details|currency|currencyISO", BankAccount.CurrencyISO)
|
||||
|
||||
' ---------------------------
|
||||
' Version
|
||||
' ---------------------------
|
||||
xml.UpdateChildContent("version",
|
||||
DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ss.fffZ"))
|
||||
DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ss.fffZ"))
|
||||
|
||||
' ---------------------------
|
||||
' RefundRequest
|
||||
xml.UpdateChildContent("refundRequest|refundMemberState|countryISOCode", RefundRequest.RefundMemberState)
|
||||
' ---------------------------
|
||||
xml.UpdateChildContent("refundRequest|refundMemberState|countryISOCode",
|
||||
RefundRequest.RefundMemberState)
|
||||
|
||||
For i As Integer = 0 To RefundRequest.PurchaseInformation.Count - 1
|
||||
|
||||
Dim p = RefundRequest.PurchaseInformation(i)
|
||||
|
||||
Dim path = $"refundRequest|purchaseInformation[{i}]"
|
||||
|
||||
xml.UpdateChildContent(path & "|sequence", p.Sequence.ToString)
|
||||
|
||||
xml.UpdateChildContent(path & "|simplifiedInvoice", p.SimplifiedInvoice.ToString.ToLower)
|
||||
|
||||
xml.UpdateChildContent(path & "|sequence", p.Sequence.ToString())
|
||||
xml.UpdateChildContent(path & "|simplifiedInvoice", p.SimplifiedInvoice.ToString().ToLower())
|
||||
xml.UpdateChildContent(path & "|referenceNumber", p.ReferenceNumber)
|
||||
|
||||
xml.UpdateChildContent(path & "|issuingDate", p.IssuingDate)
|
||||
|
||||
xml.UpdateChildContent(path & "|transactionDescription|taxableAmount|amount",
|
||||
p.TransactionDescription.TaxableAmount.Amount.ToString(Globalization.CultureInfo.InvariantCulture))
|
||||
p.TransactionDescription.TaxableAmount.Amount.ToString(Globalization.CultureInfo.InvariantCulture))
|
||||
|
||||
xml.UpdateChildContent(path & "|transactionDescription|taxableAmount|currency|currencyISO",
|
||||
p.TransactionDescription.TaxableAmount.CurrencyISO)
|
||||
p.TransactionDescription.TaxableAmount.CurrencyISO)
|
||||
|
||||
xml.UpdateChildContent(path & "|transactionDescription|VATAmount|amount",
|
||||
p.TransactionDescription.VATAmount.Amount.ToString(Globalization.CultureInfo.InvariantCulture))
|
||||
p.TransactionDescription.VATAmount.Amount.ToString(Globalization.CultureInfo.InvariantCulture))
|
||||
|
||||
xml.UpdateChildContent(path & "|transactionDescription|VATAmount|currency|currencyISO",
|
||||
p.TransactionDescription.VATAmount.CurrencyISO)
|
||||
p.TransactionDescription.VATAmount.CurrencyISO)
|
||||
|
||||
xml.UpdateChildContent(path & "|deduction|deductibleAmount|amount",
|
||||
p.Deduction.DeductibleAmount.Amount.ToString(Globalization.CultureInfo.InvariantCulture))
|
||||
p.Deduction.DeductibleAmount.Amount.ToString(Globalization.CultureInfo.InvariantCulture))
|
||||
|
||||
xml.UpdateChildContent(path & "|deduction|deductibleAmount|currency|currencyISO",
|
||||
p.Deduction.DeductibleAmount.CurrencyISO)
|
||||
p.Deduction.DeductibleAmount.CurrencyISO)
|
||||
|
||||
xml.UpdateChildContent(path & "|goodsDescription|code",
|
||||
p.GoodsDescription.Code)
|
||||
xml.UpdateChildContent(path & "|goodsDescription|code", p.GoodsDescription.Code)
|
||||
|
||||
xml.UpdateChildContent(path & "|EUSupplier|nameFree",
|
||||
p.EUSupplier.NameFree)
|
||||
xml.UpdateChildContent(path & "|EUSupplier|nameFree", p.EUSupplier.NameFree)
|
||||
xml.UpdateChildContent(path & "|EUSupplier|addressFree", p.EUSupplier.AddressFree)
|
||||
xml.UpdateChildContent(path & "|EUSupplier|country|countryISOCode", p.EUSupplier.CountryISOCode)
|
||||
|
||||
xml.UpdateChildContent(path & "|EUSupplier|addressFree",
|
||||
p.EUSupplier.AddressFree)
|
||||
|
||||
xml.UpdateChildContent(path & "|EUSupplier|country|countryISOCode",
|
||||
p.EUSupplier.CountryISOCode)
|
||||
|
||||
xml.UpdateChildContent(path & "|EUSupplier|identification|VATId",
|
||||
p.EUSupplier.VATId)
|
||||
|
||||
xml.UpdateChildContent(path & "|EUSupplier|identification|identificationCountry|countryISOCode",
|
||||
p.EUSupplier.CountryISOCode)
|
||||
xml.UpdateChildContent(path & "|EUSupplier|identification|VATId", p.EUSupplier.VATId)
|
||||
xml.UpdateChildContent(path & "|EUSupplier|identification|identificationCountry|countryISOCode", p.EUSupplier.CountryISOCode)
|
||||
|
||||
xml.UpdateChildContent(path & "|state", "N")
|
||||
|
||||
Next
|
||||
|
||||
Dim idx As Integer = 1
|
||||
' ---------------------------
|
||||
' DocumentCopy
|
||||
' ---------------------------
|
||||
For i As Integer = 0 To RefundRequest.DocumentCopy.Count - 1
|
||||
|
||||
For Each d In RefundRequest.DocumentCopy
|
||||
Dim d = RefundRequest.DocumentCopy(i)
|
||||
Dim path = $"refundRequest|documentCopy[{i}]"
|
||||
|
||||
Dim path = $"refundRequest|documentCopy[{idx}]"
|
||||
If d.FileName <> "" Then xml.UpdateChildContent(path & "|filename", d.FileName)
|
||||
If d.FileType <> "" Then xml.UpdateChildContent(path & "|fileType", d.FileType.ToUpper()) ' optional safer
|
||||
If d.Description <> "" Then xml.UpdateChildContent(path & "|description", d.Description)
|
||||
|
||||
xml.UpdateChildContent(path & "|fileType", d.FileType)
|
||||
xml.UpdateChildContent(path & "|filename", d.FileName)
|
||||
xml.UpdateChildContent(path & "|description", d.Description)
|
||||
xml.UpdateChildContent(path & "|file", d.Base64Content)
|
||||
|
||||
idx += 1
|
||||
' =========================================
|
||||
' BASE64 FILE CONTENT (WICHTIG)
|
||||
' =========================================
|
||||
If d.Base64Content <> "" Then xml.UpdateChildContent(path & "|file", d.Base64Content)
|
||||
'xml.UpdateChildContent(path & "|file|file", d.Base64Content)
|
||||
|
||||
Next
|
||||
|
||||
|
||||
xml.UpdateChildContent("refundRequest|state", "N")
|
||||
|
||||
xml.UpdateChildContent("submittedLocale", "de")
|
||||
|
||||
Return xml
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
Public Class Applicant_
|
||||
@@ -281,6 +263,11 @@ Public Class EUSupplier_
|
||||
|
||||
End Class
|
||||
|
||||
Public Class BusinessDescription_
|
||||
Public Property code As Integer
|
||||
Public Property name As String
|
||||
End Class
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ Imports System.IO
|
||||
Imports System.Reflection
|
||||
Imports System.Windows.Documents
|
||||
Imports itextsharp.text.pdf
|
||||
Imports java.util.function
|
||||
Imports Microsoft.Office.Interop
|
||||
Imports VERAG_PROG_ALLGEMEIN
|
||||
|
||||
@@ -818,15 +817,15 @@ Public Class frmMDM_USTVAntrag
|
||||
|
||||
If USTV_ANTRAG.UStVAn_Währungscode <> "EUR" AndAlso ANTRAG.plose_WaehrungAbbuchung = "EUR" Then
|
||||
|
||||
NETTOBETRAG = Math.Round(kurs.EXCHANGE_EURTOCUR(NETTOBETRAG_EUR, USTV_ANTRAG.UStVAn_Währungscode, CDate(USTV_POS.UStVPo_ReDat)), 2)
|
||||
NETTOBETRAG = Math.round(kurs.EXCHANGE_EURTOCUR(NETTOBETRAG_EUR, USTV_ANTRAG.UStVAn_Währungscode, CDate(USTV_POS.UStVPo_ReDat)), 2)
|
||||
|
||||
ElseIf USTV_ANTRAG.UStVAn_Währungscode = "EUR" AndAlso ANTRAG.plose_WaehrungAbbuchung <> "EUR" Then
|
||||
|
||||
NETTOBETRAG_EUR = Math.Round(kurs.EXCHANGE_CURTOEUR(NETTOBETRAG, USTV_ANTRAG.UStVAn_Währungscode, CDate(USTV_POS.UStVPo_ReDat)), 2)
|
||||
NETTOBETRAG_EUR = Math.round(kurs.EXCHANGE_CURTOEUR(NETTOBETRAG, USTV_ANTRAG.UStVAn_Währungscode, CDate(USTV_POS.UStVPo_ReDat)), 2)
|
||||
|
||||
ElseIf USTV_ANTRAG.UStVAn_Währungscode <> "EUR" AndAlso ANTRAG.plose_WaehrungAbbuchung <> "EUR" Then
|
||||
|
||||
NETTOBETRAG_EUR = Math.Round(kurs.EXCHANGE_CURTOEUR(NETTOBETRAG, USTV_ANTRAG.UStVAn_Währungscode, CDate(USTV_POS.UStVPo_ReDat)), 2)
|
||||
NETTOBETRAG_EUR = Math.round(kurs.EXCHANGE_CURTOEUR(NETTOBETRAG, USTV_ANTRAG.UStVAn_Währungscode, CDate(USTV_POS.UStVPo_ReDat)), 2)
|
||||
|
||||
End If
|
||||
|
||||
@@ -924,21 +923,21 @@ Public Class frmMDM_USTVAntrag
|
||||
|
||||
If USTV_ANTRAG.UStVAn_Währungscode <> "EUR" AndAlso ANTRAG.plose_WaehrungAbbuchung = "EUR" Then
|
||||
|
||||
UST_org = Math.Round(kurs.EXCHANGE_EURTOCUR(UST_EUR, USTV_ANTRAG.UStVAn_Währungscode, CDate(USTV_POS.UStVPo_ReDat)), 2)
|
||||
UST_org = Math.round(kurs.EXCHANGE_EURTOCUR(UST_EUR, USTV_ANTRAG.UStVAn_Währungscode, CDate(USTV_POS.UStVPo_ReDat)), 2)
|
||||
|
||||
ElseIf USTV_ANTRAG.UStVAn_Währungscode = "EUR" AndAlso ANTRAG.plose_WaehrungAbbuchung <> "EUR" Then
|
||||
|
||||
UST_EUR = Math.Round(kurs.EXCHANGE_CURTOEUR(UST_org, USTV_ANTRAG.UStVAn_Währungscode, CDate(USTV_POS.UStVPo_ReDat)), 2)
|
||||
UST_EUR = Math.round(kurs.EXCHANGE_CURTOEUR(UST_org, USTV_ANTRAG.UStVAn_Währungscode, CDate(USTV_POS.UStVPo_ReDat)), 2)
|
||||
|
||||
ElseIf USTV_ANTRAG.UStVAn_Währungscode <> "EUR" AndAlso ANTRAG.plose_WaehrungAbbuchung <> "EUR" Then
|
||||
|
||||
UST_EUR = Math.Round(kurs.EXCHANGE_CURTOEUR(UST_org, USTV_ANTRAG.UStVAn_Währungscode, CDate(USTV_POS.UStVPo_ReDat)), 2)
|
||||
UST_EUR = Math.round(kurs.EXCHANGE_CURTOEUR(UST_org, USTV_ANTRAG.UStVAn_Währungscode, CDate(USTV_POS.UStVPo_ReDat)), 2)
|
||||
|
||||
End If
|
||||
|
||||
|
||||
If (UST_org <> 0 AndAlso UST_org <> UST_EUR) Then
|
||||
umrechKurs = Math.Floor((UST_org / UST_EUR * 100 + 0.5)) / 100
|
||||
umrechKurs = Math.floor((UST_org / UST_EUR * 100 + 0.5)) / 100
|
||||
End If
|
||||
|
||||
|
||||
@@ -1080,7 +1079,7 @@ Public Class frmMDM_USTVAntrag
|
||||
Dim umrechKurs As Double = 1
|
||||
Dim UST_EUR = CDbl(r.Item("SteuerbetragLokal"))
|
||||
|
||||
UST_EUR = Math.Round(UST_EUR, 2)
|
||||
UST_EUR = Math.round(UST_EUR, 2)
|
||||
|
||||
USTV_POS.UStVPo_USteuerbetragEUR = UST_EUR
|
||||
USTV_POS.UStVPo_Umrechnungskurs = umrechKurs
|
||||
@@ -1213,17 +1212,17 @@ Public Class frmMDM_USTVAntrag
|
||||
|
||||
'umrechKurs = frmdw / eur
|
||||
|
||||
umrechKurs = Math.Floor((Brutto_org / Brutto_EUR * 100 + 0.5)) / 100
|
||||
umrechKurs = Math.floor((Brutto_org / Brutto_EUR * 100 + 0.5)) / 100
|
||||
|
||||
End If
|
||||
|
||||
If CDbl(r.Item("rmc_betragMWST")) <> 0 Then
|
||||
USTV_POS.UStVPo_USteuerbetragEUR = Math.Round((r.Item("rmc_betragMWST") / umrechKurs), 2)
|
||||
USTV_POS.UStVPo_USteuerbetragEUR = Math.round((r.Item("rmc_betragMWST") / umrechKurs), 2)
|
||||
USTV_POS.UStVPo_Umrechnungskurs = umrechKurs
|
||||
USTV_POS.UStVPo_USteuerbetrag = r.Item("rmc_betragMWST")
|
||||
|
||||
If USTV_POS.UStVPo_NettobetragEUR Is Nothing Then
|
||||
USTV_POS.UStVPo_NettobetragEUR = Math.Round((r.Item("rmc_betragNetto") / umrechKurs), 2)
|
||||
USTV_POS.UStVPo_NettobetragEUR = Math.round((r.Item("rmc_betragNetto") / umrechKurs), 2)
|
||||
End If
|
||||
|
||||
End If
|
||||
@@ -1316,7 +1315,7 @@ Public Class frmMDM_USTVAntrag
|
||||
|
||||
'umrechKurs = UST_org / UST_EUR
|
||||
|
||||
umrechKurs = Math.Floor((UST_org / UST_EUR * 100 + 0.5)) / 100
|
||||
umrechKurs = Math.floor((UST_org / UST_EUR * 100 + 0.5)) / 100
|
||||
|
||||
End If
|
||||
|
||||
@@ -1326,7 +1325,7 @@ Public Class frmMDM_USTVAntrag
|
||||
USTV_POS.UStVPo_USteuerbetrag = UST_org
|
||||
|
||||
If USTV_POS.UStVPo_NettobetragEUR Is Nothing Then
|
||||
USTV_POS.UStVPo_NettobetragEUR = Math.Round((r.Item("NETTO") / umrechKurs), 2)
|
||||
USTV_POS.UStVPo_NettobetragEUR = Math.round((r.Item("NETTO") / umrechKurs), 2)
|
||||
End If
|
||||
|
||||
End If
|
||||
@@ -1424,7 +1423,7 @@ Public Class frmMDM_USTVAntrag
|
||||
|
||||
|
||||
If (UST_org <> 0 AndAlso UST_org <> UST_EUR) Then
|
||||
umrechKurs = Math.Floor((UST_org / UST_EUR * 100 + 0.5)) / 100
|
||||
umrechKurs = Math.floor((UST_org / UST_EUR * 100 + 0.5)) / 100
|
||||
End If
|
||||
|
||||
|
||||
@@ -1557,11 +1556,11 @@ Public Class frmMDM_USTVAntrag
|
||||
|
||||
If USTV_ANTRAG.UStVAn_Währungscode <> "EUR" Then
|
||||
Dim kurs As New cEZB_Waehrungskurse(USTV_ANTRAG.UStVAn_Währungscode)
|
||||
UST_org = Math.Round(kurs.EXCHANGE_EURTOCUR(UST_EUR, USTV_ANTRAG.UStVAn_Währungscode, CDate(USTV_POS.UStVPo_ReDat)), 2)
|
||||
UST_org = Math.round(kurs.EXCHANGE_EURTOCUR(UST_EUR, USTV_ANTRAG.UStVAn_Währungscode, CDate(USTV_POS.UStVPo_ReDat)), 2)
|
||||
End If
|
||||
|
||||
If (UST_org <> 0 AndAlso UST_org <> UST_EUR) Then
|
||||
umrechKurs = Math.Floor((UST_org / UST_EUR * 100 + 0.5)) / 100
|
||||
umrechKurs = Math.floor((UST_org / UST_EUR * 100 + 0.5)) / 100
|
||||
End If
|
||||
|
||||
|
||||
@@ -1570,7 +1569,7 @@ Public Class frmMDM_USTVAntrag
|
||||
USTV_POS.UStVPo_Umrechnungskurs = umrechKurs
|
||||
USTV_POS.UStVPo_USteuerbetrag = UST_org
|
||||
|
||||
If USTV_POS.UStVPo_Nettobetrag Is Nothing Then USTV_POS.UStVPo_Nettobetrag = Math.Round((r.Item("Nettobetrag") * umrechKurs), 2)
|
||||
If USTV_POS.UStVPo_Nettobetrag Is Nothing Then USTV_POS.UStVPo_Nettobetrag = Math.round((r.Item("Nettobetrag") * umrechKurs), 2)
|
||||
|
||||
|
||||
If USTV_POS.INSERT() Then
|
||||
@@ -1734,8 +1733,8 @@ Public Class frmMDM_USTVAntrag
|
||||
Else
|
||||
|
||||
USTV_POS.UStVPo_USteuerbetrag = r.Cells("total_VAT_amount").Value
|
||||
USTV_POS.UStVPo_USteuerbetragEUR = Math.Round(kurs.EXCHANGE_CURTOEUR(r.Cells("total_VAT_amount").Value, r.Cells("total_VAT_currency").Value, CDate(USTV_POS.UStVPo_ReDat)), 2)
|
||||
USTV_POS.UStVPo_Umrechnungskurs = Math.Floor((CDbl(USTV_POS.UStVPo_USteuerbetrag) / CDbl(USTV_POS.UStVPo_USteuerbetragEUR) * 100 + 0.5)) / 100
|
||||
USTV_POS.UStVPo_USteuerbetragEUR = Math.round(kurs.EXCHANGE_CURTOEUR(r.Cells("total_VAT_amount").Value, r.Cells("total_VAT_currency").Value, CDate(USTV_POS.UStVPo_ReDat)), 2)
|
||||
USTV_POS.UStVPo_Umrechnungskurs = Math.floor((CDbl(USTV_POS.UStVPo_USteuerbetrag) / CDbl(USTV_POS.UStVPo_USteuerbetragEUR) * 100 + 0.5)) / 100
|
||||
End If
|
||||
Else
|
||||
'2. Antragswährung <> Belegswährung (EUR zu FREMD und FREMD zu EUR)
|
||||
@@ -1743,10 +1742,10 @@ Public Class frmMDM_USTVAntrag
|
||||
Dim kurs As New cEZB_Waehrungskurse(r.Cells("total_VAT_currency").Value)
|
||||
If r.Cells("total_VAT_currency").Value <> "EUR" Then
|
||||
USTV_POS.UStVPo_USteuerbetrag = r.Cells("total_VAT_amount").Value
|
||||
USTV_POS.UStVPo_USteuerbetragEUR = Math.Round(kurs.EXCHANGE_CURTOEUR(r.Cells("total_VAT_amount").Value, r.Cells("total_VAT_currency").Value, CDate(USTV_POS.UStVPo_ReDat)), 2)
|
||||
USTV_POS.UStVPo_Umrechnungskurs = Math.Floor((CDbl(USTV_POS.UStVPo_USteuerbetrag) / CDbl(USTV_POS.UStVPo_USteuerbetragEUR) * 100 + 0.5)) / 100
|
||||
USTV_POS.UStVPo_USteuerbetragEUR = Math.round(kurs.EXCHANGE_CURTOEUR(r.Cells("total_VAT_amount").Value, r.Cells("total_VAT_currency").Value, CDate(USTV_POS.UStVPo_ReDat)), 2)
|
||||
USTV_POS.UStVPo_Umrechnungskurs = Math.floor((CDbl(USTV_POS.UStVPo_USteuerbetrag) / CDbl(USTV_POS.UStVPo_USteuerbetragEUR) * 100 + 0.5)) / 100
|
||||
ElseIf r.Cells("total_VAT_currency").Value = "EUR" Then
|
||||
USTV_POS.UStVPo_USteuerbetrag = Math.Round(kurs.EXCHANGE_EURTOCUR(r.Cells("total_VAT_amount").Value, USTV_ANTRAG.UStVAn_Währungscode, CDate(USTV_POS.UStVPo_ReDat)), 2)
|
||||
USTV_POS.UStVPo_USteuerbetrag = Math.round(kurs.EXCHANGE_EURTOCUR(r.Cells("total_VAT_amount").Value, USTV_ANTRAG.UStVAn_Währungscode, CDate(USTV_POS.UStVPo_ReDat)), 2)
|
||||
USTV_POS.UStVPo_USteuerbetragEUR = USTV_POS.UStVPo_USteuerbetrag
|
||||
USTV_POS.UStVPo_Umrechnungskurs = 1
|
||||
End If
|
||||
@@ -1755,13 +1754,13 @@ Public Class frmMDM_USTVAntrag
|
||||
If r.Cells("total_VAT_currency").Value = "EUR" Then
|
||||
USTV_POS.UStVPo_USteuerbetragEUR = r.Cells("total_VAT_amount").Value
|
||||
Dim kurs As New cEZB_Waehrungskurse(USTV_ANTRAG.UStVAn_Währungscode)
|
||||
USTV_POS.UStVPo_USteuerbetrag = Math.Round(kurs.EXCHANGE_EURTOCUR(r.Cells("total_VAT_amount").Value, USTV_ANTRAG.UStVAn_Währungscode, CDate(USTV_POS.UStVPo_ReDat)), 2)
|
||||
USTV_POS.UStVPo_Umrechnungskurs = Math.Floor((CDbl(USTV_POS.UStVPo_USteuerbetrag) / CDbl(USTV_POS.UStVPo_USteuerbetragEUR) * 100 + 0.5)) / 100
|
||||
USTV_POS.UStVPo_USteuerbetrag = Math.round(kurs.EXCHANGE_EURTOCUR(r.Cells("total_VAT_amount").Value, USTV_ANTRAG.UStVAn_Währungscode, CDate(USTV_POS.UStVPo_ReDat)), 2)
|
||||
USTV_POS.UStVPo_Umrechnungskurs = Math.floor((CDbl(USTV_POS.UStVPo_USteuerbetrag) / CDbl(USTV_POS.UStVPo_USteuerbetragEUR) * 100 + 0.5)) / 100
|
||||
Else
|
||||
USTV_POS.UStVPo_USteuerbetrag = VERAG_PROG_ALLGEMEIN.cProgramFunctions.fktEuro(r.Cells("total_VAT_amount").Value, r.Cells("total_VAT_currency").Value, USTV_ANTRAG.UStVAn_Währungscode)
|
||||
Dim kurs As New cEZB_Waehrungskurse(USTV_ANTRAG.UStVAn_Währungscode)
|
||||
USTV_POS.UStVPo_USteuerbetragEUR = Math.Round(kurs.EXCHANGE_CURTOEUR(r.Cells("total_VAT_amount").Value, r.Cells("total_VAT_currency").Value, CDate(USTV_POS.UStVPo_ReDat)), 2)
|
||||
USTV_POS.UStVPo_Umrechnungskurs = Math.Floor((CDbl(USTV_POS.UStVPo_USteuerbetrag) / CDbl(USTV_POS.UStVPo_USteuerbetragEUR) * 100 + 0.5)) / 100
|
||||
USTV_POS.UStVPo_USteuerbetragEUR = Math.round(kurs.EXCHANGE_CURTOEUR(r.Cells("total_VAT_amount").Value, r.Cells("total_VAT_currency").Value, CDate(USTV_POS.UStVPo_ReDat)), 2)
|
||||
USTV_POS.UStVPo_Umrechnungskurs = Math.floor((CDbl(USTV_POS.UStVPo_USteuerbetrag) / CDbl(USTV_POS.UStVPo_USteuerbetragEUR) * 100 + 0.5)) / 100
|
||||
|
||||
|
||||
End If
|
||||
@@ -1834,10 +1833,10 @@ Public Class frmMDM_USTVAntrag
|
||||
averageUmrechnungskurs = averageUmrechnungskurs / dgvUSTVPositionen.Rows.Count
|
||||
End If
|
||||
|
||||
Dim abw As Double = Math.Abs(Math.Round(GesamtUSteuer / averageUmrechnungskurs, 2) - Math.Round(GesamtUSteuerEUR, 2))
|
||||
Dim abw As Double = Math.abs(Math.round(GesamtUSteuer / averageUmrechnungskurs, 2) - Math.round(GesamtUSteuerEUR, 2))
|
||||
|
||||
If abw >= 250 Then
|
||||
MsgBox("Bitte Umrechnungskurs in den Antragspositionen kontrollieren!" & vbNewLine & "Der Steuerbetrag weicht um " & Math.Round(abw, 2) & "€ vom FW-Steuerbetrag ab! ")
|
||||
MsgBox("Bitte Umrechnungskurs in den Antragspositionen kontrollieren!" & vbNewLine & "Der Steuerbetrag weicht um " & Math.round(abw, 2) & "€ vom FW-Steuerbetrag ab! ")
|
||||
End If
|
||||
|
||||
If Not invoicedateOK Then
|
||||
@@ -4161,6 +4160,7 @@ Public Class frmMDM_USTVAntrag
|
||||
Case "RO", "R" : fileName = fileName & ".xml" : createXMLforRO(ADR, KUNDE, KUNDE_ERW, FIRMA, BANK_OWNER, BANK_IBAN, BANK_BIC, fileName, filePath)
|
||||
Case "DE", "D" : fileName = fileName & ".csv" : createCSVforDE(ADR, KUNDE, KUNDE_ERW, FIRMA, BANK_OWNER, BANK_IBAN, BANK_BIC, fileName, filePath) 'ALTERNATIVE: ELMA5-Massendatenschnittstelle allerdings um einiges aufwendiger!
|
||||
Case "HR" : fileName = fileName & ".xml" : createXMLforHR(ADR, KUNDE, KUNDE_ERW, FIRMA, BANK_OWNER, BANK_IBAN, BANK_BIC, fileName, filePath)
|
||||
|
||||
End Select
|
||||
|
||||
|
||||
@@ -4389,7 +4389,7 @@ Public Class frmMDM_USTVAntrag
|
||||
' .Deduction = New Deduction With {.DeductibleVATAmount = "0.00", .ProRataRate = ""}
|
||||
'})
|
||||
|
||||
counter = +1
|
||||
counter += 1
|
||||
|
||||
Next
|
||||
|
||||
@@ -4512,233 +4512,281 @@ Public Class frmMDM_USTVAntrag
|
||||
Return False
|
||||
End If
|
||||
|
||||
|
||||
Dim fullFilePath As String = saveDialog.FileName
|
||||
Dim directoryPath As String = Path.GetDirectoryName(fullFilePath)
|
||||
|
||||
If Not Directory.Exists(directoryPath) Then
|
||||
Directory.CreateDirectory(directoryPath)
|
||||
End If
|
||||
Try
|
||||
|
||||
|
||||
Select Case Antrag_LandKz
|
||||
Case "AT", "DE", "CZ", "BE", "SI"
|
||||
BANK_OWNER = FIRMA.Firma_Bez
|
||||
BANK_IBAN = FIRMA.Firma_IBAN1
|
||||
BANK_BIC = FIRMA.Firma_BIC1
|
||||
|
||||
If BANK_BIC.ToString.Contains("BIC:") Then
|
||||
BANK_BIC = BANK_BIC.ToString.Replace("BIC:", "")
|
||||
BANK_BIC = BANK_BIC.Trim()
|
||||
BANK_BIC = BANK_BIC.ToString.Replace(" ", "")
|
||||
End If
|
||||
Dim fullFilePath As String = saveDialog.FileName
|
||||
Dim directoryPath As String = Path.GetDirectoryName(fullFilePath)
|
||||
|
||||
If BANK_IBAN.ToString.Contains("IBAN:") Then
|
||||
BANK_IBAN = BANK_IBAN.ToString.Replace("IBAN:", "")
|
||||
BANK_IBAN = BANK_IBAN.Trim()
|
||||
BANK_IBAN = BANK_IBAN.ToString.Replace(" ", "")
|
||||
End If
|
||||
If Not Directory.Exists(directoryPath) Then
|
||||
Directory.CreateDirectory(directoryPath)
|
||||
End If
|
||||
|
||||
Case Else
|
||||
'Bank aus Kunden!
|
||||
Dim dtBank As New DataTable
|
||||
dtBank = SQL.loadDgvBySql("SELECT isnull(bnk_name,'') as bnk_name ,bnk_anschrift,ISNULL(bnk_iban,'') as bnk_iban,ISNULL(bnk_bic,'') as bnk_bic FROM [tblBankverbindungen] WHERE isnull(bnk_hauptkonto,0) = 0 and isnull(bnk_archiv,0) = 0 and bnk_KundenNr = " & KUNDE.KundenNr, "FMZOLL")
|
||||
|
||||
If dtBank.Rows.Count > 0 Then
|
||||
BANK_OWNER = ADR.Name_1
|
||||
BANK_IBAN = dtBank.Rows(0).Item("bnk_iban")
|
||||
BANK_BIC = dtBank.Rows(0).Item("bnk_bic")
|
||||
End If
|
||||
'wenn nicht hinterlegt, dann leer lassen!
|
||||
Select Case Antrag_LandKz
|
||||
Case "AT", "DE", "CZ", "BE", "SI"
|
||||
BANK_OWNER = FIRMA.Firma_Bez
|
||||
BANK_IBAN = FIRMA.Firma_IBAN1
|
||||
BANK_BIC = FIRMA.Firma_BIC1
|
||||
|
||||
End Select
|
||||
If BANK_BIC.ToString.Contains("BIC:") Then
|
||||
BANK_BIC = BANK_BIC.ToString.Replace("BIC:", "")
|
||||
BANK_BIC = BANK_BIC.Trim()
|
||||
BANK_BIC = BANK_BIC.ToString.Replace(" ", "")
|
||||
End If
|
||||
|
||||
Dim app As New GlobalVATRefundApplication_HR() With {
|
||||
.RefundPeriod = New RefundPeriod_ With {.FromDate = CDate(USTV_ANTRAG.UStVAn_ReDatVon).Month, .ToDate = CDate(USTV_ANTRAG.UStVAn_ReDatBis).Month},
|
||||
.Applicant = New Applicant_ With {
|
||||
.NameFree = ADR.Name_1,
|
||||
.VATId = IIf(Not IsDBNull(ADR.UstIdNr) AndAlso ADR.UstIdNr IsNot Nothing, ADR.UstIdNr, 0),
|
||||
.AddressFree = ADR.Straße.ToString & vbCrLf & ADR.LandKz.ToString & " - " & ADR.PLZ.ToString & " -" & ADR.Ort.ToString, '"RO - 550270 - MUN. SIBIU",
|
||||
.CountryISOCode = ADR.LandKz, .Telephone = "", .Email = "juricevic@verag.ag"
|
||||
},
|
||||
.Representative = New Representative_ With {
|
||||
.Name = "VERAG 360 GMBH",
|
||||
.IdentificationNumber = "ATU76165837",
|
||||
.Address = "SUBEN NR. 100, AT-4975 SUBEN",
|
||||
.Telephone = "00437711277719",
|
||||
.Email = "juricevic@verag.ag",
|
||||
.CountryISOCode = "AT",
|
||||
.IdentificationType = "TIN"
|
||||
},
|
||||
.BankAccount = New BankAccount_ With {
|
||||
.CurrencyISO = USTV_ANTRAG.UStVAn_Währungscode,
|
||||
.OwnerType = 1,
|
||||
.OwnerName = BANK_OWNER,
|
||||
.IBAN = BANK_IBAN,
|
||||
.BIC = BANK_BIC
|
||||
If BANK_IBAN.ToString.Contains("IBAN:") Then
|
||||
BANK_IBAN = BANK_IBAN.ToString.Replace("IBAN:", "")
|
||||
BANK_IBAN = BANK_IBAN.Trim()
|
||||
BANK_IBAN = BANK_IBAN.ToString.Replace(" ", "")
|
||||
End If
|
||||
|
||||
Case Else
|
||||
'Bank aus Kunden!
|
||||
Dim dtBank As New DataTable
|
||||
dtBank = SQL.loadDgvBySql("SELECT isnull(bnk_name,'') as bnk_name ,bnk_anschrift,ISNULL(bnk_iban,'') as bnk_iban,ISNULL(bnk_bic,'') as bnk_bic FROM [tblBankverbindungen] WHERE isnull(bnk_hauptkonto,0) = 0 and isnull(bnk_archiv,0) = 0 and bnk_KundenNr = " & KUNDE.KundenNr, "FMZOLL")
|
||||
|
||||
If dtBank.Rows.Count > 0 Then
|
||||
BANK_OWNER = ADR.Name_1
|
||||
BANK_IBAN = dtBank.Rows(0).Item("bnk_iban")
|
||||
BANK_BIC = dtBank.Rows(0).Item("bnk_bic")
|
||||
End If
|
||||
'wenn nicht hinterlegt, dann leer lassen!
|
||||
|
||||
End Select
|
||||
|
||||
Dim app As New GlobalVATRefundApplication_HR() With {
|
||||
.RefundPeriod = New RefundPeriod_ With {.FromDate = CDate(USTV_ANTRAG.UStVAn_ReDatVon).ToString("yyyy-MM-dd"), .ToDate = CDate(USTV_ANTRAG.UStVAn_ReDatBis).ToString("yyyy-MM-dd")},
|
||||
.Applicant = New Applicant_ With {
|
||||
.NameType = "legal",
|
||||
.NameFree = ADR.Name_1,
|
||||
.VATId = IIf(Not IsDBNull(ADR.UstIdNr) AndAlso ADR.UstIdNr IsNot Nothing, ADR.UstIdNr, 0),
|
||||
.AddressFree = ADR.Straße.ToString & ", " & ADR.PLZ.ToString & ", " & ADR.Ort.ToString, '"RO - 550270 - MUN. SIBIU",
|
||||
.CountryISOCode = ADR.LandKz,
|
||||
.Telephone = "00",
|
||||
.Email = "juricevic@verag.ag"
|
||||
},
|
||||
.BusinessDescription = New BusinessDescription_ With {
|
||||
.code = 4941, .name = "Freight transport by road"
|
||||
},
|
||||
.Representative = New Representative_ With {
|
||||
.Name = "VERAG 360 GMBH",
|
||||
.IdentificationNumber = "AT U76165837",
|
||||
.Address = "Suben 100, 4975 Suben",
|
||||
.Telephone = "00437711277719",
|
||||
.Email = "juricevic@verag.ag",
|
||||
.CountryISOCode = "AT",
|
||||
.IdentificationType = "NVAT"
|
||||
},
|
||||
.BankAccount = New BankAccount_ With {
|
||||
.CurrencyISO = USTV_ANTRAG.UStVAn_Währungscode,
|
||||
.OwnerType = "representative",
|
||||
.OwnerName = BANK_OWNER,
|
||||
.IBAN = BANK_IBAN,
|
||||
.BIC = BANK_BIC
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Dim counter As Integer = 1
|
||||
Dim counter As Integer = 1
|
||||
|
||||
Dim nummerierung As Boolean = False
|
||||
Dim nummerierung As Boolean = False
|
||||
Dim PDFExport As Boolean = False
|
||||
|
||||
Select Case MsgBox("Soll eine Nummerierung auf den PDF Dokumenten angegeben werden?", vbYesNoCancel)
|
||||
Case vbYes : nummerierung = True
|
||||
Case vbNo : nummerierung = False
|
||||
Case Else : Return False
|
||||
End Select
|
||||
Select Case MsgBox("Sollen die PDF-Daten in die XML eingebettet werden (wenn der Import zu lange dauert oder ein Fehler auftritt, dann sollte ohne PDF export werden) ?", vbYesNoCancel)
|
||||
Case vbYes : PDFExport = True
|
||||
Case vbNo : PDFExport = False
|
||||
Case Else : Return False
|
||||
End Select
|
||||
|
||||
|
||||
|
||||
For Each row As DataGridViewRow In dgvUSTVPositionen.SelectedRows.Cast(Of DataGridViewRow)().OrderBy(Function(dgvr) dgvr.Index)
|
||||
|
||||
Dim UIDNrLeistender = ""
|
||||
Dim LeistenderName As String = ""
|
||||
|
||||
Dim maut As Boolean = False
|
||||
Dim diesel As Boolean = False
|
||||
Dim parkplatz As Boolean = False
|
||||
Dim zubeh As Boolean = False
|
||||
Dim uebernachtung As Boolean = False
|
||||
|
||||
|
||||
If Not IsDBNull(row.Cells("UstV_Leistender_UstNr").Value) AndAlso row.Cells("UstV_Leistender_UstNr").Value IsNot Nothing AndAlso row.Cells("UstV_Leistender_UstNr").Value <> "" IsNot Nothing Then
|
||||
UIDNrLeistender = row.Cells("UstV_Leistender_UstNr").Value
|
||||
UIDNrLeistender = UIDNrLeistender.ToString.Replace(Antrag_LandKz, "")
|
||||
End If
|
||||
|
||||
LeistenderName = row.Cells("UStVPo_Leistender").Value
|
||||
LeistenderName = LeistenderName.ToString.Replace(Antrag_LandKz, "")
|
||||
|
||||
Dim Nettobetrag As Double = 0
|
||||
If Not IsDBNull(row.Cells("UStVPo_Nettobetrag").Value) AndAlso IsNumeric(row.Cells("UStVPo_Nettobetrag").Value) Then Nettobetrag = CDbl(row.Cells("UStVPo_Nettobetrag").Value)
|
||||
|
||||
If Not IsDBNull(row.Cells("UStVPo_Leistungsbezeichnung").Value) AndAlso row.Cells("UStVPo_Leistungsbezeichnung").Value IsNot Nothing Then
|
||||
|
||||
Dim Bez As String = row.Cells("UStVPo_Leistungsbezeichnung").Value
|
||||
Bez = Bez.ToLower
|
||||
|
||||
If row.Cells("UStVPo_SchnittstellenNr").Value = 10 Then
|
||||
'UTA überspringen
|
||||
ElseIf row.Cells("UStVPo_SchnittstellenNr").Value = 9 Then
|
||||
maut = True 'MSE immer MAUT
|
||||
Else
|
||||
|
||||
Dim code As String = ""
|
||||
If Bez.Contains("maut") Or Bez.Contains("toll") Then maut = True
|
||||
If Bez.Contains("diesel") Or Bez.Contains("fuel") Then diesel = True
|
||||
If Bez.Contains("parkplatz") Then parkplatz = True
|
||||
If Bez.Contains("zubeh") Then zubeh = True
|
||||
If Bez.Contains("übern") Then uebernachtung = True
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Dim p As New Purchase_
|
||||
p.Sequence = counter
|
||||
p.SimplifiedInvoice = False
|
||||
p.ReferenceNumber = row.Cells("UStVPo_ReNr").Value
|
||||
p.IssuingDate = CDate(row.Cells("UStVPo_ReDat").Value).ToString("yyyy-MM-dd")
|
||||
|
||||
p.TransactionDescription = New TransactionDescription_ With {
|
||||
.TaxableAmount = New MoneyAmount_ With {
|
||||
.Amount = row.Cells("UStVPo_USteuerbetrag").Value.ToString.Replace(",", "."),
|
||||
.CurrencyISO = "EUR"
|
||||
},
|
||||
.VATAmount = New MoneyAmount_ With {
|
||||
.Amount = row.Cells("UStVPo_USteuerbetrag").Value.ToString.Replace(",", "."),
|
||||
.CurrencyISO = "EUR"
|
||||
}
|
||||
}
|
||||
|
||||
p.Deduction = New Deduction_ With {
|
||||
.DeductibleAmount = New MoneyAmount_ With {
|
||||
.Amount = row.Cells("UStVPo_USteuerbetrag").Value.ToString.Replace(",", "."),
|
||||
.CurrencyISO = "EUR"
|
||||
}
|
||||
}
|
||||
Select Case MsgBox("Soll eine Nummerierung auf den PDF Dokumenten angegeben werden?", vbYesNoCancel)
|
||||
Case vbYes : nummerierung = True
|
||||
Case vbNo : nummerierung = False
|
||||
Case Else : Return False
|
||||
End Select
|
||||
|
||||
|
||||
|
||||
|
||||
If diesel Then
|
||||
p.GoodsDescription = New GoodsDescription_ With {.Code = "1.1.2"}
|
||||
End If
|
||||
|
||||
If maut Then
|
||||
p.GoodsDescription = New GoodsDescription_ With {.Code = "4.1"}
|
||||
End If
|
||||
|
||||
If zubeh Then
|
||||
p.GoodsDescription = New GoodsDescription_ With {.Code = "3.1.5"}
|
||||
End If
|
||||
|
||||
If parkplatz Then
|
||||
p.GoodsDescription = New GoodsDescription_ With {.Code = "3.1.4"}
|
||||
End If
|
||||
|
||||
If uebernachtung Then
|
||||
p.GoodsDescription = New GoodsDescription_ With {.Code = "6.5"}
|
||||
End If
|
||||
|
||||
|
||||
p.EUSupplier = New EUSupplier_ With {
|
||||
.NameFree = LeistenderName,
|
||||
.AddressFree = row.Cells("UstV_Leistender_Strasse").Value & " " & row.Cells("UstV_Leistender_Land").Value & " " & row.Cells("UstV_Leistender_PLZ").Value & " " & row.Cells("UstV_Leistender_Stadt").Value,
|
||||
.CountryISOCode = Antrag_LandKz,
|
||||
.VATId = UIDNrLeistender
|
||||
}
|
||||
|
||||
app.RefundRequest = New RefundRequest_ With {
|
||||
.RefundMemberState = Antrag_LandKz,
|
||||
.State = "N"
|
||||
}
|
||||
.RefundMemberState = Antrag_LandKz,
|
||||
.State = "N"
|
||||
}
|
||||
|
||||
|
||||
app.RefundRequest.PurchaseInformation.Add(p)
|
||||
For Each row As DataGridViewRow In dgvUSTVPositionen.SelectedRows.Cast(Of DataGridViewRow)().OrderBy(Function(dgvr) dgvr.Index)
|
||||
|
||||
Dim UIDNrLeistender = ""
|
||||
Dim LeistenderName As String = ""
|
||||
|
||||
Dim maut As Boolean = False
|
||||
Dim diesel As Boolean = False
|
||||
Dim parkplatz As Boolean = False
|
||||
Dim zubeh As Boolean = False
|
||||
Dim uebernachtung As Boolean = False
|
||||
|
||||
|
||||
|
||||
Dim pdf As String = ""
|
||||
|
||||
pdf = func.getPDF(row.Cells("UStVPo_SchnittstellenNr").Value, row.Cells("UStVPo_ReNr").Value, row.Cells("UStVPo_ReDat").Value, row.Cells("UStVPo_daId").Value, IIf(nummerierung, row.Cells("UStVPo_ID").Value, -1), True, Antrag_LandKz, USTV_ANTRAG, New cFakturierung, False)
|
||||
|
||||
If pdf <> "" Then
|
||||
Dim dc As New DocumentCopy_
|
||||
|
||||
Dim pdfName As New FileInfo(pdf)
|
||||
dc.FileType = pdfName.Extension.ToString.Replace(".", "")
|
||||
dc.Description = "Invoice"
|
||||
dc.FileName = pdfName.Name
|
||||
|
||||
Dim bd As New Chilkat.BinData
|
||||
If bd.LoadFile(pdf) Then
|
||||
dc.Base64Content = bd.GetEncoded("base64")
|
||||
If Not IsDBNull(row.Cells("UstV_Leistender_UstNr").Value) AndAlso row.Cells("UstV_Leistender_UstNr").Value IsNot Nothing AndAlso row.Cells("UstV_Leistender_UstNr").Value <> "" IsNot Nothing Then
|
||||
UIDNrLeistender = row.Cells("UstV_Leistender_UstNr").Value
|
||||
UIDNrLeistender = UIDNrLeistender.ToString.Replace(Antrag_LandKz, "")
|
||||
End If
|
||||
|
||||
app.RefundRequest.DocumentCopy.Add(dc)
|
||||
LeistenderName = row.Cells("UStVPo_Leistender").Value
|
||||
LeistenderName = LeistenderName.ToString.Replace(Antrag_LandKz, "")
|
||||
|
||||
End If
|
||||
|
||||
|
||||
Dim Nettobetrag As Double = 0
|
||||
If Not IsDBNull(row.Cells("UStVPo_Nettobetrag").Value) AndAlso IsNumeric(row.Cells("UStVPo_Nettobetrag").Value) Then Nettobetrag = CDbl(row.Cells("UStVPo_Nettobetrag").Value)
|
||||
|
||||
If Not IsDBNull(row.Cells("UStVPo_Leistungsbezeichnung").Value) AndAlso row.Cells("UStVPo_Leistungsbezeichnung").Value IsNot Nothing Then
|
||||
|
||||
Dim Bez As String = row.Cells("UStVPo_Leistungsbezeichnung").Value
|
||||
Bez = Bez.ToLower
|
||||
|
||||
If row.Cells("UStVPo_SchnittstellenNr").Value = 10 Then
|
||||
'UTA überspringen
|
||||
ElseIf row.Cells("UStVPo_SchnittstellenNr").Value = 9 Then
|
||||
maut = True 'MSE immer MAUT
|
||||
Else
|
||||
|
||||
Dim code As String = ""
|
||||
If Bez.Contains("maut") Or Bez.Contains("toll") Then maut = True
|
||||
If Bez.Contains("diesel") Or Bez.Contains("fuel") Then diesel = True
|
||||
If Bez.Contains("parkplatz") Then parkplatz = True
|
||||
If Bez.Contains("zubeh") Then zubeh = True
|
||||
If Bez.Contains("übern") Then uebernachtung = True
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
Dim p As New Purchase_
|
||||
p.Sequence = counter
|
||||
p.SimplifiedInvoice = False
|
||||
p.ReferenceNumber = row.Cells("UStVPo_ReNr").Value
|
||||
p.IssuingDate = CDate(row.Cells("UStVPo_ReDat").Value).ToString("yyyy-MM-dd")
|
||||
|
||||
p.TransactionDescription = New TransactionDescription_ With {
|
||||
.TaxableAmount = New MoneyAmount_ With {
|
||||
.Amount = Math.Round(Nettobetrag, 2),
|
||||
.CurrencyISO = USTV_ANTRAG.UStVAn_Währungscode
|
||||
},
|
||||
.VATAmount = New MoneyAmount_ With {
|
||||
.Amount = Math.Round(row.Cells("UStVPo_USteuerbetrag").Value, 2),
|
||||
.CurrencyISO = USTV_ANTRAG.UStVAn_Währungscode
|
||||
}
|
||||
}
|
||||
|
||||
p.Deduction = New Deduction_ With {
|
||||
.DeductibleAmount = New MoneyAmount_ With {
|
||||
.Amount = Math.Round(row.Cells("UStVPo_USteuerbetrag").Value, 2),
|
||||
.CurrencyISO = USTV_ANTRAG.UStVAn_Währungscode
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
counter = +1
|
||||
If diesel Then
|
||||
p.GoodsDescription = New GoodsDescription_ With {.Code = "1.1.2"}
|
||||
End If
|
||||
|
||||
Next
|
||||
If maut Then
|
||||
p.GoodsDescription = New GoodsDescription_ With {.Code = "4.1"}
|
||||
End If
|
||||
|
||||
' =========================
|
||||
' 5️⃣ XML erzeugen
|
||||
' =========================
|
||||
Dim xml As Chilkat.Xml = app.ToXml()
|
||||
Dim xmlString As String = xml.GetXml()
|
||||
Console.WriteLine(xmlString)
|
||||
System.IO.File.WriteAllText(filePath, xmlString)
|
||||
If zubeh Then
|
||||
p.GoodsDescription = New GoodsDescription_ With {.Code = "3.1.5"}
|
||||
End If
|
||||
|
||||
If parkplatz Then
|
||||
p.GoodsDescription = New GoodsDescription_ With {.Code = "3.1.4"}
|
||||
End If
|
||||
|
||||
If uebernachtung Then
|
||||
p.GoodsDescription = New GoodsDescription_ With {.Code = "6.5"}
|
||||
End If
|
||||
|
||||
If Not (uebernachtung And parkplatz And zubeh And maut And diesel) Then
|
||||
p.GoodsDescription = New GoodsDescription_ With {.Code = "1.1.2"}
|
||||
End If
|
||||
|
||||
|
||||
Dim UstV_Leistender_Strasse = ""
|
||||
If Not IsDBNull(row.Cells("UstV_Leistender_Strasse").Value) AndAlso row.Cells("UstV_Leistender_Strasse").Value IsNot Nothing Then UstV_Leistender_Strasse = row.Cells("UstV_Leistender_Strasse").Value
|
||||
|
||||
Dim UstV_Leistender_Land = ""
|
||||
If Not IsDBNull(row.Cells("UstV_Leistender_Land").Value) AndAlso row.Cells("UstV_Leistender_Land").Value IsNot Nothing Then UstV_Leistender_Land = row.Cells("UstV_Leistender_Land").Value
|
||||
|
||||
|
||||
Dim UstV_Leistender_Stadt = ""
|
||||
If Not IsDBNull(row.Cells("UstV_Leistender_Stadt").Value) AndAlso row.Cells("UstV_Leistender_Stadt").Value IsNot Nothing Then UstV_Leistender_Stadt = row.Cells("UstV_Leistender_Stadt").Value
|
||||
|
||||
Dim UstV_Leistender_PLZ = ""
|
||||
If Not IsDBNull(row.Cells("UstV_Leistender_PLZ").Value) AndAlso row.Cells("UstV_Leistender_PLZ").Value IsNot Nothing Then UstV_Leistender_PLZ = row.Cells("UstV_Leistender_PLZ").Value
|
||||
|
||||
p.EUSupplier = New EUSupplier_ With {
|
||||
.NameFree = LeistenderName,
|
||||
.AddressFree = UstV_Leistender_Strasse & " " & UstV_Leistender_Land & " " & UstV_Leistender_PLZ & " " & UstV_Leistender_Stadt,
|
||||
.CountryISOCode = Antrag_LandKz,
|
||||
.VATId = UIDNrLeistender
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
app.RefundRequest.PurchaseInformation.Add(p)
|
||||
|
||||
|
||||
|
||||
Dim pdf As String = ""
|
||||
If PDFExport Then
|
||||
pdf = func.getPDF(row.Cells("UStVPo_SchnittstellenNr").Value, row.Cells("UStVPo_ReNr").Value, row.Cells("UStVPo_ReDat").Value, row.Cells("UStVPo_daId").Value, IIf(nummerierung, row.Cells("UStVPo_ID").Value, -1), True, Antrag_LandKz, USTV_ANTRAG, New cFakturierung, False)
|
||||
End If
|
||||
|
||||
|
||||
If pdf <> "" Then
|
||||
Dim dc As New DocumentCopy_
|
||||
dc.Description = row.Cells("UStVPo_ReNr").Value
|
||||
|
||||
Dim pdfName As New FileInfo(pdf)
|
||||
dc.FileType = pdfName.Extension.ToUpper.ToString.Replace(".", "")
|
||||
dc.FileName = pdfName.Name
|
||||
|
||||
Dim bd As New Chilkat.BinData
|
||||
If bd.LoadFile(pdf) Then
|
||||
dc.Base64Content = bd.GetEncoded("base64")
|
||||
dc.Base64Content = dc.Base64Content.Replace(vbCr, "").Replace(vbLf, "").Replace(" ", "")
|
||||
End If
|
||||
app.RefundRequest.DocumentCopy.Add(dc)
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
counter += 1
|
||||
|
||||
Next
|
||||
|
||||
' =========================
|
||||
' 5️⃣ XML erzeugen
|
||||
' =========================
|
||||
Dim xml As Chilkat.Xml = app.ToXml()
|
||||
Dim xmlString As String = xml.GetXml()
|
||||
Console.WriteLine(xmlString)
|
||||
System.IO.File.WriteAllText(filePath, xmlString)
|
||||
|
||||
Catch ex As Exception
|
||||
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
|
||||
End Try
|
||||
|
||||
End Function
|
||||
|
||||
@@ -4783,6 +4831,7 @@ Public Class frmMDM_USTVAntrag
|
||||
|
||||
|
||||
Dim counter As Integer = 1
|
||||
Dim counterLeistungen As Integer = 1
|
||||
|
||||
For Each row As DataGridViewRow In dgvUSTVPositionen.SelectedRows.Cast(Of DataGridViewRow)().OrderBy(Function(dgvr) dgvr.Index)
|
||||
|
||||
@@ -4798,7 +4847,7 @@ Public Class frmMDM_USTVAntrag
|
||||
|
||||
If Not IsDBNull(row.Cells("UstV_Leistender_UstNr").Value) AndAlso row.Cells("UstV_Leistender_UstNr").Value IsNot Nothing AndAlso row.Cells("UstV_Leistender_UstNr").Value <> "" IsNot Nothing Then
|
||||
UIDNrLeistender = row.Cells("UstV_Leistender_UstNr").Value
|
||||
UIDNrLeistender = UIDNrLeistender.ToString.Replace(Antrag_LandKz, "")
|
||||
'UIDNrLeistender = UIDNrLeistender.ToString.Replace(Antrag_LandKz, "") DEU wollen das Land dabei!
|
||||
End If
|
||||
|
||||
LeistenderName = row.Cells("UStVPo_Leistender").Value
|
||||
@@ -4808,7 +4857,7 @@ Public Class frmMDM_USTVAntrag
|
||||
If Not IsDBNull(row.Cells("UStVPo_Nettobetrag").Value) AndAlso IsNumeric(row.Cells("UStVPo_Nettobetrag").Value) Then Nettobetrag = CDbl(row.Cells("UStVPo_Nettobetrag").Value)
|
||||
|
||||
Dim Steuerbetrag As Double = 0
|
||||
If Not IsDBNull(row.Cells("UStVPo_USteuerbetragEUR").Value) AndAlso IsNumeric(row.Cells("UStVPo_USteuerbetragEUR").Value) Then Steuerbetrag = CDbl(row.Cells("UStVPo_USteuerbetragEUR").Value)
|
||||
If Not IsDBNull(row.Cells("UStVPo_USteuerbetrag").Value) AndAlso IsNumeric(row.Cells("UStVPo_USteuerbetrag").Value) Then Steuerbetrag = CDbl(row.Cells("UStVPo_USteuerbetrag").Value)
|
||||
|
||||
Dim land = row.Cells("UstV_Leistender_Land").Value
|
||||
Dim iso2Land = ""
|
||||
@@ -4859,26 +4908,36 @@ Public Class frmMDM_USTVAntrag
|
||||
If Bez.Contains("übern") Then uebernachtung = True
|
||||
End If
|
||||
|
||||
Blatt.Range("A" & counter + 1).Value = counter
|
||||
|
||||
|
||||
If diesel Then
|
||||
Blatt.Range("B" & counter + 1).Value = "1.1.2"
|
||||
Blatt.Range("A" & counterLeistungen + 1).Value = counter
|
||||
Blatt.Range("B" & counterLeistungen + 1).Value = "1.1.2"
|
||||
counterLeistungen += 1
|
||||
End If
|
||||
|
||||
If maut Then
|
||||
Blatt.Range("B" & counter + 1).Value = "4.1"
|
||||
Blatt.Range("A" & counterLeistungen + 1).Value = counter
|
||||
Blatt.Range("B" & counterLeistungen + 1).Value = "4.1"
|
||||
counterLeistungen += 1
|
||||
End If
|
||||
|
||||
If zubeh Then
|
||||
Blatt.Range("B" & counter + 1).Value = "3.1.3"
|
||||
Blatt.Range("A" & counterLeistungen + 1).Value = counter
|
||||
Blatt.Range("B" & counterLeistungen + 1).Value = "3.1.3"
|
||||
counterLeistungen += 1
|
||||
End If
|
||||
|
||||
If parkplatz Then
|
||||
Blatt.Range("B" & counter + 1).Value = "3.1.4"
|
||||
Blatt.Range("A" & counterLeistungen + 1).Value = counter
|
||||
Blatt.Range("B" & counterLeistungen + 1).Value = "3.1.4"
|
||||
counterLeistungen += 1
|
||||
End If
|
||||
|
||||
If uebernachtung Then
|
||||
Blatt.Range("B" & counter + 1).Value = "6.1"
|
||||
Blatt.Range("A" & counterLeistungen + 1).Value = counter
|
||||
Blatt.Range("B" & counterLeistungen + 1).Value = "6.1"
|
||||
counterLeistungen += 1
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user