public override void Pay(CreditPaymentInfo info) { paymentInfo = info; if (input != null && !input.IsEmpty) { info.Amount = input.ToDecimal(); } if (info.Id == -1)//Credit not assigned { paymentInfo = info; cr.State = ListCreditTypes.Instance(CreditPaymentInfo.GetCredits(), new ProcessSelectedItem <CreditPaymentInfo>(Payment.GetCreditInstallments)); } else//Called from K1..K4 { CreditPaymentInfo cInfo = (CreditPaymentInfo)info.Clone(); if (input != null && !input.IsEmpty) { cInfo.Amount = input.ToDecimal(); } input = new Number(); if (cInfo.Amount >= 0) { GetCreditInstallments(cInfo); } else { cr.State = States.AlertCashier.Instance(new Confirm(PosMessage.PAYMENT_INVALID)); } } }
public static IState Instance(Number amount) { input = amount; MenuList list = new MenuList(); list.Add(new CheckPaymentInfo()); list.AddRange(CurrencyPaymentInfo.GetCurrencies()); list.AddRange(CreditPaymentInfo.GetCredits()); States.List.Instance(list); return(state); }