public static void CloseCheck(this IFiscalRegistratorProvider fptr, int typeClose) { if (fptr.PutTypeClose(typeClose) < 0) { fptr.CheckError(); } if (fptr.CloseCheck() < 0) { fptr.CheckError(); } }
public static void Payment(this IFiscalRegistratorProvider fptr, double sum, int type) { if (fptr.PutSumm(sum) < 0) { fptr.CheckError(); } if (fptr.PutTypeClose(type) < 0) { fptr.CheckError(); } if (fptr.Payment() < 0) { fptr.CheckError(); } }
public static void OpenCheck(this IFiscalRegistratorProvider fptr, int type) { if (fptr.PutMode(FiscalRegistratorConsts.ModeRegistration) < 0) { fptr.CheckError(); } if (fptr.SetMode() < 0) { fptr.CheckError(); } if (fptr.PutCheckType(type) < 0) { fptr.CheckError(); } if (fptr.OpenCheck() < 0) { fptr.CheckError(); } }
public static void PrintX(this IFiscalRegistratorProvider fptr) { if (fptr.PutMode(FiscalRegistratorConsts.ModeReportNoClear) < 0) { fptr.CheckError(); } if (fptr.SetMode() < 0) { fptr.CheckError(); } if (fptr.PutReportType(FiscalRegistratorConsts.ReportX) < 0) { fptr.CheckError(); } if (fptr.Report() < 0) { fptr.CheckError(); } }
public static void RegistrationFz54(this IFiscalRegistratorProvider fptr, string name, double price, double quantity, int discountType, double discount, int taxNumber) { Utils.TraceMessage($"Name: {name} Price: {price}{Environment.NewLine}" + $"Quantity: {quantity} {nameof(discountType)}: {discountType}" + $"{Environment.NewLine}{nameof(discount)}: {discount} {nameof(taxNumber)}: {taxNumber}"); if (fptr.PutDiscountType(discountType) < 0) { fptr.CheckError(); } if (fptr.PutSumm(discount) < 0) { fptr.CheckError(); } if (fptr.PutTaxNumber(taxNumber) < 0) { fptr.CheckError(); } if (fptr.PutQuantity(quantity) < 0) { fptr.CheckError(); } if (fptr.PutPrice(price) < 0) { fptr.CheckError(); } if (fptr.PutTextWrap(FiscalRegistratorConsts.WrapWord) < 0) { fptr.CheckError(); } if (fptr.PutName(name) < 0) { fptr.CheckError(); } if (fptr.Registration() < 0) { fptr.CheckError(); } }
internal void Print_OnClick(object sender, EventArgs e) { _enteredSumEditText.Enabled = false; var checkParameters = new Event_EventFiskalProperties { Id = DbRef.CreateInstance($"Document_{nameof(Event_EventFiskalProperties)}" , Guid.NewGuid()), Ref = DbRef.FromString(_eventId), User = Settings.UserDetailedInfo.Id }; Dialog.ShowProgressDialog(Translator.Translate("please_wait"), true); TaskFactory.RunTaskWithTimeout(() => { var checkError = false; try { PrintCheck(); if (_fptr.CloseCheck() < 0) { _fptr.CheckError(); } checkParameters.Date = DateTime.Now; DBHelper.SaveEntity(checkParameters, false); } catch (FPTRException exception) { Utils.TraceMessage($"Error code {exception.Result} {exception.Message}"); checkError = true; Toast.MakeToast(Translator.Translate(exception.Message)); } catch (Exception exception) { Utils.TraceMessage($"{exception.Message}{Environment.NewLine}" + $"Type {exception.GetType()}"); } Utils.TraceMessage($"Check Error: {checkError}"); if (!checkError) { SaveFptrParameters(checkParameters); BusinessProcess.GlobalVariables[Parameters.IdCurrentEventId] = _eventId; Utils.TraceMessage($"GoTo {nameof(COCScreen)}"); Application.InvokeOnMainThread(() => { Navigation.ModalMove(nameof(COCScreen), new Dictionary <string, object> { { Parameters.IdCurrentEventId, _eventId }, { Parameters.IdIsReadonly, _readonly }, { Parameters.IdWasEventStarted, _wasStarted } }); }); } else { try { DBHelper.DeleteByRef(checkParameters.Id, false); _fptr.CancelCheck(); } catch (FPTRException exception) { Toast.MakeToast(Translator.Translate(exception.Message)); } finally { if (_choosedPaymentType == 0) { Application.InvokeOnMainThread(() => _enteredSumEditText.Enabled = true); } } } }, FptrAction.PrintingTimeOut, result => { if (result.Finished) { Dialog.HideProgressDialog(); return; } Dialog.HideProgressDialog(); Toast.MakeToast(Translator.Translate("сonnection_error")); }); }