Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
30044 tejbeer 1
<style>
2
 
3
   h5 { text-align: center;
4
    background-color: lightgray;
5
    padding: 5px;
6
    font-size: 16px;
7
    }
34437 ranu 8
 
9
   .mrt-0 {
10
	   margin-top: 0;
11
   }
30044 tejbeer 12
 
13
  #brand-instock tr.hide-table-padding td {
14
  padding: 0;
15
}
16
 
34095 ranu 17
 
18
   .expand-button {
30044 tejbeer 19
	position: relative;
20
}
21
 
22
.accordion-toggle .expand-button:after
23
{
24
  position: absolute;
25
  left:.75rem;
26
  top: 50%;
27
  transform: translate(0, -50%);
28
  content: '-';
29
}
30
.accordion-toggle.collapsed .expand-button:after
31
{
32
  content: '+';
33
}
34035 ranu 34
 
35
 
36
</style>
34397 ranu 37
 
38
<style>
39
	.well {
40
		background-color: #f9f9f9;
41
		border: 1px solid #ddd;
42
		border-radius: 12px;
43
		padding: 5px 20px;
44
		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
45
	}
46
 
47
	.well h4 {
48
		margin-bottom: 10px;
49
		font-weight: 500;
50
		border-bottom: 1px solid #ccc;
51
		padding-bottom: 6px;
52
	}
53
 
54
	.well ul li {
34412 ranu 55
		list-style: decimal;
34397 ranu 56
		padding: 4px 0;
57
		font-weight: 400;
58
		font-size: 16px;
59
		border-bottom: 1px dashed #eee;
60
	}
61
 
34404 ranu 62
	.well .currency {
63
		font-weight: 500
64
	}
65
 
34437 ranu 66
	li.brandFocusedStockDetail a {
67
		padding: 8px 10px !important;
68
	}
69
 
35765 ranu 70
	.out-of-stock-row a {
71
		text-decoration: none;
72
	}
73
 
74
	.out-of-stock-row a:hover {
75
		text-decoration: underline;
76
	}
77
 
78
	.oos-toggle-icon {
79
		display: inline-block;
80
		width: 16px;
81
		font-weight: bold;
82
	}
83
 
84
	.oos-content table {
85
		background-color: #fff;
86
	}
87
 
88
	.our-stock-detail-row td {
89
		border-top: none !important;
90
	}
91
 
92
	.our-stock-detail-row table {
93
		margin: 0;
94
		background-color: #fff;
95
	}
96
 
34397 ranu 97
</style>
98
 
30044 tejbeer 99
 
100
 
101
 
102
 
30003 tejbeer 103
 <div class="modal-header">
31897 tejbeer 104
	        <button type="button" class="close" style="margin:-10px" data-dismiss="modal">&times;</button>
35502 ranu 105
	 <h4 class="modal-title"><b class="fofo-stock-info">Stock Info</b> ($customRetailer.getBusinessName())
34437 ranu 106
				<input type="hidden" id="fofo-id" value="$customRetailer.getPartnerId()">
34490 ranu 107
				<a id="mobileAppId" href="${rc.contextPath}/mobileapp?emailId=$customRetailer.getEmail()"
108
				   class="btn btn-default" target="_blank">Franchise App</a>
34437 ranu 109
 
35501 ranu 110
				<a class="btn btn-default today-fofo-offer" data-fofoid="$sdCreditRequirement.getFofoId()">Today
111
					Offer</a>
35771 ranu 112
         <a class="btn btn-default scheme-imei-history-btn" data-fofoid="$sdCreditRequirement.getFofoId()">IMEI
113
             Margin</a>
35501 ranu 114
 
34437 ranu 115
			</h4>
30003 tejbeer 116
       </div>
34425 ranu 117
<div class="modal-body" style="max-height:75vh;overflow:auto;">
34389 ranu 118
	<div class="row">
35501 ranu 119
		<div class="col-md-8 today-fofo-offer-view" style="max-height: 70vh;overflow: auto;display: none;">
120
 
35771 ranu 121
        </div>
122
        <div class="col-md-8 scheme-imei-history-view" style="max-height: 70vh;overflow: auto;display: none;">
123
 
35501 ranu 124
		</div>
125
		<div class="col-md-8 fofo-summry-view" style="max-height: 70vh;overflow: auto;">
34397 ranu 126
			<div class="well row" style="margin: 0;">
34425 ranu 127
				<h4>Summary
34505 ranu 128
                    <a href="#" class="dashboard-view" data-fofoid="$sdCreditRequirement.getFofoId()">More Info</a>
34425 ranu 129
				</h4>
34412 ranu 130
				<div class="col-md-4">
131
					<h5>Fund Detail</h5>
34397 ranu 132
					<ul>
34412 ranu 133
						<li>Total Limit <span class="currency"> $sdCreditRequirement.getLimit()</span></li>
134
						<li>Utilization <span class="currency"> $sdCreditRequirement.getUtilizedAmount()</span></li>
135
						<li>Available Limit <span class="currency"> $sdCreditRequirement.getAvailableLimit()</span></li>
136
						<li>Wallet Amount <span class="currency"> $userWallet.getAmount()</span></li>
35771 ranu 137
 
34412 ranu 138
					</ul>
139
				</div>
140
				<div class="col-md-4">
141
					<h5>Investment Detail</h5>
142
					<ul>
34402 ranu 143
						#if($shortInvest > 0)
35771 ranu 144
                            <li>Short Investment -: <span class="currency"> $shortInvest</span></li>
34402 ranu 145
						#end
34412 ranu 146
 
147
						<li>DRR / Today Purchase <span class="currency"> $purchaseTargetFtd </span> /
34397 ranu 148
							#if($purchasedFtd < $purchaseTargetFtd)
149
								<span style="color: red;"> <span class="currency"> $purchasedFtd</span> </span>
150
							#else
151
								<span style="color: green;"> <span class="currency"> $purchasedFtd</span> </span>
152
							#end
153
						</li>
154
 
155
					</ul>
34412 ranu 156
 
157
					<h5>Recoverable Amount </h5>
158
					<ul>
35774 ranu 159
						<li>Short Invest <span class="currency">$shortInvest</span></li>
160
						<li>Overdue (with intr.) <span class="currency"> $totalDueWithInterest</span></li>
161
						<li>Interest <span class="currency"> $interestDue</span></li>
34412 ranu 162
					</ul>
163
 
34397 ranu 164
				</div>
34412 ranu 165
 
166
				<div class="col-md-4">
167
					<h5>Target</h5>
34397 ranu 168
					<ul>
34412 ranu 169
						<li>Monthly Target -: <span class="currency">$monthlyTarget.purchaseTarget</span></li>
170
						<li>Purchase Mtd -: <span class="currency">$purchaseMtd</span></li>
171
						<li>Sale Mtd -: <span class="currency">$saleMtd</span></li>
172
					</ul>
34397 ranu 173
 
174
				</div>
175
 
176
 
177
			</div>
34437 ranu 178
			<div class="clearfix"></div>
34389 ranu 179
			#if($brand != "undefined")
34397 ranu 180
				<hr style="margin-top:25px; margin-bottom: 10px;">
34389 ranu 181
				<div class="row">
182
					<div class="col-md-12">
183
						<ul class="nav nav-pills">
184
							#foreach($bnd in $brands)
34412 ranu 185
								<li class="brandFocusedStockDetail" data-brand="$bnd" data-fofoid="$fofoId">
34683 ranu 186
									#if(!$brandsWithPartnerStock.contains($bnd))
34412 ranu 187
										<a style="color: red;" href="#tab_$bnd">$bnd</a>
188
									#else
189
										<a href="#tab_$bnd">$bnd</a>
190
									#end
34389 ranu 191
								</li>
192
							#end
34412 ranu 193
							<li><a href="#collapse1" data-toggle="collapse"
194
								   style="background-color: #ccc;color: black;">In Stock </a></li>
195
							<li><a href="#collapse2" data-toggle="collapse"
196
								   style="background-color: #ccc;color: black;">Sales </a></li>
197
 
198
 
34389 ranu 199
						</ul>
34412 ranu 200
						<hr>
201
						<div class="col-md-12 well panel-collapse collapse" id="collapse1">
202
							<h4>In Stock </h4>
203
							<div id="itemWiseBrandStockDetail"></div>
204
						</div>
205
						<div id="collapse2" class="panel-collapse collapse col-md-12 well">
206
							<h4>Seven Days Sales</h4>
207
							<table class="table table-striped table-advance table-hover" style="width:100%">
208
								<thead>
209
								<tr>
210
									<th style="width: 25%;">Item</th>
211
									<th style="width: 9%;">Brand</th>
212
									<th style="width: 15%;">Sold Qty</th>
213
								</tr>
214
								</thead>
215
								<tbody>
216
									#foreach($catalog in $sevenDayAboveSoldsCatalogs)
217
									<tr>
218
										<td>$catalog.getModelNumber()</td>
219
										<td>$catalog.getBrand()</td>
220
										<td>$catalog.getSoldQty()</td>
221
									</tr>
222
									#end
223
								</tbody>
224
							</table>
225
							<h4>14 Days Sales</h4>
226
							<table class="table table-striped table-advance table-hover" style="width:100%">
227
								<thead>
228
								<tr>
229
									<th style="width: 25%;">Item</th>
230
									<th style="width: 9%;">Brand</th>
231
									<th style="width: 15%;">Sold Qty</th>
232
								</tr>
233
								</thead>
234
								<tbody>
235
									#foreach($catalog in $fourteenDayAboveSoldsCatalogs)
236
									<tr>
237
										<td>$catalog.getModelNumber()</td>
238
										<td>$catalog.getBrand()</td>
239
										<td>$catalog.getSoldQty()</td>
240
									</tr>
241
									#end
242
								</tbody>
243
							</table>
244
							<h4>21 Days Sales</h4>
245
							<table class="table table-striped table-advance table-hover" style="width:100%">
246
								<thead>
247
								<tr>
248
									<th style="width: 25%;">Item</th>
249
									<th style="width: 9%;">Brand</th>
250
									<th style="width: 15%;">Sold Qty</th>
251
								</tr>
252
								</thead>
253
								<tbody>
254
									#foreach($catalog in $twentyOneDayAboveSoldsCatalogs)
255
									<tr>
256
										<td>$catalog.getModelNumber()</td>
257
										<td>$catalog.getBrand()</td>
258
										<td>$catalog.getSoldQty()</td>
259
									</tr>
260
									#end
261
								</tbody>
262
							</table>
263
							<h4>28 Days Sales</h4>
264
							<table class="table table-striped table-advance table-hover" style="width:100%">
265
								<thead>
266
								<tr>
267
									<th style="width: 25%;">Item</th>
268
									<th style="width: 9%;">Brand</th>
269
									<th style="width: 15%;">Sold Qty</th>
270
								</tr>
271
								</thead>
272
								<tbody>
273
									#foreach($catalog in $twentyEightDayAboveSoldsCatalogs)
274
									<tr>
275
										<td>$catalog.getModelNumber()</td>
276
										<td>$catalog.getBrand()</td>
277
										<td>$catalog.getSoldQty()</td>
278
									</tr>
279
									#end
280
								</tbody>
281
							</table>
34035 ranu 282
 
34412 ranu 283
						</div>
34389 ranu 284
						<div>
285
							#foreach($bnd in $brands)
286
								<div id="tab_$bnd" class="clearfix"></div>
287
								#set($statusModelMap = $brandStatusWiseStockListMap.get($bnd))
288
								<h4>$bnd</h4>
289
								<table class="table table-striped table-advance table-hover" style="width:100%">
290
									<thead>
291
									<tr>
35765 ranu 292
										<th style="width: 30%;">Item</th>
293
										<th>Status</th>
294
										<th>DP</th>
295
										<th>Our Stock</th>
296
										<th> In-Transit</th>
297
										<th>P-Fullfilled</th>
298
										<th>P-Shortage</th>
299
										<th>P-CurrentQty</th>
300
										<th>Indent</th>
301
										<th>Aging</th>
34437 ranu 302
										<th>Action</th>
34389 ranu 303
									</tr>
304
									</thead>
305
									<tbody>
306
										#foreach($statusKey in $statusModelMap.keySet())
307
											#foreach($stocklist in $statusModelMap.get($statusKey))
308
											<tr>
34397 ranu 309
												#if($stocklist.getPartnerCurrentAvailability() < 1)
310
													<td style="color: red;">$stocklist.getModelNumber()</td>
311
												#else
312
													<td>$stocklist.getModelNumber()</td>
313
												#end
34462 tejus.loha 314
												<td>$stocklist.getStatus()</td>
34437 ranu 315
												<td>$tagListingsMap.get($stocklist.getCatalogId()).getSellingPrice()</td>
35765 ranu 316
												<td style="color: blue; text-decoration: underline; cursor: pointer;"
317
													onclick="toggleOurStockRow($stocklist.getCatalogId(), $warehouseId, '$stocklist.getModelNumber()')">
318
													$stocklist.getNetAvailability()
319
												</td>
34569 ranu 320
												#if($catalogWiseQtyMap.get($stocklist.getCatalogId()))
321
													<td>$catalogWiseQtyMap.get($stocklist.getCatalogId())</td>
322
												#else
323
													<td>-</td>
324
												#end
34389 ranu 325
												<td>$stocklist.getPartnerStockAvailability()</td>
326
												<td>$stocklist.getPartnerShortageStock()</td>
327
												<td>$stocklist.getPartnerCurrentAvailability()</td>
34487 ranu 328
												<td>
329
													#if($pendingIndentsDetailMap.get($stocklist.getCatalogId()).getQty())
330
														$pendingIndentsDetailMap.get($stocklist.getCatalogId()).getQty()
331
													#else
332
														-
333
													#end
334
												</td>
34397 ranu 335
												<td>$stocklist.getExceedDays()</td>
34437 ranu 336
												<td>
337
													<button class="btn btn-sm btn-success add-to-cart-btn"
34449 ranu 338
															data-toggle="modal"
339
															data-target="#poItemsDetail"
34437 ranu 340
															data-catalogid="$stocklist.getCatalogId()"
34581 ranu 341
															data-warehouseid="$warehouseId"
34437 ranu 342
															data-model="$stocklist.getModelNumber()"
343
															data-price="$tagListingsMap.get($stocklist.getCatalogId()).getSellingPrice()">
344
														Add to PO
345
													</button>
346
												</td>
34389 ranu 347
											</tr>
35765 ranu 348
											<tr id="our-stock-row-$stocklist.getCatalogId()"
349
												class="our-stock-detail-row"
350
												style="display: none; background-color: #e8f4fd;">
351
												<td colspan="11" style="padding: 10px 20px;">
352
													<div id="our-stock-content-$stocklist.getCatalogId()">
353
														<p>Loading...</p>
354
													</div>
355
												</td>
356
											</tr>
34389 ranu 357
											#end
358
										#end
35765 ranu 359
									<tr class="out-of-stock-row" style="background-color: #f8d7da;">
360
										<td colspan="11">
361
											<a href="#" style="color: #c0392b; font-weight: bold;"
362
											   onclick="toggleOutOfStock('$bnd', $warehouseId, this); return false;">
363
												<span class="oos-toggle-icon">+</span> Out of Stock Items
364
												(HID/FastMoving/Running)
365
											</a>
366
											<div id="oos-content-$bnd" class="oos-content"
367
												 style="display: none; margin-top: 10px;">
368
												<p>Loading...</p>
369
											</div>
370
										</td>
371
									</tr>
34389 ranu 372
									</tbody>
373
								</table>
374
							#end
375
						</div>
376
					</div>
377
				</div>
31417 amit.gupta 378
 
34389 ranu 379
			#end
34437 ranu 380
		</div>
381
		<div class="col-md-4">
382
			<div id="cart-sidebar"
383
				 style=" width:100%; background:#f8f9fa; border:1px solid #ccc; padding:5px; border-radius:6px;">
384
				<h5 class="mrt-0">Suggested Po Item List</h5>
385
				<div id="custom-cart-section" class="well"
386
					 style="padding: 4px;max-height: 55vh;overflow-y: auto;"></div>
387
				<button id="save-po-btn" class="btn btn-primary btn-block" style="margin-top:10px;">Save PO</button>
388
			</div>
389
		</div>
34384 ranu 390
 
34389 ranu 391
	</div>
31417 amit.gupta 392
 
34384 ranu 393
 
34389 ranu 394
</div>
30044 tejbeer 395
 
396
 
34087 ranu 397
<div class="modal-footer">
398
	<button type="button" data-dismiss="modal" class="btn btn-default view-close">Close</button>
399
 
400
</div>
34389 ranu 401
 
35765 ranu 402
<script>
403
	var ourStockDataLoaded = {};
404
	var oosDataLoaded = {};
405
 
406
	function toggleOurStockRow(catalogId, warehouseId, modelNumber) {
407
		var row = document.getElementById('our-stock-row-' + catalogId);
408
		var contentDiv = document.getElementById('our-stock-content-' + catalogId);
409
 
410
		if (row.style.display === 'none') {
411
			row.style.display = 'table-row';
412
 
413
			// Load data only if not already loaded
414
			if (!ourStockDataLoaded[catalogId]) {
415
				contentDiv.innerHTML = '<p>Loading...</p>';
416
 
417
				$.ajax({
418
					url: '${rc.contextPath}/indent/getOurStockDetails',
419
					type: 'GET',
420
					data: {catalogId: catalogId, warehouseId: warehouseId},
421
					success: function (response) {
422
 
423
 
424
						ourStockDataLoaded[catalogId] = true;
425
 
426
						var list = response.response;   // 🔥 correct key
427
 
428
						if (list && list.length > 0) {
429
							var html = '<strong>' + modelNumber + '</strong><br>';
430
							html += '<small style="color:#666;">' + list[0].itemDescription + '</small>';
431
 
432
							html += '<table class="table table-bordered table-sm" style="margin-top:5px">';
433
							html += '<thead><tr><th>Color</th><th>Qty</th></tr></thead><tbody>';
434
 
435
							for (var i = 0; i < list.length; i++) {
436
								html += '<tr>';
437
								html += '<td>' + (list[i].color || '-') + '</td>';
438
								html += '<td>' + list[i].qty + '</td>';
439
								html += '</tr>';
440
							}
441
 
442
							html += '</tbody></table>';
443
							contentDiv.innerHTML = html;
444
						} else {
445
							contentDiv.innerHTML = '<p>No color-wise stock details available</p>';
446
						}
447
					},
448
					error: function () {
449
						contentDiv.innerHTML = '<p style="color: red; margin: 0;">Error loading stock details</p>';
450
					}
451
				});
452
			}
453
		} else {
454
			row.style.display = 'none';
455
		}
456
	}
457
 
458
	function toggleOutOfStock(brand, warehouseId, linkElement) {
459
		var contentDiv = document.getElementById('oos-content-' + brand);
460
		var icon = linkElement.querySelector('.oos-toggle-icon');
461
 
462
		if (contentDiv.style.display === 'none') {
463
			contentDiv.style.display = 'block';
464
			icon.textContent = '-';
465
 
466
			// Load data only if not already loaded
467
			if (!oosDataLoaded[brand]) {
468
				contentDiv.innerHTML = '<p>Loading...</p>';
469
 
470
				$.ajax({
471
					url: '${rc.contextPath}/indent/getOutOfStockDetails',
472
					type: 'GET',
473
					data: {brand: brand, warehouseId: warehouseId},
474
					success: function (response) {
475
						console.log("RESPONSE:", response);
476
						oosDataLoaded[brand] = true;
477
 
478
						var list = response.response;   // 🔥 correct
479
 
480
						if (list && list.length > 0) {
481
							var html = '<table class="table table-bordered table-sm" style="margin-bottom: 0;">';
482
							html += '<thead><tr><th>Model Number</th><th>Status</th><th>Stock Qty</th></tr></thead><tbody>';
483
 
484
							for (var i = 0; i < list.length; i++) {
485
								html += '<tr style="background-color: #f8d7da;">';
486
								html += '<td>' + list[i].modelNumber + '</td>';
487
								html += '<td>' + list[i].status + '</td>';
488
								html += '<td>' + list[i].qty + '</td>';
489
								html += '</tr>';
490
							}
491
 
492
							html += '</tbody></table>';
493
							contentDiv.innerHTML = html;
494
						} else {
495
							contentDiv.innerHTML = '<p style="color: green; margin: 0;">No out of stock items for HID/FastMoving/Running categories.</p>';
496
						}
497
					},
498
					error: function () {
499
						contentDiv.innerHTML = '<p style="color: red; margin: 0;">Error loading out of stock details</p>';
500
					}
501
				});
502
			}
503
		} else {
504
			contentDiv.style.display = 'none';
505
			icon.textContent = '+';
506
		}
507
	}
508
</script>
509