Rev 35765 | Rev 35774 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
<style>h5 { text-align: center;background-color: lightgray;padding: 5px;font-size: 16px;}.mrt-0 {margin-top: 0;}#brand-instock tr.hide-table-padding td {padding: 0;}.expand-button {position: relative;}.accordion-toggle .expand-button:after{position: absolute;left:.75rem;top: 50%;transform: translate(0, -50%);content: '-';}.accordion-toggle.collapsed .expand-button:after{content: '+';}</style><style>.well {background-color: #f9f9f9;border: 1px solid #ddd;border-radius: 12px;padding: 5px 20px;box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);}.well h4 {margin-bottom: 10px;font-weight: 500;border-bottom: 1px solid #ccc;padding-bottom: 6px;}.well ul li {list-style: decimal;padding: 4px 0;font-weight: 400;font-size: 16px;border-bottom: 1px dashed #eee;}.well .currency {font-weight: 500}li.brandFocusedStockDetail a {padding: 8px 10px !important;}.out-of-stock-row a {text-decoration: none;}.out-of-stock-row a:hover {text-decoration: underline;}.oos-toggle-icon {display: inline-block;width: 16px;font-weight: bold;}.oos-content table {background-color: #fff;}.our-stock-detail-row td {border-top: none !important;}.our-stock-detail-row table {margin: 0;background-color: #fff;}</style><div class="modal-header"><button type="button" class="close" style="margin:-10px" data-dismiss="modal">×</button><h4 class="modal-title"><b class="fofo-stock-info">Stock Info</b> ($customRetailer.getBusinessName())<input type="hidden" id="fofo-id" value="$customRetailer.getPartnerId()"><a id="mobileAppId" href="${rc.contextPath}/mobileapp?emailId=$customRetailer.getEmail()"class="btn btn-default" target="_blank">Franchise App</a><a class="btn btn-default today-fofo-offer" data-fofoid="$sdCreditRequirement.getFofoId()">TodayOffer</a><a class="btn btn-default scheme-imei-history-btn" data-fofoid="$sdCreditRequirement.getFofoId()">IMEIMargin</a></h4></div><div class="modal-body" style="max-height:75vh;overflow:auto;"><div class="row"><div class="col-md-8 today-fofo-offer-view" style="max-height: 70vh;overflow: auto;display: none;"></div><div class="col-md-8 scheme-imei-history-view" style="max-height: 70vh;overflow: auto;display: none;"></div><div class="col-md-8 fofo-summry-view" style="max-height: 70vh;overflow: auto;"><div class="well row" style="margin: 0;"><h4>Summary<a href="#" class="dashboard-view" data-fofoid="$sdCreditRequirement.getFofoId()">More Info</a></h4><div class="col-md-4"><h5>Fund Detail</h5><ul><li>Total Limit <span class="currency"> $sdCreditRequirement.getLimit()</span></li><li>Utilization <span class="currency"> $sdCreditRequirement.getUtilizedAmount()</span></li><li>Available Limit <span class="currency"> $sdCreditRequirement.getAvailableLimit()</span></li><li>Wallet Amount <span class="currency"> $userWallet.getAmount()</span></li></ul></div><div class="col-md-4"><h5>Investment Detail</h5><ul>#if($shortInvest > 0)<li>Short Investment -: <span class="currency"> $shortInvest</span></li><li>Overdue (with intr.) <span class="currency"> $totalDueWithInterest</span></li><li>Interest <span class="currency"> $interestDue</span></li>#end<li>DRR / Today Purchase <span class="currency"> $purchaseTargetFtd </span> /#if($purchasedFtd < $purchaseTargetFtd)<span style="color: red;"> <span class="currency"> $purchasedFtd</span> </span>#else<span style="color: green;"> <span class="currency"> $purchasedFtd</span> </span>#end</li></ul><h5>Recoverable Amount </h5><ul><li>Short Invest <br> <span class="currency">$shortInvest</span></li></ul></div><div class="col-md-4"><h5>Target</h5><ul><li>Monthly Target -: <span class="currency">$monthlyTarget.purchaseTarget</span></li><li>Purchase Mtd -: <span class="currency">$purchaseMtd</span></li><li>Sale Mtd -: <span class="currency">$saleMtd</span></li></ul></div></div><div class="clearfix"></div>#if($brand != "undefined")<hr style="margin-top:25px; margin-bottom: 10px;"><div class="row"><div class="col-md-12"><ul class="nav nav-pills">#foreach($bnd in $brands)<li class="brandFocusedStockDetail" data-brand="$bnd" data-fofoid="$fofoId">#if(!$brandsWithPartnerStock.contains($bnd))<a style="color: red;" href="#tab_$bnd">$bnd</a>#else<a href="#tab_$bnd">$bnd</a>#end</li>#end<li><a href="#collapse1" data-toggle="collapse"style="background-color: #ccc;color: black;">In Stock </a></li><li><a href="#collapse2" data-toggle="collapse"style="background-color: #ccc;color: black;">Sales </a></li></ul><hr><div class="col-md-12 well panel-collapse collapse" id="collapse1"><h4>In Stock </h4><div id="itemWiseBrandStockDetail"></div></div><div id="collapse2" class="panel-collapse collapse col-md-12 well"><h4>Seven Days Sales</h4><table class="table table-striped table-advance table-hover" style="width:100%"><thead><tr><th style="width: 25%;">Item</th><th style="width: 9%;">Brand</th><th style="width: 15%;">Sold Qty</th></tr></thead><tbody>#foreach($catalog in $sevenDayAboveSoldsCatalogs)<tr><td>$catalog.getModelNumber()</td><td>$catalog.getBrand()</td><td>$catalog.getSoldQty()</td></tr>#end</tbody></table><h4>14 Days Sales</h4><table class="table table-striped table-advance table-hover" style="width:100%"><thead><tr><th style="width: 25%;">Item</th><th style="width: 9%;">Brand</th><th style="width: 15%;">Sold Qty</th></tr></thead><tbody>#foreach($catalog in $fourteenDayAboveSoldsCatalogs)<tr><td>$catalog.getModelNumber()</td><td>$catalog.getBrand()</td><td>$catalog.getSoldQty()</td></tr>#end</tbody></table><h4>21 Days Sales</h4><table class="table table-striped table-advance table-hover" style="width:100%"><thead><tr><th style="width: 25%;">Item</th><th style="width: 9%;">Brand</th><th style="width: 15%;">Sold Qty</th></tr></thead><tbody>#foreach($catalog in $twentyOneDayAboveSoldsCatalogs)<tr><td>$catalog.getModelNumber()</td><td>$catalog.getBrand()</td><td>$catalog.getSoldQty()</td></tr>#end</tbody></table><h4>28 Days Sales</h4><table class="table table-striped table-advance table-hover" style="width:100%"><thead><tr><th style="width: 25%;">Item</th><th style="width: 9%;">Brand</th><th style="width: 15%;">Sold Qty</th></tr></thead><tbody>#foreach($catalog in $twentyEightDayAboveSoldsCatalogs)<tr><td>$catalog.getModelNumber()</td><td>$catalog.getBrand()</td><td>$catalog.getSoldQty()</td></tr>#end</tbody></table></div><div>#foreach($bnd in $brands)<div id="tab_$bnd" class="clearfix"></div>#set($statusModelMap = $brandStatusWiseStockListMap.get($bnd))<h4>$bnd</h4><table class="table table-striped table-advance table-hover" style="width:100%"><thead><tr><th style="width: 30%;">Item</th><th>Status</th><th>DP</th><th>Our Stock</th><th> In-Transit</th><th>P-Fullfilled</th><th>P-Shortage</th><th>P-CurrentQty</th><th>Indent</th><th>Aging</th><th>Action</th></tr></thead><tbody>#foreach($statusKey in $statusModelMap.keySet())#foreach($stocklist in $statusModelMap.get($statusKey))<tr>#if($stocklist.getPartnerCurrentAvailability() < 1)<td style="color: red;">$stocklist.getModelNumber()</td>#else<td>$stocklist.getModelNumber()</td>#end<td>$stocklist.getStatus()</td><td>$tagListingsMap.get($stocklist.getCatalogId()).getSellingPrice()</td><td style="color: blue; text-decoration: underline; cursor: pointer;"onclick="toggleOurStockRow($stocklist.getCatalogId(), $warehouseId, '$stocklist.getModelNumber()')">$stocklist.getNetAvailability()</td>#if($catalogWiseQtyMap.get($stocklist.getCatalogId()))<td>$catalogWiseQtyMap.get($stocklist.getCatalogId())</td>#else<td>-</td>#end<td>$stocklist.getPartnerStockAvailability()</td><td>$stocklist.getPartnerShortageStock()</td><td>$stocklist.getPartnerCurrentAvailability()</td><td>#if($pendingIndentsDetailMap.get($stocklist.getCatalogId()).getQty())$pendingIndentsDetailMap.get($stocklist.getCatalogId()).getQty()#else-#end</td><td>$stocklist.getExceedDays()</td><td><button class="btn btn-sm btn-success add-to-cart-btn"data-toggle="modal"data-target="#poItemsDetail"data-catalogid="$stocklist.getCatalogId()"data-warehouseid="$warehouseId"data-model="$stocklist.getModelNumber()"data-price="$tagListingsMap.get($stocklist.getCatalogId()).getSellingPrice()">Add to PO</button></td></tr><tr id="our-stock-row-$stocklist.getCatalogId()"class="our-stock-detail-row"style="display: none; background-color: #e8f4fd;"><td colspan="11" style="padding: 10px 20px;"><div id="our-stock-content-$stocklist.getCatalogId()"><p>Loading...</p></div></td></tr>#end#end<tr class="out-of-stock-row" style="background-color: #f8d7da;"><td colspan="11"><a href="#" style="color: #c0392b; font-weight: bold;"onclick="toggleOutOfStock('$bnd', $warehouseId, this); return false;"><span class="oos-toggle-icon">+</span> Out of Stock Items(HID/FastMoving/Running)</a><div id="oos-content-$bnd" class="oos-content"style="display: none; margin-top: 10px;"><p>Loading...</p></div></td></tr></tbody></table>#end</div></div></div>#end</div><div class="col-md-4"><div id="cart-sidebar"style=" width:100%; background:#f8f9fa; border:1px solid #ccc; padding:5px; border-radius:6px;"><h5 class="mrt-0">Suggested Po Item List</h5><div id="custom-cart-section" class="well"style="padding: 4px;max-height: 55vh;overflow-y: auto;"></div><button id="save-po-btn" class="btn btn-primary btn-block" style="margin-top:10px;">Save PO</button></div></div></div></div><div class="modal-footer"><button type="button" data-dismiss="modal" class="btn btn-default view-close">Close</button></div><script>var ourStockDataLoaded = {};var oosDataLoaded = {};function toggleOurStockRow(catalogId, warehouseId, modelNumber) {var row = document.getElementById('our-stock-row-' + catalogId);var contentDiv = document.getElementById('our-stock-content-' + catalogId);if (row.style.display === 'none') {row.style.display = 'table-row';// Load data only if not already loadedif (!ourStockDataLoaded[catalogId]) {contentDiv.innerHTML = '<p>Loading...</p>';$.ajax({url: '${rc.contextPath}/indent/getOurStockDetails',type: 'GET',data: {catalogId: catalogId, warehouseId: warehouseId},success: function (response) {ourStockDataLoaded[catalogId] = true;var list = response.response; // 🔥 correct keyif (list && list.length > 0) {var html = '<strong>' + modelNumber + '</strong><br>';html += '<small style="color:#666;">' + list[0].itemDescription + '</small>';html += '<table class="table table-bordered table-sm" style="margin-top:5px">';html += '<thead><tr><th>Color</th><th>Qty</th></tr></thead><tbody>';for (var i = 0; i < list.length; i++) {html += '<tr>';html += '<td>' + (list[i].color || '-') + '</td>';html += '<td>' + list[i].qty + '</td>';html += '</tr>';}html += '</tbody></table>';contentDiv.innerHTML = html;} else {contentDiv.innerHTML = '<p>No color-wise stock details available</p>';}},error: function () {contentDiv.innerHTML = '<p style="color: red; margin: 0;">Error loading stock details</p>';}});}} else {row.style.display = 'none';}}function toggleOutOfStock(brand, warehouseId, linkElement) {var contentDiv = document.getElementById('oos-content-' + brand);var icon = linkElement.querySelector('.oos-toggle-icon');if (contentDiv.style.display === 'none') {contentDiv.style.display = 'block';icon.textContent = '-';// Load data only if not already loadedif (!oosDataLoaded[brand]) {contentDiv.innerHTML = '<p>Loading...</p>';$.ajax({url: '${rc.contextPath}/indent/getOutOfStockDetails',type: 'GET',data: {brand: brand, warehouseId: warehouseId},success: function (response) {console.log("RESPONSE:", response);oosDataLoaded[brand] = true;var list = response.response; // 🔥 correctif (list && list.length > 0) {var html = '<table class="table table-bordered table-sm" style="margin-bottom: 0;">';html += '<thead><tr><th>Model Number</th><th>Status</th><th>Stock Qty</th></tr></thead><tbody>';for (var i = 0; i < list.length; i++) {html += '<tr style="background-color: #f8d7da;">';html += '<td>' + list[i].modelNumber + '</td>';html += '<td>' + list[i].status + '</td>';html += '<td>' + list[i].qty + '</td>';html += '</tr>';}html += '</tbody></table>';contentDiv.innerHTML = html;} else {contentDiv.innerHTML = '<p style="color: green; margin: 0;">No out of stock items for HID/FastMoving/Running categories.</p>';}},error: function () {contentDiv.innerHTML = '<p style="color: red; margin: 0;">Error loading out of stock details</p>';}});}} else {contentDiv.style.display = 'none';icon.textContent = '+';}}</script>