Rev 23884 | Rev 24406 | Go to most recent revision | 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;}</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 Allocation</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>Create Purchase Order</h3>#end</div></div><div>#if ($isAdmin)<div class="row"><div class="col-lg-3"><div class="input-group"><input id="partnerId" type="text" class="typeahead form-control form-control-sm" placeholder="Search Partner by Store" data-provide="typeahead"#if(${retailerName}) value="${retailerName}" #endautocomplete="off"/><div class="input-group-btn"><button class="create_indent btn btn-primary">Get Partner Allocation</button><button class="download_indent btn btn-primary">Download</button></div></div></div><div class="col-lg-3"><div class="dropdown"><button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">Change Counter Size<span class="caret"></span></button><ul class="dropdown-menu">#foreach($counterSiz in $counterSizes)<li class="mk_counter_size #if(${counterSiz}==${counterSize}) active#end"><a href="javascript:void(0)">$counterSiz</a></li>#end</ul></div></div></div>#end<div class="row"><div class="col-lg-7" id="indent-container"><table class="table table-striped table-condensed table-bordered" id="entire-catalog-table"><thead><tr><th>Id</th><th style="width:40%">Description</th><th style="width:12%">DP</th><th>MOP</th><th style="width:20%">Allocated Quantity</th><th style="width:9%">In Stock</th><th style="width:9%">In Transit</th><th style="width:9%">To be Ordered</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><td>#if($isAdmin)<input type="number" min="0" max="20"data-catalog-id="$modelListing.getCatalogId()"data-selling-price="$modelListing.getDp()"data-description="$modelListing.getItemDescription()"value="$modelListing.getAllocatedQuantity()"/>#if($modelListing.getAllocatedQuantity() == 0)<button type="button" class="btn btn-link mk_pause_button"data-id="$modelListing.getCatalogId()"data-description="$modelListing.getItemDescription()">Pause</button>#end#else$modelListing.getAllocatedQuantity()#end</td><td>$modelListing.getStockInHand()</td><td>$modelListing.getInTransitQuantity()</td><td>$modelListing.getToBeOrdered()</td></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"><table class="table table-sm" id="summary-table"><thead><tr><th class="col">#</th><th class="col">Items</th><th class="col">Quantity</th><th class="col">Amount</th></tr></thead><tbody><tr><th class="row">Initial</th><td></td><td></td><td></td></tr><tr><th class="row">Added</th><td></td><td></td><td></td></tr><tr><th class="row">Removed</th><td></td><td></td><td></td></tr><tr><th class="row">Final</th><td></td><td></td><td></td></tr><tbody></table><button class="btn btn-primary mk_submit_indent">Update Allocation</button><button class="btn btn-primary bk_toedit_indent" style="display:none">Edit</button><button class="btn btn-primary confirm_indent" style="display:none">Confirm Update</button></div></div>#else#set($diff=$totalAmount - $walletAmount)<div class="panel-heading">PO Summary(Total Amount in Wallet - <span class="currency">$walletAmount</span>)</div><div class="panel-content"><table class="table table-sm" id="summary-table"><thead><tr><th class="col">#</th><th class="col">Total Pcs</th><th class="col">Amount to Pay</th><th class="col">Action</th></tr></thead><tbody>#**<tr><th class="row">Partial PO</th><td>$partialPcs</td><td>$partialAmount</td><td><button class="btn btn-sm btn-primary confirm_indent #if(${diff} > 0)disabled#end">Raise Partial PO</button></td></tr>**#<tr><th class="row">Complete PO</th><td>$totalPcs</td><td class="currency">$totalAmount</td>#if($totalPcs)<td><button class="btn btn-primary raise_po#if($diff > 0) disabled#end">Raise Complete PO</button></td>#else<td>Nothing to order!</td>#end</tr></tbody></table>#if($diff>0)<div class="alert alert-warning"><medium>Please add Rs.<span class="currency">$diff</span> to complete this transaction.</meduim></div>#end</div></div>#end#if($isAdmin)<div class="panel panel-default"><div class="panel-heading">Brandwise Target and Performance</div><div class="panel-content"><ul class="nav nav-tabs"><li role="presentation" class="active brandLi"><a href="javascript:void(0)">Mobiles</a></li><li role="presentation" class="brandLi"><a href="javascript:void(0)">Accessories</a></li></ul><table class="brandPerformance table table-striped table-condensed table-bordered"><thead><tr><th rowspan="2">Brand Name</th><th rowspan="2" align="center">Target Value</th><th colspan="2" align="center">Achieved</th><th colspan="2">Brand Share(%)</th></tr><tr><th>Value</th><th>Percentage</th><th>Target</th><th>Achieved</th></tr></thead><tbody>#foreach($brandPerformance in $brandPerformanceList)<tr><th>$brandPerformance.getBrandName()</th><td class="currency">$brandPerformance.getTarget()</td><td class="currency">$brandPerformance.getAchieved()</td><td>$brandPerformance.getAchievedPercentage()%</td><td>$brandPerformance.getBrandTargetShare()</td><td>$brandPerformance.getBrandAchievedShare()</td></tr>#end<tbody></tbody></table><table style="display:none" class="table brandPerformance table-striped table-condensed table-bordered"><thead><tr><th rowspan="2">Brand Name</th><th rowspan="2" align="center">Target Value</th><th colspan="2" align="center">Achieved</th><th colspan="2">Brand Share(%)</th></tr><tr><th>Value</th><th>Percentage</th><th>Target</th><th>Achieved</th></tr></thead><tbody>#foreach($brandPerformance in $accsBrandPerformanceList)<tr><th>$brandPerformance.getBrandName()</th><td>$brandPerformance.getTarget()</td><td>$brandPerformance.getAchieved()</td><td>$brandPerformance.getAchievedPercentage()%</td><td>$brandPerformance.getBrandTargetShare()</td><td>$brandPerformance.getBrandAchievedShare()</td></tr>#end<tbody></tbody></table></div></div>#end</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": [null, null, null, null,{ "orderDataType": "dom-text-numeric" }, 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){indentMap[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;}});if($isAdmin){populateIndentSummary();}});</script>