Subversion Repositories SmartDukaan

Rev

Rev 26323 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 26323 Rev 34142
Line 1... Line 1...
1
<style>
1
<style>
2
	.pointer {
2
    .pointer {
3
		cursor:pointer;
3
        cursor: pointer;
-
 
4
    }
4
	}
5
 
5
	.btn:hover{
6
    .btn:hover {
6
  		color: grey;
7
        color: grey;
7
  		text-decoration: none;
8
        text-decoration: none;
-
 
9
    }
8
	}
10
 
9
	.btn-primary:hover{
11
    .btn-primary:hover {
10
  		color: grey;
12
        color: grey;
11
  		text-decoration: none;
13
        text-decoration: none;
-
 
14
    }
12
	}
15
 
13
	.retailer-details{
16
    .retailer-details {
14
		cursor:pointer;
17
        cursor: pointer;
15
	}
18
    }
16
</style>
19
</style>
17
 
20
 
18
<script type="text/javascript">
21
<script type="text/javascript">
19
	$("#partnerFofoId").typeahead({
22
    // $("#partnerFofoId").typeahead({
20
	  source: retailers,
23
    //     source: retailers,
21
	  autoSelect: true,
24
    //     autoSelect: true,
-
 
25
    //     displayText: function (item) {
22
	  displayText:function(item){return item.businessName + "-" + item.address.city;},
26
    //         return item.businessName + "-" + item.address.city;
-
 
27
    //     },
23
	  afterSelect:	function(currentItem){
28
    //     afterSelect: function (currentItem) {
24
	  					currentFofoId = currentItem.partnerId;
29
    //         currentFofoId = currentItem.partnerId;
25
	  					fofoId = currentItem.partnerId;
30
    //         fofoId = currentItem.partnerId;
26
	  						doAjaxRequestHandler(context+"/return/inventory/" + currentFofoId, "GET", function(response){
31
    //         doAjaxRequestHandler(context + "/return/inventory/" + currentFofoId, "GET", function (response) {
27
		              	inventoryTable.rows().remove().rows.add($(response)).draw(false);
32
    //             inventoryTable.rows().remove().rows.add($(response)).draw(false);
28
		});
33
    //         });
29
	  				}
34
    //     }
30
	});
35
    // });
31
	
36
 
32
</script>
37
</script>
33
 
38
 
34
<section class="wrapper">            
39
<section class="wrapper">
35
	<div class="row">
40
    <div class="row">
36
		<div class="col-lg-12">
41
        <div class="col-lg-12">
37
			<h3 class="page-header"><i class="icon_document_alt"></i>View/Request Return</h3>
42
            <h3 class="page-header"><i class="icon_document_alt"></i>View/Request Return</h3>
38
			<ol class="breadcrumb">
43
            <ol class="breadcrumb">
39
				<li><i class="fa fa-home"></i><a href="${rc.contextPath}/dashboard">Home</a></li>
44
                <li><i class="fa fa-home"></i><a href="${rc.contextPath}/dashboard">Home</a></li>
40
				<li><i class="icon_document_alt"></i>View Returnables</li>
45
                <li><i class="icon_document_alt"></i>View Returnables</li>
41
			</ol>
46
            </ol>
42
		</div>
47
        </div>
43
	</div>
48
    </div>
44
	
49
 
45
    <div>
50
    <div>
46
	     <div class="row">
51
        <div class="row">
47
	     
-
 
48
	     	<div class="col-lg-2">
52
            <div class="col-lg-2 form-group">
-
 
53
                <select class="form-control input-sm" id="fofo-users" name="fofo-users" placeholder="Partners">
49
					<div class="input-group">
54
                    <option value="" disabled selected>Partners</option>
50
			    	<input id="partnerFofoId" type="text" class="typeahead form-control form-control-sm" placeholder="Search Partner by Store" data-provide="typeahead" 
55
                    #foreach($fofoId in $customRetailersMap.keySet())
51
			    	 #if(${retailerName}) value="${retailerName}" #end
56
                        <option value="$fofoId"
-
 
57
                                data-email="$customRetailersMap.get($fofoId).getEmail()">$customRetailersMap.get($fofoId).getBusinessName()</option>
52
			    	 autocomplete="off"/>
58
                    #end
53
			   </div> 
59
                </select>
54
			    </div>
60
            </div>
-
 
61
 
55
			    
62
 
56
			<div class="col-lg-4" id="inventory-container">
63
            <div class="col-lg-4" id="inventory-container">
57
				<table class="table table-striped table-condensed table-bordered">
64
                <table class="table table-striped table-condensed table-bordered">
58
	    			<thead>
65
                    <thead>
59
			            <tr>
66
                    <tr>
60
							<th>Item Id</th>
67
                        <th>Item Id</th>
61
							<th>Description</th>
68
                        <th>Description</th>
62
							<th>Qty</th>
69
                        <th>Qty</th>
63
			            </tr>
70
                    </tr>
64
			        </thead>
71
                    </thead>
65
			        <tbody id="inventory-body">
72
                    <tbody id="inventory-body">
66
			        </tbody>
73
                    </tbody>
67
				</table>
74
                </table>
68
			</div>
75
            </div>
69
			<div class="col-lg-6" id="returnable-container">
76
            <div class="col-lg-6" id="returnable-container">
70
				<table class="table table-striped table-condensed table-bordered">
77
                <table class="table table-striped table-condensed table-bordered">
71
					<thead>
78
                    <thead>
72
						<tr>
79
                    <tr>
73
							<th>Serial Number</th>
80
                        <th>Serial Number</th>
74
							<th>Unit Price</th>
81
                        <th>Unit Price</th>
75
							<th>Scanned On</th>
82
                        <th>Scanned On</th>
76
							<th>Status</th>
83
                        <th>Status</th>
77
						</tr>
84
                    </tr>
78
					</thead>
85
                    </thead>
79
					<tbody id="returnables-body">
86
                    <tbody id="returnables-body">
80
					</tbody>
87
                    </tbody>
81
				</table>
88
                </table>
-
 
89
            </div>
82
			</div>
90
        </div>
83
    	</div>
91
    </div>
84
</section>
92
</section>
85
<script type="text/javascript">
93
<script type="text/javascript">
-
 
94
 
-
 
95
    $(document).on('change', 'select[name="fofo-users"]', function () {
-
 
96
        console.log("partner select");
-
 
97
        let fofoId = $('select[name="fofo-users"]').val();
-
 
98
        console.log("partner id -", fofoId);
-
 
99
        doAjaxRequestHandler(context + "/return/inventory/" + fofoId, "GET", function (response) {
-
 
100
            inventoryTable.rows().remove().rows.add($(response)).draw(false);
-
 
101
        });
-
 
102
    })
86
/* Create an array with the values of all the input boxes in a column */
103
    /* Create an array with the values of all the input boxes in a column */
87
$.fn.dataTable.ext.order['dom-text'] = function  ( settings, col )
104
    $.fn.dataTable.ext.order['dom-text'] = function (settings, col) {
88
{
-
 
89
    return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
105
        return this.api().column(col, {order: 'index'}).nodes().map(function (td, i) {
90
        return $('input', td).val();
106
            return $('input', td).val();
91
    } );
107
        });
92
}
108
    }
93
 
109
 
94
/* Create an array with the values of all the input boxes in a column, parsed as numbers */
110
    /* Create an array with the values of all the input boxes in a column, parsed as numbers */
95
$.fn.dataTable.ext.order['dom-text-numeric'] = function  ( settings, col )
111
    $.fn.dataTable.ext.order['dom-text-numeric'] = function (settings, col) {
96
{
-
 
97
    return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
112
        return this.api().column(col, {order: 'index'}).nodes().map(function (td, i) {
98
        return $('input', td).val() * 1;
113
            return $('input', td).val() * 1;
99
    } );
114
        });
100
}
115
    }
101
 
116
 
102
/* Create an array with the values of all the select options in a column */
117
    /* Create an array with the values of all the select options in a column */
103
$.fn.dataTable.ext.order['dom-select'] = function  ( settings, col )
118
    $.fn.dataTable.ext.order['dom-select'] = function (settings, col) {
104
{
-
 
105
    return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
119
        return this.api().column(col, {order: 'index'}).nodes().map(function (td, i) {
106
        return $('select', td).val();
120
            return $('select', td).val();
107
    } );
121
        });
108
}
122
    }
109
 
123
 
110
/* Create an array with the values of all the checkboxes in a column */
124
    /* Create an array with the values of all the checkboxes in a column */
111
$.fn.dataTable.ext.order['dom-checkbox'] = function  ( settings, col )
125
    $.fn.dataTable.ext.order['dom-checkbox'] = function (settings, col) {
112
{
-
 
113
    return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
126
        return this.api().column(col, {order: 'index'}).nodes().map(function (td, i) {
114
        return $('input', td).prop('checked') ? '1' : '0';
127
            return $('input', td).prop('checked') ? '1' : '0';
115
    } );
128
        });
116
}
129
    }
117
 
130
 
118
/* Initialise the table with the required column ordering data types */
131
    /* Initialise the table with the required column ordering data types */
119
$(document).ready(function() {
132
    $(document).ready(function () {
120
    /*storesTable = $('#store-container').find('table').DataTable({"pageLength": 20});*/
133
        /*storesTable = $('#store-container').find('table').DataTable({"pageLength": 20});*/
121
    inventoryTable = $('#inventory-container').find('table').DataTable(
134
        inventoryTable = $('#inventory-container').find('table').DataTable(
122
     {
135
                {
123
   		"paging": true,
136
                    "paging": true,
124
    	"searching": true
137
                    "searching": true
125
	 }
138
                }
126
	);
139
        );
127
    returnsTable = $('#returnable-container').find('table').DataTable({
140
        returnsTable = $('#returnable-container').find('table').DataTable({
128
   		"paging": true,
141
            "paging": true,
129
   		"searching" : true
142
            "searching": true
-
 
143
        });
130
	});
144
    });
-
 
145
 
-
 
146
 
-
 
147
    $(document).ready(function () {
-
 
148
        $('#fofo-users').multiselect({
-
 
149
            includeSelectAllOption: true,
-
 
150
            maxHeight: 200,
-
 
151
            multiple: true,
-
 
152
            buttonWidth: '180px',
-
 
153
            numberDisplayed: 1,
-
 
154
            nonSelectedText: 'Users',
-
 
155
            nSelectedText: ' - Users Selected',
-
 
156
            allSelectedText: 'All Users Selected',
-
 
157
            enableFiltering: true,
-
 
158
            enableCaseInsensitiveFiltering: true
-
 
159
        });
-
 
160
 
-
 
161
 
131
});
162
    });
-
 
163
 
132
 
164
 
133
</script>
165
</script>
134
166