Skip to content

Add lottery code to RequestResponse in Epson, Custom PrinterRT and RT…#699

Merged
danielscainifiskaltrust merged 1 commit into
mainfrom
696-Add-lottery-code-to-RequestResponse-in-Epson,-Custom-PrinterRT-and-RT-Server-SCUs
Jun 30, 2026
Merged

Add lottery code to RequestResponse in Epson, Custom PrinterRT and RT…#699
danielscainifiskaltrust merged 1 commit into
mainfrom
696-Add-lottery-code-to-RequestResponse-in-Epson,-Custom-PrinterRT-and-RT-Server-SCUs

Conversation

@danielscainifiskaltrust

@danielscainifiskaltrust danielscainifiskaltrust commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Context

For sale receipts (POSRECEIPT), the EpsonRTPrinter and CustomRTPrinter SCUs did not
expose the receipt lottery code (codicelotteria) in the ReceiptResponse signatures:
RTCodiceLotteria was hardcoded to an empty string. As a result the code did not appear
in either of the two places the QueueIT layer derives it from:

  • the <rt-lottery-id> signature, and
  • the Codice Lotteria: line in the [www.fiskaltrust.it] footer (built by the queue from RTLotteryID).

This aligns both printer SCUs with the existing behavior: populating RTCodiceLotteria
on the sale signature data drives both outputs automatically.

Changes

EpsonRTPrinter (EpsonRTPrinterSCU.cs)

  • Added a GetLotteryCode(ReceiptRequest) helper
    (GetLotteryData()?.servizi_lotteriadegliscontrini_gov_it?.codicelotteria ?? "").
  • Populated RTCodiceLotteria on every POSRECEIPT signature path:
    PerformProtocolReceiptAsync, PerformClassicReceiptAsync, and the two network-recovery
    paths RetryReceiptWithRecoveryAsync and ApplyRecoveredDoc
    (the latter gained a lotteryCode parameter, passed by its callers that hold the ReceiptRequest).

CustomRTPrinter (CustomRTPrinterSCU.cs)

  • PerformDeliveryNoteAsync (POSRECEIPT) now reads the lottery code and sets RTCodiceLotteria.
  • PerformClassicReceiptAsync already set it → unchanged.

Refund / Void / management documents keep RTCodiceLotteria = "": the lottery code is only
attached to sale receipts (POSRECEIPT), consistent with the rest of the IT integration.

Resulting signature output

For a sale carrying a lottery code, the response now contains:

  • <rt-lottery-id>ftSignatureType 0x4954200000000015, ftSignatureFormat 0x1, Data = <code>
  • [www.fiskaltrust.it] footer (ftSignatureType 0x4954200000000001) with a Codice Lotteria: <code> line

Testing

  • Both projects build.
  • EpsonRTPrinter unit tests pass (8); CustomRTPrinter integration tests are skipped (require real hardware), none failing

Issue
#696

@danielscainifiskaltrust danielscainifiskaltrust requested a review from a team as a code owner June 30, 2026 13:37
@github-actions github-actions Bot added market-it Related to the italian market scu-it-epsonrtprinter Related to the italian EpsonRTPrinter SCU scu-it-customrtprinter Related to the Italian CustomRTPrinter SCU. labels Jun 30, 2026
@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown

✅ CLA Signed

All contributors have signed the CLA. Thank you!

@github-actions

Copy link
Copy Markdown

SCU.IT Test Results

  8 files   8 suites   2s ⏱️
 53 tests 17 ✅ 36 💤 0 ❌
106 runs  34 ✅ 72 💤 0 ❌

Results for commit 4effe22.

@danielscainifiskaltrust

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@danielscainifiskaltrust danielscainifiskaltrust merged commit c9a958f into main Jun 30, 2026
13 of 22 checks passed
@danielscainifiskaltrust danielscainifiskaltrust deleted the 696-Add-lottery-code-to-RequestResponse-in-Epson,-Custom-PrinterRT-and-RT-Server-SCUs branch June 30, 2026 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category-enhancement New feature or request market-it Related to the italian market scu-it-customrtprinter Related to the Italian CustomRTPrinter SCU. scu-it-epsonrtprinter Related to the italian EpsonRTPrinter SCU

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[IT] Add lottery code to RequestResponse in Epson, Custom PrinterRT and RT Server SCUs

2 participants