public BeforeDoCheckActionResult BeforeDoCheckAction(ChequeTask chequeTask, ICashRegisterInfo device, CashRegisterChequeExtensions chequeExtensions, IViewManager viewManager) { PluginContext.Log.InfoFormat("Before do cheque on cash register: {0} ({1})", device.FriendlyName, device.Id); const bool needChangeInfo = true; if (needChangeInfo) { var sampleBeginElement = new XElement(Tags.Left, new XElement(Tags.Left, "Organization"), new XElement(Tags.Left, "Address"), new XElement(Tags.Left, $"Table number: {chequeTask.TableNumberLocalized}")); var textBeforeCheque = sampleBeginElement; var sampleAfterElement = new XElement(Tags.Left, new XElement(Tags.Left, "Have a nice day")); var textAfterCheque = sampleAfterElement; // This information will be passed to the front app return(new BeforeDoCheckActionResult { BeforeCheque = new List <Data.Print.Document>(new[] { new Data.Print.Document { Markup = textBeforeCheque } }), // markup to add to the header (at the very beginning of the cheque) AfterCheque = new List <Data.Print.Document>(new[] { new Data.Print.Document { Markup = textAfterCheque } }), // markup to add at the end of the cheque CashierName = "CashierName" }); } // Nothing to change return(null); }
/// <summary> /// Операция печати чека включает в себя открытие фискального чека, /// Добавление предметов расчёта, дополнительные реквизиты, округление копеек или скидки, закрытие чека. /// Для чека возврата поле <paramref name="chequeTask.IsRefund"/> имеет значение true /// </summary> /// Объект <see cref="ChequeTask" />, который содерджит следующие данные: <para /> /// <see cref="ChequeTask.TextAfterCheque"/> Текст, который должен быть напечатан до тела чека, может быть пустым<para /> /// <see cref="ChequeTask.TableNumber"/> Номер стола заказа<para /> /// <see cref="ChequeTask.TextBeforeCheque"/> Текст, который должен быть распечатан после тела чека, может быть пустым<para /> /// <see cref="ChequeTask.Sales"/> Список предметов расчёта<para /> /// <see cref="ChequeTask.RoundSum"/> Сумма округления копеек, скидка содержится в поле <see cref="ChequeTask.DiscountSum"/>, <para /> /// <see cref="ChequeTask.OfdEmail"/> Адрес электронной почты покупателя, на который будет отправлен электронный чек, имеет более высокий приоритет, чем <see cref="ChequeTask.OfdPhoneNumber"/> ,<para /> /// <see cref="ChequeTask.OfdPhoneNumber"/> Номер телефона покупателя, на который будет отправлен электронный чек<para /> /// <see cref="ChequeTask.CashPayment"/> Сумма оплаты наличными<para /> /// <see cref="ChequeTask.CardPayments"/> Список оплат, кроме наличных, список типов оплат должен быть синхронизированы с идентификаторами оплат на ФР посредством настроек в BackOffice<para /> /// <returns>Возвращает объект <see cref="CashRegisterResult"/> /// При ошибке выкидывать исключение. /// </returns> public CashRegisterResult DoCheque(ChequeTask chequeTask, IViewManager viewManager) { CheckStarted(); #region Пример чтения настроек var settings = new SampleCashRegisterSettings(cashRegisterSettings); //Получаем число var fontWidth = settings.NumberSettingExample.Value; //Получаем строку var ofdVersion = settings.StringSettingExample.Value; //Получаем флаг var printOrderNumber = settings.BooleanSettingExample.Value; //Получаем перечисление var fixPrepay = settings.ListSettingExample.Values.First(value => value.IsDefault).Name; #endregion Пример чтения настроек PluginContext.Log.InfoFormat("Device: '{0} ({1})'. Cheque printed.", DeviceName, deviceId); return(GetCashRegisterData()); }
public BeforeDoCheckActionResult BeforeDoCheckAction([NotNull] ChequeTask chequeTask, [NotNull] ICashRegisterInfo device, [NotNull] CashRegisterChequeExtensions chequeExtensions, IViewManager viewManager) { var beforeCheque = new List <Data.Print.Document>(); var documentBefore = new Data.Print.Document(); documentBefore.Markup.Add(new XElement(Tags.LargeFont, "Welcome")); documentBefore.Markup.Add(new XElement(Tags.SmallFont, "tel. 555-123456")); beforeCheque.Add(documentBefore); var afterCheque = new List <Data.Print.Document>(); var documentAfter = new Data.Print.Document(); documentBefore.Markup.Add(new XElement(Tags.SmallFont, "Thank you for shopping")); documentBefore.Markup.Add(new XElement(Tags.QRCode, "iiko.ru")); beforeCheque.Add(documentAfter); return(new BeforeDoCheckActionResult { BeforeCheque = beforeCheque, AfterCheque = afterCheque, CashierName = "CashierName" }); }
public void AfterDoCheckAction([NotNull] ChequeTask chequeTask, [NotNull] PostResult result, [NotNull] ICashRegisterInfo device, IViewManager viewManager) { }
public void AfterDoCheckAction(ChequeTask chequeTask, PostResult result, ICashRegisterInfo device, IViewManager viewManager) { PluginContext.Log.InfoFormat("After do cheque on cash register: {0} ({1})", device.FriendlyName, device.Id); }