Subversion Repositories SmartDukaan

Rev

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

Rev 28057 Rev 28085
Line 7... Line 7...
7
			class="table table-striped table-advance table-hover partner-planning-details">
7
			class="table table-striped table-advance table-hover partner-planning-details">
8
			<thead>
8
			<thead>
9
				<tr>
9
				<tr>
10
					<th>Warehouse</th>
10
					<th>Warehouse</th>
11
					<th>Category</th>
11
					<th>Category</th>
12
 
-
 
13
					<th>Partner Name</th>
12
					<th>Partner Name</th>
14
					<th>Stock</th>
13
					<th>Stock</th>
15
					<th>Sale</th>
14
					<th>Sale</th>
16
					<th>Warehouse Stock</th>
15
					<th>Warehouse Stock</th>
-
 
16
					<th>PO</th>
-
 
17
					<th>last Po Entry</th>
17
 
18
 
18
				</tr>
19
				</tr>
19
			</thead>
20
			</thead>
20
			<tbody>
21
			<tbody>
21
				#foreach($keyvalue in $inStock.entrySet())
22
				#foreach($keyvalue in $inStock.entrySet())
Line 38... Line 39...
38
						data-warehouseid="$keyvalue.getValue().getWarehouseId()"
39
						data-warehouseid="$keyvalue.getValue().getWarehouseId()"
39
						data-catalogid="$keyvalue.getValue().getWarehouseId()"
40
						data-catalogid="$keyvalue.getValue().getWarehouseId()"
40
						data-toggle="modal" data-target="#warehouseStockItemModel">$warehouseStocks.get($keyvalue.getValue().getWarehouseId()).getQty()</td>
41
						data-toggle="modal" data-target="#warehouseStockItemModel">$warehouseStocks.get($keyvalue.getValue().getWarehouseId()).getQty()</td>
41
					#else
42
					#else
42
					<td>0</td> #end
43
					<td>0</td> #end
-
 
44
					<td><a class="selctItemQty" data-toggle="modal"
-
 
45
						data-fofoid="$keyvalue.getValue().getFofoId()"
-
 
46
						data-target="#selectModelItems"> Add to po </a></td>
-
 
47
					#if($suggestedPoEntry.get($keyvalue.getValue().getFofoId()))
43
 
48
 
-
 
49
					<td><a class="podetails"
-
 
50
						data-fofoid="$keyvalue.getValue().getFofoId()"
-
 
51
						data-datetime="$suggestedPoEntry.get($keyvalue.getValue().getFofoId())"
-
 
52
						data-toggle="modal" data-target="#ItemsPo">$suggestedPoEntry.get($keyvalue.getValue().getFofoId()).format($dateTimeFormatter)</a></td>
-
 
53
					#else
-
 
54
					<td></td> #end
44
 
55
 
45
				</tr>
56
				</tr>
46
				#end
57
				#end
47
 
58
 
48
			</tbody>
59
			</tbody>
Line 61... Line 72...
61
					<th>Partner Name</th>
72
					<th>Partner Name</th>
62
					<th>Item</th>
73
					<th>Item</th>
63
					<th>Stock</th>
74
					<th>Stock</th>
64
					<th>Sale</th>
75
					<th>Sale</th>
65
					<th>Warehouse Stock</th>
76
					<th>Warehouse Stock</th>
-
 
77
					<th>PO</th>
-
 
78
					<th>last Po Entry</th>
-
 
79
 
-
 
80
 
66
 
81
 
67
				</tr>
82
				</tr>
68
			</thead>
83
			</thead>
69
			<tbody>
84
			<tbody>
70
				#foreach($keyvalue in $inStockItemMap.entrySet())
85
				#foreach($keyvalue in $inStockItemMap.entrySet())
Line 81... Line 96...
81
					<td>$fofoSaleItem.get($keyvalue.getKey()).getQty()</td> #else
96
					<td>$fofoSaleItem.get($keyvalue.getKey()).getQty()</td> #else
82
					<td>0</td> #end
97
					<td>0</td> #end
83
 
98
 
84
 
99
 
85
					<td>$keyvalue.getValue().getWarehouseQty()</td>
100
					<td>$keyvalue.getValue().getWarehouseQty()</td>
-
 
101
					<td><a class="selctItemQty" data-toggle="modal"
-
 
102
						data-fofoid="$keyvalue.getValue().getFofoId()"
-
 
103
						data-target="#selectModelItems"> Add to po </a></td>
-
 
104
					#if($suggestedPoEntry.get($keyvalue.getKey().getFofoId()))
-
 
105
 
-
 
106
					<td><a class="podetails"
-
 
107
						data-fofoid="$keyvalue.getKey().getFofoId()" data-toggle="modal"
-
 
108
						data-target="#ItemsPo"
-
 
109
						data-datetime="$suggestedPoEntry.get($keyvalue.getValue().getFofoId())">
-
 
110
							$suggestedPoEntry.get($keyvalue.getKey().getFofoId()).format($dateTimeFormatter)
-
 
111
					</a></td> #else
-
 
112
					<td></td> #end
86
 
113
 
87
				</tr>
114
				</tr>
88
				#end
115
				#end
89
 
116
 
90
			</tbody>
117
			</tbody>
Line 111... Line 138...
111
<div id="warehouseStockItemModel" class="modal" role="dialog">
138
<div id="warehouseStockItemModel" class="modal" role="dialog">
112
	<div class="modal-dialog">
139
	<div class="modal-dialog">
113
		<div class="modal-content"></div>
140
		<div class="modal-content"></div>
114
	</div>
141
	</div>
115
</div>
142
</div>
-
 
143
 
-
 
144
 
-
 
145
<div id="selectModelItems" class="modal" role="dialog">
-
 
146
	<div class="modal-dialog">
-
 
147
		<div class="modal-content"></div>
-
 
148
	</div>
-
 
149
</div>
-
 
150
 
-
 
151
<div id="ItemsPo" class="modal" role="dialog">
-
 
152
	<div class="modal-dialog">
-
 
153
		<div class="modal-content"></div>
-
 
154
	</div>
-
 
155
</div>
116
<script type="text/javascript">
156
<script type="text/javascript">
117
	$(document).ready(
157
	$(document).ready(
118
			function() {
158
			function() {
119
 
159
 
120
				$('.partner-planning-details thead tr').clone(true).appendTo(
160
				$('.partner-planning-details thead tr').clone(true).appendTo(
Line 192... Line 232...
192
							$('#warehouseStockItemModel .modal-content').html(
232
							$('#warehouseStockItemModel .modal-content').html(
193
									response);
233
									response);
194
 
234
 
195
						});
235
						});
196
			});
236
			});
-
 
237
 
-
 
238
	$('.partner-planning-details').on(
-
 
239
			'click',
-
 
240
			'.selctItemQty',
-
 
241
			function() {
-
 
242
				var catalogIds = $('.criteria-item-catalogids').val();
-
 
243
				console.log(catalogIds);
-
 
244
				var fofoId = $(this).data('fofoid');
-
 
245
 
-
 
246
				doGetAjaxRequestHandler(context
-
 
247
						+ "/selectItemColorByCatalog?catalogIds=" + catalogIds
-
 
248
 
-
 
249
						+ "&fofoId=" + fofoId, function(response) {
-
 
250
					console.log(response)
-
 
251
					$('#selectModelItems .modal-content').html(response);
-
 
252
 
-
 
253
				});
-
 
254
			});
-
 
255
 
-
 
256
	$(document).on(
-
 
257
			"click",
-
 
258
			".submit-item-po",
-
 
259
			function(e) {
-
 
260
				var seletedIds;
-
 
261
				var jsonObject = {};
-
 
262
				var seletedIdsJson = [];
-
 
263
				var fofoId = $(this).data('fofoid');
-
 
264
 
-
 
265
				$('#select-item').find('tr').each(function() {
-
 
266
					var row = $(this);
-
 
267
 
-
 
268
					console.log(row);
-
 
269
					if (row.find('input[type="checkbox"]').is(':checked')) {
-
 
270
						var currentRow = $(this).closest("tr");
-
 
271
 
-
 
272
						var itemId = currentRow.find("td:eq(1)").html();
-
 
273
						var name = currentRow.find("td:eq(2)").html();
-
 
274
						var quantity = currentRow.find("td:eq(3) input").val();
-
 
275
						console.log(quantity)
-
 
276
						if (quantity == "") {
-
 
277
							alert("Select the Quantity");
-
 
278
							return false;
-
 
279
 
-
 
280
						}
-
 
281
 
-
 
282
						seletedIds = {
-
 
283
							"itemId" : itemId,
-
 
284
							"qty" : quantity
-
 
285
						}
-
 
286
						seletedIdsJson.push(seletedIds)
-
 
287
 
-
 
288
					}
-
 
289
 
-
 
290
				});
-
 
291
 
-
 
292
				console.log(fofoId)
-
 
293
				if (fofoId == null) {
-
 
294
					alert("fofoId is required");
-
 
295
					return false;
-
 
296
				}
-
 
297
				if (seletedIdsJson.length === 0) {
-
 
298
					alert("Atleast one Item selected");
-
 
299
					return false;
-
 
300
				}
-
 
301
				console.log(seletedIdsJson);
-
 
302
 
-
 
303
				jsonObject['poIds'] = seletedIdsJson;
-
 
304
				jsonObject['fofoId'] = fofoId;
-
 
305
				console.log(jsonObject)
-
 
306
				if (confirm("Are you sure you want to create po") == true) {
-
 
307
 
-
 
308
					doPostAjaxRequestWithJsonHandler(context + "/createPo",
-
 
309
							JSON.stringify(jsonObject), function(response) {
-
 
310
								if (response == 'true') {
-
 
311
									alert("successfully create");
-
 
312
 
-
 
313
									$("#selectModelItems").modal("hide");
-
 
314
									$("button.search-partner-stock").click();
-
 
315
								}
-
 
316
							});
-
 
317
				}
-
 
318
 
-
 
319
			});
-
 
320
 
-
 
321
	$('.partner-planning-details').on(
-
 
322
			'click',
-
 
323
			'.podetails',
-
 
324
			function() {
-
 
325
				var fofoId = $(this).data('fofoid');
-
 
326
				var datetime = $(this).data('datetime');
-
 
327
 
-
 
328
				doGetAjaxRequestHandler(context
-
 
329
						+ "/getSuggestedPoDetail?fofoId=" + fofoId
-
 
330
						+ "&datetime=" + datetime, function(response) {
-
 
331
					console.log(response)
-
 
332
					$('#ItemsPo .modal-content').html(response);
-
 
333
 
-
 
334
				});
-
 
335
			});
197
</script>
336
</script>
198
337