{assign var = tsqunt  value = 0}
{assign var = trqunt  value = 0}
{assign var = tsr  value = 0}
{assign var = tstotal  value = 0}
{assign var = trtotal  value = 0}
{assign var = tec  value = 0}



<div class="row" style="text-align: center;">
    <div class="col-lg-2">
               <h3>    ك المبيعات   :   <span id="tsqunt"> {$tsqunt} </span></h3> 
    </div>
    <div class="col-lg-2">
              <h3>    ك المردود     :  <span id="trqunt">{$trqunt} </span></h3> 
    </div>
    <div class="col-lg-2">
               <h3>    الكميه      :   <span id="tsr"> {$tsr} </span></h3> 
    </div>
    <div class="col-lg-2">
              <h3>  ج  المبيعات     : <span id="trqunt">{$tstotal} </span></h3> 
    </div>
    <div class="col-lg-2">
            <h3 > ج المردود    :  <span id="trtotal"> {$trtotal} </span></h3> 
    </div>
    <div class="col-lg-2">
               <h3>    الاجمالى   :   <span id="tec"> {$tec} </span></h3> 
    </div>
</div>  


<div class="row">
        <table class="table table-bordered">
          <thead>
            <tr>
              <th scope="col">التصنيف</th>
              <th scope="col">ك  المبيعات</th>
              <th scope="col">ك المردود</th>
              <th scope="col">الكميه</th>
              <th scope="col">ج المبيعات   </th>
              <th scope="col">ج المردود</th>
              <th scope="col">الاجمالى</th>            
            </tr>
          </thead>
          <tbody>
             {foreach $productcatsdatas as $productcatsdata}
            <tr>
              <td>{$productcatsdata.productCatName}</td>
              <td>{$productcatsdata.squnt}</td>
              <td>{$productcatsdata.rqunt}</td>
              <td>{$productcatsdata.squnt - $productcatsdata.rqunt}</td>
              <td>{$productcatsdata.stotal}</td>
              <td>{$productcatsdata.rtotal}</td>
              <td>{$productcatsdata.stotal - $productcatsdata.rtotal}</td>
            
              
            </tr>
              {assign  var = tsqunt value = $tsqunt + $productcatsdata.squnt}
              {assign  var = trqunt value = $trqunt + $productcatsdata.rqunt}
              {assign  var = tsr value = $tsr + ($productcatsdata.squnt - $productcatsdata.rqunt)}
              {assign  var = tstotal value = $tstotal + $productcatsdata.stotal}
              {assign  var = trtotal value = $trtotal + $productcatsdata.rtotal}
              {assign  var = tec value = $tec + ($productcatsdata.stotal - $productcatsdata.rtotal)}
            {/foreach}
          </tbody>           
        </table>
</div>

<div class="row" style="text-align: center;">
      <div class="col-lg-2">
               <h3>    ك المبيعات   :   <span id="gtsqunt"> {$tsqunt} </span></h3> 
    </div>
    <div class="col-lg-2">
              <h3>    ك المردود     :  <span id="gtrqunt">{$trqunt} </span></h3> 
    </div>
    <div class="col-lg-2">
               <h3>    الكميه      :   <span id="gtsr"> {$tsr} </span></h3> 
    </div>
    <div class="col-lg-2">
              <h3>  ج  المبيعات     : <span id="gtrqunt">{$tstotal} </span></h3> 
    </div>
    <div class="col-lg-2">
            <h3 > ج المردود    :  <span id="gtrtotal"> {$trtotal} </span></h3> 
    </div>
    <div class="col-lg-2">
               <h3>    الاجمالى   :   <span id="gtec"> {$tec} </span></h3> 
    </div>

</div>  



{literal}
<script type="text/javascript">
$(document).ready(function () {
      $("#tsqunt").html($("#gtsqunt").text());
      $("#trqunt").html($("#gtrqunt").text());
      $("#tsr").html($("#gtsr").text());
      $("#trqunt").html($("#gtrqunt").text());
      $("#trtotal").html($("#gtrtotal").text());
      $("#tec").html($("#gtec").text());
});  
</script>
{/literal}
