Subversion Repositories SmartDukaan

Rev

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

<section>


<!--<style>
        .table-striped > tbody > tr:nth-child(odd) > td{
                background: white;
                background-color: white;
        }
        .table-striped > tbody > tr:nth-child(even) > td{
                background: white;
                background-color:white;
        }
        .table-striped > tbody > tr:hover > td,
        .table-striped > tbody > tr:hover {
                background-color: #e98c8f;
                color:white;
        }
        .btn:hover{
                color: grey;
                text-decoration: none;
        }
        .btn-primary:hover{
                color: grey;
                text-decoration: none;
        }
        .sale-details{
                cursor:pointer;
        }
</style>-->
<script type="text/javascript">


        </script>
<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 Brand Stock  Detail</li>                                         
                        </ol>
                </div>
        </div>

<div class="col-lg-4">
        <table style="Width:100%; margin:15px">
                <tr>
                        <td  style="Width:40%; float:left">
                     <div class = "row">
                       <div class="col-lg-12">
                            <div class="input-group">
                                <select class="form-control input-sm" id = "warehouseMap" name="warehouseMap" placeholder="Warehouse">
                                                <option value="" disabled selected>Warehouse</option>
                                                #if($warehouseId.contains(0))
                                                <option value="0" selected>All</option>
                                                #else 
                                                        <option value="0">All</option>
                                                        #end
                                                  #foreach($wm in $warehouseMap.entrySet()))
                              #if($warehouseId.contains($wm.getKey()))
                                        <option value="$wm.getKey()" selected>$wm.getValue()</option>
                                  #else
                                        <option value="$wm.getKey()">$wm.getValue()</option>
                                  #end
                                  #end
                                </select>
                        <span class="input-group-btn">
                                <button class="btn btn-primary submit" id="warehouse-wise-stock" type="button">Go!</button>
                        </span>
                  </div>
                  </div>
                 </div>
                </td>
           
          
                </tr>
    </table>
<div class="row">
                                        
                        <div class="col-lg-12">
                                 <table id="warehouseBrandStock" class="table table-striped table-advance table-hover">
                                 <thead>
                                <tr>
                                        <th>Brand</th>
                                        <th>Category</th>
                                        <th>Stock Qty</th>
                                        <th>Stock Value</th>
                                        <th>Pending Indent</th>
                                        <th>Tertiary</th>
                                 </tr>
                                 </thead>
                                <tbody>
                                    #foreach($key in $warehouseWiseBrandStock)
                                        <tr>
                                     <td>$key.getBrand()</td>
                                     <td>$key.getCategoryName()</td>
                                     <td>$key.getStockQty()</td>
                                     <td class="currency">$key.getStockValue()</td> 
                                     <td>$key.getPendingIndent()</td>
                                     <td>$key.getTertiary()</td>
                                        </tr>
                                         #end
                                        
                            </tbody>
                        </table>
                    </div>
                                                
</div>

</div>

        <div class="col-lg-8">
                <div id="warehouse-table">
                        <div class="row">
                        <div class="col-lg-12 warehouse-brand-item-container">
                        </div>
                    </div>
                </div>
        </div>
                                        

</section>
<script type="text/javascript">
$(document).ready(function() {
    
    $('#warehouseBrandStock thead tr').clone(true).appendTo( '#warehouseBrandStock thead' );
    $('#warehouseBrandStock thead tr:eq(1) th').each( function (i) {
        var title = $(this).text();
        $(this).html( '<input type="text" style = "width:60%;" placeholder="Search '+title+'" />' );
 
        $( 'input', this ).on( 'keyup change', function () {
            if ( table.column(i).search() !== this.value ) {
                table
                    .column(i)
                    .search( this.value )
                    .draw();
            }
        } );
    });
    var table = $('#warehouseBrandStock').DataTable( {
        retrieve: true,
        orderCellsTop: true,
        fixedHeader: true
    });
    
    $("#warehouse-wise-stock").click(function() {
                var warehouseId = $('#warehouseMap').val();
          doGetAjaxRequestHandler(context + "/getWarehouseWiseBrandStock?warehouseId="+warehouseId,
                        function(response) {
                                $('#' + "main-content").html(response);
                                console.log(response)
                        });
        });
    
    $('#warehouseBrandStock tbody').on('click', ' tr', function () {
        var data = table.row( this ).data();
        var warehouseId = $('#warehouseMap').val();
        var brands = [];
        brands.push(data[0])
        doGetAjaxRequestHandler(context + "/getWarehouseWiseBrandAndCategory?warehouseId="+warehouseId+"&brands="+brands+"&category="+data[1], function(response) {
                        $('.warehouse-brand-item-container').html(response);
                        doGetAjaxRequestHandler(context + "/getWarehouseWiseItemStock?warehouseId="+warehouseId+"&brands="+brands+"&category="+data[1], function(response) {
                                        $('#warehosueItemStock').html(response);
                        });
                });

    });
});

</script>