Да бисте имплементирали процес поништења документа (void), морате да урадите следеће:
Прво је поступак исти као приликом резервације обичне потврде, а документацију за овај процес можете пронаћи у одељку Основни процес преноса докумената.
Да бисте означили документ као поништен (или отказан) документ (обавезан параметар у неколико земаља), морате подесити следеће својства.
Ове особине можете пронаћи на објекту документа (RetailForce.Fiscalisation.Model.Document.Document)
- Поставите својство CancellationDocument = true
- Додајте референцу документа са својством DocumentReference
- Преокрените документ (претворите све вредности у негативне) у односу на поништен документ (документ који желите да поништите). То значи да ако документ који треба поништити има промет од 20 EUR, документ поништења има промет од -20 EUR.
Пример C# кода:
public Document CancelDocument(TrustedFiscalModule fiscalModule, Document documentToCancel, string storeNumber, string terminalNumber)
{
// check parameter
if (fiscalModule == null) throw new ArgumentNullException(nameof(fiscalModule));
if (documentToCancel == null) throw new ArgumentNullException(nameof(documentToCancel));
// revert all values of the document (can also be done by pos software)
Document cancelDocument = fiscalModule.RevertDocument(documentToCancel);
// set CancellationDocument property to true
cancelDocument.CancellationDocument = true;
// now set document cancellation reference
cancelDocument.DocumentReference = new DocumentReference()
{
DocumentType = DocumentType.Receipt,
DocumentBookDate = documentToCancel.BookDate,
DocumentId = documentToCancel.DocumentId,
DocumentGuid = documentToCancel.DocumentGuid, // not necessary
ReferenceType = ReferenceType.Cancellation,
DocumentNumber = documentToCancel.DocumentNumber,
FiscalDocumentNumber = documentToCancel.FiscalDocumentNumber,
StoreNumber = storeNumber,
TerminalNumber = terminalNumber
};
cancelDocument.BookDate = DateTime.Now;
cancelDocument.DocumentGuid = Guid.NewGuid();
cancelDocument.DocumentId = "NEWID";
cancelDocument.DocumentNumber = "NEWNUMBER";
return cancelDocument;
}
За детаљне информације о модулу објекта документа погледајте документацију о моделу објекта документа.
Овај чланак је аутоматски преведен.
Komentari
Komentara: 0
Molimo prijavi se da biste komentarisali.