Fiskaltrist, fakt, Verzollungsunterlagen, etc.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
Imports System.Net.Http
|
||||
Imports System.Reflection
|
||||
Imports System.Text
|
||||
Imports System.Threading
|
||||
Imports Newtonsoft.Json
|
||||
|
||||
Public Class cFiskaltrustClient
|
||||
@@ -251,7 +252,7 @@ Public Class cFiskaltrustClient
|
||||
End Function
|
||||
|
||||
|
||||
Public Async Function CancelReceiptAsync_test(reference As String, amount As Decimal, kindOfPayment As String) As Task(Of String)
|
||||
Public Async Function CancelReceiptAsync_test(reference As String, amount As Decimal, kindOfPayment As String, posSystemId As String) As Task(Of String)
|
||||
|
||||
|
||||
Dim LIST = New List(Of EABelegPositionen)
|
||||
@@ -273,8 +274,8 @@ Public Class cFiskaltrustClient
|
||||
|
||||
Dim payload = New With {
|
||||
.ftCashBoxID = _cashboxId,
|
||||
.ftPosSystemId = "POS-1",
|
||||
.cbTerminalID = "T1",
|
||||
.ftPosSystemId = getVersion(posSystemId),
|
||||
.cbTerminalID = posSystemId,
|
||||
.cbReceiptReference = reference,
|
||||
.cbReceiptMoment = DateTime.UtcNow.ToString("o"),
|
||||
.ftReceiptCase = 4919338172267102210,
|
||||
@@ -335,7 +336,9 @@ Public Class cFiskaltrustClient
|
||||
request.Content = requestContent
|
||||
End If
|
||||
|
||||
Dim response = Await _httpClient.SendAsync(request)
|
||||
|
||||
Dim cts As New CancellationTokenSource(TimeSpan.FromSeconds(30))
|
||||
Dim response = Await _httpClient.SendAsync(request, cts.Token)
|
||||
Dim result = Await response.Content.ReadAsStringAsync()
|
||||
|
||||
Log($"[{DateTime.Now}] Response ({CInt(response.StatusCode)}): {result}")
|
||||
@@ -409,8 +412,8 @@ Public Class cFiskaltrustClient
|
||||
' Payload Objekt erstellen
|
||||
Dim payload = New With {
|
||||
.ftCashBoxID = _cashboxId,
|
||||
.ftPosSystemId = posSystemId,
|
||||
.cbTerminalID = "T1",
|
||||
.ftPosSystemId = getVersion(posSystemId),
|
||||
.cbTerminalID = posSystemId,
|
||||
.cbReceiptReference = Guid.NewGuid().ToString(),
|
||||
.cbReceiptMoment = DateTime.UtcNow.ToString("o"),
|
||||
.cbChargeItems = chargeItems,
|
||||
@@ -447,8 +450,8 @@ Public Class cFiskaltrustClient
|
||||
|
||||
Dim payload = New With {
|
||||
.ftCashBoxID = _cashboxId,
|
||||
.ftPosSystemId = posSystemId,
|
||||
.cbTerminalID = "T1",
|
||||
.ftPosSystemId = getVersion(posSystemId),
|
||||
.cbTerminalID = posSystemId,
|
||||
.cbReceiptReference = cbReceiptReference_,
|
||||
.cbReceiptMoment = DateTime.UtcNow.ToString("o"),
|
||||
.cbChargeItems = New Object() {},
|
||||
@@ -476,8 +479,8 @@ Public Class cFiskaltrustClient
|
||||
|
||||
Dim payload = New With {
|
||||
.ftCashBoxID = _cashboxId,
|
||||
.ftPosSystemId = posSystemId,
|
||||
.cbTerminalID = "T1",
|
||||
.ftPosSystemId = getVersion(posSystemId),
|
||||
.cbTerminalID = posSystemId,
|
||||
.cbReceiptReference = type & "-closing-" & DateTime.UtcNow.ToString("o"),
|
||||
.cbReceiptMoment = DateTime.UtcNow.ToString("o"),
|
||||
.cbChargeItems = New Object() {},
|
||||
@@ -545,6 +548,9 @@ Public Class cFiskaltrustClient
|
||||
Return False
|
||||
End If
|
||||
|
||||
|
||||
Dim saved As Boolean = False
|
||||
|
||||
Dim ftSig As New cFiskaltrustSignatures()
|
||||
|
||||
Dim ftReceiptMoment As New Chilkat.CkDateTime
|
||||
@@ -568,7 +574,7 @@ Public Class cFiskaltrustClient
|
||||
.ftReceiptIdentification = json.StringOf("ftReceiptIdentification")
|
||||
.ftReceiptMoment = ftReceiptMoment.GetAsTimestamp(getAsLocal)
|
||||
.ftState = json.StringOf("ftState")
|
||||
ftID = .SAVE()
|
||||
saved = .SAVE()
|
||||
|
||||
End With
|
||||
|
||||
@@ -596,8 +602,8 @@ Public Class cFiskaltrustClient
|
||||
.ftData = SignObj.StringOf("Data")
|
||||
.ftSignatureFormat = SignObj.StringOf("ftSignatureFormat")
|
||||
.ftSignatureType = SignObj.StringOf("ftSignatureType")
|
||||
.SAVE()
|
||||
If IsNumeric(.ftSignatureType) AndAlso CInt(.ftSignatureType) = 3 Then
|
||||
saved = .SAVE()
|
||||
If IsNumeric(.ftSignatureType) AndAlso CInt(.ftSignatureType) = 3 Then
|
||||
QR_CodeString = .ftData
|
||||
End If
|
||||
|
||||
@@ -606,6 +612,7 @@ Public Class cFiskaltrustClient
|
||||
Next
|
||||
|
||||
|
||||
Return saved
|
||||
|
||||
|
||||
|
||||
@@ -681,6 +688,13 @@ Public Class cFiskaltrustClient
|
||||
|
||||
|
||||
|
||||
End Function
|
||||
|
||||
Public Function getVersion(Terminal_ID) As String
|
||||
|
||||
Return Terminal_ID & "_" & Application.ProductVersion
|
||||
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
@@ -936,4 +950,6 @@ Public Class cFiskaltrustSignaturPositions
|
||||
Return ""
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
@@ -130,13 +130,14 @@ Public Class cRKSV
|
||||
|
||||
Dim result = Await client.SignReceiptAsync(summeBRUTTO, steuersatz, POS, "Cash", kasse.rksv_id)
|
||||
|
||||
client.saveRKSV_FT(result, QR_CodeString)
|
||||
Return client.saveRKSV_FT(result, QR_CodeString)
|
||||
|
||||
|
||||
Catch ex As Exception
|
||||
MsgBox("Es ist ein Fehler bei der Signatur aufgetreten (insertRKSV): " & vbNewLine & ex.Message & ex.StackTrace)
|
||||
Return False
|
||||
End Try
|
||||
Return False
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user