| 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 |
|
| 35838 |
ranu |
35 |
.partner-wallet-view .modelHeaderCustom {
|
|
|
36 |
font-size: 14px !important;
|
|
|
37 |
}
|
| 34035 |
ranu |
38 |
|
| 35838 |
ranu |
39 |
.partner-wallet-view {
|
|
|
40 |
font-size: 13px;
|
|
|
41 |
}
|
|
|
42 |
|
|
|
43 |
|
| 34035 |
ranu |
44 |
</style>
|
| 34397 |
ranu |
45 |
|
|
|
46 |
<style>
|
|
|
47 |
.well {
|
|
|
48 |
background-color: #f9f9f9;
|
|
|
49 |
border: 1px solid #ddd;
|
|
|
50 |
border-radius: 12px;
|
|
|
51 |
padding: 5px 20px;
|
|
|
52 |
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
|
|
|
53 |
}
|
|
|
54 |
|
|
|
55 |
.well h4 {
|
|
|
56 |
margin-bottom: 10px;
|
|
|
57 |
font-weight: 500;
|
|
|
58 |
border-bottom: 1px solid #ccc;
|
|
|
59 |
padding-bottom: 6px;
|
|
|
60 |
}
|
|
|
61 |
|
|
|
62 |
.well ul li {
|
| 34412 |
ranu |
63 |
list-style: decimal;
|
| 34397 |
ranu |
64 |
padding: 4px 0;
|
|
|
65 |
font-weight: 400;
|
|
|
66 |
font-size: 16px;
|
|
|
67 |
border-bottom: 1px dashed #eee;
|
|
|
68 |
}
|
|
|
69 |
|
| 34404 |
ranu |
70 |
.well .currency {
|
|
|
71 |
font-weight: 500
|
|
|
72 |
}
|
|
|
73 |
|
| 34437 |
ranu |
74 |
li.brandFocusedStockDetail a {
|
|
|
75 |
padding: 8px 10px !important;
|
|
|
76 |
}
|
|
|
77 |
|
| 35765 |
ranu |
78 |
.out-of-stock-row a {
|
|
|
79 |
text-decoration: none;
|
|
|
80 |
}
|
|
|
81 |
|
|
|
82 |
.out-of-stock-row a:hover {
|
|
|
83 |
text-decoration: underline;
|
|
|
84 |
}
|
|
|
85 |
|
|
|
86 |
.oos-toggle-icon {
|
|
|
87 |
display: inline-block;
|
|
|
88 |
width: 16px;
|
|
|
89 |
font-weight: bold;
|
|
|
90 |
}
|
|
|
91 |
|
|
|
92 |
.oos-content table {
|
|
|
93 |
background-color: #fff;
|
|
|
94 |
}
|
|
|
95 |
|
|
|
96 |
.our-stock-detail-row td {
|
|
|
97 |
border-top: none !important;
|
|
|
98 |
}
|
|
|
99 |
|
|
|
100 |
.our-stock-detail-row table {
|
|
|
101 |
margin: 0;
|
|
|
102 |
background-color: #fff;
|
|
|
103 |
}
|
|
|
104 |
|
| 34397 |
ranu |
105 |
</style>
|
|
|
106 |
|
| 30044 |
tejbeer |
107 |
|
|
|
108 |
|
|
|
109 |
|
|
|
110 |
|
| 30003 |
tejbeer |
111 |
<div class="modal-header">
|
| 31897 |
tejbeer |
112 |
<button type="button" class="close" style="margin:-10px" data-dismiss="modal">×</button>
|
| 35502 |
ranu |
113 |
<h4 class="modal-title"><b class="fofo-stock-info">Stock Info</b> ($customRetailer.getBusinessName())
|
| 34437 |
ranu |
114 |
<input type="hidden" id="fofo-id" value="$customRetailer.getPartnerId()">
|
| 34490 |
ranu |
115 |
<a id="mobileAppId" href="${rc.contextPath}/mobileapp?emailId=$customRetailer.getEmail()"
|
|
|
116 |
class="btn btn-default" target="_blank">Franchise App</a>
|
| 34437 |
ranu |
117 |
|
| 35501 |
ranu |
118 |
<a class="btn btn-default today-fofo-offer" data-fofoid="$sdCreditRequirement.getFofoId()">Today
|
|
|
119 |
Offer</a>
|
| 35771 |
ranu |
120 |
<a class="btn btn-default scheme-imei-history-btn" data-fofoid="$sdCreditRequirement.getFofoId()">IMEI
|
|
|
121 |
Margin</a>
|
| 35838 |
ranu |
122 |
<a class="btn btn-default partner-wallet-btn" data-fofoid="$sdCreditRequirement.getFofoId()">Partner
|
|
|
123 |
Wallet</a>
|
| 35501 |
ranu |
124 |
|
| 34437 |
ranu |
125 |
</h4>
|
| 30003 |
tejbeer |
126 |
</div>
|
| 34425 |
ranu |
127 |
<div class="modal-body" style="max-height:75vh;overflow:auto;">
|
| 34389 |
ranu |
128 |
<div class="row">
|
| 35501 |
ranu |
129 |
<div class="col-md-8 today-fofo-offer-view" style="max-height: 70vh;overflow: auto;display: none;">
|
|
|
130 |
|
| 35771 |
ranu |
131 |
</div>
|
|
|
132 |
<div class="col-md-8 scheme-imei-history-view" style="max-height: 70vh;overflow: auto;display: none;">
|
|
|
133 |
|
| 35501 |
ranu |
134 |
</div>
|
| 35838 |
ranu |
135 |
<div class="col-md-8 partner-wallet-view" style="max-height: 70vh;overflow: auto;display: none;">
|
|
|
136 |
|
|
|
137 |
</div>
|
| 35501 |
ranu |
138 |
<div class="col-md-8 fofo-summry-view" style="max-height: 70vh;overflow: auto;">
|
| 34397 |
ranu |
139 |
<div class="well row" style="margin: 0;">
|
| 34425 |
ranu |
140 |
<h4>Summary
|
| 34505 |
ranu |
141 |
<a href="#" class="dashboard-view" data-fofoid="$sdCreditRequirement.getFofoId()">More Info</a>
|
| 34425 |
ranu |
142 |
</h4>
|
| 34412 |
ranu |
143 |
<div class="col-md-4">
|
|
|
144 |
<h5>Fund Detail</h5>
|
| 34397 |
ranu |
145 |
<ul>
|
| 34412 |
ranu |
146 |
<li>Total Limit <span class="currency"> $sdCreditRequirement.getLimit()</span></li>
|
|
|
147 |
<li>Utilization <span class="currency"> $sdCreditRequirement.getUtilizedAmount()</span></li>
|
|
|
148 |
<li>Available Limit <span class="currency"> $sdCreditRequirement.getAvailableLimit()</span></li>
|
|
|
149 |
<li>Wallet Amount <span class="currency"> $userWallet.getAmount()</span></li>
|
| 35771 |
ranu |
150 |
|
| 34412 |
ranu |
151 |
</ul>
|
|
|
152 |
</div>
|
|
|
153 |
<div class="col-md-4">
|
|
|
154 |
<h5>Investment Detail</h5>
|
|
|
155 |
<ul>
|
| 34402 |
ranu |
156 |
#if($shortInvest > 0)
|
| 35771 |
ranu |
157 |
<li>Short Investment -: <span class="currency"> $shortInvest</span></li>
|
| 34402 |
ranu |
158 |
#end
|
| 34412 |
ranu |
159 |
|
|
|
160 |
<li>DRR / Today Purchase <span class="currency"> $purchaseTargetFtd </span> /
|
| 34397 |
ranu |
161 |
#if($purchasedFtd < $purchaseTargetFtd)
|
|
|
162 |
<span style="color: red;"> <span class="currency"> $purchasedFtd</span> </span>
|
|
|
163 |
#else
|
|
|
164 |
<span style="color: green;"> <span class="currency"> $purchasedFtd</span> </span>
|
|
|
165 |
#end
|
|
|
166 |
</li>
|
|
|
167 |
|
|
|
168 |
</ul>
|
| 34412 |
ranu |
169 |
|
|
|
170 |
<h5>Recoverable Amount </h5>
|
|
|
171 |
<ul>
|
| 35774 |
ranu |
172 |
<li>Short Invest <span class="currency">$shortInvest</span></li>
|
|
|
173 |
<li>Overdue (with intr.) <span class="currency"> $totalDueWithInterest</span></li>
|
|
|
174 |
<li>Interest <span class="currency"> $interestDue</span></li>
|
| 34412 |
ranu |
175 |
</ul>
|
|
|
176 |
|
| 34397 |
ranu |
177 |
</div>
|
| 34412 |
ranu |
178 |
|
|
|
179 |
<div class="col-md-4">
|
|
|
180 |
<h5>Target</h5>
|
| 34397 |
ranu |
181 |
<ul>
|
| 34412 |
ranu |
182 |
<li>Monthly Target -: <span class="currency">$monthlyTarget.purchaseTarget</span></li>
|
|
|
183 |
<li>Purchase Mtd -: <span class="currency">$purchaseMtd</span></li>
|
|
|
184 |
<li>Sale Mtd -: <span class="currency">$saleMtd</span></li>
|
|
|
185 |
</ul>
|
| 34397 |
ranu |
186 |
|
|
|
187 |
</div>
|
|
|
188 |
|
|
|
189 |
|
|
|
190 |
</div>
|
| 34437 |
ranu |
191 |
<div class="clearfix"></div>
|
| 34389 |
ranu |
192 |
#if($brand != "undefined")
|
| 34397 |
ranu |
193 |
<hr style="margin-top:25px; margin-bottom: 10px;">
|
| 34389 |
ranu |
194 |
<div class="row">
|
|
|
195 |
<div class="col-md-12">
|
|
|
196 |
<ul class="nav nav-pills">
|
|
|
197 |
#foreach($bnd in $brands)
|
| 34412 |
ranu |
198 |
<li class="brandFocusedStockDetail" data-brand="$bnd" data-fofoid="$fofoId">
|
| 34683 |
ranu |
199 |
#if(!$brandsWithPartnerStock.contains($bnd))
|
| 34412 |
ranu |
200 |
<a style="color: red;" href="#tab_$bnd">$bnd</a>
|
|
|
201 |
#else
|
|
|
202 |
<a href="#tab_$bnd">$bnd</a>
|
|
|
203 |
#end
|
| 34389 |
ranu |
204 |
</li>
|
|
|
205 |
#end
|
| 34412 |
ranu |
206 |
<li><a href="#collapse1" data-toggle="collapse"
|
|
|
207 |
style="background-color: #ccc;color: black;">In Stock </a></li>
|
|
|
208 |
<li><a href="#collapse2" data-toggle="collapse"
|
|
|
209 |
style="background-color: #ccc;color: black;">Sales </a></li>
|
|
|
210 |
|
|
|
211 |
|
| 34389 |
ranu |
212 |
</ul>
|
| 35846 |
ranu |
213 |
<div style="margin-top: 10px;">
|
|
|
214 |
<input type="text" id="modelSearchInput" class="form-control"
|
|
|
215 |
placeholder="Search by Model Number..."
|
|
|
216 |
style="width: 300px; display: inline-block;">
|
|
|
217 |
<button class="btn btn-default btn-sm" onclick="clearModelSearch()">Clear</button>
|
|
|
218 |
</div>
|
| 34412 |
ranu |
219 |
<hr>
|
|
|
220 |
<div class="col-md-12 well panel-collapse collapse" id="collapse1">
|
|
|
221 |
<h4>In Stock </h4>
|
|
|
222 |
<div id="itemWiseBrandStockDetail"></div>
|
|
|
223 |
</div>
|
|
|
224 |
<div id="collapse2" class="panel-collapse collapse col-md-12 well">
|
|
|
225 |
<h4>Seven 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 $sevenDayAboveSoldsCatalogs)
|
|
|
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>14 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 $fourteenDayAboveSoldsCatalogs)
|
|
|
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>21 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 $twentyOneDayAboveSoldsCatalogs)
|
|
|
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>
|
|
|
282 |
<h4>28 Days Sales</h4>
|
|
|
283 |
<table class="table table-striped table-advance table-hover" style="width:100%">
|
|
|
284 |
<thead>
|
|
|
285 |
<tr>
|
|
|
286 |
<th style="width: 25%;">Item</th>
|
|
|
287 |
<th style="width: 9%;">Brand</th>
|
|
|
288 |
<th style="width: 15%;">Sold Qty</th>
|
|
|
289 |
</tr>
|
|
|
290 |
</thead>
|
|
|
291 |
<tbody>
|
|
|
292 |
#foreach($catalog in $twentyEightDayAboveSoldsCatalogs)
|
|
|
293 |
<tr>
|
|
|
294 |
<td>$catalog.getModelNumber()</td>
|
|
|
295 |
<td>$catalog.getBrand()</td>
|
|
|
296 |
<td>$catalog.getSoldQty()</td>
|
|
|
297 |
</tr>
|
|
|
298 |
#end
|
|
|
299 |
</tbody>
|
|
|
300 |
</table>
|
| 34035 |
ranu |
301 |
|
| 34412 |
ranu |
302 |
</div>
|
| 34389 |
ranu |
303 |
<div>
|
|
|
304 |
#foreach($bnd in $brands)
|
|
|
305 |
<div id="tab_$bnd" class="clearfix"></div>
|
|
|
306 |
#set($statusModelMap = $brandStatusWiseStockListMap.get($bnd))
|
|
|
307 |
<h4>$bnd</h4>
|
|
|
308 |
<table class="table table-striped table-advance table-hover" style="width:100%">
|
|
|
309 |
<thead>
|
|
|
310 |
<tr>
|
| 35765 |
ranu |
311 |
<th style="width: 30%;">Item</th>
|
|
|
312 |
<th>Status</th>
|
|
|
313 |
<th>DP</th>
|
|
|
314 |
<th>Our Stock</th>
|
|
|
315 |
<th> In-Transit</th>
|
|
|
316 |
<th>P-Fullfilled</th>
|
|
|
317 |
<th>P-Shortage</th>
|
|
|
318 |
<th>P-CurrentQty</th>
|
|
|
319 |
<th>Indent</th>
|
|
|
320 |
<th>Aging</th>
|
| 34437 |
ranu |
321 |
<th>Action</th>
|
| 34389 |
ranu |
322 |
</tr>
|
|
|
323 |
</thead>
|
|
|
324 |
<tbody>
|
|
|
325 |
#foreach($statusKey in $statusModelMap.keySet())
|
|
|
326 |
#foreach($stocklist in $statusModelMap.get($statusKey))
|
|
|
327 |
<tr>
|
| 34397 |
ranu |
328 |
#if($stocklist.getPartnerCurrentAvailability() < 1)
|
|
|
329 |
<td style="color: red;">$stocklist.getModelNumber()</td>
|
|
|
330 |
#else
|
|
|
331 |
<td>$stocklist.getModelNumber()</td>
|
|
|
332 |
#end
|
| 34462 |
tejus.loha |
333 |
<td>$stocklist.getStatus()</td>
|
| 34437 |
ranu |
334 |
<td>$tagListingsMap.get($stocklist.getCatalogId()).getSellingPrice()</td>
|
| 35765 |
ranu |
335 |
<td style="color: blue; text-decoration: underline; cursor: pointer;"
|
|
|
336 |
onclick="toggleOurStockRow($stocklist.getCatalogId(), $warehouseId, '$stocklist.getModelNumber()')">
|
|
|
337 |
$stocklist.getNetAvailability()
|
|
|
338 |
</td>
|
| 34569 |
ranu |
339 |
#if($catalogWiseQtyMap.get($stocklist.getCatalogId()))
|
|
|
340 |
<td>$catalogWiseQtyMap.get($stocklist.getCatalogId())</td>
|
|
|
341 |
#else
|
|
|
342 |
<td>-</td>
|
|
|
343 |
#end
|
| 34389 |
ranu |
344 |
<td>$stocklist.getPartnerStockAvailability()</td>
|
|
|
345 |
<td>$stocklist.getPartnerShortageStock()</td>
|
| 35776 |
ranu |
346 |
<td style="color: green; text-decoration: underline; cursor: pointer;"
|
|
|
347 |
onclick="togglePartnerStockRow($stocklist.getCatalogId(), $fofoId, '$stocklist.getModelNumber()')">
|
|
|
348 |
$stocklist.getPartnerCurrentAvailability()
|
|
|
349 |
</td>
|
| 34487 |
ranu |
350 |
<td>
|
|
|
351 |
#if($pendingIndentsDetailMap.get($stocklist.getCatalogId()).getQty())
|
|
|
352 |
$pendingIndentsDetailMap.get($stocklist.getCatalogId()).getQty()
|
|
|
353 |
#else
|
|
|
354 |
-
|
|
|
355 |
#end
|
|
|
356 |
</td>
|
| 34397 |
ranu |
357 |
<td>$stocklist.getExceedDays()</td>
|
| 34437 |
ranu |
358 |
<td>
|
|
|
359 |
<button class="btn btn-sm btn-success add-to-cart-btn"
|
| 34449 |
ranu |
360 |
data-toggle="modal"
|
|
|
361 |
data-target="#poItemsDetail"
|
| 34437 |
ranu |
362 |
data-catalogid="$stocklist.getCatalogId()"
|
| 34581 |
ranu |
363 |
data-warehouseid="$warehouseId"
|
| 34437 |
ranu |
364 |
data-model="$stocklist.getModelNumber()"
|
|
|
365 |
data-price="$tagListingsMap.get($stocklist.getCatalogId()).getSellingPrice()">
|
|
|
366 |
Add to PO
|
|
|
367 |
</button>
|
|
|
368 |
</td>
|
| 34389 |
ranu |
369 |
</tr>
|
| 35765 |
ranu |
370 |
<tr id="our-stock-row-$stocklist.getCatalogId()"
|
|
|
371 |
class="our-stock-detail-row"
|
|
|
372 |
style="display: none; background-color: #e8f4fd;">
|
|
|
373 |
<td colspan="11" style="padding: 10px 20px;">
|
|
|
374 |
<div id="our-stock-content-$stocklist.getCatalogId()">
|
|
|
375 |
<p>Loading...</p>
|
|
|
376 |
</div>
|
|
|
377 |
</td>
|
|
|
378 |
</tr>
|
| 35776 |
ranu |
379 |
<tr id="partner-stock-row-$stocklist.getCatalogId()"
|
|
|
380 |
class="partner-stock-detail-row"
|
|
|
381 |
style="display: none; background-color: #d4edda;">
|
|
|
382 |
<td colspan="11" style="padding: 10px 20px;">
|
|
|
383 |
<div id="partner-stock-content-$stocklist.getCatalogId()">
|
|
|
384 |
<p>Loading...</p>
|
|
|
385 |
</div>
|
|
|
386 |
</td>
|
|
|
387 |
</tr>
|
| 34389 |
ranu |
388 |
#end
|
|
|
389 |
#end
|
| 35765 |
ranu |
390 |
<tr class="out-of-stock-row" style="background-color: #f8d7da;">
|
|
|
391 |
<td colspan="11">
|
|
|
392 |
<a href="#" style="color: #c0392b; font-weight: bold;"
|
| 35782 |
ranu |
393 |
onclick="toggleOutOfStock('$bnd', $warehouseId, $fofoId, this); return false;">
|
| 35765 |
ranu |
394 |
<span class="oos-toggle-icon">+</span> Out of Stock Items
|
|
|
395 |
(HID/FastMoving/Running)
|
|
|
396 |
</a>
|
|
|
397 |
<div id="oos-content-$bnd" class="oos-content"
|
|
|
398 |
style="display: none; margin-top: 10px;">
|
|
|
399 |
<p>Loading...</p>
|
|
|
400 |
</div>
|
|
|
401 |
</td>
|
|
|
402 |
</tr>
|
| 34389 |
ranu |
403 |
</tbody>
|
|
|
404 |
</table>
|
|
|
405 |
#end
|
|
|
406 |
</div>
|
|
|
407 |
</div>
|
|
|
408 |
</div>
|
| 31417 |
amit.gupta |
409 |
|
| 34389 |
ranu |
410 |
#end
|
| 34437 |
ranu |
411 |
</div>
|
|
|
412 |
<div class="col-md-4">
|
|
|
413 |
<div id="cart-sidebar"
|
|
|
414 |
style=" width:100%; background:#f8f9fa; border:1px solid #ccc; padding:5px; border-radius:6px;">
|
|
|
415 |
<h5 class="mrt-0">Suggested Po Item List</h5>
|
|
|
416 |
<div id="custom-cart-section" class="well"
|
|
|
417 |
style="padding: 4px;max-height: 55vh;overflow-y: auto;"></div>
|
|
|
418 |
<button id="save-po-btn" class="btn btn-primary btn-block" style="margin-top:10px;">Save PO</button>
|
|
|
419 |
</div>
|
|
|
420 |
</div>
|
| 34384 |
ranu |
421 |
|
| 34389 |
ranu |
422 |
</div>
|
| 31417 |
amit.gupta |
423 |
|
| 34384 |
ranu |
424 |
|
| 34389 |
ranu |
425 |
</div>
|
| 30044 |
tejbeer |
426 |
|
|
|
427 |
|
| 34087 |
ranu |
428 |
<div class="modal-footer">
|
|
|
429 |
<button type="button" data-dismiss="modal" class="btn btn-default view-close">Close</button>
|
|
|
430 |
|
|
|
431 |
</div>
|
| 34389 |
ranu |
432 |
|
| 35765 |
ranu |
433 |
<script>
|
|
|
434 |
var ourStockDataLoaded = {};
|
|
|
435 |
var oosDataLoaded = {};
|
| 35776 |
ranu |
436 |
var partnerStockDataLoaded = {};
|
| 35765 |
ranu |
437 |
|
| 35776 |
ranu |
438 |
function togglePartnerStockRow(catalogId, fofoId, modelNumber) {
|
|
|
439 |
var row = document.getElementById('partner-stock-row-' + catalogId);
|
|
|
440 |
var contentDiv = document.getElementById('partner-stock-content-' + catalogId);
|
|
|
441 |
|
|
|
442 |
if (row.style.display === 'none') {
|
|
|
443 |
row.style.display = 'table-row';
|
|
|
444 |
|
|
|
445 |
// Load data only if not already loaded
|
|
|
446 |
if (!partnerStockDataLoaded[catalogId]) {
|
|
|
447 |
contentDiv.innerHTML = '<p>Loading...</p>';
|
|
|
448 |
|
|
|
449 |
$.ajax({
|
|
|
450 |
url: '${rc.contextPath}/getItemsByCatalog',
|
|
|
451 |
type: 'GET',
|
|
|
452 |
data: {catalogId: catalogId, fofoId: fofoId},
|
|
|
453 |
success: function (response) {
|
|
|
454 |
partnerStockDataLoaded[catalogId] = true;
|
|
|
455 |
|
|
|
456 |
var list = response.response;
|
|
|
457 |
|
|
|
458 |
if (list && list.length > 0) {
|
|
|
459 |
var html = '<strong>Partner Stock: ' + modelNumber + '</strong>';
|
|
|
460 |
html += '<table class="table table-bordered table-sm" style="margin-top:5px; background-color: #fff;">';
|
|
|
461 |
html += '<thead><tr style="background-color: #d4edda;"><th>Item ID</th><th>Description</th><th>Qty</th><th>Status</th></tr></thead><tbody>';
|
|
|
462 |
|
|
|
463 |
for (var i = 0; i < list.length; i++) {
|
|
|
464 |
if (list[i].availability > 0) {
|
|
|
465 |
var stockType = list[i].stockType || 'IN_STOCK';
|
|
|
466 |
var rowStyle = stockType === 'GRN_PENDING' ? 'background-color: #fff3cd;' : '';
|
|
|
467 |
var statusLabel = stockType === 'GRN_PENDING' ? '<span style="color: #856404; font-weight: bold;">GRN Pending</span>' : '<span style="color: #155724;">In Stock</span>';
|
|
|
468 |
html += '<tr style="' + rowStyle + '">';
|
|
|
469 |
html += '<td>' + list[i].itemId + '</td>';
|
|
|
470 |
html += '<td>' + (list[i].itemDescription || '-') + '</td>';
|
|
|
471 |
html += '<td>' + list[i].availability + '</td>';
|
|
|
472 |
html += '<td>' + statusLabel + '</td>';
|
|
|
473 |
html += '</tr>';
|
|
|
474 |
}
|
|
|
475 |
}
|
|
|
476 |
|
|
|
477 |
html += '</tbody></table>';
|
|
|
478 |
contentDiv.innerHTML = html;
|
|
|
479 |
} else {
|
|
|
480 |
contentDiv.innerHTML = '<p>No partner stock details available</p>';
|
|
|
481 |
}
|
|
|
482 |
},
|
|
|
483 |
error: function () {
|
|
|
484 |
contentDiv.innerHTML = '<p style="color: red; margin: 0;">Error loading partner stock details</p>';
|
|
|
485 |
}
|
|
|
486 |
});
|
|
|
487 |
}
|
|
|
488 |
} else {
|
|
|
489 |
row.style.display = 'none';
|
|
|
490 |
}
|
|
|
491 |
}
|
|
|
492 |
|
| 35765 |
ranu |
493 |
function toggleOurStockRow(catalogId, warehouseId, modelNumber) {
|
|
|
494 |
var row = document.getElementById('our-stock-row-' + catalogId);
|
|
|
495 |
var contentDiv = document.getElementById('our-stock-content-' + catalogId);
|
|
|
496 |
|
|
|
497 |
if (row.style.display === 'none') {
|
|
|
498 |
row.style.display = 'table-row';
|
|
|
499 |
|
|
|
500 |
// Load data only if not already loaded
|
|
|
501 |
if (!ourStockDataLoaded[catalogId]) {
|
|
|
502 |
contentDiv.innerHTML = '<p>Loading...</p>';
|
|
|
503 |
|
|
|
504 |
$.ajax({
|
|
|
505 |
url: '${rc.contextPath}/indent/getOurStockDetails',
|
|
|
506 |
type: 'GET',
|
|
|
507 |
data: {catalogId: catalogId, warehouseId: warehouseId},
|
|
|
508 |
success: function (response) {
|
|
|
509 |
|
|
|
510 |
|
|
|
511 |
ourStockDataLoaded[catalogId] = true;
|
|
|
512 |
|
|
|
513 |
var list = response.response; // 🔥 correct key
|
|
|
514 |
|
|
|
515 |
if (list && list.length > 0) {
|
|
|
516 |
var html = '<strong>' + modelNumber + '</strong><br>';
|
|
|
517 |
html += '<small style="color:#666;">' + list[0].itemDescription + '</small>';
|
|
|
518 |
|
|
|
519 |
html += '<table class="table table-bordered table-sm" style="margin-top:5px">';
|
|
|
520 |
html += '<thead><tr><th>Color</th><th>Qty</th></tr></thead><tbody>';
|
|
|
521 |
|
|
|
522 |
for (var i = 0; i < list.length; i++) {
|
|
|
523 |
html += '<tr>';
|
|
|
524 |
html += '<td>' + (list[i].color || '-') + '</td>';
|
|
|
525 |
html += '<td>' + list[i].qty + '</td>';
|
|
|
526 |
html += '</tr>';
|
|
|
527 |
}
|
|
|
528 |
|
|
|
529 |
html += '</tbody></table>';
|
|
|
530 |
contentDiv.innerHTML = html;
|
|
|
531 |
} else {
|
|
|
532 |
contentDiv.innerHTML = '<p>No color-wise stock details available</p>';
|
|
|
533 |
}
|
|
|
534 |
},
|
|
|
535 |
error: function () {
|
|
|
536 |
contentDiv.innerHTML = '<p style="color: red; margin: 0;">Error loading stock details</p>';
|
|
|
537 |
}
|
|
|
538 |
});
|
|
|
539 |
}
|
|
|
540 |
} else {
|
|
|
541 |
row.style.display = 'none';
|
|
|
542 |
}
|
|
|
543 |
}
|
|
|
544 |
|
| 35782 |
ranu |
545 |
function toggleOutOfStock(brand, warehouseId, fofoId, linkElement) {
|
| 35765 |
ranu |
546 |
var contentDiv = document.getElementById('oos-content-' + brand);
|
|
|
547 |
var icon = linkElement.querySelector('.oos-toggle-icon');
|
|
|
548 |
|
|
|
549 |
if (contentDiv.style.display === 'none') {
|
|
|
550 |
contentDiv.style.display = 'block';
|
|
|
551 |
icon.textContent = '-';
|
|
|
552 |
|
|
|
553 |
// Load data only if not already loaded
|
|
|
554 |
if (!oosDataLoaded[brand]) {
|
|
|
555 |
contentDiv.innerHTML = '<p>Loading...</p>';
|
|
|
556 |
|
|
|
557 |
$.ajax({
|
|
|
558 |
url: '${rc.contextPath}/indent/getOutOfStockDetails',
|
|
|
559 |
type: 'GET',
|
| 35782 |
ranu |
560 |
data: {brand: brand, warehouseId: warehouseId, fofoId: fofoId},
|
| 35765 |
ranu |
561 |
success: function (response) {
|
|
|
562 |
console.log("RESPONSE:", response);
|
|
|
563 |
oosDataLoaded[brand] = true;
|
|
|
564 |
|
| 35782 |
ranu |
565 |
var list = response.response;
|
| 35765 |
ranu |
566 |
|
|
|
567 |
if (list && list.length > 0) {
|
| 35782 |
ranu |
568 |
// Sort items alphabetically by model number (series-wise)
|
|
|
569 |
list.sort(function (a, b) {
|
|
|
570 |
return a.modelNumber.localeCompare(b.modelNumber, undefined, {sensitivity: 'base'});
|
|
|
571 |
});
|
|
|
572 |
|
| 35765 |
ranu |
573 |
var html = '<table class="table table-bordered table-sm" style="margin-bottom: 0;">';
|
| 35782 |
ranu |
574 |
html += '<thead><tr style="background-color: #f8d7da;"><th>Model Number</th><th>Status</th><th>DP</th><th>Our Stock</th><th>P-CurrentQty</th><th>Action</th></tr></thead><tbody>';
|
| 35765 |
ranu |
575 |
|
|
|
576 |
for (var i = 0; i < list.length; i++) {
|
| 35782 |
ranu |
577 |
var partnerQty = list[i].partnerCurrentQty || 0;
|
|
|
578 |
var dpPrice = list[i].dp || 0;
|
|
|
579 |
var partnerQtyStyle = partnerQty > 0 ? 'color: green; text-decoration: underline; cursor: pointer;' : 'color: #666;';
|
|
|
580 |
var partnerQtyClick = partnerQty > 0 ? 'onclick="toggleOosPartnerStockRow(' + list[i].catalogId + ', ' + fofoId + ', \'' + list[i].modelNumber + '\')"' : '';
|
|
|
581 |
|
| 35765 |
ranu |
582 |
html += '<tr style="background-color: #f8d7da;">';
|
|
|
583 |
html += '<td>' + list[i].modelNumber + '</td>';
|
|
|
584 |
html += '<td>' + list[i].status + '</td>';
|
| 35782 |
ranu |
585 |
html += '<td>' + dpPrice + '</td>';
|
| 35765 |
ranu |
586 |
html += '<td>' + list[i].qty + '</td>';
|
| 35782 |
ranu |
587 |
html += '<td style="' + partnerQtyStyle + '" ' + partnerQtyClick + '>' + partnerQty + '</td>';
|
|
|
588 |
html += '<td>';
|
|
|
589 |
html += '<button class="btn btn-sm btn-success add-to-cart-btn" data-toggle="modal" data-target="#poItemsDetail" ';
|
|
|
590 |
html += 'data-catalogid="' + list[i].catalogId + '" data-warehouseid="' + warehouseId + '" ';
|
|
|
591 |
html += 'data-model="' + list[i].modelNumber + '" data-price="' + dpPrice + '">Add to PO</button>';
|
|
|
592 |
html += '</td>';
|
| 35765 |
ranu |
593 |
html += '</tr>';
|
| 35782 |
ranu |
594 |
|
|
|
595 |
// Add hidden row for partner stock details
|
|
|
596 |
html += '<tr id="oos-partner-stock-row-' + list[i].catalogId + '" class="oos-partner-stock-detail-row" style="display: none; background-color: #d4edda;">';
|
|
|
597 |
html += '<td colspan="6" style="padding: 10px 20px;"><div id="oos-partner-stock-content-' + list[i].catalogId + '"><p>Loading...</p></div></td>';
|
|
|
598 |
html += '</tr>';
|
| 35765 |
ranu |
599 |
}
|
|
|
600 |
|
|
|
601 |
html += '</tbody></table>';
|
|
|
602 |
contentDiv.innerHTML = html;
|
|
|
603 |
} else {
|
|
|
604 |
contentDiv.innerHTML = '<p style="color: green; margin: 0;">No out of stock items for HID/FastMoving/Running categories.</p>';
|
|
|
605 |
}
|
|
|
606 |
},
|
|
|
607 |
error: function () {
|
|
|
608 |
contentDiv.innerHTML = '<p style="color: red; margin: 0;">Error loading out of stock details</p>';
|
|
|
609 |
}
|
|
|
610 |
});
|
|
|
611 |
}
|
|
|
612 |
} else {
|
|
|
613 |
contentDiv.style.display = 'none';
|
|
|
614 |
icon.textContent = '+';
|
|
|
615 |
}
|
|
|
616 |
}
|
| 35782 |
ranu |
617 |
|
|
|
618 |
var oosPartnerStockDataLoaded = {};
|
|
|
619 |
|
|
|
620 |
function toggleOosPartnerStockRow(catalogId, fofoId, modelNumber) {
|
|
|
621 |
var row = document.getElementById('oos-partner-stock-row-' + catalogId);
|
|
|
622 |
var contentDiv = document.getElementById('oos-partner-stock-content-' + catalogId);
|
|
|
623 |
|
|
|
624 |
if (row.style.display === 'none') {
|
|
|
625 |
row.style.display = 'table-row';
|
|
|
626 |
|
|
|
627 |
// Load data only if not already loaded
|
|
|
628 |
if (!oosPartnerStockDataLoaded[catalogId]) {
|
|
|
629 |
contentDiv.innerHTML = '<p>Loading...</p>';
|
|
|
630 |
|
|
|
631 |
$.ajax({
|
|
|
632 |
url: '${rc.contextPath}/getItemsByCatalog',
|
|
|
633 |
type: 'GET',
|
|
|
634 |
data: {catalogId: catalogId, fofoId: fofoId},
|
|
|
635 |
success: function (response) {
|
|
|
636 |
oosPartnerStockDataLoaded[catalogId] = true;
|
|
|
637 |
|
|
|
638 |
var list = response.response;
|
|
|
639 |
|
|
|
640 |
if (list && list.length > 0) {
|
|
|
641 |
var html = '<strong>Partner Stock: ' + modelNumber + '</strong>';
|
|
|
642 |
html += '<table class="table table-bordered table-sm" style="margin-top:5px; background-color: #fff;">';
|
|
|
643 |
html += '<thead><tr style="background-color: #d4edda;"><th>Item ID</th><th>Description</th><th>Qty</th><th>Status</th></tr></thead><tbody>';
|
|
|
644 |
|
|
|
645 |
for (var i = 0; i < list.length; i++) {
|
|
|
646 |
if (list[i].availability > 0) {
|
|
|
647 |
var stockType = list[i].stockType || 'IN_STOCK';
|
|
|
648 |
var rowStyle = stockType === 'GRN_PENDING' ? 'background-color: #fff3cd;' : '';
|
|
|
649 |
var statusLabel = stockType === 'GRN_PENDING' ? '<span style="color: #856404; font-weight: bold;">GRN Pending</span>' : '<span style="color: #155724;">In Stock</span>';
|
|
|
650 |
html += '<tr style="' + rowStyle + '">';
|
|
|
651 |
html += '<td>' + list[i].itemId + '</td>';
|
|
|
652 |
html += '<td>' + (list[i].itemDescription || '-') + '</td>';
|
|
|
653 |
html += '<td>' + list[i].availability + '</td>';
|
|
|
654 |
html += '<td>' + statusLabel + '</td>';
|
|
|
655 |
html += '</tr>';
|
|
|
656 |
}
|
|
|
657 |
}
|
|
|
658 |
|
|
|
659 |
html += '</tbody></table>';
|
|
|
660 |
contentDiv.innerHTML = html;
|
|
|
661 |
} else {
|
|
|
662 |
contentDiv.innerHTML = '<p>No partner stock details available</p>';
|
|
|
663 |
}
|
|
|
664 |
},
|
|
|
665 |
error: function () {
|
|
|
666 |
contentDiv.innerHTML = '<p style="color: red; margin: 0;">Error loading partner stock details</p>';
|
|
|
667 |
}
|
|
|
668 |
});
|
|
|
669 |
}
|
|
|
670 |
} else {
|
|
|
671 |
row.style.display = 'none';
|
|
|
672 |
}
|
|
|
673 |
}
|
| 35846 |
ranu |
674 |
|
|
|
675 |
// Model Number Search Filter
|
|
|
676 |
$('#modelSearchInput').on('keyup', function () {
|
|
|
677 |
var searchText = $(this).val().toLowerCase().trim();
|
|
|
678 |
|
|
|
679 |
// Filter rows in all brand tables
|
|
|
680 |
$('.fofo-summry-view table tbody tr').each(function () {
|
|
|
681 |
var $row = $(this);
|
|
|
682 |
|
|
|
683 |
// Skip detail rows (our-stock-detail-row, partner-stock-detail-row, out-of-stock-row, oos-partner-stock-detail-row)
|
|
|
684 |
if ($row.hasClass('our-stock-detail-row') ||
|
|
|
685 |
$row.hasClass('partner-stock-detail-row') ||
|
|
|
686 |
$row.hasClass('out-of-stock-row') ||
|
|
|
687 |
$row.hasClass('oos-partner-stock-detail-row')) {
|
|
|
688 |
return;
|
|
|
689 |
}
|
|
|
690 |
|
|
|
691 |
// Get model number from first column
|
|
|
692 |
var modelNumber = $row.find('td:first').text().toLowerCase().trim();
|
|
|
693 |
|
|
|
694 |
if (searchText === '' || modelNumber.indexOf(searchText) > -1) {
|
|
|
695 |
$row.show();
|
|
|
696 |
} else {
|
|
|
697 |
$row.hide();
|
|
|
698 |
// Also hide related detail rows
|
|
|
699 |
var catalogId = $row.find('td:first').text().trim();
|
|
|
700 |
$row.next('.our-stock-detail-row').hide();
|
|
|
701 |
$row.next().next('.partner-stock-detail-row').hide();
|
|
|
702 |
}
|
|
|
703 |
});
|
|
|
704 |
});
|
|
|
705 |
|
|
|
706 |
function clearModelSearch() {
|
|
|
707 |
$('#modelSearchInput').val('');
|
|
|
708 |
$('.fofo-summry-view table tbody tr').show();
|
|
|
709 |
}
|
| 35765 |
ranu |
710 |
</script>
|
|
|
711 |
|