Subversion Repositories SmartDukaan

Rev

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