public ProcessPaymentOtherForm(AccountOther account, POSView printPOS) { this.m_Account = account; this.m_PrintPOS = printPOS; this.m_NumberFormat = new System.Globalization.NumberFormatInfo(); this.m_NumberFormat.set_NumberDecimalSeparator("."); this.m_NumberFormat.set_NumberDecimalDigits(2); this.InitializeComponent(); }
private void btnAddPsAccount_Click(object sender, System.EventArgs e) { AccountOther accountOther = new AccountOther { Number = this.m_AccountEdit.get_Text(), Phone = this.m_Phone.get_Text() }; AccountOtherAddForm form = new AccountOtherAddForm(accountOther); if (form.ShowDialog(this) == System.Windows.Forms.DialogResult.OK) { this.m_AccountEdit.set_Text(accountOther.Number); this.m_Barcode.Clear(); this.m_Phone.set_Text(accountOther.Phone); this.m_SearchWorker.RunWorkerAsync(); } }
public AccountOtherAddForm(AccountOther accountOther) : this() { this.m_AccountOther = accountOther; this.m_AccountOther.BeginEdit(); }
public void Reverse(PayRequest payment) { string cashierTerminal = Settings.Default.CashierTerminal; if (payment.Id < 0L) { if (payment.ReverseRequestId != 0L) { throw new System.ApplicationException("Платеж уже был возвращен. Повторный возврат невозможен."); } decimal paidSumm = payment.PaidSumm; decimal commission = payment.Commission; User currentUser = User.GetCurrentUser(); long id = 0L; if (!long.TryParse(payment.AccountId, ref id) || (id == 0L)) { throw new System.ApplicationException("Ошибка при возврате."); } this.m_Account = AccountOther.FindById(id); ObjectList<SpPayment> services = SpPayment.FindByUno(payment.ExternalTransactionId); PayLocalTransaction transaction = AccountOther.MakeReversePaymentTry(payment.ExternalTransactionId, currentUser.Id, cashierTerminal); AccountOther.MakeCommit(); this.AddToAccumulatePaySumWithoutQuestion(-paidSumm, -commission); this.PrintPayment(this.m_Account, services, ((long) transaction.Id).ToString(), true, paidSumm, commission, false, () => Messages.ShowMessage("Платеж успешно возвращен."), () => Messages.ShowMessage("Платеж успешно возвращен.")); } else { PayRequest request = payment.Reverse(cashierTerminal); this.AddToAccumulatePaySumWithoutQuestion(-request.PaidSumm, -payment.Commission); this.Print(request, payment, true); } }
public void PrintPayment(AccountOther account, ObjectList<SpPayment> services, string uno, bool cancelPayment, decimal paymentSumm, decimal commission, bool isUseSlipDoc, VoidDelegate printPaymentSuccessed, VoidDelegate printPaymentFailured) { try { if (!this.IsUseFiscalDocument.Value) { if (printPaymentSuccessed != null) { printPaymentSuccessed(); } } else if (!this.bwPOSOperation_BeforeStart()) { if (printPaymentFailured != null) { printPaymentFailured(); } } else { this.lState.set_Text("Печать чека..."); this.m_CurrentOperation = POSOperations.PrintPayment; this.m_Account = account; this.m_AccountServices = services; this.m_Uno = uno; this.m_PaymentSumm = paymentSumm; this.m_Commission = commission; this.m_CancelPayment = cancelPayment; this.m_PrintPaymentSuccessed = printPaymentSuccessed; this.m_PrintPaymentFailured = printPaymentFailured; this.m_IsUseSlipDoc = isUseSlipDoc; this.bwPOSOperation.RunWorkerAsync(); } } catch (System.Exception) { if (printPaymentFailured != null) { printPaymentFailured(); } throw; } }
public void Print(PayRequest payment, PayRequest paymentForServices, bool isCancelPayment) { if (this.IsUseFiscalDocument.Value) { AccountOther other; ObjectList<PayRequestAccountService> requestAccountServices = paymentForServices.GetRequestAccountServices(); ObjectList<SpPayment> services = new ObjectList<SpPayment>(); foreach (PayRequestAccountService service in requestAccountServices) { SpPayment payment2 = new SpPayment { ServiceName = service.Name, Summ = service.Paid }; services.Add(payment2); } ObjectList<AccountOther> infoOrgFromRequestAccountServices = AccountOther.GetInfoOrgFromRequestAccountServices(paymentForServices.Id); if ((infoOrgFromRequestAccountServices != null) && (infoOrgFromRequestAccountServices.get_Count() > 0)) { other = infoOrgFromRequestAccountServices.get_Item(0); } else { other = new AccountOther(); } this.PrintPayment(other, services, payment.ExternalTransactionId, isCancelPayment, payment.PaidSumm, paymentForServices.Commission, false, null, null); } }