Subversion Repositories SmartDukaan

Rev

Rev 27868 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<section class="wrapper">
        <div class="row">
                <div class="col-lg-12">
                        <h3 class="page-header"><i class="icon_document_alt"></i>Details</h3>
                        <ol class="breadcrumb">
                                <li><i class="fa fa-home"></i><a href="${rc.contextPath}/dashboard">Home</a></li>
                                <li><i class="icon_document_alt"></i>Warehouse Wise Secondary Billing</li>                                              
                        </ol>
                </div>
        </div>

    <div class = "row" >
  
                        <div class="col-lg-12">
                                 <table id="billingBrandItem" class="table table-striped table-advance table-hover">
                                 <thead>
                                 <tr>
                                 <th rowspan="3">Warehouse</th>
                                 <th rowspan="3">Brand</th>
                                 <th rowspan="3">Qty</th>
                                 <th rowspan="3">Total</th>
                                  #foreach($dr in $dateRange)
                                  
                                   <th colspan= 2> $dr.format($dateMonthFormatter) </th>
                                  #end
                                  </tr>
                                 
                                 
                                 <tr>
                                  #foreach($dr in $dateRange)
                                  #if($dateWiseQtyTotal.get($dr))
                                   <td> $dateWiseQtyTotal.get($dr) </td>
                                   <td class="currency"> $dateWiseTotal.get($dr)</td>
                                   #else
                                   <td> - </td>
                                   <td> -</td>
                                   #end
                                  #end
                                </tr>
                        
                                 <tr>
                                  #foreach($dr in $dateRange)
                                   <th> Qty </th>
                                   <th> Val </th>
                                  #end
                                </tr>
                        
                        
                                 </thead>
                                <tbody>
                                
                
                                
                         #foreach($bwo in $brandWarehouseOrderMap.entrySet())
                              <tr>
                                  <td> $warehouseMap.get($bwo.getKey().getWarehouseId())</td>
                                  <td> $bwo.getKey().getBrand()</td>
                                  <td data-date = "$dateRange"  data-brand = "$bwo.getKey().getBrand()" data-warehouseid = "$bwo.getKey().getWarehouseId()"> $bwo.getKey().getQty()</td>
                                  <td class="currency" data-date = "$dateRange"  data-brand = "$bwo.getKey().getBrand()" data-warehouseid = "$bwo.getKey().getWarehouseId()"> $bwo.getKey().getTotal()</td>
                                 #foreach($dr in $dateRange)
                                  #if($bwo.getValue().get($dr))
                                       <td data-date = "$dr"  data-brand = "$bwo.getKey().getBrand()" data-warehouseid = "$bwo.getKey().getWarehouseId()"> $bwo.getValue().get($dr).getQty()</td>
                                       <td class="" data-date = "$dr"  data-brand = "$bwo.getKey().getBrand()" data-warehouseid = "$bwo.getKey().getWarehouseId()"> $bwo.getValue().get($dr).getValue() </td>
                                     #else
                                       <td> - </td>
                                       <td> - </td>
                                     #end
                                     #end
                            </tr>       
                        #end
                                 
                                        
                            </tbody>
                        </table>
                        </div>
                        </div>
                        
                        <div class="item-wise-container">
                        
                        
                        </div>

</section>
         
<script type="text/javascript">
 var table = $('#billingBrandItem').DataTable( {
        "scrollX": true,
            "pageLength": 25,
             "fixedColumns":   {
               leftColumns: 2
            
        }
            
    } );
    
    $('#billingBrandItem').on('click','tbody td',function(e){
    var cell_value = table.cell(this).data();
    console.log(cell_value);
    
    if(cell_value == "-"){
    
    return false;
    }
    
   
    var dataDate =  $(this).data('date').replace(/[\[\]']+/g,'');
    var brand = $(this).data('brand')
    var warehouseId = $(this).data('warehouseid');
    
     if(brand == undefined){
    return false;
    }
    console.log(cell_value);
    console.log(dataDate);
      console.log(warehouseId);
   
        doGetAjaxRequestHandler(context + "/getSecondaryBillingItemByBrand?warehouseId="
                                                + warehouseId+ "&brand="+brand + "&date="+dataDate, function(response) {

                                        $('.' + "item-wise-container").html(response);
                                                console.log(response)
                                });
    
      });
</script>