Subversion Repositories SmartDukaan

Rev

Rev 35765 | Rev 35774 | 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>
145
                            <li>Overdue (with intr.) <span class="currency"> $totalDueWithInterest</span></li>
146
                            <li>Interest <span class="currency"> $interestDue</span></li>
34402 ranu 147
						#end
34412 ranu 148
 
149
						<li>DRR / Today Purchase <span class="currency"> $purchaseTargetFtd </span> /
34397 ranu 150
							#if($purchasedFtd < $purchaseTargetFtd)
151
								<span style="color: red;"> <span class="currency"> $purchasedFtd</span> </span>
152
							#else
153
								<span style="color: green;"> <span class="currency"> $purchasedFtd</span> </span>
154
							#end
155
						</li>
156
 
157
					</ul>
34412 ranu 158
 
159
					<h5>Recoverable Amount </h5>
160
					<ul>
35771 ranu 161
                        <li>Short Invest <br> <span class="currency">$shortInvest</span>
34412 ranu 162
						</li>
163
					</ul>
164
 
34397 ranu 165
				</div>
34412 ranu 166
 
167
				<div class="col-md-4">
168
					<h5>Target</h5>
34397 ranu 169
					<ul>
34412 ranu 170
						<li>Monthly Target -: <span class="currency">$monthlyTarget.purchaseTarget</span></li>
171
						<li>Purchase Mtd -: <span class="currency">$purchaseMtd</span></li>
172
						<li>Sale Mtd -: <span class="currency">$saleMtd</span></li>
173
					</ul>
34397 ranu 174
 
175
				</div>
176
 
177
 
178
			</div>
34437 ranu 179
			<div class="clearfix"></div>
34389 ranu 180
			#if($brand != "undefined")
34397 ranu 181
				<hr style="margin-top:25px; margin-bottom: 10px;">
34389 ranu 182
				<div class="row">
183
					<div class="col-md-12">
184
						<ul class="nav nav-pills">
185
							#foreach($bnd in $brands)
34412 ranu 186
								<li class="brandFocusedStockDetail" data-brand="$bnd" data-fofoid="$fofoId">
34683 ranu 187
									#if(!$brandsWithPartnerStock.contains($bnd))
34412 ranu 188
										<a style="color: red;" href="#tab_$bnd">$bnd</a>
189
									#else
190
										<a href="#tab_$bnd">$bnd</a>
191
									#end
34389 ranu 192
								</li>
193
							#end
34412 ranu 194
							<li><a href="#collapse1" data-toggle="collapse"
195
								   style="background-color: #ccc;color: black;">In Stock </a></li>
196
							<li><a href="#collapse2" data-toggle="collapse"
197
								   style="background-color: #ccc;color: black;">Sales </a></li>
198
 
199
 
34389 ranu 200
						</ul>
34412 ranu 201
						<hr>
202
						<div class="col-md-12 well panel-collapse collapse" id="collapse1">
203
							<h4>In Stock </h4>
204
							<div id="itemWiseBrandStockDetail"></div>
205
						</div>
206
						<div id="collapse2" class="panel-collapse collapse col-md-12 well">
207
							<h4>Seven Days Sales</h4>
208
							<table class="table table-striped table-advance table-hover" style="width:100%">
209
								<thead>
210
								<tr>
211
									<th style="width: 25%;">Item</th>
212
									<th style="width: 9%;">Brand</th>
213
									<th style="width: 15%;">Sold Qty</th>
214
								</tr>
215
								</thead>
216
								<tbody>
217
									#foreach($catalog in $sevenDayAboveSoldsCatalogs)
218
									<tr>
219
										<td>$catalog.getModelNumber()</td>
220
										<td>$catalog.getBrand()</td>
221
										<td>$catalog.getSoldQty()</td>
222
									</tr>
223
									#end
224
								</tbody>
225
							</table>
226
							<h4>14 Days Sales</h4>
227
							<table class="table table-striped table-advance table-hover" style="width:100%">
228
								<thead>
229
								<tr>
230
									<th style="width: 25%;">Item</th>
231
									<th style="width: 9%;">Brand</th>
232
									<th style="width: 15%;">Sold Qty</th>
233
								</tr>
234
								</thead>
235
								<tbody>
236
									#foreach($catalog in $fourteenDayAboveSoldsCatalogs)
237
									<tr>
238
										<td>$catalog.getModelNumber()</td>
239
										<td>$catalog.getBrand()</td>
240
										<td>$catalog.getSoldQty()</td>
241
									</tr>
242
									#end
243
								</tbody>
244
							</table>
245
							<h4>21 Days Sales</h4>
246
							<table class="table table-striped table-advance table-hover" style="width:100%">
247
								<thead>
248
								<tr>
249
									<th style="width: 25%;">Item</th>
250
									<th style="width: 9%;">Brand</th>
251
									<th style="width: 15%;">Sold Qty</th>
252
								</tr>
253
								</thead>
254
								<tbody>
255
									#foreach($catalog in $twentyOneDayAboveSoldsCatalogs)
256
									<tr>
257
										<td>$catalog.getModelNumber()</td>
258
										<td>$catalog.getBrand()</td>
259
										<td>$catalog.getSoldQty()</td>
260
									</tr>
261
									#end
262
								</tbody>
263
							</table>
264
							<h4>28 Days Sales</h4>
265
							<table class="table table-striped table-advance table-hover" style="width:100%">
266
								<thead>
267
								<tr>
268
									<th style="width: 25%;">Item</th>
269
									<th style="width: 9%;">Brand</th>
270
									<th style="width: 15%;">Sold Qty</th>
271
								</tr>
272
								</thead>
273
								<tbody>
274
									#foreach($catalog in $twentyEightDayAboveSoldsCatalogs)
275
									<tr>
276
										<td>$catalog.getModelNumber()</td>
277
										<td>$catalog.getBrand()</td>
278
										<td>$catalog.getSoldQty()</td>
279
									</tr>
280
									#end
281
								</tbody>
282
							</table>
34035 ranu 283
 
34412 ranu 284
						</div>
34389 ranu 285
						<div>
286
							#foreach($bnd in $brands)
287
								<div id="tab_$bnd" class="clearfix"></div>
288
								#set($statusModelMap = $brandStatusWiseStockListMap.get($bnd))
289
								<h4>$bnd</h4>
290
								<table class="table table-striped table-advance table-hover" style="width:100%">
291
									<thead>
292
									<tr>
35765 ranu 293
										<th style="width: 30%;">Item</th>
294
										<th>Status</th>
295
										<th>DP</th>
296
										<th>Our Stock</th>
297
										<th> In-Transit</th>
298
										<th>P-Fullfilled</th>
299
										<th>P-Shortage</th>
300
										<th>P-CurrentQty</th>
301
										<th>Indent</th>
302
										<th>Aging</th>
34437 ranu 303
										<th>Action</th>
34389 ranu 304
									</tr>
305
									</thead>
306
									<tbody>
307
										#foreach($statusKey in $statusModelMap.keySet())
308
											#foreach($stocklist in $statusModelMap.get($statusKey))
309
											<tr>
34397 ranu 310
												#if($stocklist.getPartnerCurrentAvailability() < 1)
311
													<td style="color: red;">$stocklist.getModelNumber()</td>
312
												#else
313
													<td>$stocklist.getModelNumber()</td>
314
												#end
34462 tejus.loha 315
												<td>$stocklist.getStatus()</td>
34437 ranu 316
												<td>$tagListingsMap.get($stocklist.getCatalogId()).getSellingPrice()</td>
35765 ranu 317
												<td style="color: blue; text-decoration: underline; cursor: pointer;"
318
													onclick="toggleOurStockRow($stocklist.getCatalogId(), $warehouseId, '$stocklist.getModelNumber()')">
319
													$stocklist.getNetAvailability()
320
												</td>
34569 ranu 321
												#if($catalogWiseQtyMap.get($stocklist.getCatalogId()))
322
													<td>$catalogWiseQtyMap.get($stocklist.getCatalogId())</td>
323
												#else
324
													<td>-</td>
325
												#end
34389 ranu 326
												<td>$stocklist.getPartnerStockAvailability()</td>
327
												<td>$stocklist.getPartnerShortageStock()</td>
328
												<td>$stocklist.getPartnerCurrentAvailability()</td>
34487 ranu 329
												<td>
330
													#if($pendingIndentsDetailMap.get($stocklist.getCatalogId()).getQty())
331
														$pendingIndentsDetailMap.get($stocklist.getCatalogId()).getQty()
332
													#else
333
														-
334
													#end
335
												</td>
34397 ranu 336
												<td>$stocklist.getExceedDays()</td>
34437 ranu 337
												<td>
338
													<button class="btn btn-sm btn-success add-to-cart-btn"
34449 ranu 339
															data-toggle="modal"
340
															data-target="#poItemsDetail"
34437 ranu 341
															data-catalogid="$stocklist.getCatalogId()"
34581 ranu 342
															data-warehouseid="$warehouseId"
34437 ranu 343
															data-model="$stocklist.getModelNumber()"
344
															data-price="$tagListingsMap.get($stocklist.getCatalogId()).getSellingPrice()">
345
														Add to PO
346
													</button>
347
												</td>
34389 ranu 348
											</tr>
35765 ranu 349
											<tr id="our-stock-row-$stocklist.getCatalogId()"
350
												class="our-stock-detail-row"
351
												style="display: none; background-color: #e8f4fd;">
352
												<td colspan="11" style="padding: 10px 20px;">
353
													<div id="our-stock-content-$stocklist.getCatalogId()">
354
														<p>Loading...</p>
355
													</div>
356
												</td>
357
											</tr>
34389 ranu 358
											#end
359
										#end
35765 ranu 360
									<tr class="out-of-stock-row" style="background-color: #f8d7da;">
361
										<td colspan="11">
362
											<a href="#" style="color: #c0392b; font-weight: bold;"
363
											   onclick="toggleOutOfStock('$bnd', $warehouseId, this); return false;">
364
												<span class="oos-toggle-icon">+</span> Out of Stock Items
365
												(HID/FastMoving/Running)
366
											</a>
367
											<div id="oos-content-$bnd" class="oos-content"
368
												 style="display: none; margin-top: 10px;">
369
												<p>Loading...</p>
370
											</div>
371
										</td>
372
									</tr>
34389 ranu 373
									</tbody>
374
								</table>
375
							#end
376
						</div>
377
					</div>
378
				</div>
31417 amit.gupta 379
 
34389 ranu 380
			#end
34437 ranu 381
		</div>
382
		<div class="col-md-4">
383
			<div id="cart-sidebar"
384
				 style=" width:100%; background:#f8f9fa; border:1px solid #ccc; padding:5px; border-radius:6px;">
385
				<h5 class="mrt-0">Suggested Po Item List</h5>
386
				<div id="custom-cart-section" class="well"
387
					 style="padding: 4px;max-height: 55vh;overflow-y: auto;"></div>
388
				<button id="save-po-btn" class="btn btn-primary btn-block" style="margin-top:10px;">Save PO</button>
389
			</div>
390
		</div>
34384 ranu 391
 
34389 ranu 392
	</div>
31417 amit.gupta 393
 
34384 ranu 394
 
34389 ranu 395
</div>
30044 tejbeer 396
 
397
 
34087 ranu 398
<div class="modal-footer">
399
	<button type="button" data-dismiss="modal" class="btn btn-default view-close">Close</button>
400
 
401
</div>
34389 ranu 402
 
35765 ranu 403
<script>
404
	var ourStockDataLoaded = {};
405
	var oosDataLoaded = {};
406
 
407
	function toggleOurStockRow(catalogId, warehouseId, modelNumber) {
408
		var row = document.getElementById('our-stock-row-' + catalogId);
409
		var contentDiv = document.getElementById('our-stock-content-' + catalogId);
410
 
411
		if (row.style.display === 'none') {
412
			row.style.display = 'table-row';
413
 
414
			// Load data only if not already loaded
415
			if (!ourStockDataLoaded[catalogId]) {
416
				contentDiv.innerHTML = '<p>Loading...</p>';
417
 
418
				$.ajax({
419
					url: '${rc.contextPath}/indent/getOurStockDetails',
420
					type: 'GET',
421
					data: {catalogId: catalogId, warehouseId: warehouseId},
422
					success: function (response) {
423
 
424
 
425
						ourStockDataLoaded[catalogId] = true;
426
 
427
						var list = response.response;   // 🔥 correct key
428
 
429
						if (list && list.length > 0) {
430
							var html = '<strong>' + modelNumber + '</strong><br>';
431
							html += '<small style="color:#666;">' + list[0].itemDescription + '</small>';
432
 
433
							html += '<table class="table table-bordered table-sm" style="margin-top:5px">';
434
							html += '<thead><tr><th>Color</th><th>Qty</th></tr></thead><tbody>';
435
 
436
							for (var i = 0; i < list.length; i++) {
437
								html += '<tr>';
438
								html += '<td>' + (list[i].color || '-') + '</td>';
439
								html += '<td>' + list[i].qty + '</td>';
440
								html += '</tr>';
441
							}
442
 
443
							html += '</tbody></table>';
444
							contentDiv.innerHTML = html;
445
						} else {
446
							contentDiv.innerHTML = '<p>No color-wise stock details available</p>';
447
						}
448
					},
449
					error: function () {
450
						contentDiv.innerHTML = '<p style="color: red; margin: 0;">Error loading stock details</p>';
451
					}
452
				});
453
			}
454
		} else {
455
			row.style.display = 'none';
456
		}
457
	}
458
 
459
	function toggleOutOfStock(brand, warehouseId, linkElement) {
460
		var contentDiv = document.getElementById('oos-content-' + brand);
461
		var icon = linkElement.querySelector('.oos-toggle-icon');
462
 
463
		if (contentDiv.style.display === 'none') {
464
			contentDiv.style.display = 'block';
465
			icon.textContent = '-';
466
 
467
			// Load data only if not already loaded
468
			if (!oosDataLoaded[brand]) {
469
				contentDiv.innerHTML = '<p>Loading...</p>';
470
 
471
				$.ajax({
472
					url: '${rc.contextPath}/indent/getOutOfStockDetails',
473
					type: 'GET',
474
					data: {brand: brand, warehouseId: warehouseId},
475
					success: function (response) {
476
						console.log("RESPONSE:", response);
477
						oosDataLoaded[brand] = true;
478
 
479
						var list = response.response;   // 🔥 correct
480
 
481
						if (list && list.length > 0) {
482
							var html = '<table class="table table-bordered table-sm" style="margin-bottom: 0;">';
483
							html += '<thead><tr><th>Model Number</th><th>Status</th><th>Stock Qty</th></tr></thead><tbody>';
484
 
485
							for (var i = 0; i < list.length; i++) {
486
								html += '<tr style="background-color: #f8d7da;">';
487
								html += '<td>' + list[i].modelNumber + '</td>';
488
								html += '<td>' + list[i].status + '</td>';
489
								html += '<td>' + list[i].qty + '</td>';
490
								html += '</tr>';
491
							}
492
 
493
							html += '</tbody></table>';
494
							contentDiv.innerHTML = html;
495
						} else {
496
							contentDiv.innerHTML = '<p style="color: green; margin: 0;">No out of stock items for HID/FastMoving/Running categories.</p>';
497
						}
498
					},
499
					error: function () {
500
						contentDiv.innerHTML = '<p style="color: red; margin: 0;">Error loading out of stock details</p>';
501
					}
502
				});
503
			}
504
		} else {
505
			contentDiv.style.display = 'none';
506
			icon.textContent = '+';
507
		}
508
	}
509
</script>
510