Mailversand, FIskaltrust, ustva, etc.

This commit is contained in:
2026-06-22 17:42:05 +02:00
parent 123f06f3b1
commit 22fd208b55
14 changed files with 1414 additions and 383 deletions

View File

@@ -542,6 +542,17 @@ Public Class cFiskaltrustClient
Throw New Exception("Unsupported country") Throw New Exception("Unsupported country")
End Select End Select
ElseIf type = "storno" Then
Select Case _country
Case "DE"
Return "/json/v1/Sign"
Case "AT"
Return "/json/Sign"
Case Else
Throw New Exception("Unsupported country")
End Select
End If End If

View File

@@ -2,8 +2,67 @@
Imports System.Data.SqlClient Imports System.Data.SqlClient
Imports System.Reflection Imports System.Reflection
Imports Chilkat Imports Chilkat
Imports GrapeCity.DataVisualization.Chart
Imports Newtonsoft.Json Imports Newtonsoft.Json
Public Class FtReceiptCases
' Normaler Verkauf
Public Const PosReceipt As Long = &H4445000000000001L
' Test-/Nullbeleg
Public Const ZeroReceipt As Long = &H4445000000000002L
Public Const InitialOperation As Long = &H4445000000000003L
Public Const OutOfOperation As Long = &H4445000000000004L
' Tagesabschluss (Z-Bericht)
Public Const MonthlyClosing As Long = &H4445000000000005L
Public Const YearlyClosing As Long = &H4445000000000006L
Public Const DailyClosing As Long = &H4445000000000007L
' Flags
Public Const ImplicitTransaction As Long = &H100000000L
Public Const ReversalReceipt As Long = &H40000L
Public Const TrainingReceipt As Long = &H20000L
End Class
Public Class FtChargeItemCase
Public Const RevenueNormal As Long = &H4445000000000001L ' 19 %
Public Const RevenueReduced As Long = &H4445000000000002L ' 7 %
Public Const RevenueTaxFree As Long = &H4445000000000005L ' 0 %
End Class
Public Class FtJournalType
Public Const VersionInformation As Integer = 0
Public Const ActionJournal As Integer = 1
Public Const ReceiptJournal As Integer = 2
Public Const QueueItemJournal As Integer = 3
End Class
Public Class FtPayItemCases
' Barzahlung
Public Const Cash As Long = &H4445000000000001L
' EC-/Girokarte
Public Const DebitCard As Long = &H4445000000000004L
' Kreditkarte
Public Const CreditCard As Long = &H4445000000000005L
' Online-Zahlung (PayPal, Klarna, etc.)
Public Const OnlinePayment As Long = &H4445000000000006L
' Gutschein
Public Const Voucher As Long = &H444500000000000DL
End Class
Public Class cFiskaltrustClient_chilkat Public Class cFiskaltrustClient_chilkat
@@ -21,9 +80,10 @@ Public Class cFiskaltrustClient_chilkat
Public Function SignReceipt(amount As Decimal, vat As Decimal, POS As List(Of EABelegPositionen), kindOfPayment As String, posSystemId As String) As String Public Function SignReceipt(amount As Decimal, vat As Decimal, POS As List(Of EABelegPositionen), kindOfPayment As String, posSystemId As String) As String
Dim payload As JsonObject = BuildPayloadReceipt(amount, vat, POS, kindOfPayment, posSystemId) Dim payload As JsonObject = BuildPayloadReceipt(amount, vat, POS, kindOfPayment, posSystemId, "Verkauf", "")
Return SendChilkat(GetEndpoint("payment"), payload.Emit()) Return SendChilkat(GetEndpoint("payment"), payload.Emit())
End Function End Function
Public Function SignReceipt_test(posSystemId As String) As String Public Function SignReceipt_test(posSystemId As String) As String
@@ -48,18 +108,55 @@ Public Class cFiskaltrustClient_chilkat
Dim POS = LIST Dim POS = LIST
Dim kindOfPayment = "Cash" Dim kindOfPayment = "Cash"
Dim payload As JsonObject = BuildPayloadReceipt(amount, vat, POS, kindOfPayment, posSystemId) Dim payload As JsonObject = BuildPayloadReceipt(amount, vat, POS, kindOfPayment, posSystemId, "Verkauf", "")
Return SendChilkat(GetEndpoint("payment"), payload.Emit()) Return SendChilkat(GetEndpoint("payment"), payload.Emit())
End Function End Function
Public Function ChancelReceipt(reference As String, amount As Decimal, vat As Decimal, POS As List(Of EABelegPositionen), kindOfPayment As String, posSystemId As String) As String
Dim payload As JsonObject = BuildPayloadReceipt(amount, vat, POS, kindOfPayment, posSystemId, "Storno", reference)
Return SendChilkat(GetEndpoint("storno"), payload.Emit())
End Function
Public Function ChancelReceipt_test(reference As String, posSystemId As String) As String
Dim LIST = New List(Of EABelegPositionen)
Dim p = New EABelegPositionen
p.Mandant = "VERA"
p.Niederlassung = "SUB"
p.Benutzer = 74
p.BelegDat = Now
p.BelegNr = 1
p.PreislistenNr = 1
p.PreislistenPos = 1
p.LeistungsNr = 300
p.LeistungsBez = "TEST"
p.Preis = 10
p.Anzahl = 1
LIST.Add(p)
Dim amount = 100
Dim vat = 0
Dim POS = LIST
Dim kindOfPayment = "Cash"
Dim payload As JsonObject = BuildPayloadReceipt(amount, vat, POS, kindOfPayment, posSystemId, "Storno", reference)
Return SendChilkat(GetEndpoint("storno"), payload.Emit())
End Function
Public Function SignNullReceipt(posSystemId As String) As String Public Function SignNullReceipt(posSystemId As String) As String
Return SendChilkat(GetEndpoint("payment"), BuildPayloadNullReceipt(posSystemId, _country).Emit()) Return SendChilkat(GetEndpoint("payment"), BuildPayloadNullReceipt(posSystemId, _country).Emit())
End Function End Function
Public Function SignClosingReceipt(receiptType As String, posSystemId As String) As String Public Function SignClosingReceipt(receiptType As String, posSystemId As String, kind As String) As String
Return SendChilkat(GetEndpoint("payment"), BuildPayloadClosingReceipt(receiptType, posSystemId).Emit()) Return SendChilkat(GetEndpoint("payment"), BuildPayloadClosingReceipt(receiptType, posSystemId, kind).Emit())
End Function End Function
Public Function Echo(kassenName As String) As String Public Function Echo(kassenName As String) As String
@@ -71,13 +168,13 @@ Public Class cFiskaltrustClient_chilkat
End Function End Function
Public Function Journal(Optional typ As String = "") As String Public Function Journal(ftJournalType As Integer) As String
Dim endpoint = GetEndpoint("journal") Dim endpoint = GetEndpoint("journal")
If typ <> "" Then endpoint &= "?type=" & typ endpoint &= "?type=" & ftJournalType
Return SendChilkat(endpoint, "", True) Return SendChilkat(endpoint, "")
End Function End Function
Private Function SendChilkat(endpoint As String, payload As String, Optional isGet As Boolean = False) As String Private Function SendChilkat(endpoint As String, payload As String, Optional isGet As Boolean = False) As String
@@ -144,16 +241,36 @@ Public Class cFiskaltrustClient_chilkat
End Function End Function
Private Function BuildPayloadReceipt(amount As Decimal, vat As Decimal, POS As List(Of EABelegPositionen), kindOfPayment As String, posSystemId As String) As JsonObject Private Function BuildPayloadReceipt(amount As Decimal, vat As Decimal, POS As List(Of EABelegPositionen), kindOfPayment As String, posSystemId As String, _receiptCase As String, _reference As String) As JsonObject
Dim json As New JsonObject() Dim json As New JsonObject()
json.UpdateString("ftCashBoxID", _cashboxId) json.UpdateString("ftCashBoxID", _cashboxId)
json.UpdateString("ftPosSystemId", getVersion(posSystemId)) json.UpdateString("ftPosSystemId", getVersion(posSystemId))
json.UpdateString("cbTerminalID", posSystemId) json.UpdateString("cbTerminalID", posSystemId)
If _reference <> "" Then
json.UpdateString("cbReceiptReference", _reference)
Else
json.UpdateString("cbReceiptReference", Guid.NewGuid().ToString()) json.UpdateString("cbReceiptReference", Guid.NewGuid().ToString())
End If
json.UpdateString("cbReceiptMoment", DateTime.UtcNow.ToString("o")) json.UpdateString("cbReceiptMoment", DateTime.UtcNow.ToString("o"))
json.UpdateString("ftReceiptCase", 4919338172267102209)
Dim receipCase As Long
Select Case _receiptCase
Case "Storno"
receipCase = FtReceiptCases.PosReceipt Or FtReceiptCases.ReversalReceipt Or FtReceiptCases.ImplicitTransaction 'Storno
Case Else
receipCase = FtReceiptCases.PosReceipt Or FtReceiptCases.ImplicitTransaction 'Verkauf
End Select
json.UpdateString("ftReceiptCase", receipCase)
Dim chargeItems = json.AppendArray("cbChargeItems") Dim chargeItems = json.AppendArray("cbChargeItems")
@@ -165,7 +282,25 @@ Public Class cFiskaltrustClient_chilkat
item.UpdateNumber("Amount", p.Preis.ToString().Replace(",", ".")) item.UpdateNumber("Amount", p.Preis.ToString().Replace(",", "."))
item.UpdateNumber("VATRate", vat.ToString().Replace(",", ".")) item.UpdateNumber("VATRate", vat.ToString().Replace(",", "."))
item.UpdateString("Description", p.LeistungsBez) item.UpdateString("Description", p.LeistungsBez)
item.UpdateString("ftChargeItemCase", 4919338167972134929)
Dim ChargeItemCase As Long
Select Case vat
Case 19D
ChargeItemCase = FtChargeItemCase.RevenueNormal
Case 7D
ChargeItemCase = FtChargeItemCase.RevenueReduced
Case 0D
ChargeItemCase = FtChargeItemCase.RevenueTaxFree
Case Else
Throw New Exception("Unbekannter Steuersatz")
End Select
item.UpdateString("ftChargeItemCase", ChargeItemCase)
End If End If
@@ -177,7 +312,14 @@ Public Class cFiskaltrustClient_chilkat
pay.UpdateInt("Quantity", 1) pay.UpdateInt("Quantity", 1)
pay.UpdateNumber("Amount", amount.ToString().Replace(",", ".")) pay.UpdateNumber("Amount", amount.ToString().Replace(",", "."))
pay.UpdateString("Description", kindOfPayment) pay.UpdateString("Description", kindOfPayment)
pay.UpdateString("ftPayItemCase", 4919338167972134913)
Select Case kindOfPayment
Case "Cash"
pay.UpdateString("ftPayItemCase", FtPayItemCases.Cash)
Case "Card"
pay.UpdateString("ftPayItemCase", FtPayItemCases.DebitCard)
End Select
Return json Return json
@@ -191,17 +333,86 @@ Public Class cFiskaltrustClient_chilkat
json.UpdateString("ftPosSystemId", getVersion(posSystemId)) json.UpdateString("ftPosSystemId", getVersion(posSystemId))
json.UpdateString("cbTerminalID", posSystemId) json.UpdateString("cbTerminalID", posSystemId)
json.UpdateString("cbReceiptMoment", DateTime.UtcNow.ToString("o")) json.UpdateString("cbReceiptMoment", DateTime.UtcNow.ToString("o"))
json.UpdateString("ftReceiptCase", (FtReceiptCases.ZeroReceipt Or FtReceiptCases.ImplicitTransaction).ToString())
json.UpdateString("cbReceiptReference", "ZeroReceiptAfterFailure")
Dim chargeItems = json.AppendArray("cbChargeItems")
Dim payItems = json.AppendArray("cbPayItems")
Return json Return json
End Function End Function
Private Function BuildPayloadClosingReceipt(receiptType As String, posSystemId As String) As JsonObject Private Function BuildPayloadInitialOperationReceipt(posSystemId As String, country As String) As JsonObject
Dim json As New JsonObject() Dim json As New JsonObject()
json.UpdateString("ftCashBoxID", _cashboxId) json.UpdateString("ftCashBoxID", _cashboxId)
json.UpdateString("ftPosSystemId", getVersion(posSystemId)) json.UpdateString("ftPosSystemId", getVersion(posSystemId))
json.UpdateString("cbTerminalID", posSystemId) json.UpdateString("cbTerminalID", posSystemId)
json.UpdateString("cbReceiptMoment", DateTime.UtcNow.ToString("o"))
json.UpdateString("ftReceiptCase", (FtReceiptCases.InitialOperation).ToString())
json.UpdateString("cbReceiptReference", "INIT")
json.UpdateString("cbUser", "Admin")
json.UpdateString("ftReceiptCaseData", "")
Dim chargeItems = json.AppendArray("cbChargeItems")
Dim payItems = json.AppendArray("cbPayItems")
Return json
End Function
Private Function BuildPayloadOutOfOperationReceipt(posSystemId As String, country As String) As JsonObject
Dim json As New JsonObject()
json.UpdateString("ftCashBoxID", _cashboxId)
json.UpdateString("ftPosSystemId", getVersion(posSystemId))
json.UpdateString("cbTerminalID", posSystemId)
json.UpdateString("cbReceiptMoment", DateTime.UtcNow.ToString("o"))
json.UpdateString("ftReceiptCase", (FtReceiptCases.OutOfOperation).ToString())
json.UpdateString("cbReceiptReference", "OutOfOperation")
json.UpdateString("cbUser", "Admin")
json.UpdateString("ftReceiptCaseData", "")
Dim chargeItems = json.AppendArray("cbChargeItems")
Dim payItems = json.AppendArray("cbPayItems")
Return json
End Function
Private Function BuildPayloadClosingReceipt(receiptType As String, posSystemId As String, kind As String) As JsonObject
Dim json As New JsonObject()
json.UpdateString("ftCashBoxID", _cashboxId)
json.UpdateString("ftPosSystemId", getVersion(posSystemId))
json.UpdateString("cbTerminalID", posSystemId)
json.UpdateString("cbReceiptMoment", DateTime.UtcNow.ToString("o"))
Dim chargeItems = json.AppendArray("cbChargeItems")
Dim payItems = json.AppendArray("cbPayItems")
Select Case kind
Case "yearly"
json.UpdateString("cbReceiptReference", "yearly-closing-" & DateTime.UtcNow.ToString("o"))
json.UpdateString("ftReceiptCase", (FtReceiptCases.YearlyClosing Or FtReceiptCases.ImplicitTransaction).ToString())
Case "monthly"
json.UpdateString("cbReceiptReference", "monthly-closing-" & DateTime.UtcNow.ToString("o"))
json.UpdateString("ftReceiptCase", (FtReceiptCases.MonthlyClosing Or FtReceiptCases.ImplicitTransaction).ToString())
Case Else 'daily
json.UpdateString("cbReceiptReference", "daily-closing-" & DateTime.UtcNow.ToString("o"))
json.UpdateString("ftReceiptCase", (FtReceiptCases.DailyClosing Or FtReceiptCases.ImplicitTransaction).ToString())
End Select
Return json Return json
End Function End Function
@@ -231,6 +442,14 @@ Public Class cFiskaltrustClient_chilkat
Case "AT" : Return "/json/Journal" Case "AT" : Return "/json/Journal"
End Select End Select
Case "storno"
Select Case _country
Case "DE" : Return "/json/v1/Sign"
Case "AT" : Return "/json/Sign"
End Select
End Select End Select
Throw New Exception("Unsupported country") Throw New Exception("Unsupported country")
@@ -398,5 +617,19 @@ Public Class cFiskaltrustClient_chilkat
Console.WriteLine(message) Console.WriteLine(message)
End Sub End Sub
Public Function PrettyPrintJson(jsonText As String) As String
Dim json As New Chilkat.JsonObject()
If Not json.Load(jsonText) Then
Return jsonText
End If
json.EmitCompact = False
Return json.Emit()
End Function
End Class End Class

View File

@@ -934,9 +934,6 @@ Public Class cAutomailversand
Private Function mergeSinglePDFDocuments(path As String, Filiale As Integer, Firma As Integer, isSR As Boolean) Private Function mergeSinglePDFDocuments(path As String, Filiale As Integer, Firma As Integer, isSR As Boolean)
Dim zusammenfassen As Boolean = False Dim zusammenfassen As Boolean = False
'True 'True
@@ -962,9 +959,8 @@ Public Class cAutomailversand
If Not isSR Then If Not isSR Then
Return True Return True
Else Else
'laut Marlene nichts zusammenfassen (außer CBAM)! Mail am 19.06.2026
'mit Marlene sprechen! If Not (path.ToString.ToLower.Contains("flyercbam")) Then
If Not (path.ToString.ToLower.Contains("flyercbam") OrElse Not (path.ToString.ToLower.Contains("sammelrechnung"))) Then
Return True Return True
End If End If
End If End If

View File

@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' übernehmen, indem Sie "*" eingeben: ' übernehmen, indem Sie "*" eingeben:
' <Assembly: AssemblyVersion("1.0.*")> ' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.5.5.4")> <Assembly: AssemblyVersion("1.5.5.5")>
<Assembly: AssemblyFileVersion("1.5.5.4")> <Assembly: AssemblyFileVersion("1.5.5.5")>

View File

@@ -2591,6 +2591,16 @@ Namespace My.Resources
End Get End Get
End Property End Property
'''<summary>
''' Sucht eine lokalisierte Ressource vom Typ System.Byte[].
'''</summary>
Friend ReadOnly Property Ustveu_Rechnungsanlagen_DE() As Byte()
Get
Dim obj As Object = ResourceManager.GetObject("Ustveu_Rechnungsanlagen_DE", resourceCulture)
Return CType(obj,Byte())
End Get
End Property
'''<summary> '''<summary>
''' Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap. ''' Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
'''</summary> '''</summary>

View File

@@ -991,4 +991,7 @@
<data name="auto_mailversand_small" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="auto_mailversand_small" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\auto_mailversand_small.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Resources\auto_mailversand_small.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<data name="Ustveu_Rechnungsanlagen_DE" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Ustveu-Rechnungsanlagen-DE.xls;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root> </root>

Binary file not shown.

View File

@@ -1412,7 +1412,8 @@
<Compile Include="mdm\PLOSE\rptPLOSE_Konsortium.vb"> <Compile Include="mdm\PLOSE\rptPLOSE_Konsortium.vb">
<SubType>Component</SubType> <SubType>Component</SubType>
</Compile> </Compile>
<Compile Include="USTV\VATRefund.vb" /> <Compile Include="USTV\VATRefund_HR.vb" />
<Compile Include="USTV\VATRefund_RO.vb" />
<Compile Include="USTV\usrCntlUSTV.Designer.vb"> <Compile Include="USTV\usrCntlUSTV.Designer.vb">
<DependentUpon>usrCntlUSTV.vb</DependentUpon> <DependentUpon>usrCntlUSTV.vb</DependentUpon>
</Compile> </Compile>
@@ -5063,6 +5064,7 @@
</None> </None>
<None Include="Resources\SR_EVOLOG.xlsx" /> <None Include="Resources\SR_EVOLOG.xlsx" />
<None Include="Resources\SR_TransFerry360.xlsx" /> <None Include="Resources\SR_TransFerry360.xlsx" />
<None Include="Resources\Ustveu-Rechnungsanlagen-DE.xls" />
<None Include="Resources\VERAG_CBAM_Report_Template.xlsx" /> <None Include="Resources\VERAG_CBAM_Report_Template.xlsx" />
<None Include="Resources\Zoll\EORI_UID.dotx"> <None Include="Resources\Zoll\EORI_UID.dotx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>

286
SDL/USTV/VATRefund_HR.vb Normal file
View File

@@ -0,0 +1,286 @@

Public Class GlobalVATRefundApplication_HR
Public Property Applicant As Applicant_
Public Property Representative As Representative_
Public Property RefundPeriod As RefundPeriod_
Public Property BankAccount As BankAccount_
Public Property RefundRequest As RefundRequest_
Public Function ToXml() As Chilkat.Xml
Dim xml As New Chilkat.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")
' 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|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)
' Representative
xml.UpdateChildContent("representative|nameFree",
Representative.Name)
xml.UpdateChildContent("representative|addressFree",
Representative.Address)
xml.UpdateChildContent("representative|telephone",
Representative.Telephone)
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)
' RefundPeriod
xml.UpdateChildContent("refundPeriod|fromDate",
RefundPeriod.FromDate)
xml.UpdateChildContent("refundPeriod|toDate",
RefundPeriod.ToDate)
' 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)
xml.UpdateChildContent("version",
DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ss.fffZ"))
' RefundRequest
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 & "|referenceNumber", p.ReferenceNumber)
xml.UpdateChildContent(path & "|issuingDate", p.IssuingDate)
xml.UpdateChildContent(path & "|transactionDescription|taxableAmount|amount",
p.TransactionDescription.TaxableAmount.Amount.ToString(Globalization.CultureInfo.InvariantCulture))
xml.UpdateChildContent(path & "|transactionDescription|taxableAmount|currency|currencyISO",
p.TransactionDescription.TaxableAmount.CurrencyISO)
xml.UpdateChildContent(path & "|transactionDescription|VATAmount|amount",
p.TransactionDescription.VATAmount.Amount.ToString(Globalization.CultureInfo.InvariantCulture))
xml.UpdateChildContent(path & "|transactionDescription|VATAmount|currency|currencyISO",
p.TransactionDescription.VATAmount.CurrencyISO)
xml.UpdateChildContent(path & "|deduction|deductibleAmount|amount",
p.Deduction.DeductibleAmount.Amount.ToString(Globalization.CultureInfo.InvariantCulture))
xml.UpdateChildContent(path & "|deduction|deductibleAmount|currency|currencyISO",
p.Deduction.DeductibleAmount.CurrencyISO)
xml.UpdateChildContent(path & "|goodsDescription|code",
p.GoodsDescription.Code)
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|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
For Each d In RefundRequest.DocumentCopy
Dim path = $"refundRequest|documentCopy[{idx}]"
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
Next
xml.UpdateChildContent("refundRequest|state", "N")
xml.UpdateChildContent("submittedLocale", "de")
Return xml
End Function
End Class
Public Class Applicant_
Public Property NameType As String
Public Property NameFree As String
Public Property AddressFree As String
Public Property Telephone As String
Public Property CountryISOCode As String
Public Property VATId As String
Public Property Email As String
End Class
Public Class Representative_
Public Property Name As String
Public Property Address As String
Public Property Telephone As String
Public Property CountryISOCode As String
Public Property IdentificationType As String
Public Property IdentificationNumber As String
Public Property Email As String
End Class
Public Class RefundPeriod_
Public Property FromDate As String
Public Property ToDate As String
End Class
Public Class BankAccount_
Public Property IBAN As String
Public Property BIC As String
Public Property OwnerName As String
Public Property OwnerType As String
Public Property CurrencyISO As String
End Class
Public Class Purchase_
Public Property Sequence As Integer
Public Property SimplifiedInvoice As Boolean
Public Property ReferenceNumber As String
Public Property IssuingDate As String
Public Property TransactionDescription As TransactionDescription_
Public Property Deduction As Deduction_
Public Property GoodsDescription As GoodsDescription_
Public Property EUSupplier As EUSupplier_
Public Property State As String = "N"
End Class
Public Class DocumentCopy_
Public Property FileType As String
Public Property FileName As String
Public Property Description As String
Public Property Base64Content As String
End Class
Public Class RefundRequest_
Public Property RefundMemberState As String
Public Property PurchaseInformation As New List(Of Purchase_)
Public Property DocumentCopy As New List(Of DocumentCopy_)
Public Property State As String = "N"
End Class
Public Class TransactionDescription_
Public Property TaxableAmount As MoneyAmount_
Public Property VATAmount As MoneyAmount_
End Class
Public Class Deduction_
Public Property DeductibleAmount As MoneyAmount_
End Class
Public Class MoneyAmount_
Public Property Amount As Decimal
Public Property CurrencyISO As String = "EUR"
End Class
Public Class GoodsDescription_
Public Property Code As String
End Class
Public Class EUSupplier_
Public Property NameFree As String
Public Property AddressFree As String
Public Property CountryISOCode As String
Public Property VATId As String
End Class

View File

@@ -1,9 +1,6 @@
Imports Chilkat Imports Chilkat
'========================= Public Class VATRefundApplication_RO
' HAUFENKLASSEN
'=========================
Public Class VATRefundApplication
Public Property CodF1 As FormInfo Public Property CodF1 As FormInfo
Public Property RefundPeriod As Period Public Property RefundPeriod As Period
Public Property ApplicationReference As ApplicationReference Public Property ApplicationReference As ApplicationReference
@@ -24,9 +21,6 @@ Public Class VATRefundApplication
ImportInformation = New ImportInformation() ImportInformation = New ImportInformation()
End Sub End Sub
'=========================
' Methode um das XML zu erzeugen
'=========================
Public Function ToXml() As Xml Public Function ToXml() As Xml
Dim xml As New Xml Dim xml As New Xml
xml.Tag = "VATRefundApplication" xml.Tag = "VATRefundApplication"

View File

@@ -1,7 +1,9 @@
Imports System.IO Imports System.Globalization
Imports System.IO
Imports System.Reflection Imports System.Reflection
Imports System.Windows.Documents Imports System.Windows.Documents
Imports itextsharp.text.pdf Imports itextsharp.text.pdf
Imports java.util.function
Imports Microsoft.Office.Interop Imports Microsoft.Office.Interop
Imports VERAG_PROG_ALLGEMEIN Imports VERAG_PROG_ALLGEMEIN
@@ -4152,14 +4154,34 @@ Public Class frmMDM_USTVAntrag
End If End If
Dim filePath As String = "" Dim filePath As String = ""
Dim fileName As String = USTV_ANTRAG.UStVAn_KuNr & "_" & Antrag_LandKz & "_" & CDate(USTV_ANTRAG.UStVAn_ReDatVon).Month & "_" & CDate(USTV_ANTRAG.UStVAn_ReDatBis).Month & "_" & CDate(USTV_ANTRAG.UStVAn_ReDatBis).Year & "_VATRefund.xml" Dim fileName As String = USTV_ANTRAG.UStVAn_KuNr & "_" & Antrag_LandKz & "_" & CDate(USTV_ANTRAG.UStVAn_ReDatVon).Month & "_" & CDate(USTV_ANTRAG.UStVAn_ReDatBis).Month & "_" & CDate(USTV_ANTRAG.UStVAn_ReDatBis).Year & "_VATRefund"
Select Case ADR.LandKz
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
Me.Cursor = Cursors.Default
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
Me.Cursor = Cursors.Default
End Try
End Sub
Private Function createXMLforRO(ADR As cAdressen, KUNDE As cKunde, KUNDE_ERW As cKundenErweitert, FIRMA As cFirmen, BANK_OWNER As String, BANK_IBAN As String, BANK_BIC As String, filename As String, filePath As String)
Dim saveDialog As New SaveFileDialog() With { Dim saveDialog As New SaveFileDialog() With {
.Title = "XML-Datei speichern", .Title = "XML-Datei speichern",
.Filter = "XML-Dateien (*.xml)|*.xml|Alle Dateien (*.*)|*.*", .Filter = "XML-Dateien (*.xml)|*.xml|Alle Dateien (*.*)|*.*",
.DefaultExt = "xml", .DefaultExt = "xml",
.AddExtension = True, .AddExtension = True,
.FileName = fileName, .FileName = filename,
.OverwritePrompt = True .OverwritePrompt = True
} }
@@ -4167,7 +4189,7 @@ Public Class frmMDM_USTVAntrag
filePath = saveDialog.FileName filePath = saveDialog.FileName
Else Else
Me.Cursor = Cursors.Default Me.Cursor = Cursors.Default
Exit Sub Return False
End If End If
@@ -4212,7 +4234,7 @@ Public Class frmMDM_USTVAntrag
End Select End Select
Dim app As New VATRefundApplication() With { Dim app As New VATRefundApplication_RO() With {
.CodF1 = New FormInfo With {.FormType = "D318", .FormId = 318, .UniversalCode = "D318_A1.0.0"}, .CodF1 = New FormInfo With {.FormType = "D318", .FormId = 318, .UniversalCode = "D318_A1.0.0"},
.RefundPeriod = New Period With {.StartDate = CDate(USTV_ANTRAG.UStVAn_ReDatVon).Month, .EndDate = CDate(USTV_ANTRAG.UStVAn_ReDatBis).Month}, .RefundPeriod = New Period With {.StartDate = CDate(USTV_ANTRAG.UStVAn_ReDatVon).Month, .EndDate = CDate(USTV_ANTRAG.UStVAn_ReDatBis).Month},
.ApplicationReference = New ApplicationReference With { .ApplicationReference = New ApplicationReference With {
@@ -4387,7 +4409,7 @@ Public Class frmMDM_USTVAntrag
Select Case MsgBox("Soll eine Nummerierung auf den PDF Dokumenten angegeben werden?", vbYesNoCancel) Select Case MsgBox("Soll eine Nummerierung auf den PDF Dokumenten angegeben werden?", vbYesNoCancel)
Case vbYes : nummerierung = True Case vbYes : nummerierung = True
Case vbNo : nummerierung = False Case vbNo : nummerierung = False
Case Else : Exit Sub Case Else : Return False
End Select End Select
For Each row As DataGridViewRow In dgvUSTVPositionen.SelectedRows.Cast(Of DataGridViewRow)().OrderBy(Function(dgvr) dgvr.Index) For Each row As DataGridViewRow In dgvUSTVPositionen.SelectedRows.Cast(Of DataGridViewRow)().OrderBy(Function(dgvr) dgvr.Index)
@@ -4432,7 +4454,7 @@ Public Class frmMDM_USTVAntrag
Dim success = zipFile.NewZip(fileNamePDFAttZIP) Dim success = zipFile.NewZip(fileNamePDFAttZIP)
If (success = False) Then If (success = False) Then
Debug.WriteLine(zipFile.LastErrorText) Debug.WriteLine(zipFile.LastErrorText)
Exit Sub Return False
End If End If
Dim saveExtraPath As Boolean = False Dim saveExtraPath As Boolean = False
success = zipFile.AppendFiles(pdfPathfinished, saveExtraPath) success = zipFile.AppendFiles(pdfPathfinished, saveExtraPath)
@@ -4470,16 +4492,425 @@ Public Class frmMDM_USTVAntrag
Console.WriteLine(xmlString) Console.WriteLine(xmlString)
System.IO.File.WriteAllText(filePath, xmlString) System.IO.File.WriteAllText(filePath, xmlString)
End Function
Private Function createXMLforHR(ADR As cAdressen, KUNDE As cKunde, KUNDE_ERW As cKundenErweitert, FIRMA As cFirmen, BANK_OWNER As String, BANK_IBAN As String, BANK_BIC As String, filename As String, filePath As String)
Dim saveDialog As New SaveFileDialog() With {
.Title = "XML-Datei speichern",
.Filter = "XML-Dateien (*.xml)|*.xml|Alle Dateien (*.*)|*.*",
.DefaultExt = "xml",
.AddExtension = True,
.FileName = filename,
.OverwritePrompt = True
}
If saveDialog.ShowDialog() = DialogResult.OK Then
filePath = saveDialog.FileName
Else
Me.Cursor = Cursors.Default Me.Cursor = Cursors.Default
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
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
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).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
}
}
Dim counter As Integer = 1
Dim nummerierung 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
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"
}
}
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"
}
app.RefundRequest.PurchaseInformation.Add(p)
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")
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)
End Function
Private Function createCSVforDE(ADR As cAdressen, KUNDE As cKunde, KUNDE_ERW As cKundenErweitert, FIRMA As cFirmen, BANK_OWNER As String, BANK_IBAN As String, BANK_BIC As String, filename As String, filePath As String)
Try
Dim sPath As String = Environment.GetFolderPath(Environment.SpecialFolder.Personal) & "\VERAG\SDL\tmp\"
If Not My.Computer.FileSystem.DirectoryExists(sPath) Then
My.Computer.FileSystem.CreateDirectory(sPath)
End If
Dim exclApp As Object 'as Application
Dim Datei As Object 'as WorkBook
Dim Blatt As Object 'Microsoft.Office.Interop.Excel.Worksheet 'As Object 'as Worksheet
exclApp = CreateObject("Excel.Application")
With exclApp
.Visible = False
Try
filePath = sPath & filename
If File.Exists(filePath) Then
File.Delete(filePath)
End If
My.Computer.FileSystem.WriteAllBytes(filePath, My.Resources.Ustveu_Rechnungsanlagen_DE, False)
Catch ex As System.Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
Me.Cursor = Cursors.Default
Return False
End Try
Datei = .Workbooks.Open(filePath) 'Anpassen
Blatt = Datei.Worksheets(1) 'Anpassen
Dim counter As Integer = 1
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)
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)
Dim land = row.Cells("UstV_Leistender_Land").Value
Dim iso2Land = ""
If land.Length = 2 Then
iso2Land = land
ElseIf land.Length = 3 Then
iso2Land = VERAG_PROG_ALLGEMEIN.cProgramFunctions.getISO2LandFromISO3Land(land)
ElseIf land.Length = 1 Then
iso2Land = VERAG_PROG_ALLGEMEIN.cProgramFunctions.getISO2LandFromISO1Land(land)
End If
Blatt.Range("A" & counter + 1).Value = counter
Blatt.Range("B" & counter + 1).Value = CDate(row.Cells("UStVPo_ReDat").Value).ToString("dd.MM.yyyy")
Blatt.Range("C" & counter + 1).Value = row.Cells("UStVPo_ReNr").Value
Blatt.Range("D" & counter + 1).Value = Nettobetrag.ToString("0.00", CultureInfo.InvariantCulture)
Blatt.Range("E" & counter + 1).Value = Steuerbetrag.ToString("0.00", CultureInfo.InvariantCulture)
Blatt.Range("F" & counter + 1).Value = Steuerbetrag.ToString("0.00", CultureInfo.InvariantCulture)
Blatt.Range("H" & counter + 1).Value = "false"
Blatt.Range("I" & counter + 1).Value = LeistenderName
Blatt.Range("J" & counter + 1).Value = row.Cells("UstV_Leistender_Strasse").Value
Blatt.Range("M" & counter + 1).Value = row.Cells("UstV_Leistender_PLZ").Value
Blatt.Range("N" & counter + 1).Value = row.Cells("UstV_Leistender_Stadt").Value
Blatt.Range("O" & counter + 1).Value = iso2Land
Blatt.Range("P" & counter + 1).Value = UIDNrLeistender
Datei.Save
Blatt = Datei.Worksheets(2)
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
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
Blatt.Range("A" & counter + 1).Value = counter
If diesel Then
Blatt.Range("B" & counter + 1).Value = "1.1.2"
End If
If maut Then
Blatt.Range("B" & counter + 1).Value = "4.1"
End If
If zubeh Then
Blatt.Range("B" & counter + 1).Value = "3.1.3"
End If
If parkplatz Then
Blatt.Range("B" & counter + 1).Value = "3.1.4"
End If
If uebernachtung Then
Blatt.Range("B" & counter + 1).Value = "6.1"
End If
End If
Datei.Save
Blatt = Datei.Worksheets(1)
counter += 1
Next
Datei.Save
.Visible = True
End With
Catch ex As Exception Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
Me.Cursor = Cursors.Default
End Try End Try
End Sub Me.Cursor = Cursors.Default
End Function
Private Function PDFInvoicesPath(ByRef posId As String) As String Private Function PDFInvoicesPath(ByRef posId As String) As String

View File

@@ -1941,8 +1941,26 @@ Public Class frmBelegNeu
cm_FT.Items.Add(ids) cm_FT.Items.Add(ids)
End If End If
If Not cm_FT.Items.ContainsKey("journal") Then If Not cm_FT.Items.ContainsKey("version") Then
Dim ids = New ToolStripMenuItem() With {.Text = "Journal", .Name = "journal", .Font = New Font(Me.Font.FontFamily, Me.Font.Size)} Dim ids = New ToolStripMenuItem() With {.Text = "Journal - Version", .Name = "version", .Font = New Font(Me.Font.FontFamily, Me.Font.Size)}
AddHandler ids.Click, AddressOf mnuItemAuftrauege_Clicked
cm_FT.Items.Add(ids)
End If
If Not cm_FT.Items.ContainsKey("signatures") Then
Dim ids = New ToolStripMenuItem() With {.Text = "Journal - Signaturen", .Name = "signatures", .Font = New Font(Me.Font.FontFamily, Me.Font.Size)}
AddHandler ids.Click, AddressOf mnuItemAuftrauege_Clicked
cm_FT.Items.Add(ids)
End If
If Not cm_FT.Items.ContainsKey("action") Then
Dim ids = New ToolStripMenuItem() With {.Text = "Journal - Action", .Name = "action", .Font = New Font(Me.Font.FontFamily, Me.Font.Size)}
AddHandler ids.Click, AddressOf mnuItemAuftrauege_Clicked
cm_FT.Items.Add(ids)
End If
If Not cm_FT.Items.ContainsKey("queueitem") Then
Dim ids = New ToolStripMenuItem() With {.Text = "Journal - Queue", .Name = "queueitem", .Font = New Font(Me.Font.FontFamily, Me.Font.Size)}
AddHandler ids.Click, AddressOf mnuItemAuftrauege_Clicked AddHandler ids.Click, AddressOf mnuItemAuftrauege_Clicked
cm_FT.Items.Add(ids) cm_FT.Items.Add(ids)
End If End If
@@ -1961,7 +1979,7 @@ Public Class frmBelegNeu
KASSE.LOAD(cboKassen._value) KASSE.LOAD(cboKassen._value)
Dim client As New cFiskaltrustClient(KASSE.rksv_FT_RestServiceURL, KASSE.rksv_FT_CashboxID, KASSE.rksv_FT_AccessToken, KASSE.rksv_FT_Country) 'Dim client As New cFiskaltrustClient(KASSE.rksv_FT_RestServiceURL, KASSE.rksv_FT_CashboxID, KASSE.rksv_FT_AccessToken, KASSE.rksv_FT_Country)
Dim client_chilkat As New cFiskaltrustClient_chilkat(KASSE.rksv_FT_RestServiceURL, KASSE.rksv_FT_CashboxID, KASSE.rksv_FT_AccessToken, KASSE.rksv_FT_Country) Dim client_chilkat As New cFiskaltrustClient_chilkat(KASSE.rksv_FT_RestServiceURL, KASSE.rksv_FT_CashboxID, KASSE.rksv_FT_AccessToken, KASSE.rksv_FT_Country)
If item.Name = "null" Then If item.Name = "null" Then
@@ -1970,20 +1988,36 @@ Public Class frmBelegNeu
Dim result As String = client_chilkat.SignNullReceipt(KASSE.rksv_id) Dim result As String = client_chilkat.SignNullReceipt(KASSE.rksv_id)
MsgBox(result)
If result <> "" Then
MsgBox(client_chilkat.PrettyPrintJson(result))
End If
ElseIf item.Name = "test" Then ElseIf item.Name = "test" Then
'beide 'beide
'Dim result As String = Await client.Echo(KASSE.rksv_bez & " " & KASSE.rksv_FT_Country & " - ") 'Dim result As String = Await client.Echo(KASSE.rksv_bez & " " & KASSE.rksv_FT_Country & " - ")
Dim result As String = client_chilkat.Echo(KASSE.rksv_bez & " " & KASSE.rksv_FT_Country & " - ") Dim result As String = client_chilkat.Echo(KASSE.rksv_bez & " " & KASSE.rksv_FT_Country & " - ")
MsgBox(result)
If result <> "" Then
MsgBox(client_chilkat.PrettyPrintJson(result))
End If
ElseIf item.Name = "storno" Then ElseIf item.Name = "storno" Then
'beide 'beide
Dim result As String = Await client.CancelReceiptAsync_test("-1", 100, "Cash", KASSE.rksv_id) 'Dim result As String = Await client.CancelReceiptAsync_test("-1", 100, "Cash", KASSE.rksv_id)
MsgBox(result) Dim result As String = client_chilkat.ChancelReceipt_test("-1", KASSE.rksv_id)
If result <> "" Then
MsgBox(client_chilkat.PrettyPrintJson(result))
End If
ElseIf item.Name = "bar" Then ElseIf item.Name = "bar" Then
'beide 'beide
@@ -1994,26 +2028,41 @@ Public Class frmBelegNeu
If vbYes = MsgBox(result & vbNewLine & vbNewLine & "Testdaten in DB speichern?", vbYesNoCancel) Then If vbYes = MsgBox(result & vbNewLine & vbNewLine & "Testdaten in DB speichern?", vbYesNoCancel) Then
Dim QR_CodeString As String = "" Dim QR_CodeString As String = ""
client.saveRKSV_FT(result, QR_CodeString) client_chilkat.saveRKSV_FT(result, QR_CodeString)
End If End If
Else Else
Return False Return False
End If End If
MsgBox(result)
If result <> "" Then
MsgBox(client_chilkat.PrettyPrintJson(result))
End If
ElseIf item.Name = "monthly" Then ElseIf item.Name = "monthly" Then
'beide 'beide
'Dim result As String = Await client.SignClosinglReceiptAsync(item.Name, KASSE.rksv_id) 'Dim result As String = Await client.SignClosinglReceiptAsync(item.Name, KASSE.rksv_id)
Dim result As String = client_chilkat.SignClosingReceipt(item.Name, KASSE.rksv_id) Dim result As String = client_chilkat.SignClosingReceipt(item.Name, KASSE.rksv_id, item.Name)
MsgBox(result)
If result <> "" Then
MsgBox(client_chilkat.PrettyPrintJson(result))
End If
ElseIf item.Name = "daily" Then ElseIf item.Name = "daily" Then
'Nur DE 'Nur DE
If KASSE.rksv_FT_Country = "DE" Then If KASSE.rksv_FT_Country = "DE" Then
'Dim result As String = Await client.SignClosinglReceiptAsync(item.Name, KASSE.rksv_id) 'Dim result As String = Await client.SignClosinglReceiptAsync(item.Name, KASSE.rksv_id)
Dim result As String = client_chilkat.SignClosingReceipt(item.Name, KASSE.rksv_id) Dim result As String = client_chilkat.SignClosingReceipt(item.Name, KASSE.rksv_id, item.Name)
MsgBox(result)
If result <> "" Then
MsgBox(client_chilkat.PrettyPrintJson(result))
End If
Else Else
MsgBox("nicht für AT-Kassen möglich!") MsgBox("nicht für AT-Kassen möglich!")
End If End If
@@ -2022,14 +2071,30 @@ Public Class frmBelegNeu
ElseIf item.Name = "yearly" Then ElseIf item.Name = "yearly" Then
' Dim result As String = Await client.SignClosinglReceiptAsync(item.Name, KASSE.rksv_id) ' Dim result As String = Await client.SignClosinglReceiptAsync(item.Name, KASSE.rksv_id)
Dim result As String = client_chilkat.SignClosingReceipt(item.Name, KASSE.rksv_id) Dim result As String = client_chilkat.SignClosingReceipt(item.Name, KASSE.rksv_id, item.Name)
MsgBox(result) If result <> "" Then
ElseIf item.Name = "journal" Then MsgBox(client_chilkat.PrettyPrintJson(result))
End If
ElseIf (item.Name = "version" Or item.Name = "action" Or item.Name = "signatures" Or item.Name = "queueitem") Then
'Dim result As String = Await client.Journal(2) 'Dim result As String = Await client.Journal(2)
Dim result As String = client_chilkat.Journal(2)
MsgBox(result) Dim result As String = ""
Select Case item.Name
Case "version" : result = client_chilkat.Journal(FtJournalType.VersionInformation)
Case "action" : result = client_chilkat.Journal(FtJournalType.ActionJournal)
Case "signatures" : result = client_chilkat.Journal(FtJournalType.ReceiptJournal)
Case "queueitem" : result = client_chilkat.Journal(FtJournalType.QueueItemJournal)
End Select
If result <> "" Then
MsgBox(client_chilkat.PrettyPrintJson(result))
End If

View File

@@ -195,9 +195,9 @@ Namespace My
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _ <Global.System.Configuration.ApplicationScopedSettingAttribute(), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Configuration.SpecialSettingAttribute(Global.System.Configuration.SpecialSetting.ConnectionString), _ Global.System.Configuration.SpecialSettingAttribute(Global.System.Configuration.SpecialSetting.ConnectionString), _
Global.System.Configuration.DefaultSettingValueAttribute("Data Source=192.168.0.90\DEVSQL;Initial Catalog=AVISO_new;Integrated Security=fal"& _ Global.System.Configuration.DefaultSettingValueAttribute("Data Source=192.168.0.90\DEVSQL;Initial Catalog=AVISO;Integrated Security=false;U"& _
"se;User ID=AppUser;Password=yp/THDd?xM+pZ$;Pooling=true;Min Pool Size=20;Max Poo"& _ "ser ID=AppUser;Password=yp/THDd?xM+pZ$;Pooling=true;Min Pool Size=20;Max Pool Si"& _
"l Size=250")> _ "ze=250")> _
Public ReadOnly Property AVISOConnectionStringTEST() As String Public ReadOnly Property AVISOConnectionStringTEST() As String
Get Get
Return CType(Me("AVISOConnectionStringTEST"),String) Return CType(Me("AVISOConnectionStringTEST"),String)

View File

@@ -65,9 +65,9 @@
<Setting Name="AVISOConnectionStringTEST" Type="(Connection string)" Scope="Application"> <Setting Name="AVISOConnectionStringTEST" Type="(Connection string)" Scope="Application">
<DesignTimeValue Profile="(Default)">&lt;?xml version="1.0" encoding="utf-16"?&gt; <DesignTimeValue Profile="(Default)">&lt;?xml version="1.0" encoding="utf-16"?&gt;
&lt;SerializableConnectionString xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt; &lt;SerializableConnectionString xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
&lt;ConnectionString&gt;Data Source=192.168.0.90\DEVSQL;Initial Catalog=AVISO_new;Integrated Security=false;User ID=AppUser;Password=yp/THDd?xM+pZ$;Pooling=true;Min Pool Size=20;Max Pool Size=250&lt;/ConnectionString&gt; &lt;ConnectionString&gt;Data Source=192.168.0.90\DEVSQL;Initial Catalog=AVISO;Integrated Security=false;User ID=AppUser;Password=yp/THDd?xM+pZ$;Pooling=true;Min Pool Size=20;Max Pool Size=250&lt;/ConnectionString&gt;
&lt;/SerializableConnectionString&gt;</DesignTimeValue> &lt;/SerializableConnectionString&gt;</DesignTimeValue>
<Value Profile="(Default)">Data Source=192.168.0.90\DEVSQL;Initial Catalog=AVISO_new;Integrated Security=false;User ID=AppUser;Password=yp/THDd?xM+pZ$;Pooling=true;Min Pool Size=20;Max Pool Size=250</Value> <Value Profile="(Default)">Data Source=192.168.0.90\DEVSQL;Initial Catalog=AVISO;Integrated Security=false;User ID=AppUser;Password=yp/THDd?xM+pZ$;Pooling=true;Min Pool Size=20;Max Pool Size=250</Value>
</Setting> </Setting>
<Setting Name="AVISOConnectionString" Type="(Connection string)" Scope="Application"> <Setting Name="AVISOConnectionString" Type="(Connection string)" Scope="Application">
<DesignTimeValue Profile="(Default)">&lt;?xml version="1.0" encoding="utf-16"?&gt; <DesignTimeValue Profile="(Default)">&lt;?xml version="1.0" encoding="utf-16"?&gt;