Subversion Repositories SmartDukaan

Rev

Rev 28020 | Rev 28036 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
28005 tejbeer 1
<div class="row">
2
 
3
 
4
	#if(!$inStock.isEmpty())
5
	<div class="col-lg-6">
6
		<table
7
			class="table table-striped table-advance table-hover partner-planning-details">
8
			<thead>
9
				<tr>
28020 tejbeer 10
					<th>Warehouse</th>
28005 tejbeer 11
					<th>Partner Name</th>
12
					<th>Stock</th>
13
					<th>Sale</th>
14
 
15
				</tr>
16
			</thead>
17
			<tbody>
18
				#foreach($keyvalue in $inStock.entrySet())
19
				<tr>
28020 tejbeer 20
					<td>$warehouseMap.get($keyvalue.getValue().getWarehouseId())</td>
28005 tejbeer 21
					<td>$customRetailers.get($keyvalue.getKey()).getBusinessName()</td>
28032 tejbeer 22
					<td class="instockItem"
23
						data-fofoid="$keyvalue.getValue().getFofoId()" data-toggle="modal"
24
						data-target="#inStockItemModel">$keyvalue.getValue().getQty()</td>
28005 tejbeer 25
					#if($fofoSale.get($keyvalue.getKey()))
28032 tejbeer 26
					<td class="inSaleItem"
27
						data-fofoid="$keyvalue.getValue().getFofoId()" data-toggle="modal"
28
						data-target="#inSaleItemModel">$fofoSale.get($keyvalue.getKey()).getQty()</td>
29
					#else
28005 tejbeer 30
					<td>0</td> #end
31
				</tr>
32
				#end
33
 
34
			</tbody>
35
		</table>
36
	</div>
37
	#else
38
 
39
	<div class="col-lg-6">
40
		<table
41
			class="table table-striped table-advance table-hover partner-planning-details">
42
			<thead>
43
				<tr>
28020 tejbeer 44
					<th>Warehouse</th>
28005 tejbeer 45
					<th>Partner Name</th>
46
					<th>Item</th>
47
					<th>Stock</th>
48
					<th>Sale</th>
49
 
50
				</tr>
51
			</thead>
52
			<tbody>
53
				#foreach($keyvalue in $inStockItemMap.entrySet())
54
				<tr>
28020 tejbeer 55
					<td>$warehouseMap.get($keyvalue.getValue().getWarehouseId())</td>
56
 
28005 tejbeer 57
					<td>$customRetailers.get($keyvalue.getKey().getFofoId()).getBusinessName()</td>
58
					<td>$keyvalue.getValue().getBrand()
59
						$keyvalue.getValue().getModelName()
60
						$keyvalue.getValue().getModelNumber()</td>
61
					<td>$keyvalue.getValue().getQty()</td>
62
					#if($fofoSaleItem.get($keyvalue.getKey()))
63
					<td>$fofoSaleItem.get($keyvalue.getKey()).getQty()</td> #else
64
					<td>0</td> #end
65
				</tr>
66
				#end
67
 
68
			</tbody>
69
		</table>
70
	</div>
71
 
72
	#end
73
</div>
74
 
75
 
28032 tejbeer 76
<div id="inStockItemModel" class="modal" role="dialog">
77
	<div class="modal-dialog">
78
		<div class="modal-content"></div>
79
	</div>
80
</div>
81
 
82
 
83
<div id="inSaleItemModel" class="modal" role="dialog">
84
	<div class="modal-dialog">
85
		<div class="modal-content"></div>
86
	</div>
87
</div>
28005 tejbeer 88
<script type="text/javascript">
28020 tejbeer 89
	$(document).ready(
90
			function() {
91
 
92
				$('.partner-planning-details thead tr').clone(true).appendTo(
93
						'.partner-planning-details thead');
94
				$('.partner-planning-details thead tr:eq(1) th').each(
95
						function(i) {
96
							var title = $(this).text();
97
							$(this).html(
98
									'<input type="text" style = "width:60%;" placeholder="Search '
99
											+ title + '" />');
100
 
101
							$('input', this).on('keyup change', function() {
102
								if (table.column(i).search() !== this.value) {
103
									table.column(i).search(this.value).draw();
104
								}
105
							});
106
						});
107
				var table = $('.partner-planning-details').DataTable({
108
 
109
					"lengthMenu" : [ 10, 25, 50, 75, 100, 250 ],
110
					"pageLength" : 250,
111
				});
112
			});
28032 tejbeer 113
 
114
	$('.partner-planning-details').on(
115
			'click',
116
			'.instockItem',
117
			function() {
118
				var fofoId = $(this).data('fofoid');
119
				var catalogIds = $('.criteria-item-catalogids').val();
120
				console.log(catalogIds);
121
 
122
				doGetAjaxRequestHandler(context
123
						+ "/getInStockItembyFofoId?fofoId=" + fofoId
124
						+ "&catalogItemIds=" + catalogIds, function(response) {
125
					console.log(response)
126
					$('#inStockItemModel .modal-content').html(response);
127
 
128
				});
129
			});
130
 
131
	$('.partner-planning-details').on(
132
			'click',
133
			'.inSaleItem',
134
			function() {
135
				var fofoId = $(this).data('fofoid');
136
				var catalogIds = $('.criteria-item-catalogids').val();
137
				console.log(catalogIds);
138
 
139
				doGetAjaxRequestHandler(context
140
						+ "/getSaleItembyCatalogFofoId?fofoId=" + fofoId
141
						+ "&catalogItemIds=" + catalogIds + "&date="
142
						+ startDate, function(response) {
143
					console.log(response)
144
					$('#inSaleItemModel .modal-content').html(response);
145
 
146
				});
147
			});
28005 tejbeer 148
</script>