CashChequePrinting przy anulowaniu
Powiadomienie o drukowaniu paragonu przy płatności
CashChequePrinting,
umożliwiające rozszerzenie markup paragonu w nagłówku i stopce, od wersji SyrvePOS 8.5.1 będzie również generowane przy anulowaniu (zwrocie) zamówienia.
Przykład:
public sealed class CashChequePrintingHandler : IDisposable
{
private readonly IDisposable subscription;
public CashChequePrintingHandler()
{
subscription = PluginContext.Notifications.CashChequePrinting.Subscribe(OnCashChequePrinting);
}
private static CashCheque OnCashChequePrinting(Guid orderId)
{
PluginContext.Log.Info("On cash cheque printing subscription.");
var order = PluginContext.Operations.GetOrderById(orderId);
var message = order.Status == OrderStatus.Closed
? $"Zamówienie #{order.Number} storno."
: $"Zamówienie #{order.Number} zapłata.";
return new CashCheque
{
BeforeCheque = new XElement(Tags.Center, message),
AfterCheque = new XElement(Tags.QRCode, message)
};
}
public void Dispose()
{
try
{
subscription.Dispose();
}
catch (RemotingException)
{
// nic do zrobienia przy utracie połączenia
}
}
}