Migrácia na verziu 9
Pri prechode z verzie 8 na verziu 9 je potrebné pri práci s knižnicou adaptovať niektoré spätne nekompatibilné zmeny.
1. Úprava registrácie hotovostného vkladu a výberu
Pri pokuse o registráciu dokladu typu vklad (Deposit) alebo výber (Withdrawal) aplikácia vyhlási chybu Registrácia vkladu, výberu a neplatného dokladu nie je v tejto verzii podporovaná.
Pre registráciu vkladu a výberu je možné vyvolať tlačový výstup API volaním POST {{server_address}}/api/v1/printers/print, pričom v tele požiadavky uvediete:
cashRegisterCode: kód pokladnice, ktorej hlavička (informácie o spoločnosti, predajnom mieste a kóde pokladnice) bude vytlačená na tlačovom výstupe.
text: informácia o sume vkladu alebo výberu podľa príkladu nižšie.
{
"text": "\u001atext\u001econtent\u001fVKLAD: 100,00 EUR\u001eformat\u001f12\u001a",
"cashRegisterCode": "88812345678900001",
"contentFlags": []
}
Príklad tlače potvrdení o hotovostnom vklade pri použití DLL knižnice:
ORPCode cashRegisterCode = "88812345678900001";
decimal amount = 100;
ReceiptText receiptText = TextToken.Create(
$"VKLAD: {amount} EUR",
TextFormats.DoubleHeight | TextFormats.DoubleWidth)
.ToString();
NonfiscalReceiptContentFlags contentFlags = NonfiscalReceiptContentFlags.None;
TextPrintContext printContext = new TextPrintContext(
receiptText, contentFlags, cashRegisterCode);
await client.PrintTextAsync(printContext, cancellationToken);
2. Úprava používania neplatných dokladov
Pri pokuse o registráciu dokladu typu neplatný doklad (Invalid) aplikácia vyhlási chybu Registrácia vkladu, výberu a neplatného dokladu nie je v tejto verzii podporovaná.
Nakoľko neplatný doklad bol určený pre tlač dokladov v rámci školenia obsluhy, odporúčame v prípade takejto potreby používať nulové ceny a ostré pokladničné doklady.
Migration to Version 9
When upgrading from version 8 to version 9, some backward-incompatible changes must be adapted when working with the library.
1. Changes to cash deposit and withdrawal registration
When attempting to register a document of type deposit (Deposit) or withdrawal (Withdrawal), the application raises the error Registration of deposits, withdrawals and invalid documents is not supported in this version.
To register a deposit or withdrawal, you can trigger a print output via the API call POST {{server_address}}/api/v1/printers/print, specifying the following in the request body:
cashRegisterCode: the code of the cash register whose header (information about the company, point of sale and cash register code) will be printed on the print output.
text: information about the deposit or withdrawal amount according to the example below.
{
"text": "\u001atext\u001econtent\u001fVKLAD: 100,00 EUR\u001eformat\u001f12\u001a",
"cashRegisterCode": "88812345678900001",
"contentFlags": []
}
Example of printing a cash deposit confirmation when using the DLL library:
ORPCode cashRegisterCode = "88812345678900001";
decimal amount = 100;
ReceiptText receiptText = TextToken.Create(
$"VKLAD: {amount} EUR",
TextFormats.DoubleHeight | TextFormats.DoubleWidth)
.ToString();
NonfiscalReceiptContentFlags contentFlags = NonfiscalReceiptContentFlags.None;
TextPrintContext printContext = new TextPrintContext(
receiptText, contentFlags, cashRegisterCode);
await client.PrintTextAsync(printContext, cancellationToken);
2. Changes to the use of invalid documents
When attempting to register a document of type invalid document (Invalid), the application raises the error Registration of deposits, withdrawals and invalid documents is not supported in this version.
Since the invalid document was intended for printing documents during staff training, we recommend using zero prices and regular cash register receipts if such a need arises.