V tomto článku sa dozviete, ako nahrať účtenky vo formáte PDF do služby RetailForce Cloud pomocou daňového klienta (pri použití fiskalizácie) a získať odkaz pre svojho zákazníka na stiahnutie/prístup k účtenkám.
Táto funkcia je k dispozícii od verzie 1.2 klienta a poskytuje zodpovedajúcu offline funkciu pre digitálnu účtenku.
Upozornenie: Ak nepoužívate fiskalizáciu, volanie musí byť navrhnuté inak; prečítajte si prosím článok Prenos digitálnych dokladov prostredníctvom fiskálneho klienta.
Aby ste mohli túto funkciu používať, musí byť v konfigurácii príslušného klienta aktivovaná licencia „Digitálna pokladničná stvrzenka (plná verzia)“.
Upozornenie: Aby systém mohol čítať Metadata z daňového dokladu, daňový doklad musí byť odoslaný do daňového klienta PRED volaním nasledujúcich metód.
Použitie prostredníctvom FiscalClient/FiscalService
Pri použití FiscalClient sú na prenos digitálnych dokladov k dispozícii nasledujúce 2 metódy:
Metóda s použitím názvu súboru
/// <summary>
/// Uploads digital receipt with digital receipt metadata.
/// </summary>
/// <param name="uniqueClientId">The client id of the client where the digital receipt should be uploaded.</param>
/// <param name="filename">The name of the file to be uploaded. The file must exist and must be readable.</param>
/// <param name="documentGuid">The document guid of the document to get the receipt meta data. Document must be transferred before to fiscalisation.</param>
/// <returns>A unique url to download the file for the customer.</returns>
/// <exception cref="ArgumentNullException">Thrown if parameter <paramref name="uniqueClientId"/> is set to <see cref="Guid.Empty"/>.</exception>
/// <exception cref="ArgumentNullException">Thrown if parameter <paramref name="filename"/> is null or <see cref="string.Empty"/>.</exception>
/// <exception cref="FileNotFoundException">Thrown if given filename is not found.</exception>
/// <exception cref="ArgumentNullException">Thrown if parameter <paramref name="documentGuid"/> is set to <see cref="Guid.Empty"/>.</exception>
/// <exception cref="UnauthorizedAccessException"><paramref name="filename" /> specified a directory.-or- The caller does not have the required permission. </exception>
/// <exception cref="IOException">An I/O error occurred while opening the file. </exception>
public string UploadDigitalReceipt(Guid uniqueClientId, string filename, Guid documentGuid)
Táto funkcia umožňuje nahrať digitálnu účtenku pomocou súboru na pevnom disku (názov súboru).
Parametre
- uniqueClientId: jedinečné ID fiškálneho klienta.
- filename: názov súboru (vrátane cesty) PDF súboru, ktorý sa má nahrať.
- documentGuid: identifikátor (GUID) daňového dokladu (Document.DocumentGuid)
Vrátená hodnota: URL na zobrazenie.
Metóda streamovania
/// <summary>
/// Uploads digital receipt with digital receipt metadata.
/// </summary>
/// <param name="uniqueClientId">The client id of the client where the digital receipt should be uploaded.</param>
/// <param name="file">The stream of the file to be uploaded.</param>
/// <param name="documentGuid">The document guid of the document to get the receipt meta data. Document must be transferred before to fiscalisation.</param>
/// <returns>A unique url to download the file for the customer.</returns>
/// <remarks>You can only use documents from the actual day.</remarks>
/// <exception cref="ArgumentNullException">Thrown if parameter <paramref name="uniqueClientId"/> is set to <see cref="Guid.Empty"/>.</exception>
/// <exception cref="ArgumentNullException">Thrown if parameter <paramref name="file"/> is set to null.</exception>
/// <exception cref="ArgumentNullException">Thrown if parameter <paramref name="documentGuid"/> is set to <see cref="Guid.Empty"/>.</exception>
public string UploadDigitalReceipt(Guid uniqueClientId, Stream file, Guid documentGuid)
Pomocou tejto funkcie môžete nahrať digitálnu účtenku prenosom súborového toku (alebo tokov).
Parametre
- uniqueClientId: jedinečné ID daňového klienta.
- file: stream s obsahom súboru PDF (stream musí byť na začiatku)
- documentGuid: identifikátor (GUID) daňového dokladu (Document.DocumentGuid)
Vrátená hodnota: URL na zobrazenie.
Použitie prostredníctvom implementácie nuget
Pri použití priamej implementácie Fiskaclient (TrustedFiscalModule) s nugetom je k dispozícii len jedna metóda s FileStream:
/// <summary>
/// Upload digital receipt (if proper license exists). Only in combination with fiscalisation.
/// </summary>
/// <param name="file">The file to upload.</param>
/// <param name="documentGuid">The document guid of the document to get the receipt meta data. Document must be transferred before to fiscalisation.</param>
/// <returns>An url to request the file in the cloud.</returns>
/// <remarks>You can only use documents from the actual day.</remarks>
/// <exception cref="ArgumentNullException">Thrown if parameter <paramref name="file"/> is set to null.</exception>
/// <exception cref="ArgumentNullException">Thrown if parameter <paramref name="documentGuid"/> is set to <see cref="Guid.Empty"/>.</exception>
/// <exception cref="KeyNotFoundException">Thrown if the given documentGuid does not found a document in the document store.</exception>
public string UploadDigitalReceipt(Stream file, Guid documentGuid)
Pomocou tejto funkcie môžete nahrať digitálnu účtenku prenosom dátového toku (alebo tokov).
Parametre
- file: stream s obsahom súboru PDF (stream musí byť na začiatku)
- documentGuid: GUID daňového dokladu (Document.DocumentGuid)
Vrátená hodnota: URL na zobrazenie.
Tento článok bol preložený automaticky.
Príspevky
0 komentárov
Ak chcete napísať komentár, prihlásiť sa.