I denne artikel lærer du, hvordan du uploader kvitteringer som PDF-filer til RetailForce Cloud ved hjælp af skatteklienten (når du bruger skattehåndtering) og får et link, som din kunde kan bruge til at downloade/få adgang til kvitteringerne.
Denne funktionalitet er tilgængelig fra version 1.2 af clienten og giver en tilsvarende offlinefunktion til den digitale kvittering.
Bemærk: Hvis du ikke bruger fiskalisering, skal opkaldet udformes anderledes. Læs venligst artiklen Overførsel af digitale kvitteringer via fiskalklienten.
For at kunne bruge denne funktion skal licensen til »Digital kvittering (fuld version)« være aktiveret i konfigurationen for den pågældende client.
Bemærk: For at systemet kan læse metadataene fra det skattemæssige dokument, skal det skattemæssige dokument overføres til skattemæssig client, FØR følgende metoder kaldes.
Brug via FiscalClient/FiscalService
Når du bruger FiscalClient, er følgende to metoder tilgængelige til overførsel af digitale kvitteringer:
Metode ved hjælp af filnavn
/// <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)
Denne funktion giver dig mulighed for at uploade den digitale kvittering ved hjælp af en fil på harddisken (filnavn).
Parametre
- uniqueClientId: den unikke ID for den skattemæssige klient.
- filename: filnavnet (inkl. sti) på den PDF-fil, der skal uploades.
- documentGuid: GUID'en for det skattemæssige dokument (Document.DocumentGuid)
Returværdi: URL til visning.
Streaming-metode
/// <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 denne funktion kan du uploade den digitale kvittering ved at overføre en filstrøm (eller flere strømme).
Parametre
- uniqueClientId: den unikke ID for den skattepligtige klient.
- file: streamen med indholdet af PDF-filen (streamen skal være i begyndelsen)
- documentGuid: GUID'en for det skattemæssige dokument (Document.DocumentGuid)
Returværdi: URL til visning.
Anvendelse via nuget-implementering
Når du bruger den direkte implementering af Fiskaclient (TrustedFiscalModule) med nuget, er der kun én metode med FileStream tilgængelig:
/// <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 denne funktion kan du uploade den digitale kvittering ved at overføre en filestrøm (eller flere filestrømme).
Parametre
- file: streamen med indholdet af PDF-filen (streamen skal være i begyndelsen)
- documentGuid: GUID'en for det skattemæssige dokument (Document.DocumentGuid)
Returværdi: URL til visning.
Denne artikel er oversat automatisk.
Kommentarer
0 kommentarer
Log ind for at kommentere.