Subversion Repositories SmartDukaan

Rev

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

<style>
        .pointer {
                cursor:pointer;
        }
        .btn:hover{
                color: grey;
                text-decoration: none;
        }
        .btn-primary:hover{
                color: grey;
                text-decoration: none;
        }
        .retailer-details{
                cursor:pointer;
        }
</style>

<script type="text/javascript">
        $("#partnerFofoId").typeahead({
          source: retailers,
          autoSelect: true,
          displayText:function(item){return item.businessName + "-" + item.address.city;},
          afterSelect:  function(currentItem){
                                                currentFofoId = currentItem.partnerId;
                                                fofoId = currentItem.partnerId;
                                                        doAjaxRequestHandler(context+"/return/inventory/" + currentFofoId, "GET", function(response){
                                inventoryTable.rows().remove().rows.add($(response)).draw(false);
                });
                                        }
        });
        
</script>

<section class="wrapper">            
        <div class="row">
                <div class="col-lg-12">
                        <h3 class="page-header"><i class="icon_document_alt"></i>View/Request Return</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>View Returnables</li>
                        </ol>
                </div>
        </div>
        
    <div>
             <div class="row">
             
                <div class="col-lg-2">
                                        <div class="input-group">
                                <input id="partnerFofoId" type="text" class="typeahead form-control form-control-sm" placeholder="Search Partner by Store" data-provide="typeahead" 
                                 #if(${retailerName}) value="${retailerName}" #end
                                 autocomplete="off"/>
                           </div> 
                            </div>
                            
                        <div class="col-lg-4" id="inventory-container">
                                <table class="table table-striped table-condensed table-bordered">
                                <thead>
                                    <tr>
                                                        <th>Item Id</th>
                                                        <th>Description</th>
                                                        <th>Qty</th>
                                    </tr>
                                </thead>
                                <tbody id="inventory-body">
                                </tbody>
                                </table>
                        </div>
                        <div class="col-lg-6" id="returnable-container">
                                <table class="table table-striped table-condensed table-bordered">
                                        <thead>
                                                <tr>
                                                        <th>Serial Number</th>
                                                        <th>Unit Price</th>
                                                        <th>Scanned On</th>
                                                        <th>Status</th>
                                                </tr>
                                        </thead>
                                        <tbody id="returnables-body">
                                        </tbody>
                                </table>
                        </div>
        </div>
</section>
<script type="text/javascript">
/* Create an array with the values of all the input boxes in a column */
$.fn.dataTable.ext.order['dom-text'] = function  ( settings, col )
{
    return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
        return $('input', td).val();
    } );
}
 
/* Create an array with the values of all the input boxes in a column, parsed as numbers */
$.fn.dataTable.ext.order['dom-text-numeric'] = function  ( settings, col )
{
    return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
        return $('input', td).val() * 1;
    } );
}
 
/* Create an array with the values of all the select options in a column */
$.fn.dataTable.ext.order['dom-select'] = function  ( settings, col )
{
    return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
        return $('select', td).val();
    } );
}
 
/* Create an array with the values of all the checkboxes in a column */
$.fn.dataTable.ext.order['dom-checkbox'] = function  ( settings, col )
{
    return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
        return $('input', td).prop('checked') ? '1' : '0';
    } );
}
 
/* Initialise the table with the required column ordering data types */
$(document).ready(function() {
    /*storesTable = $('#store-container').find('table').DataTable({"pageLength": 20});*/
    inventoryTable = $('#inventory-container').find('table').DataTable(
     {
                "paging": true,
        "searching": true
         }
        );
    returnsTable = $('#returnable-container').find('table').DataTable({
                "paging": true,
                "searching" : true
        });
});

</script>