-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
49 lines (35 loc) · 2.11 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
from mw_request import RestRequest
from decimal import Decimal, ROUND_HALF_UP
from config import *
from pos import ReceiptPrinter
from pos import Exporter
from examples import Example
# Please add your config data to config.py
cashboxId = CASHBOX_ID
accesstoken = CASHBOX_ACCESSTOKEN
queue_url = QUEUE_URL
# Create RestRequest Object to communicate with the middleware
mwrequest = RestRequest(queue_url,cashboxId,accesstoken)
# Load example requests. The examples are executed for the Country defined in config.py (DE,AT,FR)
example = Example()
# Create a printer object to print middleware response to the console
Printer = ReceiptPrinter()
# To Initialize the Queue, send a initial-operation receipt. Needs to be done once in a queue lifetime
Printer.print(mwrequest.sendSign(example.Special_Initial_Operation()))
# Send a simple POS-Receipt (https://middleware-samples.docs.fiskaltrust.cloud/#778edb52-464a-411d-ac3c-301803cab9e8)
Printer.print(mwrequest.sendSign(example.PosReceipt()))
# You can also look at the response object coming back from the middleware request
# print(mwrequest.sendSign(example.PosReceipt()))
# You can void this receipt
Printer.print(mwrequest.sendSign(example.PosReceiptVoid()))
# Create an order and order a few items. You won't pay yet. (https://middleware-samples.docs.fiskaltrust.cloud/#59f790db-dd8f-4339-83ae-6b9652c732eb)
# Doesn't exist in Austria
Printer.print(mwrequest.sendSign(example.Info_Order()))
# You spent enough time in the restaurant. Let's pay our order https://middleware-samples.docs.fiskaltrust.cloud/#e0609e70-5485-48f4-963e-10e06262b2a4
# Doesn't exist in Austria
Printer.print(mwrequest.sendSign(example.Info_Order_Pay()))
# The business day comes to an end. In Germany this means the Daily-Closing is necessary https://middleware-samples.docs.fiskaltrust.cloud/#ebb752b7-5cc8-4026-9e13-f2b3ef0e5c87
Printer.print(mwrequest.sendSign(example.Special_Daily_Closing()))
# Now the auditor wants to check your business. He requests an export of the DSFinV-K
#file_export = Exporter()
#file_export.export_dsfinvk(mwrequest,"C:\python_tests","2024-09-26 06:00:00","2024-09-26 17:00:00")