У овом чланку ћете научити како да отпремате потврде као PDF-ове у RetailForce Cloud користећи фискалног клијента (приликом коришћења фискализације) и добијете линк за вашег купца да преузме/приступи потврдама.
Ова функционалност је доступна од верзије 1.2 клијента и пружа одговарајућу офлајн могућност за дигитални рачун.
Пажња: Ако не користите фискализацију, позив мора бити другачије дизајниран, молимо вас да прочитате чланак Пренос дигиталних потврда преко фискалног клијента.
Да бисте користили ову функцију, лиценца за Дигитални рачун (цео производ) мора бити активирана у конфигурацији одговарајућег клијента.
Пажња: Да би систем могао да прочита метаподатке из фискалног документа, фискални документ мора бити пренет фискалном клијенту ПРЕ позива следећих метода.
Коришћење преко FiscalClient/FiscalService
При коришћењу FiscalClient-а, за пренос дигиталних потврда доступне су следеће 2 методе:
Метод коришћењем имена датотеке
/// <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)
Ова функција омогућава отпремање дигиталног рачуна коришћењем датотеке на чврстом диску (име датотеке).
Параметри
- uniqueClientId: јединствени ИД фискалног клијента.
- filename: име датотеке (укључујући путању) PDF датотеке која се отпрема.
- documentGuid: ГИД пореског документа (Document.DocumentGuid)
Вредност повраћаја: URL за приказ.
Метод стримовања
/// <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)
Овом функцијом можете отпремити дигитални рачун преносом тока датотеке (или токова).
Параметри
- uniqueClientId: јединствени ИД пореског клијента.
- фајл: стримовање садржаја PDF фајла (стрим мора бити на почетку)
- documentGuid: ГИД пореског документа (Document.DocumentGuid)
Вредност повраћаја: URL за приказ.
Употреба преко nuget имплементације
Када се користи директна имплементација Fiskaclient-а (TrustedFiscalModule) преко nuget-а, доступна је само једна метода са 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)
Помоћу ове функције можете отпремити дигитални рачун преношењем стрима датотеке (или више стримова).
Параметри
- фајл: стримовање садржаја PDF фајла (стрим мора бити на почетку)
- documentGuid: ГИД пореског документа (Document.DocumentGuid)
Вредност повраћаја: URL за приказивање.
Овај чланак је аутоматски преведен.
Komentari
Komentara: 0
Molimo prijavi se da biste komentarisali.