public ActionResult GetAllPrintSalesRecord() { decimal total = 0; decimal tax = 0; decimal discount = 0; if (modifiedData != null) { total = Convert.ToDecimal(TotalAmount); discount = Sum(a=>a.DiscountPercent); tax = Sum(discount * VatPercent) / 100); } return Json(new { modifiedData = modifiedData, total = total, discount = discount, tax = tax }, JsonRequestBehavior.AllowGet); }