title: how to store math function value in mysql using angularjs?
body: <p>I am creating invoice generator. In that I want to store the total,discount and all things in my database. 
  Total and discount are calculated as follow...</p>
  
  <pre><code>&lt;tr ng-repeat="list in data"&gt;
    &lt;td&gt; 
      &lt;label class="clabel"&gt;Subtotal&lt;/label&gt;
    &lt;/td&gt;
    &lt;td ng-model="subtotal"&gt;{{list.sale_price*list.quantity}}&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr ng-repeat="list in data"&gt;
    &lt;td&gt; 
      &lt;label class="clabel"&gt;Tax(2%)&lt;/label&gt;
    &lt;/td&gt;
    &lt;td ng-model="tax"&gt;{{((list.sale_price*list.quantity)*2)/100}}&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr ng-repeat="list in data"&gt;
    &lt;td&gt; 
      &lt;label class="clabel"&gt;Discount(%)&lt;/label&gt;
    &lt;/td&gt;
    &lt;td ng-model="discount"&gt;{{((list.sale_price*list.quantity)*list.discount)/100}}&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr ng-repeat="list in data"&gt;
    &lt;td&gt; 
      &lt;label class="clabel"&gt;Total&lt;/label&gt;
    &lt;/td&gt;
    &lt;td ng-model="total"&gt;{{((list.sale_price*list.quantity)+(((list.sale_price*list.quantity)*2)/100))-(((list.sale_price*list.quantity)*list.discount)/100)}}&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
      &lt;td colspan="2"&gt;
      &lt;button class="btn btn-success" style="margin-left:400px;" ng-click="GenerateBill();updateAll()"&gt;Generate Invoice&lt;/button&gt;
      &lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>Now I want to save the calculated values in my database.which means I want to store <code>list.sale_price*list.quantity</code> 's value.</p>
  
  <p>js part is here..</p>
  
  <pre><code>$scope.updateAll = function(){
  
      data={
          qnt:$scope.qnt,
          subt:$scope.subtotal,
          tax:$scope.tax,
          dis:$scope.discount,
          total:$scope.total
      }
      $http.post("../POS_System/widget/updateAll.php?barcode="+$scope.barcode,data).success(function(data){
  
      });
  </code></pre>
  
  <p>please help me out...</p>