Beispiel #1
0
        public override void  Engage(int keyValue)
        {
            //essageBox.Show("*** Exit ***");
            //Check if employee role is authorized to this event
            if (!PosContext.Instance.Employee.RolesEventNames.Contains("Shutdown"))
            {
                PosError posError = new PosError(PosErrorCode.INSUFFICIENT_USER_AUTHORITY);
                posError.Engage(0);
                return;
            }

            if ((PosContext.Instance.CurrentEj != null) && (PosContext.Instance.CurrentEj.SeqNo > 0))
            {
                PosError error = new PosError(PosErrorCode.SHUTDOWN_NOT_ALLOWED);
                error.Engage(0);
            }
            else
            {
                PosHardware.Instance.Close();

                PosContext.Instance.Dispose();
                //Environment.Exit(1);
                //Process.


                Application.Current.Shutdown();
                //MessageBox.Show("Delteed code");
            }
        }
Beispiel #2
0
        public override void  Engage(int keyValue)
        {
            //Transaction	t = ((EjHeader) PosContext.Instance.CurrentEj.[0]).;
            //t.setTransType (Transaction.LOGOFF);
            //t.updateStateAndType (Transaction.COMPLETE, Transaction.LOGOFF);

            // Close any guis that might exist.

            //for (int i=0;i<context ().guis ().size (); i++)
            //{
            //	PosGui gui = (PosGui) context ().guis ().elementAt (i);
            //	gui.close ();
            //
            //}
            //Check if employee role is authorized to this event
            if (!PosContext.Instance.Employee.RolesEventNames.Contains("LogOff"))
            {
                PosError posError = new PosError(PosErrorCode.INSUFFICIENT_USER_AUTHORITY);
                posError.Engage(0);
                return;
            }


            if ((PosContext.Instance.CurrentEj != null) && (PosContext.Instance.CurrentEj.SeqNo > 0))
            {
                PosError error = new PosError(PosErrorCode.INVALID_FUNCTION_KEY);
                error.Engage(0);
            }
            else
            {
                PosContext.Instance.DisableKeys();
                PosEventStack.Instance.LoadDialog("Logon");
                PosEventStack.Instance.NextEvent();
            }
        }
Beispiel #3
0
        public override void  Engage(int keyValue)
        {
            //Check if employee role is authorized to this event
            if (!PosContext.Instance.Employee.RolesEventNames.Contains("SystemManager"))
            {
                PosError posError = new PosError(PosErrorCode.INSUFFICIENT_USER_AUTHORITY);
                posError.Engage(0);
                return;
            }


            //essageBox.Show("*** Exit ***");
            if ((PosContext.Instance.CurrentEj != null) && (PosContext.Instance.CurrentEj.SeqNo > 0))
            {
                PosError error = new PosError(PosErrorCode.SHUTDOWN_NOT_ALLOWED);
                error.Engage(0);
            }
            else
            {
                try
                {
                    Process.Start(@"..\EclipsePosSystemManager\EclipsePOS.WPF.SystemManager.exe");

                    PosContext.Instance.Dispose();
                    Application.Current.Shutdown();
                }
                catch (Exception e)
                {
                    MessageBox.Show(e.ToString(), "Run System Manager", MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }
        }
Beispiel #4
0
        public override void  Engage(int keyValue)
        {
            //	MessageBox.Show("*** CashTender ***");

            // if there are input in buffer
            if (PosContext.Instance.InputLine.Length > 0)
            {
                PosError posError = new PosError(PosErrorCode.INVALID_FUNCTION_KEY);
                posError.Engage(0);
                return;
            }


            if ((PosContext.Instance.Sign > 0 && PosContext.Instance.CurrentEj != null && PosContext.Instance.CurrentEj.EjBalance() > 0.0) ||
                (PosContext.Instance.Sign < 0 && PosContext.Instance.CurrentEj != null && PosContext.Instance.CurrentEj.EjBalance() < 0.0))
            {
                PosEventStack.Instance.LoadDialog("CashTender");
                PosEventStack.Instance.NextEvent();
            }
            else
            {
                PosError posError = new PosError(PosErrorCode.INVALID_FUNCTION_KEY);
                posError.Engage(0);
            }
        }
Beispiel #5
0
        /**
         * Gets the current header EJ record, sets the type to RETURN and
         * toggles the sign in the context.
         */

        public override void  Engage(int keyValue)
        {
            //Check if employee role is authorized to this event
            if (!PosContext.Instance.Employee.RolesEventNames.Contains("ReturnSale"))
            {
                PosError posError = new PosError(PosErrorCode.INSUFFICIENT_USER_AUTHORITY);
                posError.Engage(0);
                return;
            }

            // if in a middle of a dialog just return
            if (!(PosEventStack.Instance.CurrentPosEvent() is EclipsePos.Apps.PosEvents.RegisterOpen))
            {
                PosEventStack.Instance.PushEvent(new PosError(PosErrorCode.ERROR_EVENT));
                PosEventStack.Instance.NextEvent();
                return;
            }

            // if in a middle of a dialog just return
            if ((PosContext.Instance.CurrentEj != null) && (PosContext.Instance.CurrentEj.SeqNo > 0))
            {
                PosEventStack.Instance.PushEvent(new PosError(PosErrorCode.ERROR_EVENT));
                PosEventStack.Instance.NextEvent();
                return;
            }


            PosContext.Instance.ToggleSign();
            PosContext.Instance.TransactionType = (int)Transaction.Types.RETURN;
            PosContext.Instance.Operprompt.Update(this);
            PosContext.Instance.Receipt.Update(this);
        }
Beispiel #6
0
        public override void Engage(int val)
        {
            //MessageBox.Show("*** Discount ***" + keyValue.ToString());
            //Check if employee role is authorized to this event
            if (!PosContext.Instance.Employee.RolesEventNames.Contains("Discount"))
            {
                PosError posError = new PosError(PosErrorCode.INSUFFICIENT_USER_AUTHORITY);
                posError.Engage(0);
                return;
            }



            // if ( PosContext.Instance.CurrentEj != null && PosContext.Instance.CurrentEj.Seq_no > 0 )
            //{
            //	PosError posError = new PosError(PosErrorCode.PROMOTION_NOT_APPLICABLE);
            //	posError.Engage(0);
            //	return;
            //}


            int keyValue = val; //(int) PosContext.Instance.PosKeyValue;

            Promotion pro = new Promotion();

            pro.PromotionNo     = keyValue;
            pro.Organization_no = PosSettings.Default.Organization;
            pro.Load();
            if (pro.PromotionType == (int)EjPromotionTypes.WHOLE_ORDER)
            {
                PosContext.Instance.SaleMode = pro;

                //Apply promotion for current Ej
                object[] currentEj = new Object[PosContext.Instance.CurrentEj.EjArrayList.Count];
                PosContext.Instance.CurrentEj.EjArrayList.CopyTo(currentEj);
                foreach (object obj in currentEj)
                {
                    if (obj is EjItem)
                    {
                        EjItem ejItem = obj as EjItem;
                        if ((ejItem.TransItem.State == (int)EjLineStates.VOID_ITEM) || ejItem.TransItem.State == (int)EjLineStates.PRICE_OVERRIDE)
                        {
                            continue;
                        }
                        EjPromotion ejPromo1 = new EjPromotion(PosContext.Instance.SaleMode, ejItem);
                        ejPromo1.SKU = ejItem.SKU;
                        ejPromo1.Engage(0);
                    }
                }
            }
            else
            {
                EjPromotion ejPromo1 = new EjPromotion(pro, PosContext.Instance.CurrentEjItem);
                ejPromo1.SKU = PosContext.Instance.CurrentEjItem.SKU;
                ejPromo1.Engage(0);
            }
        }
Beispiel #7
0
        public override void  Engage(int keyValue)
        {
            //Check if employee role is authorized to this event
            if (!PosContext.Instance.Employee.RolesEventNames.Contains("VoidSale"))
            {
                PosError posError = new PosError(PosErrorCode.INSUFFICIENT_USER_AUTHORITY);
                posError.Engage(0);
                return;
            }



            // If tried to void without any sales, just return
            if (PosContext.Instance.CurrentEj == null)
            {
                return;
            }
            if (PosContext.Instance.CurrentEj.SeqNo == 0)
            {
                return;
            }

            //Tried to void while in a dialog
            if (!(PosEventStack.Instance.CurrentPosEvent() is EclipsePos.Apps.PosEvents.RegisterOpen))
            {
                PosEventStack.Instance.PushEvent(new PosError(PosErrorCode.ERROR_EVENT));
                PosEventStack.Instance.NextEvent();
                return;
            }

            PosContext.Instance.Receipt.Update(this);

            PosContext.Instance.CurrentEj.Complete((int)Transaction.Status.VOIDED);
            if (PosContext.Instance.AlphaKeyEntryDisplay != null)
            {
                PosContext.Instance.AlphaKeyEntryDisplay.KeyReset();
            }


            /*
             * PosContext.Instance.TableName = "";
             * PosContext.Instance.EjCustomer = null;
             * if (PosContext.Instance.Sign < 0)
             * {
             *  PosContext.Instance.ToggleSign();
             * }
             * PosContext.Instance.SaleMode = null;
             *          PosEventStack.Instance.ClearPending();
             *          PosEventStack.Instance.SetEvent(new RegisterOpen());
             */

            new FinishTransaction().Engage(0);

            PosEventStack.Instance.NextEvent();
        }
Beispiel #8
0
        public override void  Engage(int keyValue)
        {
            //Check if employee role is authorized to this event
            if (!PosContext.Instance.Employee.RolesEventNames.Contains("TrainingMode"))
            {
                PosError posError = new PosError(PosErrorCode.INSUFFICIENT_USER_AUTHORITY);
                posError.Engage(0);
                return;
            }

            PosContext.Instance.Training = true;
        }
Beispiel #9
0
        public override void  Engage(int keyValue)
        {
            if (PosContext.Instance.CurrentEj == null || PosContext.Instance.CurrentEj.LineNo == 0)
            {
                PosError posError = new PosError(PosErrorCode.INVALID_FUNCTION_KEY);
                posError.Engage(0);
                return;
            }


            // PrintJobQueue.Instance.Backup();
            // PrintJobQueue.Instance.PrintReceiptStart();
            // PrintJobQueue.Instance.Restore();
            PosContext.Instance.Receipt.Update(this);
        }
Beispiel #10
0
        public override void Engage(int keyValue)
        {
            //Check if employee role is authorized to this event
            if (!PosContext.Instance.Employee.RolesEventNames.Contains("ChangePrice"))
            {
                PosError posError = new PosError(PosErrorCode.INSUFFICIENT_USER_AUTHORITY);
                posError.Engage(0);
                return;
            }
            EjPriceOverride ejPriceOverride = new EjPriceOverride();

            ejPriceOverride.States().PushState((int)EjPriceOverride.ENTER_LINE_NUMBER);
            PosEventStack.Instance.PushEvent(ejPriceOverride);
            PosEventStack.Instance.NextEvent();
        }
Beispiel #11
0
        public override void Engage(int keyValue)
        {
            // PosContext.Instance.CurrentPosDisplay.LoadOpenOrdersList();

            //Merger to current order
            if (PosContext.Instance.CurrentEj != null && PosContext.Instance.CurrentEj.SeqNo > 0)
            {
                PosError posError = new PosError(PosErrorCode.ERROR_EVENT);
                posError.Engage(0);
                return;
            }


            switch (this.States().PeekState())
            {
            case ENTER_TRANS_NO:

                PosContext.Instance.CurrentPosDisplay.LoadOpenOrdersList();

                PosContext.Instance.ClearInput();
                this.PromptText = PosContext.Instance.Parameters.getParam("PromptTransNo");
                PosContext.Instance.Operprompt.Update(this);

                this.PopState();
                this.PushState(GET_TRANS_NO);
                // PosEventStack.Instance.NextEvent();
                break;


            case GET_TRANS_NO:


                int trxno = PosContext.Instance.Input();
                this.LoadEj(trxno);
                PosContext.Instance.ClearInput();
                PosContext.Instance.Operprompt.Clear();


                this.States().Clear();
                PosEventStack.Instance.ClearPending();
                PosContext.Instance.HomeGUI();
                PosEventStack.Instance.NextEvent();


                break;
            }
        }
Beispiel #12
0
        public override void  Engage(int keyValue)
        {
            //Check if employee role is authorized to this event
            if (!PosContext.Instance.Employee.RolesEventNames.Contains("Store"))
            {
                PosError posError = new PosError(PosErrorCode.INSUFFICIENT_USER_AUTHORITY);
                posError.Engage(0);
                return;
            }

            // If tried to save without any sales, just return
            if (PosContext.Instance.CurrentEj == null)
            {
                return;
            }

            //Tried to recall in a middle of a dialog
            if (!(PosEventStack.Instance.CurrentPosEvent() is EclipsePos.Apps.PosEvents.RegisterOpen))
            {
                PosEventStack.Instance.PushEvent(new PosError(PosErrorCode.ERROR_EVENT));
                PosEventStack.Instance.NextEvent();
                return;
            }



            // Print receipt

            PosContext.Instance.Receipt.Update(this);


            PosContext.Instance.CurrentEj.Complete((int)Transaction.Status.SUSPEND);

            /*  PosContext.Instance.TableName = "";
             *             PosContext.Instance.ReceiptHeader.TrxNo = "";
             *             PosContext.Instance.ReceiptDetails.Clear();
             *             PosContext.Instance.ReceiptTotal.Clear();
             * if (PosContext.Instance.AlphaKeyEntryDisplay != null)
             * {
             *     PosContext.Instance.AlphaKeyEntryDisplay.KeyReset();
             * }
             */
            new FinishTransaction().Engage(0);

            PosEventStack.Instance.NextEvent();
        }
Beispiel #13
0
        public override void Engage(int keyValue)
        {
            //Check if employee role is authorized to this event
            // if (!PosContext.Instance.Employee.RolesEventNames.Contains("ReceiveOnAccount"))
            // {
            //     PosError posError = new PosError(PosErrorCode.INSUFFICIENT_USER_AUTHORITY);
            //    posError.Engage(0);
            //    return;
            //}

            if (PosContext.Instance.CurrentEj == null || PosContext.Instance.CurrentEj.EjBalance() == 0)
            {
                PosEventStack.Instance.LoadDialog("ReceiveOnAccount");
                PosEventStack.Instance.NextEvent();
            }
            else
            {
                PosError posError = new PosError(PosErrorCode.INVALID_FUNCTION_KEY);
                posError.Engage(0);
            }
        }
Beispiel #14
0
 public override void  Engage(int keyValue)
 {
     if (!PosContext.Instance.Employee.RolesEventNames.Contains("CreditTender"))
     {
         PosError posError = new PosError(PosErrorCode.INSUFFICIENT_USER_AUTHORITY);
         posError.Engage(0);
         return;
     }
     //MessageBox.Show("*** CreditTender ***");
     if (PosContext.Instance.CurrentEj != null && PosContext.Instance.CurrentEj.EjBalance() > 0.0)
     {
         PosContext.Instance.PosKeyValue = keyValue;
         PosEventStack.Instance.LoadDialog("CreditTender");
         PosEventStack.Instance.NextEvent();
     }
     else
     {
         PosError posError = new PosError(PosErrorCode.INVALID_FUNCTION_KEY);
         posError.Engage(0);
     }
 }
Beispiel #15
0
        public override void Engage(int keyValue)
        {
            //Check if employee role is authorized to this event
            if (!PosContext.Instance.Employee.RolesEventNames.Contains("Customer"))
            {
                PosError posError = new PosError(PosErrorCode.INSUFFICIENT_USER_AUTHORITY);
                posError.Engage(0);
                return;
            }

            if (PosContext.Instance.CurrentEj != null && PosContext.Instance.CurrentEj.EjBalance() != 0.0)
            {
                PosEventStack.Instance.LoadDialog("Customer");
                PosEventStack.Instance.NextEvent();
            }
            else
            {
                PosError posError = new PosError(PosErrorCode.INVALID_FUNCTION_KEY);
                posError.Engage(0);
            }
        }
Beispiel #16
0
        public override void  Engage(int keyValue)
        {
            //MessageBox.Show("*** AltCurrTender ***" + keyValue);
            //Check if employee role is authorized to this event
            if (!PosContext.Instance.Employee.RolesEventNames.Contains("AltCurrencyTender"))
            {
                PosError posError = new PosError(PosErrorCode.INSUFFICIENT_USER_AUTHORITY);
                posError.Engage(0);
                return;
            }

            Logger.Info(
                this.GetType().FullName,
                this.GetType().FullName + "Key value:" + PosContext.Instance.InputLine.ToString(),
                PosSettings.Default.Debug
                );

            // The type of alternate currency is passed as the value to engage ()
            CurrencyCode inputCurrencyCode = new CurrencyCode();

            inputCurrencyCode.Pos_key_number = keyValue;
            inputCurrencyCode.LoadCurrencyCodeByPosKey();

            Currency curr = new Currency();

            //curr.Organization_no = PosContext.Instance.Config.Organization_id;
            //curr.Currency_code = PosContext.Instance.InputLine.Substring(0,3);
            curr.Home_currency   = PosContext.Instance.Organization.Home_currency;
            curr.Source_currency = inputCurrencyCode.Currency_code;
            curr.Rate_date       = DateTime.Now;
            curr.LoadByCurrencyCodeId();

            PosContext.Instance.AltCurrency     = curr;
            PosContext.Instance.AltCurrencyCode = inputCurrencyCode;

            // Set up and push the current dialog on the stack

            PosEventStack.Instance.LoadDialog("AltCurrTender");
            PosEventStack.Instance.NextEvent();
        }
Beispiel #17
0
        public override void  Engage(int keyValue)
        {
            //Check if employee role is authorized to this event
            if (!PosContext.Instance.Employee.RolesEventNames.Contains("PaidOut"))
            {
                PosError posError = new PosError(PosErrorCode.INSUFFICIENT_USER_AUTHORITY);
                posError.Engage(0);
                return;
            }
            if (PosContext.Instance.CurrentEj == null || PosContext.Instance.CurrentEj.EjBalance() == 0)
            {
                PosEventStack.Instance.LoadDialog("PaidOut");

                PosContext.Instance.TransactionType = (int)Transaction.Types.PAID_OUT;
                PosEventStack.Instance.NextEvent();
            }
            else
            {
                PosError posError = new PosError(PosErrorCode.INVALID_FUNCTION_KEY);
                posError.Engage(0);
            }
        }
Beispiel #18
0
        public override void  Engage(int keyValue)
        {
            //MessageBox.Show("*** Item markdown ***" + keyValue.ToString() );
            //if there are no items in the invoice error out
            if (PosContext.Instance.CurrentEj == null || PosContext.Instance.CurrentEj.SeqNo == 0)
            {
                PosError posError = new PosError(PosErrorCode.ITEM_DISCOUNT_NOT_APPLICABLE);
                posError.Engage(0);
                return;
            }

            Promotion promo = new Promotion();

            // int keyValue = (int) PosContext.Instance.PosKeyValue;
            promo.PromotionNo     = keyValue;
            promo.Organization_no = PosSettings.Default.Organization;
            promo.Load();
            if (promo.PromotionClass != null)
            {
                EjPromotion ejPromo = new EjPromotion(promo, PosContext.Instance.CurrentEjItem);
                ejPromo.Engage(0);
            }
//			PosEventStack.Instance.NextEvent();
        }
Beispiel #19
0
        public override void  Engage(int keyValue)
        {
            //Check if employee role is authorized to this event
            if (!PosContext.Instance.Employee.RolesEventNames.Contains("Recall"))
            {
                PosError posError = new PosError(PosErrorCode.INSUFFICIENT_USER_AUTHORITY);
                posError.Engage(0);
                return;
            }


            switch (this.States().PeekState())
            {
            case RECALL:

                // Tried to recall in a middle of a dialog
                if (PosContext.Instance.CurrentEj != null && PosContext.Instance.CurrentEj.SeqNo > 0)

                {
                    PosEventStack.Instance.PushEvent(new PosError(PosErrorCode.ERROR_EVENT));
                    PosEventStack.Instance.NextEvent();
                    return;
                }


                PosEventStack.Instance.LoadDialog("RecallEj");
                this.PopState();
                this.PushState(RecallEj.ENTER_TRANS_NO);
                PosEventStack.Instance.NextEvent();
                break;

            case ENTER_TRANS_NO:

                PosContext.Instance.ClearInput();
                this.PromptText = PosContext.Instance.Parameters.getParam("PromptTransNo");
                PosContext.Instance.Operprompt.Update(this);
                this.PopState();
                this.PushState(GET_TRANS_NO);

                break;

            case ENTER_POS_NO:

                PosContext.Instance.ClearInput();
                this.PromptText = PosContext.Instance.Parameters.getParam("PromptPosNo");
                PosContext.Instance.Operprompt.Update(this);
                this.PopState();
                this.PushState(GET_POS_NO);

                break;

            case GET_TRANS_NO:

                this.trxno = PosContext.Instance.Input();
                PosContext.Instance.ClearInput();
                PosContext.Instance.Operprompt.Clear();
                this.PopState();
                PosEventStack.Instance.NextEvent();

                break;

            case GET_POS_NO:

                this.PosNo = PosContext.Instance.Input();
                PosContext.Instance.ClearInput();
                this.PopState();
                PosContext.Instance.Operprompt.Clear();
                PosEventStack.Instance.NextEvent();

                break;

            case COMPLETE_RECALL:

                PosContext.Instance.ClearInput();
                trans                 = new Transaction(this.trxno);
                trans.Pos_no          = this.PosNo;
                trans.Organization_no = PosSettings.Default.Organization;
                trans.Store_no        = PosContext.Instance.RetailStore.Retail_store_no;
                trans.Load();
                //	if (trans.State == (int)Transaction.Status.SUSPEND)
                //	{  // was this a suspended transaction?

                PosContext.Instance.CurrentEj = Ej.GetSuspendedEj(trans);

                if (PosContext.Instance.CurrentEj.EjArrayList.Count > 0)
                {                                          // finally make sure there are records
                    if (trans.State == (int)Transaction.Status.SUSPEND)
                    {
                        trans.State = (int)Transaction.Status.IN_PROGRESS;
                    }
                    foreach (Object obj in PosContext.Instance.CurrentEj.EjArrayList)
                    {
                        EjLine line = (EjLine)obj;
                        PosContext.Instance.Receipt.Update(line);
                    }

                    this.States().Clear();
                }
                // }
                PosContext.Instance.TrxNo = this.TrxNo;     /* ES01-26/11/08 */
                this.PromptText           = PosContext.Instance.Parameters.getParam("RegOpen");


                PosContext.Instance.Operprompt.Update(this);
                PosContext.Instance.Receipt.Update(this);

                if (trans.Customer_tax_id.Length > 0)
                {
                    EclipsePos.Data.Customer cus = new EclipsePos.Data.Customer();
                    cus.Organization_no = PosSettings.Default.Organization;
                    cus.Tax_id          = trans.Customer_tax_id;
                    cus.LoadByTaxID();
                    EjCustomer ejCus = new EjCustomer(cus);
                    PosContext.Instance.Receipt.Update(ejCus);
                    PosContext.Instance.EjCustomer = ejCus;
                }

                this.States().Clear();
                PosEventStack.Instance.ClearPending();

                //Clear transaction if complete
                if (trans.State == (int)Transaction.Status.COMPLETE)
                {
                    PosEventStack.Instance.PushEvent(new FinishTransaction());
                }


                break;
            }
        }
Beispiel #20
0
        public override void  Engage(int keyValue)
        {
            //Check if employee role is authorized to this event
            if (!PosContext.Instance.Employee.RolesEventNames.Contains("MergeOrder"))
            {
                PosError posError = new PosError(PosErrorCode.INSUFFICIENT_USER_AUTHORITY);
                posError.Engage(0);
                return;
            }


            //Merger to current order
            if (PosContext.Instance.CurrentEj == null || PosContext.Instance.CurrentEj.SeqNo == 0)
            {
                PosError posError = new PosError(PosErrorCode.ERROR_EVENT);
                posError.Engage(0);
                return;
            }


            switch (this.States().PeekState())
            {
            case MERGE:

                PosContext.Instance.CurrentPosDisplay.LoadOpenOrdersList();

                this.PopState();
                this.PushState(ENTER_TRANS_NO);
                PosEventStack.Instance.NextEvent();
                break;

            case ENTER_TRANS_NO:

                PosContext.Instance.ClearInput();
                this.PromptText = PosContext.Instance.Parameters.getParam("PromptTransNo");
                PosContext.Instance.Operprompt.Update(this);

                this.PopState();
                this.PushState(GET_TRANS_NO);

                break;


            case GET_TRANS_NO:

                this.trxno = PosContext.Instance.Input();
                PosContext.Instance.ClearInput();
                PosContext.Instance.Operprompt.Clear();

                this.PopState();
                this.PushState(COMPLETE_MERGE);
                PosEventStack.Instance.NextEvent();

                break;


            case COMPLETE_MERGE:

                PosContext.Instance.ClearInput();
                trans                 = new Transaction(this.trxno);
                trans.Pos_no          = PosSettings.Default.Station;
                trans.Organization_no = PosSettings.Default.Organization;
                trans.Store_no        = PosSettings.Default.Store;
                trans.Load();

                if (trans.State == (int)Transaction.Status.SUSPEND)
                {      // was this a suspended transaction?
                    Ej ejFrom = Ej.GetSuspendedEj(trans);

                    if (ejFrom.EjArrayList.Count > 0)
                    {      // finally make sure there are records
                           // trans.State = (int)Transaction.Status.IN_PROGRESS;
                        foreach (Object obj in ejFrom.EjArrayList)
                        {
                            EjLine line = (EjLine)obj;
                            ProcessEjLine(line);
                        }

                        //	context ().homeGuis ();
                        //	context ().eventStack ().setEvent (new FirstItem (context ()));
                        this.States().Clear();
                        //	PosEventStack.Instance.NextEvent();
                    }

                    // ejFrom.Complete((int)Transaction.Status.VOIDED);
                    this.VoidEj(ejFrom);
                }

                if (trans.Customer_tax_id.Length > 0)
                {
                    EclipsePos.Data.Customer cus = new EclipsePos.Data.Customer();
                    cus.Organization_no = PosSettings.Default.Organization;
                    cus.Tax_id          = trans.Customer_tax_id;
                    cus.LoadByTaxID();
                    EjCustomer ejCus = new EjCustomer(cus);
                    PosContext.Instance.Receipt.Update(ejCus);
                    PosContext.Instance.EjCustomer = ejCus;
                }

                this.States().Clear();
                // PosEventStack.Instance.ClearPending();
                PosContext.Instance.HomeGUI();
                PosEventStack.Instance.NextEvent();


                break;
            }
        }
Beispiel #21
0
        public override void  Engage(int keyValue)
        {
            //MessageBox.Show("*** EnterKey ***");
            if (PosEventStack.Instance.CurrentEvent is PosError)
            {
                PosError posError = PosEventStack.Instance.CurrentEvent as PosError;
                if (posError.ErrorCode == PosErrorCode.HARDWARE_PROBLEM)
                {
                    new CheckHardware().Engage(0);
                }
                else
                {
                    //posError.Engage(0);
                }

                return;
            }

            if (PosEventStack.Instance.CurrentEvent is TerminalReport)
            {
                PosError posError = new PosError(PosErrorCode.TERMINAL_REPORT);
                posError.Engage(0);
                return;
            }


            if (PosEventStack.Instance.CurrentPosEvent() is EclipsePos.Apps.PosEvents.RegisterOpen)
            {
                if (PosContext.Instance.InputLine.Length > 0)
                {
                    //new LookupItem().Engage(0);
                    if (PosContext.Instance.Parameters.getParam("PromptForTableNo").ToUpper() == "TRUE" &&
                        PosContext.Instance.TransactionType == (int)Transaction.Types.DINE_IN)
                    {
                        // PosEventStack.Instance.LoadDialog("FindItem");

                        PosEventStack.Instance.PushEvent(new LookupItem());

                        // Request to select or enter table number
                        SelectTable posEvent = new SelectTable();
                        posEvent.PushState(posEvent.StartState);

                        PosEventStack.Instance.PushEvent(posEvent);

                        PosEventStack.Instance.NextEvent();
                    }
                    else
                    {
                        // new LookupItem().Engage(0);
                        PosEventStack.Instance.PushEvent(new LookupItem());
                        PosEventStack.Instance.NextEvent();
                    }
                }
            }
            else
            {
                // Get the next event
                PosEventStack.Instance.NextEvent();
                PosContext.Instance.InputLine = "";
            }
        }
Beispiel #22
0
        /**
         * Void the last item in the ej. Logic also
         * sets any related ej record amounts to 0,
         * but doesn't remove them.
         */
        public override void  Engage(int keyValue)
        {
            //Check if employee role is authorized to this event
            if (!PosContext.Instance.Employee.RolesEventNames.Contains("VoidItemLine"))
            {
                PosError posError = new PosError(PosErrorCode.INSUFFICIENT_USER_AUTHORITY);
                posError.Engage(0);
                return;
            }

            // if in a middle of a dialog just return
            //   if (!(PosEventStack.Instance.CurrentPosEvent() is EclipsePos.Apps.PosEvents.RegisterOpen))
            //   {

            //      PosEventStack.Instance.PushEvent(new PosError(PosErrorCode.ERROR_EVENT));
            //      PosEventStack.Instance.NextEvent();
            //      return;
            //  }


            // If tried to void without any sales, just return
            //   if (PosContext.Instance.CurrentEj == null) return;



            switch (this.States().PeekState())
            {
            case VOID_ITEM:
                this.PopState();
                this.PushState(ENTER_LINE_NUMBER);
                PosEventStack.Instance.NextEvent();
                break;

            case ENTER_LINE_NUMBER:
                PosContext.Instance.ClearInput();
                this.PromptText = PosContext.Instance.Parameters.getParam("PromptEnterLineNumber");
                this.PopState();
                this.PushState(GET_LINE_NUMBER);
                PosContext.Instance.Operprompt.Update(this);

                break;

            case GET_LINE_NUMBER:

                this.lineNumber = PosContext.Instance.Input();
                PosContext.Instance.ClearInput();
                PosContext.Instance.Operprompt.Clear();

                this.PopState();

                if (this.lineNumber > 0 && this.lineNumber <= PosContext.Instance.CurrentEj.LineNo)
                {
                    this.PushState(COMPLETE_ITEM_VOID);
                }
                else
                {
                    this.PushState(ENTER_LINE_NUMBER);
                    PosContext.Beep(500, 50);
                }
                PosEventStack.Instance.NextEvent();
                break;


            case COMPLETE_ITEM_VOID:
                // this.ProcessItemVoid(this.lineNumber);
                this.VoidLine(this.lineNumber);
                this.States().Clear();
                PosContext.Instance.HomeGUI();
                PosEventStack.Instance.NextEvent();

                break;
            }
        }
Beispiel #23
0
        public override void  Engage(int keyValue)
        {
            //MessageBox.Show("*** Y ** Logon ***"+ this.PeekState().ToString() );
            LogonStates states = (LogonStates)this.PeekState();

            switch (states)
            {
            case LogonStates.EnterUser:

                PosContext.Instance.ClearInput();

                PosContext.Instance.ClearInput();
                PosContext.Instance.HomeGUI();

                this.PromptText = PosContext.Instance.Parameters.getParam("EnterUser");
                //this.tytype = PosNumberDialog.CLEAR;
                PosContext.Instance.Operprompt.Update(this);
                this.States().PushState((int)LogonStates.GetUser);

                break;

            case LogonStates.EnterPassword:

                mask = true;
                PosContext.Instance.ClearInput();
                this.PromptText = PosContext.Instance.Parameters.getParam("EnterPass");
                //type = PosNumberDialog.MASK;
                PosContext.Instance.Operprompt.Update(this);
                this.States().PushState((int)LogonStates.GetPassword);
                break;

            case LogonStates.EnterOpenAmount:
                break;

            case LogonStates.EnterDrawerNumber:
                break;

            case LogonStates.GetUser:

                this.States().PopState();
                user = PosContext.Instance.InputLine;
                try
                {
                    userno = int.Parse(user);
                }
                catch
                {
                    this.PromptText = PosContext.Instance.Parameters.getParam("BadName");
                    PosContext.Instance.Operprompt.Update(this);
                    return;
                }

                this.States().PushState((int)LogonStates.EnterPassword);
                PosContext.Instance.ClearInput();
                PosEventStack.Instance.NextEvent();
                break;


            case LogonStates.GetPassword:

                this.States().PopState();
                pass = PosContext.Instance.InputLine;
                try
                {
                    passno = int.Parse(pass);
                }
                catch
                {
                    PosContext.Instance.Operprompt.Update(this);
                    return;
                }

                if (this.CheckLogon())
                {
                    this.States().Clear();
                    try
                    {
                        PosContext.Instance.TransactionType = int.Parse(PosContext.Instance.Parameters.getParam("DefaultTransactionType"));
                    }
                    catch
                    {
                    }
                    PosContext.Instance.Receipt.Update(this);
                    PosContext.Instance.ClearInput();
                }
                else
                {
                    //this.PromptText = PosContext.Instance.Parameters.getParam("BadName");
                    //PosContext.Instance.Operprompt.Update(this);
                    PosError posError = new PosError(errorCode);
                    PosEventStack.Instance.PushEvent(posError);
                }

                PosEventStack.Instance.NextEvent();
                break;

            case LogonStates.GetAmount:
                break;

            case LogonStates.GetDrawerNumber:
                break;

            case LogonStates.CompleteLogon:
                break;

            case LogonStates.TemproryLogon:
                break;

            case LogonStates.Unlock:
                break;
                //default:
            }
        }
        public override void Engage(int keyValue)
        {
            if (PosContext.Instance.CurrentEj.EjBalance() > 0.00)
            {
                PosContext.Instance.ClearInput();
                PosEventStack.Instance.ClearPending();
                PosError error = new PosError(PosErrorCode.INSUFFICIENT_TENDER_AMOUNT);
                // this.PromptText = PosContext.Instance.Parameters.getParam("InsufficientTenderAmount");
                PosEventStack.Instance.PushEvent(error);
                PosContext.Instance.Operprompt.Update(this);
                PosEventStack.Instance.NextEvent();
                return;
            }


            switch (this.PeekState())
            {
            case CHECK_PROMPT_PRINT:

                try
                {
                    this.param = PosContext.Instance.Parameters.getParam("PromptForReceiptPrint");
                }
                catch
                {
                }



                //Wait for the Enter key after after input amount
                this.PopState();
                if (this.param == "TRUE")
                {
                    this.PushState(WAIT_FOR_PRINT);
                    PosContext.Instance.ClearInput();
                    this.PromptText = PosContext.Instance.Parameters.getParam("PressPrintKey");
                    PosContext.Instance.Operprompt.Update(this);
                }
                else
                {
                    this.PushState(PRINT_FINAL);
                    PosEventStack.Instance.NextEvent();
                    return;
                }



                break;

            case WAIT_FOR_PRINT:

                // Wait for Print Key to be presseed
                this.PopState();
                PosContext.Instance.ClearInput();
                PosEventStack.Instance.NextEvent();
                //
                break;


            case PRINT_FINAL:

                this.PopState();
                //Print Receipt;

                PosContext.Instance.Receipt.PrintBuffer();
                PosContext.Instance.ClearInput();
                PosEventStack.Instance.NextEvent();

                break;
            }
        }
Beispiel #25
0
        public override void Engage(int keyValue)
        {
            if (PosContext.Instance.InputLine.Length > 0)
            {
                return;
            }


            if (PosEventStack.Instance.CurrentEvent is PosError)
            {
                PosError posError = PosEventStack.Instance.CurrentEvent as PosError;
                if (posError.ErrorCode == PosErrorCode.HARDWARE_PROBLEM)
                {
                    new CheckHardware().Engage(0);
                }
                else
                {
                    //posError.Engage(0);
                }

                return;
            }

            PosContext.Instance.InputLine = keyValue.ToString();  //PosContext.Instance.PosKeyValue.ToString(); // keyValue.ToString();

            //  if (PosEventStack.Instance.CurrentPosEvent() is EclipsePos.Apps.PosEvents.RegisterOpen ||
            //      PosEventStack.Instance.CurrentPosEvent() is EclipsePos.Apps.PosEvents.Plu )
            //  {
            if (PosContext.Instance.InputLine.Length > 0)
            {
                /*
                 * if (PosContext.Instance.Parameters.getParam("PromptForTableNo").ToUpper() == "TRUE")
                 * {
                 *  PosEventStack.Instance.LoadDialog("FindItem");
                 *  PosEventStack.Instance.NextEvent();
                 * }
                 * else
                 * {
                 *  new LookupItem().Engage(0);
                 * }
                 * */

                if (PosContext.Instance.Parameters.getParam("PromptForTableNo").ToUpper() == "TRUE" &&
                    PosContext.Instance.TransactionType == (int)Transaction.Types.DINE_IN)
                {
                    // PosEventStack.Instance.LoadDialog("FindItem");

                    PosContext.Instance.PosKeyValue = keyValue;

                    PosEventStack.Instance.PushEvent(new LookupItem());

                    // Request to select or enter table number
                    SelectTable posEvent = new SelectTable();
                    posEvent.PushState(posEvent.StartState);

                    PosEventStack.Instance.PushEvent(posEvent);

                    PosEventStack.Instance.NextEvent();
                }
                else
                {
                    new LookupItem().Engage(0);
                    // PosEventStack.Instance.PushEvent(new LookupItem());
                    // PosEventStack.Instance.NextEvent();
                }

                //    }
            }
            else
            {
                // Get the next event
                PosEventStack.Instance.NextEvent();
                PosContext.Instance.InputLine = "";
            }

            /*
             * Item item = new Item();
             * item.Organization_no = PosSettings.Default.Organization;
             *
             * if (keyValue > 0)
             * {
             *  item.Plu = keyValue;
             *  item.LoadByPLU();
             *
             * }
             *
             * if (item.Short_Desc != null)
             * {
             *  EjItem ejItem = new EjItem(item);
             *  ejItem.Engage(0);
             * }
             * else
             * {
             *  PosError posError = new PosError(PosErrorCode.INVALID_INPUT);
             *  posError.Engage(0);
             * }
             *
             * PosContext.Instance.InputLine = "";
             * PosContext.Instance.ClearInput();
             *
             * keyValue = 0;
             */
        }
Beispiel #26
0
        public override void  Engage(int keyValue)
        {
            //Check if employee role is authorized to this event
            if (!PosContext.Instance.Employee.RolesEventNames.Contains("Discount"))
            {
                PosError posError = new PosError(PosErrorCode.INSUFFICIENT_USER_AUTHORITY);
                posError.Engage(0);
                return;
            }


            if (PosContext.Instance.CurrentEj.SeqNo == 0)
            {
                PosError posError = new PosError(PosErrorCode.ITEM_DISCOUNT_NOT_APPLICABLE);
                posError.Engage(0);
                return;
            }


            switch (this.States().PeekState())
            {
            case ENTER_AMOUNT:

                PosContext.Instance.ClearInput();
                this.PromptText = PosContext.Instance.Parameters.getParam("EnterDiscountAmount");
                PosContext.Instance.Operprompt.Update(this);
                this.PopState();
                this.PushState(GET_AMOUNT);

                break;


            case GET_AMOUNT:

                this.discountAmt = PosContext.Instance.Input();
                //	PosContext.Instance.ClearInput();
                //	PosContext.Instance.Operprompt.Clear();
                this.PopState();
                this.States().PushState(APPLY_DISCOUNT);
                PosEventStack.Instance.NextEvent();

                break;

            case APPLY_DISCOUNT:

                Promotion promo = new Promotion();
                // int keyValue = (int) PosContext.Instance.PosKeyValue;
                promo.PromotionNo     = 0;
                promo.Organization_no = PosSettings.Default.Organization;
                promo.PromotionType   = 1;
                promo.PromotionVal1   = 1;
                promo.PromotionString = "Discount";
                promo.PromotionClass  = "EclipsePos.Apps.Operators.GetDiscountFromInput";
                EjPromotion ejPromo = new EjPromotion(promo, PosContext.Instance.CurrentEjItem);
                ejPromo.Engage(0);

                this.States().Clear();
                PosContext.Instance.ClearInput();
                PosContext.Instance.Operprompt.Clear();

                break;
            }
        }
Beispiel #27
0
        //	public NumKey(PosContext pContext)
        //	{
        //this.Context = pContext;
        //	}



        /*
         * If the input is >= 0, assume valid number is entered.
         * Else look at the current PosEvent and figure out what to do
         * Logon, get the prompt text from that event
         * EjCheckTender, get the prompt text from that event
         * etc.
         */

        public override void  Engage(int keyValue)
        {
            //MessageBox.Show( keyValue.ToString() );
            if (keyValue >= 0)
            {
                PosContext.Instance.AddToInput(keyValue);
            }

            PosEvent posEvent = PosEventStack.Instance.CurrentEvent;

            if (posEvent is PosError)
            {
                PosError posError = posEvent as PosError;
                PosContext.Instance.Operprompt.Update(posError);
                return;
            }

            if (posEvent is PosNumberDialog)
            {
                PosNumberDialog numberDialog = posEvent as PosNumberDialog;
                this.PromptText = numberDialog.PromptText;
                numText         = PosContext.Instance.InputLine;

                switch (numberDialog.Type)
                {
                case (PosNumberDialogTypes.Clear):
                    break;

                case (PosNumberDialogTypes.Currency):
                    double currVal = PosContext.Instance.InputDouble() / 100.0;

                    string argToConvert = currVal.ToString(System.Globalization.CultureInfo.CurrentCulture.NumberFormat);
                    // Convert the specified argument using the specified format.
                    try
                    {
                        numText = string.Format(new PosTextFormatter( ), "{0:Money}", argToConvert);
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.ToString());
                    }

                    break;
                //

                case (PosNumberDialogTypes.Decimal):
                    double val1 = PosContext.Instance.InputDouble() / 100.0;
                    numText = val1.ToString("#########.##");
                    break;

                case (PosNumberDialogTypes.Mask):
                    StringBuilder tmp = new StringBuilder();
                    tmp.Append('*', numText.Length);
                    numText = tmp.ToString();
                    break;
                }
            }
            else
            if (posEvent is EjLine)
            {
                numText = PosContext.Instance.InputLine;
            }
            else
            {
                numText = PosContext.Instance.InputLine;
            }

            PosContext.Instance.Operprompt.Update(this);
        }
Beispiel #28
0
        /** Event logic is implemented here */
        public override void Engage(int keyValue)
        {
            Item item = new Item();

            item.Organization_no = PosSettings.Default.Organization;

            // if (keyValue > 0)
            // {
            //     item.Plu = keyValue;
            //     item.LoadByPLU();
            //
            // }
            //  else
            // {
            if (PosContext.Instance.InputLine.Length == 0 &&
                PosContext.Instance.ItemLookupDevice.SelectedItem().Length > 0)
            {
                item.Sku = PosContext.Instance.ItemLookupDevice.SelectedItem();
                item.LoadBySKU();
            }
            else
            {
                if (PosContext.Instance.InputLine.Length <= maxPluLength)
                {
                    try
                    {
                        item.Plu = PosContext.Instance.InputLine.Trim();
                        item.LoadByPLU();
                    }
                    catch (System.FormatException e)
                    {
                        //Could be SKU
                        item.Sku = PosContext.Instance.InputLine;
                        item.LoadBySKU();
                    }
                }


                if (item.Short_Desc == null)
                {
                    try
                    {
                        item.Sku = PosContext.Instance.InputLine;
                        item.LoadBySKU();
                    }
                    catch
                    {
                    }
                }
            }
            //  }

            if (item.Short_Desc != null)
            {
                try
                {
                    EjItem ejItem = new EjItem(item);
                    //ejItem.Engage(0);
                    ejItem.States().PushState((int)EjItemStates.ENTER_QTY);
                    PosEventStack.Instance.PushEvent(ejItem);
                    // PosEventStack.Instance.Dump();
                    PosEventStack.Instance.NextEvent();
                }
                catch (Exception e)
                {
                    MessageBox.Show(e.StackTrace.ToString());
                }
            }
            else
            {
                PosError posError = new PosError(PosErrorCode.INVALID_INPUT);
                posError.Engage(0);
            }

            PosContext.Instance.InputLine = "";
            PosContext.Instance.ClearInput();
        }
Beispiel #29
0
        /**
         * Switch on the report type and update displays.
         */
        public override void  Engage(int keyValue)
        {
            keyValue = (int)PosContext.Instance.PosKeyValue;
            //MessageBox.Show("*** TerminalReport ***"+keyValue.ToString());

            //Check if employee role is authorized to this event
            if (!PosContext.Instance.Employee.RolesEventNames.Contains("TerminalReports"))
            {
                PosError posError = new PosError(PosErrorCode.INSUFFICIENT_USER_AUTHORITY);
                posError.Engage(0);
                return;
            }

            //Check if employee role is authorized to this event
            if ((PosContext.Instance.CurrentEj != null) && (PosContext.Instance.CurrentEj.SeqNo > 0))
            {
                PosError posError = new PosError(PosErrorCode.ERROR_EVENT);
                posError.Engage(0);
                return;
            }


            if (keyValue == 0)
            {
                reportType = (XZReportType)this.States().PeekState();
            }
            else
            {
                reportType = (XZReportType)keyValue;
            }

            posTotal = new PosTotal();
            posTotal.Organization_no = PosSettings.Default.Organization;
            posTotal.Store_no        = PosContext.Instance.RetailStore.Retail_store_no;
            posTotal.Pos_no          = PosSettings.Default.Station;
            switch (reportType)
            {
            case XZReportType.Z_DAILY:
            case XZReportType.X_DAILY:
                posTotal.Total_name = (int)TotalName.DAILY_BASE;
                break;

            case XZReportType.Z_WEEKLY:
            case XZReportType.X_WEEKLY:
                posTotal.Total_name = (int)TotalName.WEEKLY_BASE;
                break;

            case XZReportType.Z_MONTHLY:
            case XZReportType.X_MONTHLY:
                posTotal.Total_name = (int)TotalName.MONTHLY_BASE;
                break;

            case XZReportType.Z_YEARLY:
            case XZReportType.X_YEARLY:
                posTotal.Total_name = (int)TotalName.MONTHLY_BASE;
                break;
            }
            posTotal.Load();
            posTotal.Relations();



            if ((reportType == XZReportType.Z_WEEKLY || (reportType == XZReportType.Z_MONTHLY)))
            {
                // roll-up totals that migth be left over.
                switch (reportType)
                {
                case XZReportType.Z_DAILY:
                    UpdateTotals(posTotal, TotalType.DAILY_BASE, TotalName.DAILY_BASE);
                    break;

                case XZReportType.Z_WEEKLY:
                    UpdateTotals(posTotal, TotalType.WEEKLY_BASE, TotalName.WEEKLY_BASE);
                    break;

                case XZReportType.Z_MONTHLY:
                    UpdateTotals(posTotal, TotalType.MONTHLY_BASE, TotalName.MONTHLY_BASE);
                    break;
                }

                // re-read the totals
                posTotal = new PosTotal();
                posTotal.Organization_no = PosSettings.Default.Organization;
                posTotal.Store_no        = PosContext.Instance.RetailStore.Retail_store_no;
                posTotal.Pos_no          = PosSettings.Default.Station;
                posTotal.Load();
                posTotal.Relations();
            }

            // see if there is any total information.

            if (posTotal.Totals.Count > 0)
            {
                PosContext.Instance.Receipt.Update(this);
                //	PosError posError = new PosError(PosErrorCode.TERMINAL_REPORT);
                //	posError.Engage(0);
            }
            else
            {
                return;
            }


            switch (reportType)
            {
            case XZReportType.Z_DAILY:
                UpdateTotals(posTotal, TotalType.WEEKLY_BASE, TotalName.DAILY_BASE);
                break;

            case XZReportType.Z_WEEKLY:
                UpdateTotals(posTotal, TotalType.MONTHLY_BASE, TotalName.WEEKLY_BASE);
                break;

            case XZReportType.Z_MONTHLY:
                UpdateTotals(posTotal, TotalType.YEARLY_BASE, TotalName.MONTHLY_BASE);
                break;
            }

            // pause...

            //PosContext ().eventStack ().pushEvent (new Pause (context ()));
            //PosContext.Instance.Operprompt.Update((Pause) context ().eventStack ().event ());
            PosContext.Instance.InputLine   = "";
            PosContext.Instance.PosKeyValue = 0;
        }
Beispiel #30
0
        public override void  Engage(int keyValue)
        {
            //Check if employee role is authorized to this event
            if (!PosContext.Instance.Employee.RolesEventNames.Contains("Recall"))
            {
                PosError posError = new PosError(PosErrorCode.INSUFFICIENT_USER_AUTHORITY);
                posError.Engage(0);
                return;
            }

            try
            {
                if (PosContext.Instance.CurrentEj.SeqNo > 0)
                {
                    PosError posError = new PosError(PosErrorCode.RECALL_FAILLED);
                    posError.Engage(0);
                    return;
                }
            }
            catch (Exception ex)
            {
            }


            PosContext.Instance.ClearInput();
            trans                 = new Transaction(this.trxno);
            trans.Pos_no          = this.PosNo;
            trans.Organization_no = PosSettings.Default.Organization;
            trans.Store_no        = PosContext.Instance.RetailStore.Retail_store_no;
            trans.Load();

            PosContext.Instance.CurrentEj = Ej.GetSuspendedEj(trans);

            if (PosContext.Instance.CurrentEj.EjArrayList.Count > 0)
            {
                // finally make sure there are records
                foreach (Object obj in PosContext.Instance.CurrentEj.EjArrayList)
                {
                    EjLine line = (EjLine)obj;
                    PosContext.Instance.Receipt.Update(line);
                }

                this.States().Clear();
            }

            PosContext.Instance.TrxNo = this.TrxNo; /* ES01-26/11/08 */
            this.PromptText           = PosContext.Instance.Parameters.getParam("RegOpen");


            //PosContext.Instance.Operprompt.Update(this);
            PosContext.Instance.Receipt.Update(this);

            if (trans.Customer_tax_id.Length > 0)
            {
                EclipsePos.Data.Customer cus = new EclipsePos.Data.Customer();
                cus.Organization_no = PosSettings.Default.Organization;
                cus.Tax_id          = trans.Customer_tax_id;
                cus.LoadByTaxID();
                EjCustomer ejCus = new EjCustomer(cus);
                PosContext.Instance.Receipt.Update(ejCus);
                PosContext.Instance.EjCustomer = ejCus;
            }

            this.States().Clear();
            PosEventStack.Instance.ClearPending();

            //Clear transaction if complete
            if ((trans.State == (int)Transaction.Status.COMPLETE) ||
                (trans.State == (int)Transaction.Status.VOIDED))
            {
                PosEventStack.Instance.PushEvent(new FinishTransaction());
            }
        }