| 23405 |
amit.gupta |
1 |
<style>
|
|
|
2 |
.btn:hover{
|
|
|
3 |
color: grey;
|
|
|
4 |
text-decoration: none;
|
|
|
5 |
}
|
|
|
6 |
.btn-primary:hover{
|
|
|
7 |
color: grey;
|
|
|
8 |
text-decoration: none;
|
|
|
9 |
}
|
|
|
10 |
.retailer-details{
|
|
|
11 |
cursor:pointer;
|
|
|
12 |
}
|
|
|
13 |
</style>
|
|
|
14 |
|
|
|
15 |
<section class="wrapper">
|
|
|
16 |
<div class="row">
|
|
|
17 |
<div class="col-lg-12">
|
| 23786 |
amit.gupta |
18 |
<h3 class="page-header"><i class="icon_document_alt"></i>Create/Edit Allocation</h3>
|
| 23405 |
amit.gupta |
19 |
<ol class="breadcrumb">
|
|
|
20 |
<li><i class="fa fa-home"></i><a href="${rc.contextPath}/dashboard">Home</a></li>
|
| 23786 |
amit.gupta |
21 |
#if($retailerName)
|
|
|
22 |
<script type="text/javascript">
|
|
|
23 |
currentFofoId=${retailerId};
|
|
|
24 |
</script>
|
|
|
25 |
<li><i class="icon_document_alt"></i><b>Allocation for $retailerName (Counter Size - $counterSize)</b></li>
|
|
|
26 |
#else
|
|
|
27 |
<li><i class="icon_document_alt"></i><b>Standard Allocation (Counter Size - $counterSize)</b></li>
|
|
|
28 |
#end
|
| 23405 |
amit.gupta |
29 |
</ol>
|
|
|
30 |
</div>
|
|
|
31 |
</div>
|
|
|
32 |
|
|
|
33 |
<div>
|
| 23786 |
amit.gupta |
34 |
<div class="row">
|
|
|
35 |
<!--<div class="col-lg-3">
|
|
|
36 |
<div class="input-group">
|
|
|
37 |
<input type="text" class="form-control">
|
|
|
38 |
<div class="input-group-btn">
|
|
|
39 |
<button type="button" class="btn btn-default">Get Partner Allocation</span></button>
|
|
|
40 |
</div>
|
|
|
41 |
</div>
|
|
|
42 |
</div>-->
|
|
|
43 |
<div class="col-lg-3">
|
|
|
44 |
<div class="input-group">
|
|
|
45 |
<input id="partnerId" type="text" class="typeahead form-control form-control-sm" placeholder="Search Partner by Store" data-provide="typeahead"
|
|
|
46 |
#if(${retailerName}) value="${retailerName}" #end
|
|
|
47 |
autocomplete="off"/>
|
|
|
48 |
<div class="input-group-btn">
|
|
|
49 |
<button class="create_indent btn btn-primary">Get Partner Allocation</button>
|
|
|
50 |
</div>
|
|
|
51 |
</div>
|
|
|
52 |
</div>
|
|
|
53 |
<div class="col-lg-3">
|
|
|
54 |
<div class="dropdown">
|
|
|
55 |
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">Change Counter Size
|
|
|
56 |
<span class="caret"></span></button>
|
|
|
57 |
<ul class="dropdown-menu">
|
|
|
58 |
#foreach($counterSiz in $counterSizes)
|
|
|
59 |
<li class="mk_counter_size #if(${counterSiz}==${counterSize}) active#end"><a href="javascript:void(0)">$counterSiz</a></li>
|
|
|
60 |
#end
|
|
|
61 |
</ul>
|
|
|
62 |
</div>
|
|
|
63 |
</div>
|
|
|
64 |
</div>
|
| 23405 |
amit.gupta |
65 |
<div class="row">
|
| 23786 |
amit.gupta |
66 |
<div class="col-lg-7" id="indent-container">
|
| 23405 |
amit.gupta |
67 |
<table class="table table-striped table-condensed table-bordered" id="entire-catalog-table">
|
|
|
68 |
<thead>
|
|
|
69 |
<tr>
|
|
|
70 |
<th>Id</th>
|
|
|
71 |
<th>Description</th>
|
|
|
72 |
<th>Selling Price</th>
|
|
|
73 |
<th>MOP</th>
|
|
|
74 |
<th>Stock</th>
|
|
|
75 |
<th>30 days Sale</th>
|
| 23786 |
amit.gupta |
76 |
<th>Allocated Quantity</th>
|
| 23405 |
amit.gupta |
77 |
</tr>
|
|
|
78 |
</thead>
|
|
|
79 |
<tbody>
|
|
|
80 |
#foreach( $tagListing in $tagListings )
|
|
|
81 |
<tr>
|
|
|
82 |
<td>$tagListing.getItemId()</td>
|
|
|
83 |
<td>$tagListing.getItemDescription()</td>
|
| 23786 |
amit.gupta |
84 |
<td class="currency">$tagListing.getSellingPrice()</td>
|
|
|
85 |
<td class="currency">$tagListing.getMop()</td>
|
| 23405 |
amit.gupta |
86 |
<td>$tagListing.getStockInHand()</td>
|
|
|
87 |
<td>$tagListing.getLast30DaysSale()</td>
|
|
|
88 |
<td><input type="number" min="0" max="10"
|
|
|
89 |
data-item-id="$tagListing.getItemId()"
|
|
|
90 |
data-selling-price="$tagListing.getSellingPrice()"
|
|
|
91 |
data-description="$tagListing.getItemDescription()"
|
| 23786 |
amit.gupta |
92 |
value="$tagListing.getAllocatedQuantity()"/></td>
|
| 23405 |
amit.gupta |
93 |
</tr>
|
|
|
94 |
#end
|
|
|
95 |
</tbody>
|
|
|
96 |
</table>
|
|
|
97 |
</div>
|
| 23786 |
amit.gupta |
98 |
<div class="col-lg-7" id="indent-container1" style="display:none"></div>
|
|
|
99 |
<div class="col-lg-4">
|
| 23405 |
amit.gupta |
100 |
<div class="panel panel-default">
|
| 23786 |
amit.gupta |
101 |
<div class="panel-heading">Allocation Update Summary #if($retailerName) (Counter Size - $counterSize) #end</div>
|
| 23405 |
amit.gupta |
102 |
<div class="panel-content">
|
| 23786 |
amit.gupta |
103 |
<table class="table table-sm" id="summary-table">
|
|
|
104 |
<thead>
|
|
|
105 |
<tr>
|
|
|
106 |
<th class="col">#</th>
|
|
|
107 |
<th class="col">Items</th>
|
|
|
108 |
<th class="col">Quantity</th>
|
|
|
109 |
<th class="col">Amount</th>
|
|
|
110 |
</tr>
|
|
|
111 |
</thead>
|
|
|
112 |
<tbody>
|
|
|
113 |
<tr>
|
|
|
114 |
<th class="row">Initial</th>
|
|
|
115 |
<td></td>
|
|
|
116 |
<td></td>
|
|
|
117 |
<td></th>
|
|
|
118 |
</tr>
|
|
|
119 |
<tr>
|
|
|
120 |
<th class="row">Added</th>
|
|
|
121 |
<td></td>
|
|
|
122 |
<td></td>
|
|
|
123 |
<td></th>
|
|
|
124 |
</tr>
|
|
|
125 |
<tr>
|
|
|
126 |
<th class="row">Removed</th>
|
|
|
127 |
<td></td>
|
|
|
128 |
<td></td>
|
|
|
129 |
<td></th>
|
|
|
130 |
</tr>
|
|
|
131 |
<tr>
|
|
|
132 |
<th class="row">Final</th>
|
|
|
133 |
<td></td>
|
|
|
134 |
<td></td>
|
|
|
135 |
<td></th>
|
|
|
136 |
</tr>
|
|
|
137 |
<tbody>
|
|
|
138 |
</table>
|
|
|
139 |
<button class="btn btn-primary mk_submit_indent">Update Allocation</button>
|
| 23405 |
amit.gupta |
140 |
<button class="btn btn-primary bk_toedit_indent" style="display:none">Edit</button>
|
| 23786 |
amit.gupta |
141 |
<button class="btn btn-primary confirm_indent" style="display:none">Confirm Update</button>
|
| 23405 |
amit.gupta |
142 |
</div>
|
|
|
143 |
</div>
|
| 23786 |
amit.gupta |
144 |
<div class="panel panel-default">
|
|
|
145 |
<div class="panel-heading">Brandwise Target and Performance</div>
|
|
|
146 |
<div class="panel-content">
|
|
|
147 |
<ul class="nav nav-tabs">
|
|
|
148 |
<li role="presentation" class="active brandLi"><a href="javascript:void(0)">Mobiles</a></li>
|
|
|
149 |
<li role="presentation" class="brandLi"><a href="javascript:void(0)">Accessories</a></li>
|
|
|
150 |
</ul>
|
|
|
151 |
|
|
|
152 |
<table class="brandPerformance table table-striped table-condensed table-bordered">
|
|
|
153 |
<thead>
|
|
|
154 |
<tr>
|
|
|
155 |
<th rowspan="2">Brand Name</th>
|
|
|
156 |
<th rowspan="2" align="center">Target Value</th>
|
|
|
157 |
<th colspan="2" align="center">Achieved</th>
|
|
|
158 |
<th colspan="2">Brand Share(%)</th>
|
|
|
159 |
</tr>
|
|
|
160 |
<tr>
|
|
|
161 |
<th>Value</th>
|
|
|
162 |
<th>Percentage</th>
|
|
|
163 |
<th>Target</th>
|
|
|
164 |
<th>Achieved</th>
|
|
|
165 |
</tr>
|
|
|
166 |
</thead>
|
|
|
167 |
<tbody>
|
|
|
168 |
#foreach($brandPerformance in $brandPerformanceList)
|
|
|
169 |
<tr>
|
|
|
170 |
<th>$brandPerformance.getBrandName()</th>
|
|
|
171 |
<td class="currency">$brandPerformance.getTarget()</td>
|
|
|
172 |
<td class="currency">$brandPerformance.getAchieved()</td>
|
|
|
173 |
<td>$brandPerformance.getAchievedPercentage()%</td>
|
|
|
174 |
<td>$brandPerformance.getBrandTargetShare()</td>
|
|
|
175 |
<td>$brandPerformance.getBrandAchievedShare()</td>
|
|
|
176 |
</tr>
|
|
|
177 |
#end
|
|
|
178 |
<tbody>
|
|
|
179 |
</tbody>
|
|
|
180 |
</table>
|
|
|
181 |
<table style="display:none" class="table brandPerformance table-striped table-condensed table-bordered">
|
|
|
182 |
<thead>
|
|
|
183 |
<tr>
|
|
|
184 |
<th rowspan="2">Brand Name</th>
|
|
|
185 |
<th rowspan="2" align="center">Target Value</th>
|
|
|
186 |
<th colspan="2" align="center">Achieved</th>
|
|
|
187 |
<th colspan="2">Brand Share(%)</th>
|
|
|
188 |
</tr>
|
|
|
189 |
<tr>
|
|
|
190 |
<th>Value</th>
|
|
|
191 |
<th>Percentage</th>
|
|
|
192 |
<th>Target</th>
|
|
|
193 |
<th>Achieved</th>
|
|
|
194 |
</tr>
|
|
|
195 |
</thead>
|
|
|
196 |
<tbody>
|
|
|
197 |
#foreach($brandPerformance in $accsBrandPerformanceList)
|
|
|
198 |
<tr>
|
|
|
199 |
<th>$brandPerformance.getBrandName()</th>
|
|
|
200 |
<td>$brandPerformance.getTarget()</td>
|
|
|
201 |
<td>$brandPerformance.getAchieved()</td>
|
|
|
202 |
<td>$brandPerformance.getAchievedPercentage()%</td>
|
|
|
203 |
<td>$brandPerformance.getBrandTargetShare()</td>
|
|
|
204 |
<td>$brandPerformance.getBrandAchievedShare()</td>
|
|
|
205 |
</tr>
|
|
|
206 |
#end
|
|
|
207 |
<tbody>
|
|
|
208 |
</tbody>
|
|
|
209 |
</table>
|
|
|
210 |
</div>
|
|
|
211 |
|
|
|
212 |
</div>
|
| 23405 |
amit.gupta |
213 |
</div>
|
|
|
214 |
</div>
|
|
|
215 |
</div>
|
|
|
216 |
</section>
|
|
|
217 |
<script type="text/javascript">
|
|
|
218 |
/* Create an array with the values of all the input boxes in a column */
|
|
|
219 |
$.fn.dataTable.ext.order['dom-text'] = function ( settings, col )
|
|
|
220 |
{
|
|
|
221 |
return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
|
|
|
222 |
return $('input', td).val();
|
|
|
223 |
} );
|
|
|
224 |
}
|
|
|
225 |
|
|
|
226 |
/* Create an array with the values of all the input boxes in a column, parsed as numbers */
|
|
|
227 |
$.fn.dataTable.ext.order['dom-text-numeric'] = function ( settings, col )
|
|
|
228 |
{
|
|
|
229 |
return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
|
|
|
230 |
return $('input', td).val() * 1;
|
|
|
231 |
} );
|
|
|
232 |
}
|
|
|
233 |
|
|
|
234 |
/* Create an array with the values of all the select options in a column */
|
|
|
235 |
$.fn.dataTable.ext.order['dom-select'] = function ( settings, col )
|
|
|
236 |
{
|
|
|
237 |
return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
|
|
|
238 |
return $('select', td).val();
|
|
|
239 |
} );
|
|
|
240 |
}
|
|
|
241 |
|
|
|
242 |
/* Create an array with the values of all the checkboxes in a column */
|
|
|
243 |
$.fn.dataTable.ext.order['dom-checkbox'] = function ( settings, col )
|
|
|
244 |
{
|
|
|
245 |
return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
|
|
|
246 |
return $('input', td).prop('checked') ? '1' : '0';
|
|
|
247 |
} );
|
|
|
248 |
}
|
|
|
249 |
|
|
|
250 |
/* Initialise the table with the required column ordering data types */
|
| 23786 |
amit.gupta |
251 |
var customRetailers = ${customRetailers};
|
| 23405 |
amit.gupta |
252 |
$(document).ready(function() {
|
|
|
253 |
indentTable = $('#entire-catalog-table').DataTable({
|
| 23786 |
amit.gupta |
254 |
"scrollY":"600px",
|
| 23405 |
amit.gupta |
255 |
"columns": [
|
|
|
256 |
null,null, null, null, null, null,
|
|
|
257 |
{ "orderDataType": "dom-text-numeric" }
|
| 23786 |
amit.gupta |
258 |
],
|
|
|
259 |
"lengthMenu":[[25,50],[25,50]]
|
| 23405 |
amit.gupta |
260 |
});
|
|
|
261 |
indentMap = {};
|
|
|
262 |
indentTable.rows().data().each(function(arr){
|
|
|
263 |
var $input = $(arr[6]);
|
|
|
264 |
quantity = parseInt($input.val(), 10);
|
|
|
265 |
if(quantity > 0){
|
| 23786 |
amit.gupta |
266 |
indentMap[parseInt(arr[0])] = {"initialQuantity": quantity, "quantity": quantity, "sellingPrice":parseInt(arr[2]), "description": arr[1], "diff":0};
|
| 23405 |
amit.gupta |
267 |
}
|
|
|
268 |
});
|
| 23786 |
amit.gupta |
269 |
$(".typeahead").typeahead({
|
|
|
270 |
source: customRetailers,
|
|
|
271 |
autoSelect: true,
|
|
|
272 |
displayText:function(item){return item.businessName + "-" + item.address.city;},
|
|
|
273 |
afterSelect: function(currentItem){
|
|
|
274 |
currentFofoId = currentItem.partnerId;
|
|
|
275 |
}
|
|
|
276 |
});
|
| 23405 |
amit.gupta |
277 |
populateIndentSummary();
|
|
|
278 |
});
|
|
|
279 |
|
|
|
280 |
</script>
|