Subversion Repositories SmartDukaan

Rev

Rev 30055 | Rev 30409 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed


         <section>
         <div>
          <table class="table table-border table-condensed table-bordered" id="brandWiseIncome">

        <thead class="row htable">

            <tr style="color:black;">
                <th>Model Name</th>
                <th>Purchase Qty</th>
               <th>Purchase Margin</th>
               <th>Sale Qty</th>
               <th>Sale Margin</th>
               <th>Pending Sale Magin</th>
               <th>Total Amount</th>
            </tr>
       </thead>
            <tbody>
             #foreach($modelWiseEntry in $modelWiseMap.entrySet())
           
            #if($modelWiseEntry.getValue().getCatalogItemId())
               <tr class="imei_wise_income" data-catalogitemid="$modelWiseEntry.getValue().getCatalogItemId()" data-month="$month">
            #else
               <tr class="imei_wise_income" data-catalogitemid="$purchaseWiseMap.get($modelWiseEntry.getKey()).getCatalogItemId()" data-month="$month">
            #end
              
              #if($modelWiseEntry.getValue().getModelName())
                <td>$modelWiseEntry.getValue().getModelName() $modelWiseEntry.getKey()</td>
                #else
                <td>$modelWiseEntry.getKey()</td>
              #end
           
              #if($purchaseWiseMap.get($modelWiseEntry.getKey()).getQty())
                 <td>$purchaseWiseMap.get($modelWiseEntry.getKey()).getQty()</td>
              #else
                 <td>--</td>
              #end
              #if($purchaseWiseMap.get($modelWiseEntry.getKey()).getAmount())
                 <td>$nf.format($purchaseWiseMap.get($modelWiseEntry.getKey()).getAmount())</td>
              #else
                 <td>--</td>
              #end
              
              #if($modelWiseEntry.getValue().getQty() )
                  <td>$modelWiseEntry.getValue().getQty()</td>
              #else
                   <td>--</td>
              #end
              
             #if($categoryUpradeBrandModelMap.get($modelWiseEntry.getKey()))
          
               #if($modelWiseEntry.getValue().getAmount())
                  <td>$nf.format($modelWiseEntry.getValue().getAmount()) <i class='far fa-arrow-alt-circle-up' style="color: green;" title="$nf.format($categoryUpradeBrandModelMap.get($modelWiseEntry.getKey())) Category Upgrade Additional Margin."></i></td>
              #else
                  <td> --  <i class='far fa-arrow-alt-circle-up' style="color: green;" title="$nf.format($categoryUpradeBrandModelMap.get($modelWiseEntry.getKey())) Category Upgrade Additional Margin."></i></td>
              #end
              #else
              #if($modelWiseEntry.getValue().getAmount())
                  <td>$nf.format($modelWiseEntry.getValue().getAmount()) </td>
              #else
                  <td>--</td>
              #end
              
              #end
              
              #if($modelWiseEntry.getValue().getPendingSaleAmount())
              <td>$modelWiseEntry.getValue().getPendingSaleAmount()</td>
              #else
                <td>--</td>
              #end
              
              #if($modelWiseTotalAmount.get($modelWiseEntry.getKey()))
                  <td>$nf.format($modelWiseTotalAmount.get($modelWiseEntry.getKey()))</td>
              #else
                   <td>--</td>
              #end
              
           </tr>       
            #end
            
         <tbody>
            
          <tfoot>
             <tr>
               <td style="font-weight: bold;">Total</td>
               <td>-</td>
               <td id= "brand-purchase-total"></td>
                <td>-</td>
               <td id = "brand-sale-total"> </td>
               <td id = "brand-pending-total"></td>
               
               <td id ="brand-sum-total"></td>
             
             </tr>
         </tfoot>
           
           
      </table>   
       
         </div>    
      
    </section>   
   
 <script type="text/javascript">

 $(document).ready(function() {
        var table = $('#brandWiseIncome').DataTable(
                {
                    "bPaginate": true,
                    "bLengthChange": true,
                    "bFilter": true,
                    "bInfo": false,
                    "bAutoWidth": false,
                    "scrollX": true,
                   
            });
            
           datatableSum();
                    table.on('search.dt', function () {
             console.log('Currently applied global search: ' + table.search());
              datatableSum();
        });
        
 });
        
  
         function datatableSum() {
         
              var col_two_sum = $('#brandWiseIncome').DataTable().column(2,{page:'current'}).data().sum();
                 $('#brand-purchase-total').html(col_two_sum);
              
               var col_four_sum = $('#brandWiseIncome').DataTable().column(4,{page:'current'}).data().sum();
                 console.log(col_four_sum)
                  $('#brand-sale-total').html(col_four_sum);
                    
                   var col_five_sum = $('#brandWiseIncome').DataTable().column(5,{page:'current'}).data().sum();
                 $('#brand-pending-total').html(col_five_sum);
              
              
               var col_six_sum = $('#brandWiseIncome').DataTable().column(6,{page:'current'}).data().sum();
                 console.log(col_six_sum)
                  $('#brand-sum-total').html(col_six_sum);
                    
             }
   
    
    </script>