Printing a Fiscal Receipt Before Payment of an Order (Federal Law-54)
Starting from V9Preview4, it is now possible to print a fiscal receipt before payment of an order:
PrintFiscalChequeBeforePaymentOrder.
To print a fiscal receipt before payment of an order, the following conditions must be met:
- the total amount of payments made must be sufficient to cover the order
- there must be at least one fiscal payment in the order for which the fiscal receipt will be printed
- the order must belong to a section where the option “Separate printing of fiscal receipt before payment” is enabled:
FiscalChequeBeforePaymentEnabled. - the order must not be fiscalized yet:
IsFiscalizedBeforePayment= false.
Also, printing a fiscal receipt before payment is not available for deliveries, except for the takeout mode.
Before payment of the order PayOrder or before printing the fiscal receipt before payment of the order PrintFiscalChequeBeforePaymentOrder, a notification will trigger:
BeforeProceedOrderPayment. If any of the subscribed plugins throw an OperationCanceledException, the addition of the payment will be canceled.
When printing a fiscal receipt before payment, the order will enter a non-editable state (status Bill), however, the payments will not be processed.
In case of success, the order is marked as fiscalized:
IsFiscalizedBeforePayment.
All payments of the order are marked as fiscalized:
IsFiscalizedLocally.
In case of an error, the front will throw an exception with the error description:
PrintFiscalChequeBeforePaymentOrderFailed.
Closing a Fiscalized Order
A fiscal receipt can be printed once before payment for an order.
Then the fiscalized order can be closed:
PayOrder.
At this stage, all unprocessed payments will be processed.
If the fiscalized order has been modified, then when executing IOperationService.PayOrder, the following will be printed for the order:
- a correction receipt for the return of the income and a correction receipt for the income (for FFD 1.1 and above)
- a return receipt for the income and a receipt for the income according to the current state of the order (FFD 1.05).
Correction Receipt
A fiscalized order is considered modified if at least one of the following conditions is met:
- the pre-check of the fiscalized order has been canceled. That is, a fiscal receipt was printed for the order before payment, and then the pre-check was canceled.
- one or more amounts on the receipt have been changed: cash / electronic (non-cash) / prepayment / postpayment (on credit) / counter-provision. For example, if one electronic payment is replaced with another of the same amount, a correction receipt will not be printed, as in this case, the details of the fiscal receipt remain unchanged.
To track the fiscal operation “correction receipt” (for FFD 1.1 and above), which occurs when paying for a modified fiscalized order, use:
BeforeDoFfd11CorrectionOnPaymentOrderAction- a command that is executed before the “correction receipt” operation. Here you can check the possibility of performing the operation, as well as add additional information to the receipt.AfterDoFfd11CorrectionOnPaymentOrderAction- a command that is executed after the “correction receipt” operation. Its main purpose is to perform final actions after printing the correction receipt, where the argumentresultdescribes the result of the operation on the fiscal register.
Deleting a Fiscalized Order
When deleting a fiscalized order, a fiscal return receipt will be printed.
Examples of calls to PrintFiscalChequeBeforePaymentOrder can be found in the SDK SamplePaymentPlugin project.