Šiame straipsnyje sužinosite, kaip naudodami fiskalinį klientą (taikant fiskalinę funkciją) įkelti sąskaitas PDF formatu į „RetailForce Cloud“ ir gauti nuorodą, kurią galėsite pateikti savo klientams atsisiuntimui.
Ši funkcija yra prieinama nuo kliento versijos 1.2 ir suteikia atitinkamą neprisijungus prie interneto galimybę naudotis skaitmeniniu kvitu.
Dėmesio: jei nenaudojate fiskalizacijos, šią funkciją reikia naudoti kitaip, todėl prašome perskaityti straipsnį „Kvitų perdavimas naudojant fiskalinį klientą“.
Norint naudotis šia funkcija, atitinkamo kliento konfigūracijoje turi būti aktyvuota licencija „Digital Receipt“ (pilnas produktas).
Dėmesio: Kad sistema galėtų nuskaityti fiskalinio kvito metaduomenis, PRIEŠ iškvietant toliau nurodytus metodus, fiskalinis kvitas turi būti perduotas fiskaliniam klientui.
Naudojimas naudojant „FiscalClient“ / „FiscalService“
Naudojant „FiscalClient“, galite naudoti šiuos 2 metodus skaitmeninių kvitų perdavimui:
Metodas su failo pavadinimu
/// <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)
Naudodami šią funkciją, galite įkelti skaitmeninį kvitą pagal kietajame diske esantį failą (failo pavadinimas).
Parametrai
- uniqueClientId: FiscalClient identifikatorius.
- filename: failo pavadinimas (įskaitant kelią) į PDF failą, kurį norite įkelti.
- documentGuid: fiskalinio dokumento GUID (Document.DocumentGuid)
Grąžinimas: URL rodymui.
Metodas su srautu
/// <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)
Naudodami šią funkciją galite įkelti skaitmeninį dokumentą perduodami failų srautą (arba srautus).
Parametrai
- uniqueClientId: fiskalinio kliento ID.
- file: srautas su PDF failo turiniu (srautas turi būti pradžioje)
- documentGuid: fiskalinio dokumento GUID (Document.DocumentGuid)
Grąžinimas: URL rodymui.
Naudojimas naudojant „NuGet“ įgyvendinimą
Naudojant tiesioginį fiskalinio kliento (TrustedFiscalModule) įgyvendinimą su „NuGet“, yra prieinamas tik vienas metodas su „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)
Naudodami šią funkciją, galite įkelti skaitmeninį dokumentą perduodami failų srautą (arba srautą).
Parametrai
- file: srautas su PDF failo turiniu (srautas turi būti pradžioje)
- documentGuid: fiskalinio dokumento GUID (Document.DocumentGuid)
Grąžinimas: URL rodymui.
Komentarai
0 komentarų
Tam, kad paliktumėte komentarus prisijunkite