From f3629681e628b4c762937a0f87eb7ec96530b590 Mon Sep 17 00:00:00 2001 From: Stefan Kert Date: Fri, 1 May 2020 09:43:04 +0200 Subject: [PATCH 1/5] Improved info order document --- .../examples/info-order.md | 142 +++++++++--------- 1 file changed, 68 insertions(+), 74 deletions(-) diff --git a/doc/appendix-de-kassensichv/examples/info-order.md b/doc/appendix-de-kassensichv/examples/info-order.md index c88241b1..c25ac69b 100644 --- a/doc/appendix-de-kassensichv/examples/info-order.md +++ b/doc/appendix-de-kassensichv/examples/info-order.md @@ -1,85 +1,79 @@ +## Info-Order - Implicit Flow -info-order -implicit flow +This is used to persist orders -this is unsed to persist orders - -same `cbReceiptReference` in multiple receiptrequest/receiptresponse (sign-calls) can be used to connect multiple actions into a business-action. each `cbReceiptReference` can only be used once within a explicit flow. this also meanse only one time start-transaction can be done with one specific `cbReceiptReference`, because it is mapped 1:1 to the ongoing transaction of the (tse). +Same `cbReceiptReference` in multiple receiptrequest/receiptresponse (sign-calls) can be used to connect multiple actions into a business-action. each `cbReceiptReference` can only be used once within a explicit flow. this also meanse only one time start-transaction can be done with one specific `cbReceiptReference`, because it is mapped 1:1 to the ongoing transaction of the (tse). the implicit flow uses start-transaction and finish-transaction within the same receiptrequest/receiptresponse. therefore in this case the `cbReceiptReference` has no impact on already ongoing transactions as long as there wasn't a start-transaction with same `cbReceiptReference` before. -and additional method to connect multiple actions to a ongoing business-action is to reference a previouse action by `cbPreviouseReceiptReference`. - - -Request +An additional method to connect multiple actions to a ongoing business-action is to reference a previouse action by `cbPreviouseReceiptReference`. +```json { -"ftCashBoxID": "cashboxid-guid", -"ftPosSystemId": "possystemid-guid", -"cbTerminalID": "terminalid", -"cbReceiptReference": "233348", -"cbReceiptMoment": "2019-07-19T12:52:34.9609375Z", -"cbChargeItems": [ -{ -"Quantity": 2.0, -"Description": "0,5 Soda Zitrone", -"Amount": 5.6, -"VATRate":19.0000, -"ftChargeItemCase":4919338167972134913 -} -], -"cbPayItems": [ -{ -"Quantity": 1.0, -"Description": "Internal", -"Amount": 5.6, -// 0x4445 0000 0000 000A (internal / material consumption) -"ftPayItemCase": 4919338167972134922 + "ftCashBoxID":"cashboxid-guid", + "ftPosSystemId":"possystemid-guid", + "cbTerminalID":"terminalid", + "cbReceiptReference":"233348", + "cbReceiptMoment":"2019-07-19T12:52:34.9609375Z", + "cbChargeItems":[ + { + "Quantity":2.0, + "Description":"0,5 Soda Zitrone", + "Amount":5.6, + "VATRate":19.0000, + "ftChargeItemCase":4919338167972134913 + } + ], + "cbPayItems":[ + { + "Quantity":1.0, + "Description":"Internal", + "Amount":5.6, + // 0x4445 0000 0000 000A (internal / material consumption) + "ftPayItemCase":4919338167972134922 + } + ], + // 0x4445 0000 0000 0010 (info-order) + 0000 0001 0000 0000 (implicit flow) + "ftReceiptCase":4919338172267102224, + "cbArea":"Tisch 56", + "cbPreviousReceiptReference":"233347" } -], -// 0x4445 0000 0000 0010 (info-order) + 0000 0001 0000 0000 (implicit flow) -"ftReceiptCase":4919338172267102224, -"cbArea": "Tisch 56", -"cbPreviousReceiptReference": "233347" -} - +``` Response +```json { -"ftCashBoxID": "cashboxid-guid", -"ftPosSystemId": "possystemid-guid", -"cbTerminalID": "terminalid", -"cbReceiptReference": "233348", - -"ftQueueID":"queueid-guid", -"ftQueueItemID":"queueitemid-guid", -"ftQueueRow":"queuerow", -"ftReceiptMoment":"2019-10-25T13:48:04.323Z", - -"ftCashboxIdentification":"fiskaltrust1=tse-client-id", -"ftReceiptIdentification":"ft[queue-receiptnumerator-hex]#IT[tse-transaction]" - -ftSignatures[ - { - "ftSignatureFormat":13, - //0x4445000000000010 (start-transaction-result) - "ftSignatureType": 4919338167972134928, - "caption": "start-transaction-signature", - "data": "[startTransactionResult]" - }, - { - "ftSignatureFormat":13, - //0x4445000000000011 (finish-transaction-payload) - "ftSignatureType": 4919338167972134929, - "caption": "finish-transaction-payload", - "data": "[finishTransactionPayload]" - }, - { - "ftSignatureFormat": 13, - //0x4445000000000012 (finish-transaction-result) - "ftSignatureType": 4919338167972134930, - "caption": "finish-transaction-payload", - "data": "[finishTransactionResult]" - } -] - + "ftCashBoxID":"cashboxid-guid", + "ftPosSystemId":"possystemid-guid", + "cbTerminalID":"terminalid", + "cbReceiptReference":"233348", + "ftQueueID":"queueid-guid", + "ftQueueItemID":"queueitemid-guid", + "ftQueueRow":"queuerow", + "ftReceiptMoment":"2019-10-25T13:48:04.323Z", + "ftCashboxIdentification":"fiskaltrust1=tse-client-id", + "ftReceiptIdentification":"ft[queue-receiptnumerator-hex]#IT[tse-transaction]" + "ftSignatures"[ + { + "ftSignatureFormat":13, + //0x4445000000000010 (start-transaction-result) + "ftSignatureType":4919338167972134928, + "caption":"start-transaction-signature", + "data":"[startTransactionResult]" + }, + { + "ftSignatureFormat":13, + //0x4445000000000011 (finish-transaction-payload) + "ftSignatureType":4919338167972134929, + "caption":"finish-transaction-payload", + "data":"[finishTransactionPayload]" + }, + { + "ftSignatureFormat":13, + //0x4445000000000012 (finish-transaction-result) + "ftSignatureType":4919338167972134930, + "caption":"finish-transaction-payload", + "data":"[finishTransactionResult]" + } + ] } +``` From 6653f14ecab2361f7bc1482f95656d1784b5599e Mon Sep 17 00:00:00 2001 From: Christian Rogobete Date: Fri, 1 May 2020 16:58:49 +0200 Subject: [PATCH 2/5] fix chapters for DE --- doc/toc.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/toc.md b/doc/toc.md index a5709532..f5f5595c 100644 --- a/doc/toc.md +++ b/doc/toc.md @@ -32,7 +32,7 @@ ## [Reference tables](appendix-fr-boi-tva-decl-30-10-30/reference-tables/reference-tables.md) # [Appendix: DE – KassenSichV](appendix-de-kassensichv/appendix-de-kassensichv.md) -# [Terminology](appendix-de-kassensichv/terminology/terminology.md) -# [Cash Register Integration](appendix-de-kassensichv/cash-register-integration/cash-register-integration.md) -# [Reference Tables](appendix-de-kassensichv/reference-tables/reference-tables.md) -# [Procedural documentation for DSFinV-K generation](appendix-de-kassensichv/procedural-documentation/dsfinv-k-generation.md) +## [Terminology](appendix-de-kassensichv/terminology/terminology.md) +## [Cash Register Integration](appendix-de-kassensichv/cash-register-integration/cash-register-integration.md) +## [Reference Tables](appendix-de-kassensichv/reference-tables/reference-tables.md) +## [Procedural documentation for DSFinV-K generation](appendix-de-kassensichv/procedural-documentation/dsfinv-k-generation.md) From e4bcf6f06f58038468efe28927f90b0f14494fdb Mon Sep 17 00:00:00 2001 From: Tom Schmiedlechner Date: Sun, 3 May 2020 16:17:27 +0200 Subject: [PATCH 3/5] Added proto files --- dist/protos/IPOS.proto | 110 +++++++++++++++++++++++++++++++++++++++++ dist/protos/bcl.proto | 76 ++++++++++++++++++++++++++++ 2 files changed, 186 insertions(+) create mode 100644 dist/protos/IPOS.proto create mode 100644 dist/protos/bcl.proto diff --git a/dist/protos/IPOS.proto b/dist/protos/IPOS.proto new file mode 100644 index 00000000..36266c19 --- /dev/null +++ b/dist/protos/IPOS.proto @@ -0,0 +1,110 @@ +syntax = "proto3"; + +package fiskaltrust.ifPOS.v1; +option csharp_namespace = "fiskaltrust.ifPOS.v1"; + +import "bcl.proto"; + +service POS { + rpc Echo(EchoRequest) returns (EchoResponse) {} + + rpc Journal(JournalRequest) returns (JournalResponse) {} + + rpc Sign(ReceiptRequest) returns (ReceiptResponse) {} +} + +message EchoRequest { + string Message = 1; +} + +message EchoResponse { + string Message = 1; +} + +message JournalRequest { + int64 ftJournalType = 1; + int64 From = 2; + int64 To = 3; +} + +message JournalResponse { + repeated uint32 Chunk = 1 [packed = false]; +} + +message ChargeItem { + int64 Position = 5; + .bcl.Decimal Quantity = 10; + string Description = 20; + .bcl.Decimal Amount = 30; + .bcl.Decimal VATRate = 40; + int64 ftChargeItemCase = 50; + string ftChargeItemCaseData = 60; + .bcl.Decimal VATAmount = 70; + string AccountNumber = 80; + string CostCenter = 90; + string ProductGroup = 100; + string ProductNumber = 110; + string ProductBarcode = 120; + string Unit = 130; + .bcl.Decimal UnitQuantity = 140; + .bcl.Decimal UnitPrice = 150; + .bcl.DateTime Moment = 160; +} +message PayItem { + int64 Position = 5; + .bcl.Decimal Quantity = 10; + string Description = 20; + .bcl.Decimal Amount = 30; + int64 ftPayItemCase = 40; + string ftPayItemCaseData = 50; + string AccountNumber = 60; + string CostCenter = 70; + string MoneyGroup = 80; + string MoneyNumber = 90; + .bcl.DateTime Moment = 100; +} +message ReceiptRequest { + string ftCashBoxID = 10; + string ftQueueID = 15; + string ftPosSystemId = 16; + string cbTerminalID = 20; + string cbReceiptReference = 30; + .bcl.DateTime cbReceiptMoment = 40; + repeated ChargeItem cbChargeItems = 50; + repeated PayItem cbPayItems = 60; + int64 ftReceiptCase = 70; + string ftReceiptCaseData = 80; + .bcl.Decimal cbReceiptAmount = 90; + string cbUser = 100; + string cbArea = 110; + string cbCustomer = 120; + string cbSettlement = 130; + string cbPreviousReceiptReference = 140; +} + +message ReceiptResponse { + string ftCashBoxID = 10; + string ftQueueID = 14; + string ftQueueItemID = 15; + int64 ftQueueRow = 16; + string cbTerminalID = 20; + string cbReceiptReference = 30; + string ftCashBoxIdentification = 35; + string ftReceiptIdentification = 40; + .bcl.DateTime ftReceiptMoment = 50; + repeated string ftReceiptHeader = 60; + repeated ChargeItem ftChargeItems = 70; + repeated string ftChargeLines = 80; + repeated PayItem ftPayItems = 90; + repeated string ftPayLines = 100; + repeated SignaturItem ftSignatures = 110; + repeated string ftReceiptFooter = 120; + int64 ftState = 130; + string ftStateData = 140; +} +message SignaturItem { + int64 ftSignatureFormat = 10; + int64 ftSignatureType = 20; + string Caption = 30; + string Data = 40; +} diff --git a/dist/protos/bcl.proto b/dist/protos/bcl.proto new file mode 100644 index 00000000..8df17622 --- /dev/null +++ b/dist/protos/bcl.proto @@ -0,0 +1,76 @@ +// The types in here indicate how protobuf-net represents certain types when using protobuf-net specific +// library features. Note that it is not *required* to use any of these types, and cross-platform code +// should usually avoid them completely (ideally starting from a .proto schema) + +// Some of these are ugly, sorry. The TimeSpan / DateTime dates here pre-date the introduction of Timestamp +// and Duration, and the "well known" types should be preferred when possible. Guids are particularly +// awkward - it turns out that there are multiple guid representations, and I accidentally used one that +// I can only call... "crazy-endian". Just make sure you check the order! + +// It should not be necessary to use bcl.proto from code that uses protobuf-net + +syntax = "proto3"; + +option csharp_namespace = "ProtoBuf.Bcl"; + +package bcl; + +message TimeSpan { + sint64 value = 1; // the size of the timespan (in units of the selected scale) + TimeSpanScale scale = 2; // the scale of the timespan [default = DAYS] + enum TimeSpanScale { + DAYS = 0; + HOURS = 1; + MINUTES = 2; + SECONDS = 3; + MILLISECONDS = 4; + TICKS = 5; + + MINMAX = 15; // dubious + } +} + +message DateTime { + sint64 value = 1; // the offset (in units of the selected scale) from 1970/01/01 + TimeSpanScale scale = 2; // the scale of the timespan [default = DAYS] + DateTimeKind kind = 3; // the kind of date/time being represented [default = UNSPECIFIED] + enum TimeSpanScale { + DAYS = 0; + HOURS = 1; + MINUTES = 2; + SECONDS = 3; + MILLISECONDS = 4; + TICKS = 5; + + MINMAX = 15; // dubious + } + enum DateTimeKind + { + // The time represented is not specified as either local time or Coordinated Universal Time (UTC). + UNSPECIFIED = 0; + // The time represented is UTC. + UTC = 1; + // The time represented is local time. + LOCAL = 2; + } +} + +message NetObjectProxy { + int32 existingObjectKey = 1; // for a tracked object, the key of the **first** time this object was seen + int32 newObjectKey = 2; // for a tracked object, a **new** key, the first time this object is seen + int32 existingTypeKey = 3; // for dynamic typing, the key of the **first** time this type was seen + int32 newTypeKey = 4; // for dynamic typing, a **new** key, the first time this type is seen + string typeName = 8; // for dynamic typing, the name of the type (only present along with newTypeKey) + bytes payload = 10; // the new string/value (only present along with newObjectKey) +} + +message Guid { + fixed64 lo = 1; // the first 8 bytes of the guid (note:crazy-endian) + fixed64 hi = 2; // the second 8 bytes of the guid (note:crazy-endian) +} + +message Decimal { + uint64 lo = 1; // the first 64 bits of the underlying value + uint32 hi = 2; // the last 32 bis of the underlying value + uint32 signScale = 3; // the number of decimal digits (bits 1-16), and the sign (bit 0) +} \ No newline at end of file From 7180a62155d57255eeee1abd9bea11523a3e0408 Mon Sep 17 00:00:00 2001 From: Tom Schmiedlechner Date: Sun, 3 May 2020 16:19:16 +0200 Subject: [PATCH 4/5] Formatting --- dist/protos/IPOS.proto | 11 ++++++----- dist/protos/bcl.proto | 1 + 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/dist/protos/IPOS.proto b/dist/protos/IPOS.proto index 36266c19..f40e4514 100644 --- a/dist/protos/IPOS.proto +++ b/dist/protos/IPOS.proto @@ -6,10 +6,8 @@ option csharp_namespace = "fiskaltrust.ifPOS.v1"; import "bcl.proto"; service POS { - rpc Echo(EchoRequest) returns (EchoResponse) {} - - rpc Journal(JournalRequest) returns (JournalResponse) {} - + rpc Echo(EchoRequest) returns (EchoResponse) {} + rpc Journal(JournalRequest) returns (JournalResponse) {} rpc Sign(ReceiptRequest) returns (ReceiptResponse) {} } @@ -50,6 +48,7 @@ message ChargeItem { .bcl.Decimal UnitPrice = 150; .bcl.DateTime Moment = 160; } + message PayItem { int64 Position = 5; .bcl.Decimal Quantity = 10; @@ -63,6 +62,7 @@ message PayItem { string MoneyNumber = 90; .bcl.DateTime Moment = 100; } + message ReceiptRequest { string ftCashBoxID = 10; string ftQueueID = 15; @@ -102,9 +102,10 @@ message ReceiptResponse { int64 ftState = 130; string ftStateData = 140; } + message SignaturItem { int64 ftSignatureFormat = 10; int64 ftSignatureType = 20; string Caption = 30; string Data = 40; -} +} \ No newline at end of file diff --git a/dist/protos/bcl.proto b/dist/protos/bcl.proto index 8df17622..aaa7f5b0 100644 --- a/dist/protos/bcl.proto +++ b/dist/protos/bcl.proto @@ -1,3 +1,4 @@ +// Taken from https://github.com/protobuf-net/protobuf-net/blob/master/src/Tools/bcl.proto // The types in here indicate how protobuf-net represents certain types when using protobuf-net specific // library features. Note that it is not *required* to use any of these types, and cross-platform code // should usually avoid them completely (ideally starting from a .proto schema) From 618a072e52e6195ead968ee1e8b47908e30f7dea Mon Sep 17 00:00:00 2001 From: Tom Schmiedlechner Date: Mon, 4 May 2020 10:21:06 +0200 Subject: [PATCH 5/5] Fixed formatting --- dist/protos/IPOS.proto | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/protos/IPOS.proto b/dist/protos/IPOS.proto index f40e4514..8d380fe1 100644 --- a/dist/protos/IPOS.proto +++ b/dist/protos/IPOS.proto @@ -6,8 +6,8 @@ option csharp_namespace = "fiskaltrust.ifPOS.v1"; import "bcl.proto"; service POS { - rpc Echo(EchoRequest) returns (EchoResponse) {} - rpc Journal(JournalRequest) returns (JournalResponse) {} + rpc Echo(EchoRequest) returns (EchoResponse) {} + rpc Journal(JournalRequest) returns (JournalResponse) {} rpc Sign(ReceiptRequest) returns (ReceiptResponse) {} } @@ -108,4 +108,4 @@ message SignaturItem { int64 ftSignatureType = 20; string Caption = 30; string Data = 40; -} \ No newline at end of file +}