Rev 26952 | Blame | Compare with Previous | Last modification | View Log | RSS feed
<style>.btn:hover{color: grey;text-decoration: none;}.btn-primary:hover{color: grey;text-decoration: none;}.retailer-details{cursor:pointer;}.indentMessage{text-transform: lowercase;display: inline-block;}.indentMessage:first-letter{text-transform: UpperCase;}</style><section class="wrapper"><div class="row"><div class="col-lg-12">#if ($isAdmin)<h3 class="page-header"><i class="icon_document_alt"></i>Create/Edit PURCHASE PLAN</h3><ol class="breadcrumb"><li><i class="fa fa-home"></i><a href="${rc.contextPath}/dashboard">Home</a></li>#if($retailerName)<script type="text/javascript">currentFofoId=${retailerId};</script><li><i class="icon_document_alt"></i><b>Allocation for $retailerName (Counter Size - $counterSize)</b></li>#else<li><i class="icon_document_alt"></i><b>Standard Allocation (Counter Size - $counterSize)</b></li>#end</ol>#else<h3 class="page-header"><i class="icon_document_alt"></i>My Business Plan <span style ="font-size:18px";>(Open from <b>21<sup>st</sup> till end of Month</b>)</span></h3>#end</div></div><div><div class="row"><div class="col-lg-3" style="text-align:left;">#if(!$isAdmin)<button type="button" class="btn btn-default previous-month" aria-label="Previous" >$previousPlanningMonth</button><button type="button" class="btn btn-default current-month" aria-label="Current" >$currentPlanningMonth</button>#end</div>#if($freezed&&$planningMonth)<div style = "font-size:20px;font-weight:bold;color:red;" class="indentMessage"> $planningMonth Month Planning is <b>Closed</b></div>#else<div style = "font-size:20px;font-weight:bold;color:Green;" >$planningMonth Month Planning is <b>Open</b></div>#end</div><div class="row"><div class="col-lg-8" id="indent-container"><table class="table table-striped table-condensed table-bordered" id="entire-catalog-table"><thead><tr><th>Id</th><th style="width:30%">Description</th><th style="width:12%">DP</th><th>MOP</th><th style="width:20%">Planned Qty</th>#if($previousMonth||$mtd)<th style="width:6%">Sale</th>#else<th style="width:6%">15 days sale</th>#end<th style="width:9%">In Stock</th><th style="width:9%">In Transit</th><th style="width:6%">Recommended</th><th style="width:6%">Minimum</th><th>Remaining</th></tr></thead><tbody>#foreach( $modelListing in $catalogTagListings )<tr><td>$modelListing.getCatalogId()</td><td>$modelListing.getItemDescription()</td><td class="currency">$modelListing.getDp()</td><td class="currency">$modelListing.getMop()</td>#if($freezed&&$previousMonth)<td><input type="number" min="0" max="40"data-catalog-id="$modelListing.getCatalogId()"data-selling-price="$modelListing.getDp()"data-brand-name="$modelListing.getBrand()"data-description="$modelListing.getItemDescription()"value="$modelListing.getAllocatedQuantity()" readonly/></td>#elseif($freezed)<td><input type="number" min="0" max="40"data-catalog-id="$modelListing.getCatalogId()"data-selling-price="$modelListing.getDp()"data-brand-name="$modelListing.getBrand()"data-description="$modelListing.getItemDescription()"value="$modelListing.getAllocatedQuantity()" readonly/></td>#else<td><input type="number" min="0" max="40"data-catalog-id="$modelListing.getCatalogId()"data-selling-price="$modelListing.getDp()"data-brand-name="$modelListing.getBrand()"data-description="$modelListing.getItemDescription()"value="$modelListing.getAllocatedQuantity()"/></td>#end#if($previousMonth)<td>$modelListing.getLastMonthSaleMap()</td>#elseif($mtd)<td>$modelListing.getLast15DaysSale()</td>#else<td>$modelListing.getLast15DaysSale()</td>#end<td>$modelListing.getStockInHand()</td><td>$modelListing.getInTransitQuantity()</td><td>$modelListing.getRecommendedQty()</td><td>$modelListing.getMinimumQty()</td>#if($mtd)<td>$modelListing.getRemaining()</td>#else<td></td>#end</tr>#end</tbody></table></div><div class="col-lg-7" id="indent-container1" style="display:none"></div><div class="col-lg-4"><div class="panel panel-default">## #if(!$isAdmin)<div class="panel-heading">Allocation Update Summary #if($retailerName) (Counter Size - $counterSize) #end</div><div class="panel-content"><div id="plansummary"></div><div id="planbuttons"><!-- <button class="btn btn-primary mk_submit_indent">Update Allocation</button><button class="btn btn-primary bk_toedit_indent" style="display:none">Edit</button> -->#if($freezed&&$previousMonth)<button class="btn btn-primary confirm_indent" disabled>Confirm Update</button>#elseif($freezed)<button class="btn btn-primary confirm_indent" disabled >Confirm Update</button>#else<button class="btn btn-primary confirm_indent" style="display:none">Confirm Update</button>#end</div></div></div><div class="panel panel-default"><div class="panel-heading">Brand Stock</div><div class="panel-content"><table class="table table-sm" id="stock-table"><thead><tr><th>Brand</th><th>Qty(pc)</th><th>Value</th></tr></thead><tbody>#foreach( $brandStockPrice in $brandStockPrices )<tr class="stockInfo" ><td>$brandStockPrice.getBrand()</td><td>$brandStockPrice.getTotalQty()</td><td><span class="currency">$brandStockPrice.getTotalValue()</span></td></tr>#end</tbody></table></div></div></div></div></div></div></section><script type="text/javascript">totalAmount = $totalAmount;/* Create an array with the values of all the input boxes in a column */$.fn.dataTable.ext.order['dom-text'] = function ( settings, col ){return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {return $('input', td).val();} );}/* Create an array with the values of all the input boxes in a column, parsed as numbers */$.fn.dataTable.ext.order['dom-text-numeric'] = function ( settings, col ){return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {return $('input', td).val() * 1;} );}/* Create an array with the values of all the select options in a column */$.fn.dataTable.ext.order['dom-select'] = function ( settings, col ){return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {return $('select', td).val();} );}/* Create an array with the values of all the checkboxes in a column */$.fn.dataTable.ext.order['dom-checkbox'] = function ( settings, col ){return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {return $('input', td).prop('checked') ? '1' : '0';} );}/* Initialise the table with the required column ordering data types */var customRetailers = ${customRetailers};$(document).ready(function() {indentTable = $('#entire-catalog-table').DataTable({"scrollY":"600px","columns": [{ "visible": false }, null,null, null,{ "orderDataType": "dom-text-numeric" }, null, null, null,null,null,null],"lengthMenu":[[25,50],[25,50]],"order": []});indentMap = {};indentTable.rows().data().each(function(arr){var $input = $(arr[4]);quantity = parseInt($input.val(), 10);if(quantity > 0){var brandName = arr[1].split(" ")[0];if(indentMap[brandName] == undefined) {indentMap[brandName] = {};}indentMap[brandName][parseInt(arr[0])]= {"initialQuantity": quantity, "quantity": quantity,"sellingPrice":parseInt(arr[2]), "description": arr[1], "diff":0};}})$("#partnerId").typeahead({source: customRetailers,autoSelect: true,displayText:function(item){return item.businessName + "-" + item.address.city;},afterSelect: function(currentItem){currentFofoId = currentItem.partnerId;}});populateIndentSummary();});</script>