public static TillSession EnsureOpenTill(this BSOItemTransaction BSOTrans, string TillId) { var tillManager = new TillManager(); var tillSetResult = BSOTrans.SetTillID(TillId); var sessions = APIEngine.DSOCache.TillSessionProvider.GetOpenedTillSessions(TillId, BSOTrans.Transaction.CreateDate); TillSession tillSession = null; if (sessions.Length == 1) { if (!tillManager.CheckTransactionTillSession(BSOTrans.Transaction, 0, ref tillSession)) { throw new Exception("Não foi possível abrir o Caixa"); } } // foreach (TenderLineItem tenderLine in BSOTrans.Transaction.TenderLineItem) { tenderLine.TillId = BSOTrans.Transaction.Till.TillID; tenderLine.CreateDate = BSOTrans.Transaction.CreateDate; } // return(tillSession); }
public static TillSession EnsureOpenTill(this AccountTransactionManager AccountTransManager, string TillId) { var tillId = APIEngine.SystemSettings.WorkstationInfo.DefaultTillID; var tillManager = new TillManager(); var tillSetResult = AccountTransManager.SetTillID(tillId); var sessions = APIEngine.DSOCache.TillSessionProvider.GetOpenedTillSessions(tillId, AccountTransManager.Transaction.CreateDate); TillSession tillSession = null; if (sessions.Length == 1) { if (!tillManager.CheckTransactionTillSession(AccountTransManager.Transaction, 0, ref tillSession)) { throw new Exception("Não foi possível abrir o Caixa"); } } // foreach (TenderLineItem tenderLine in AccountTransManager.Transaction.TenderLineItems) { tenderLine.TillId = AccountTransManager.Transaction.Till.TillID; tenderLine.CreateDate = AccountTransManager.Transaction.CreateDate; } // return(tillSession); }