title: Mvc 3: Using calculated fields in a model and displaying calculated fields in a view
body: <p>I need to show the result of a stored procedure and make it look like the attached image. I know I have to create a model that will look like this</p>
  
  <pre><code>public class MyInvoice
  {
      public DateTime invoiceDate { get; set; }
      public string invoiceNumber { get; set; }
      public double amount { get; set; }
      public double amountDue { get; set; }
  }
  </code></pre>
  
  <p>The Other amount will be a total of some fields
  Total Due will be a sum of Other amount and total sum of amount due</p>
  
  <p>I will need to pass just one model to my view. How can I include the calculated fields in my model?
  I will like to have access to the calculated fields in my view. 
  Do I just add other amount and total due to my model?</p>
  
  <p>I also know I have to write something like this in my action result method but not sure how to handle
  other amount and total due since they are not coming from the database.</p>
  
  <pre><code>IEnumerable&lt;MyInvoice&gt; model = _myInvoiceService.GetInvoice()
  return view(model);
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/5Kl9S.png" alt="enter image description here"></p>