public virtual Object Clone() { FiscalItem cloneItem = (FiscalItem)this.MemberwiseClone(); cloneItem.adjustments = new List <Adjustment>(this.adjustments); return(cloneItem); }
public override bool CanAddItem(FiscalItem item) { if (TotalAmount + item.TotalAmount > CashRegister.DataConnector.CurrentSettings.ReceiptLimit) { throw new ReceiptLimitExceededException(); } return(base.CanAddItem(item)); }
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); }
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; } }