示例#1
0
 public void ReApplySurcharge()
 {
     if (this.Method == 0)
     {
         double percent = surcharge.Amount / 100;
         this.transItem.Amount     = PosContext.Instance.PosMath.Mult(PosContext.Instance.CurrentEj.EjSaleTotal(), percent);
         this.transItem.Ext_amount = transItem.Amount;
         transItem.UpdateAmounts();
         this.ReCompute = true;
         PosContext.Instance.Receipt.Update(this);
     }
 }
示例#2
0
        public void EffectChangeQuantity(int lineNumber)
        {
            object[] ejList = PosContext.Instance.CurrentEj.EjArrayList.ToArray();
            foreach (object obj in ejList)
            {
                EjLine ejLine = obj as EjLine;
                if (ejLine.LineNo != lineNumber)
                {
                    continue;
                }
                switch (ejLine.LineType)
                {
                case (int)EjLineType.ITEM:

                    this.ejItem = ejLine as EjItem;

                    this.transItem = (TransItem)ejLine.DataRecord();

                    if (transItem.State != (int)EjLineStates.VOID_ITEM)
                    {
                        transItem.Quantity = this.newQuantity;

                        transItem.Ext_amount = PosContext.Instance.PosMath.Mult(transItem.Amount, this.newQuantity);
                        transItem.Ext_amount = PosContext.Instance.PosMath.Mult(transItem.Ext_amount, PosContext.Instance.Sign);

                        transItem.UpdateAmounts();

                        PosContext.Instance.Operprompt.Update(this.ejItem);
                        PosContext.Instance.Receipt.Update(this);
                    }
                    break;

                case (int)EjLineType.ITEM_LINK:
                    //	TransItemLink itemLink = (TransItemLink) line.dataRecord ();
                    //	itemLink.setAmount (0.0);
                    break;



                case (int)EjLineType.TAX:
                    EjTax itemTax = (EjTax)ejLine as EjTax;
                    itemTax.ApplyTax();


                    break;
                }
            }
        }
示例#3
0
        public void ChangePrice(int lineNumber)
        {
            object[] ejList = PosContext.Instance.CurrentEj.EjArrayList.ToArray();
            foreach (object obj in ejList)
            {
                EjLine ejLine = obj as EjLine;
                if (ejLine.LineNo != lineNumber)
                {
                    continue;
                }
                switch (ejLine.LineType)
                {
                case (int)EjLineType.ITEM:

                    this.ejItem = ejLine as EjItem;

                    this.transItem = (TransItem)ejLine.DataRecord();

                    if (transItem.State != (int)EjLineStates.VOID_ITEM)
                    {
                        //transItem = PosContext.Instance.CurrentEjItem.TransItem;


                        //Create a price oveeride audit ( New line )
                        EclipsePos.Data.TransItem transItemAudit = new TransItem();
                        transItemAudit.Trans_no        = transItem.Trans_no;
                        transItemAudit.Organization_no = transItem.Organization_no;
                        transItemAudit.Store_no        = transItem.Store_no;
                        transItemAudit.Pos_no          = transItem.Pos_no;
                        transItemAudit.Sku_link        = transItem.Sku_link;
                        transItemAudit.Sku             = transItem.Sku;
                        transItemAudit.Item_desc       = transItem.Item_desc;
                        transItemAudit.Quantity        = transItem.Quantity;

                        transItemAudit.Amount     = transItem.Amount;
                        transItemAudit.Ext_amount = transItem.Ext_amount;     //PosContext.Instance.PosMath.Mult(transItem.Quantity, changedTransItem.Amount);
                        transItemAudit.State      = (int)EjLineStates.PRICE_OVERRIDE;



                        transItemAudit.Tax_exempt = transItem.Tax_exempt;
                        transItemAudit.Tax_incl   = transItem.Tax_incl;
                        transItemAudit.State      = (int)EjLineStates.PRICE_OVERRIDE;

                        EjItem ejItem = new EjItem(transItemAudit);

                        // Add to Ej to set the seq no and line no's
                        PosContext.Instance.CurrentEj.EjAdd(ejItem);

                        transItemAudit.Line_no = PosContext.Instance.CurrentEj.LineNo;
                        transItemAudit.Seq_no  = PosContext.Instance.CurrentEj.SeqNo;

                        transItemAudit.Add();



                        //Now change the current line to reflect the price change
                        transItem.Amount = newAmount;

                        transItem.Ext_amount = PosContext.Instance.PosMath.Mult(transItem.Quantity, newAmount);
                        transItem.Ext_amount = PosContext.Instance.PosMath.Mult(transItem.Ext_amount, PosContext.Instance.Sign);

                        transItem.UpdateAmounts();

                        this.ejItem.Desc = "*" + ejItem.Desc;
                        PosContext.Instance.Operprompt.Update(this.ejItem);
                        PosContext.Instance.Receipt.Update(this);
                    }
                    break;

                case (int)EjLineType.ITEM_LINK:
                    //	TransItemLink itemLink = (TransItemLink) line.dataRecord ();
                    //	itemLink.setAmount (0.0);
                    break;



                case (int)EjLineType.TAX:
                    EjTax itemTax = (EjTax)ejLine as EjTax;
                    //itemTax.ApplyTax();


                    break;
                }
            }
        }