Emmmanuel FIADUFE

Emmmanuel FIADUFE

  • 785
  • 1.1k
  • 56k

In controller Discount and Vat Value are not consistent

Feb 8 2024 11:20 AM

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);
        }


Answers (3)