Ebben a cikkben megtudhatja, hogyan tölthet fel nyugtákat PDF-formátumban a RetailForce Cloudba a fiskális client segítségével (fiskalizálás használata esetén), és hogyan szerezhet linket az ügyfele számára a nyugták letöltéséhez/eléréséhez.
Ez a funkció a client 1.2-es verziójától elérhető, és a digitális nyugtákhoz megfelelő offline funkciót is biztosít.
Figyelem: Ha nem használja a fiskalizációt, akkor a hívást másképp kell megtervezni; kérjük, olvassa el a „Digitális nyugták átvitele a fiskális kliensen keresztül” című cikket.
A funkció használatához a „Digitális nyugta (teljes termék)” licencet aktiválni kell az adott client konfigurációjában.
Figyelem: Ahhoz, hogy a rendszer ki tudja olvasni a fiskális dokumentum metadata-ját, a fiskális dokumentumot a következő módszerek meghívása ELŐTT el kell küldeni a fiskális clientnek.
Használat a FiscalClient/FiscalService segítségével
A FiscalClient használata esetén a digitális nyugták továbbításához a következő 2 módszer áll rendelkezésre:
Fájlnévvel történő módszer
/// <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)
Ez a funkció lehetővé teszi a digitális nyugta feltöltését a merevlemezen található fájl (fájlnév) segítségével.
Paraméterek
- uniqueClientId: a fiskális kliens egyedi ID-je.
- filename: a feltöltendő PDF-fájl neve (az elérési útvonalat is beleértve).
- documentGuid: az adóügyi dokumentum GUID-ja (Document.DocumentGuid)
Visszatérési érték: a megjelenítéshez szükséges URL.
Streaming módszer
/// <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)
Ezzel a funkcióval fájlfolyam (vagy streamek) átvitelével töltheti fel a digitális nyugtát.
Paraméterek
- uniqueClientId: az adóügyi ügyfél egyedi ID-je.
- file: a PDF-fájl tartalmát tartalmazó stream (a streamnek a fájl elején kell lennie)
- documentGuid: az adóügyi dokumentum GUID-ja (Document.DocumentGuid)
Visszatérési érték: a megjelenítéshez szükséges URL.
Használat a nuget-implementáción keresztül
A Fiskaclient (TrustedFiscalModule) közvetlen implementációjának használata esetén a nuget-en keresztül csak egy FileStream-et használó metódus áll rendelkezésre:
/// <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)
Ezzel a függvénnyel egy (vagy több) stream átvitelével feltöltheti a digitális nyugtát.
Paraméterek
- file: a PDF-fájl tartalmát tartalmazó stream (a streamnek a fájl elején kell lennie)
- documentGuid: az adóügyi dokumentum DocumentGuid-ja (Document.DocumentGuid)
Visszatérési érték: a megjelenítéshez szükséges URL.
Ezt a cikket automatikusan lefordították.
Hozzászólások
0 hozzászólás
Hozzászólások írásához jelentkezzen be.