Ejemplo n.º 1
0
        public virtual Object Clone()
        {
            FiscalItem cloneItem = (FiscalItem)this.MemberwiseClone();

            cloneItem.adjustments = new List <Adjustment>(this.adjustments);
            return(cloneItem);
        }
Ejemplo n.º 2
0
 public override bool CanAddItem(FiscalItem item)
 {
     if (TotalAmount + item.TotalAmount > CashRegister.DataConnector.CurrentSettings.ReceiptLimit)
     {
         throw new ReceiptLimitExceededException();
     }
     return(base.CanAddItem(item));
 }
Ejemplo n.º 3
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            if (!(obj is FiscalItem))
            {
                return(false);
            }
            FiscalItem fi = (FiscalItem)obj;

            return(this.TotalAmount == fi.TotalAmount && this.Product == fi.Product);
        }
Ejemplo n.º 4
0
        public VoidItem(FiscalItem item)
        {
            //voidedSalesItem = item;
            barcode     = item.Barcode;
            name        = item.Name;
            product     = item.Product;
            quantity    = item.Quantity;
            salesPerson = item.SalesPerson;
            unit        = item.Unit;
            unitPrice   = item.UnitPrice;
            totalAmount = item.TotalAmount;

            /* to escape any exception i checked the condition that the item is sale item */

            /* quantity should be remaining quantity of sale item and
             * totalAmount should be remaing amount of the sale item
             */
            if (item is SalesItem)
            {
                quantity    -= ((SalesItem)item).VoidQuantity;
                totalAmount -= ((SalesItem)item).VoidAmount;
            }
        }