I den här artikeln lär du dig hur du laddar upp kvitton som PDF-filer till RetailForce Cloud med hjälp av skatteklienten (vid användning av skattehantering) och får en länk som din kund kan använda för att ladda ner/komma åt kvittona.
Denna funktion är tillgänglig från version 1.2 av clienten och erbjuder motsvarande offlinefunktion för det digitala kvittot.
Observera: Om du inte använder skattehantering måste anropet utformas på ett annat sätt. Läs artikeln Överföring av digitala kvitton via skatteklienten.
För att kunna använda denna funktion måste licensen för Digitalt kvitto (fullständig produkt) vara aktiverad i konfigurationen för respektive client.
Observera: För att systemet ska kunna läsa metadata från det skattedokumentet måste skattedokumentet överföras till skatteklienten INNAN följande metoder anropas.
Användning via FiscalClient/FiscalService
När du använder FiscalClient finns följande två metoder tillgängliga för överföring av digitala kvitton:
Metod med filnamn
/// <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)
Denna funktion gör det möjligt att ladda upp det digitala kvittot med hjälp av en fil på hårddisken (filnamn).
Parametrar
- uniqueClientId: det unika ID:t för skatteklienten.
- filename: filnamnet (inkl. sökväg) på den PDF-fil som ska laddas upp.
- documentGuid: skattedokumentets GUID (DocumentGuid)
Returvärde: URL för visning.
Strömningsmetod
/// <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)
Med den här funktionen kan du ladda upp det digitala kvittot genom att överföra en filström (eller flera strömmar).
Parametrar
- uniqueClientId: det unika ID:t för den skattemässiga klienten.
- file: streamen med innehållet i PDF-filen (streamen måste vara i början)
- documentGuid: skattedokumentets GUID (DocumentGuid)
Returvärde: URL för visning.
Användning via nuget-implementering
När du använder den direkta implementeringen av Fiskaclient (TrustedFiscalModule) med nuget finns endast en metod med FileStream tillgänglig:
/// <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)
Med denna funktion kan du ladda upp det digitala kvittot genom att överföra en filström (eller flera strömmar).
Parametrar
- file: streamen med innehållet i PDF-filen (streamen måste vara i början)
- documentGuid: GUID för det skattedokumentet (Document.DocumentGuid)
Returvärde: URL för visning.
Den här artikeln har översatts automatiskt.
Kommentarer
0 kommentarer
logga in för att lämna en kommentar.