| 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">
|
| 23796 |
amit.gupta |
18 |
#if ($isAdmin)
|
| 23786 |
amit.gupta |
19 |
<h3 class="page-header"><i class="icon_document_alt"></i>Create/Edit Allocation</h3>
|
| 23405 |
amit.gupta |
20 |
<ol class="breadcrumb">
|
|
|
21 |
<li><i class="fa fa-home"></i><a href="${rc.contextPath}/dashboard">Home</a></li>
|
| 23786 |
amit.gupta |
22 |
#if($retailerName)
|
|
|
23 |
<script type="text/javascript">
|
|
|
24 |
currentFofoId=${retailerId};
|
|
|
25 |
</script>
|
|
|
26 |
<li><i class="icon_document_alt"></i><b>Allocation for $retailerName (Counter Size - $counterSize)</b></li>
|
|
|
27 |
#else
|
|
|
28 |
<li><i class="icon_document_alt"></i><b>Standard Allocation (Counter Size - $counterSize)</b></li>
|
|
|
29 |
#end
|
| 23405 |
amit.gupta |
30 |
</ol>
|
| 23796 |
amit.gupta |
31 |
#else
|
| 25701 |
amit.gupta |
32 |
<h3 class="page-header"><i class="icon_document_alt"></i>My Business Plan</h3>
|
| 26131 |
tejbeer |
33 |
<div style = "font-size:25px;font-weight:bold" >Monthly planning available for each month between 26 - 07</div>
|
|
|
34 |
#if($freezed&&$planningMonth)
|
|
|
35 |
<div style = "font-size:20px;font-weight:bold" >Monthly planning for $planningMonth Month Closed</div>
|
|
|
36 |
#else
|
|
|
37 |
<div style = "font-size:20px;font-weight:bold" >Monthly planning for $planningMonth Month</div>
|
|
|
38 |
#end
|
| 26082 |
tejbeer |
39 |
|
| 26131 |
tejbeer |
40 |
|
| 23796 |
amit.gupta |
41 |
#end
|
| 23405 |
amit.gupta |
42 |
</div>
|
| 26131 |
tejbeer |
43 |
|
|
|
44 |
<div class="col-lg-3" style="text-align:left;">
|
|
|
45 |
|
|
|
46 |
<button type="button" class="btn btn-default previous-month" aria-label="Previous" >
|
|
|
47 |
$previousPlanningMonth</button>
|
|
|
48 |
<button type="button" class="btn btn-default current-month" aria-label="Current" >
|
|
|
49 |
$currentPlanningMonth</button>
|
|
|
50 |
</div>
|
| 23405 |
amit.gupta |
51 |
</div>
|
|
|
52 |
|
|
|
53 |
<div>
|
| 23796 |
amit.gupta |
54 |
#if ($isAdmin)
|
| 23786 |
amit.gupta |
55 |
<div class="row">
|
|
|
56 |
<div class="col-lg-3">
|
|
|
57 |
<div class="input-group">
|
|
|
58 |
<input id="partnerId" type="text" class="typeahead form-control form-control-sm" placeholder="Search Partner by Store" data-provide="typeahead"
|
|
|
59 |
#if(${retailerName}) value="${retailerName}" #end
|
|
|
60 |
autocomplete="off"/>
|
|
|
61 |
<div class="input-group-btn">
|
|
|
62 |
<button class="create_indent btn btn-primary">Get Partner Allocation</button>
|
| 24229 |
amit.gupta |
63 |
<button class="download_indent btn btn-primary">Download</button>
|
| 23786 |
amit.gupta |
64 |
</div>
|
|
|
65 |
</div>
|
|
|
66 |
</div>
|
|
|
67 |
<div class="col-lg-3">
|
|
|
68 |
<div class="dropdown">
|
|
|
69 |
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">Change Counter Size
|
|
|
70 |
<span class="caret"></span></button>
|
|
|
71 |
<ul class="dropdown-menu">
|
|
|
72 |
#foreach($counterSiz in $counterSizes)
|
|
|
73 |
<li class="mk_counter_size #if(${counterSiz}==${counterSize}) active#end"><a href="javascript:void(0)">$counterSiz</a></li>
|
|
|
74 |
#end
|
|
|
75 |
</ul>
|
|
|
76 |
</div>
|
|
|
77 |
</div>
|
|
|
78 |
</div>
|
| 23796 |
amit.gupta |
79 |
#end
|
| 23405 |
amit.gupta |
80 |
<div class="row">
|
| 25721 |
tejbeer |
81 |
<div class="col-lg-8" id="indent-container">
|
| 23405 |
amit.gupta |
82 |
<table class="table table-striped table-condensed table-bordered" id="entire-catalog-table">
|
|
|
83 |
<thead>
|
|
|
84 |
<tr>
|
|
|
85 |
<th>Id</th>
|
| 25721 |
tejbeer |
86 |
<th style="width:30%">Description</th>
|
| 24229 |
amit.gupta |
87 |
<th style="width:12%">DP</th>
|
| 23405 |
amit.gupta |
88 |
<th>MOP</th>
|
| 25721 |
tejbeer |
89 |
<th style="width:20%">Planned Qty</th>
|
| 26131 |
tejbeer |
90 |
#if($previousMonth)
|
|
|
91 |
<th style="width:6%">Sale</th>
|
|
|
92 |
#else
|
| 25721 |
tejbeer |
93 |
<th style="width:6%">15 days sale</th>
|
| 26131 |
tejbeer |
94 |
#end
|
| 23855 |
amit.gupta |
95 |
<th style="width:9%">In Stock</th>
|
|
|
96 |
<th style="width:9%">In Transit</th>
|
| 25721 |
tejbeer |
97 |
<th style="width:6%">Recommended</th>
|
|
|
98 |
<th style="width:6%">Minimum</th>
|
|
|
99 |
|
| 23405 |
amit.gupta |
100 |
</tr>
|
|
|
101 |
</thead>
|
|
|
102 |
<tbody>
|
| 24229 |
amit.gupta |
103 |
#foreach( $modelListing in $catalogTagListings )
|
| 23405 |
amit.gupta |
104 |
<tr>
|
| 24229 |
amit.gupta |
105 |
<td>$modelListing.getCatalogId()</td>
|
| 25701 |
amit.gupta |
106 |
<td>$modelListing.getItemDescription()</td>
|
| 24229 |
amit.gupta |
107 |
<td class="currency">$modelListing.getDp()</td>
|
|
|
108 |
<td class="currency">$modelListing.getMop()</td>
|
| 26131 |
tejbeer |
109 |
#if($freezed&&$previousMonth)
|
| 23796 |
amit.gupta |
110 |
<td>
|
| 24229 |
amit.gupta |
111 |
<input type="number" min="0" max="20"
|
|
|
112 |
data-catalog-id="$modelListing.getCatalogId()"
|
|
|
113 |
data-selling-price="$modelListing.getDp()"
|
| 25721 |
tejbeer |
114 |
data-brand-name="$modelListing.getBrand()"
|
| 24229 |
amit.gupta |
115 |
data-description="$modelListing.getItemDescription()"
|
| 25721 |
tejbeer |
116 |
value="$modelListing.getAllocatedQuantity()" readonly/>
|
|
|
117 |
</td>
|
| 26131 |
tejbeer |
118 |
#elseif($freezed)
|
| 25721 |
tejbeer |
119 |
<td>
|
| 26131 |
tejbeer |
120 |
<input type="number" min="0" max="20"
|
|
|
121 |
data-catalog-id="$modelListing.getCatalogId()"
|
|
|
122 |
data-selling-price="$modelListing.getDp()"
|
|
|
123 |
data-brand-name="$modelListing.getBrand()"
|
|
|
124 |
data-description="$modelListing.getItemDescription()"
|
|
|
125 |
value="$modelListing.getAllocatedQuantity()" readonly/>
|
|
|
126 |
</td>
|
|
|
127 |
#else
|
|
|
128 |
<td>
|
| 25721 |
tejbeer |
129 |
<input type="number" min="0" max="20"
|
|
|
130 |
data-catalog-id="$modelListing.getCatalogId()"
|
|
|
131 |
data-selling-price="$modelListing.getDp()"
|
|
|
132 |
data-brand-name="$modelListing.getBrand()"
|
|
|
133 |
data-description="$modelListing.getItemDescription()"
|
|
|
134 |
value="$modelListing.getAllocatedQuantity()"/>
|
|
|
135 |
</td>
|
| 23796 |
amit.gupta |
136 |
#end
|
| 26131 |
tejbeer |
137 |
#if($previousMonth)
|
|
|
138 |
<td>$modelListing.getLastMonthSaleMap()</td>
|
|
|
139 |
#else
|
| 25721 |
tejbeer |
140 |
<td>$modelListing.getLast15DaysSale()</td>
|
| 26131 |
tejbeer |
141 |
#end
|
| 24229 |
amit.gupta |
142 |
<td>$modelListing.getStockInHand()</td>
|
|
|
143 |
<td>$modelListing.getInTransitQuantity()</td>
|
| 25721 |
tejbeer |
144 |
<td>$modelListing.getRecommendedQty()</td>
|
|
|
145 |
<td>$modelListing.getMinimumQty()</td>
|
|
|
146 |
|
| 23405 |
amit.gupta |
147 |
</tr>
|
|
|
148 |
#end
|
|
|
149 |
</tbody>
|
|
|
150 |
</table>
|
|
|
151 |
</div>
|
| 23786 |
amit.gupta |
152 |
<div class="col-lg-7" id="indent-container1" style="display:none"></div>
|
|
|
153 |
<div class="col-lg-4">
|
| 23405 |
amit.gupta |
154 |
<div class="panel panel-default">
|
| 25721 |
tejbeer |
155 |
#if(!$isAdmin)
|
|
|
156 |
<div class="panel-heading">Allocation Update Summary #if($retailerName) (Counter Size - $counterSize) #end</div>
|
| 23405 |
amit.gupta |
157 |
<div class="panel-content">
|
| 25721 |
tejbeer |
158 |
<div id="plansummary">
|
|
|
159 |
</div>
|
|
|
160 |
<div id="planbuttons">
|
|
|
161 |
<!-- <button class="btn btn-primary mk_submit_indent">Update Allocation</button>
|
|
|
162 |
<button class="btn btn-primary bk_toedit_indent" style="display:none">Edit</button> -->
|
|
|
163 |
|
| 26131 |
tejbeer |
164 |
#if($freezed&&$previousMonth)
|
|
|
165 |
<button class="btn btn-primary confirm_indent" disabled>Confirm Update</button>
|
|
|
166 |
#elseif($freezed)
|
| 25721 |
tejbeer |
167 |
<button class="btn btn-primary confirm_indent" disabled>Confirm Update</button>
|
|
|
168 |
#else
|
|
|
169 |
<button class="btn btn-primary confirm_indent" style="display:none">Confirm Update</button>
|
|
|
170 |
#end
|
|
|
171 |
</div>
|
| 23405 |
amit.gupta |
172 |
</div>
|
|
|
173 |
</div>
|
| 23796 |
amit.gupta |
174 |
#else
|
|
|
175 |
#set($diff=$totalAmount - $walletAmount)
|
|
|
176 |
<div class="panel-heading">PO Summary(Total Amount in Wallet - <span class="currency">$walletAmount</span>)</div>
|
|
|
177 |
<div class="panel-content">
|
|
|
178 |
<table class="table table-sm" id="summary-table">
|
|
|
179 |
<thead>
|
|
|
180 |
<tr>
|
|
|
181 |
<th class="col">#</th>
|
|
|
182 |
<th class="col">Total Pcs</th>
|
|
|
183 |
<th class="col">Amount to Pay</th>
|
|
|
184 |
<th class="col">Action</th>
|
|
|
185 |
</tr>
|
|
|
186 |
</thead>
|
|
|
187 |
<tbody>
|
|
|
188 |
#**
|
|
|
189 |
<tr>
|
|
|
190 |
<th class="row">Partial PO</th>
|
|
|
191 |
<td>$partialPcs</td>
|
|
|
192 |
<td>$partialAmount</td>
|
|
|
193 |
<td><button class="btn btn-sm btn-primary confirm_indent #if(${diff} > 0)disabled#end"
|
|
|
194 |
>Raise Partial PO</button></td>
|
|
|
195 |
</tr>
|
|
|
196 |
**#
|
|
|
197 |
<tr>
|
|
|
198 |
<th class="row">Complete PO</th>
|
|
|
199 |
<td>$totalPcs</td>
|
|
|
200 |
<td class="currency">$totalAmount</td>
|
|
|
201 |
#if($totalPcs)
|
|
|
202 |
<td><button class="btn btn-primary raise_po#if($diff > 0) disabled#end">Raise Complete PO</button></td>
|
|
|
203 |
#else
|
|
|
204 |
<td>Nothing to order!</td>
|
|
|
205 |
#end
|
|
|
206 |
</tr>
|
|
|
207 |
</tbody>
|
|
|
208 |
</table>
|
|
|
209 |
#if($diff>0)
|
|
|
210 |
<div class="alert alert-warning">
|
|
|
211 |
<medium>Please add Rs.<span class="currency">$diff</span> to complete this transaction.</meduim>
|
|
|
212 |
</div>
|
|
|
213 |
#end
|
|
|
214 |
</div>
|
|
|
215 |
</div>
|
|
|
216 |
#end
|
| 25736 |
tejbeer |
217 |
|
|
|
218 |
|
|
|
219 |
<div class="panel panel-default">
|
|
|
220 |
#if(!$isAdmin)
|
|
|
221 |
<div class="panel-heading">Brand Stock</div>
|
|
|
222 |
<div class="panel-content">
|
|
|
223 |
<table class="table table-sm" id="stock-table">
|
|
|
224 |
<thead>
|
|
|
225 |
<tr>
|
|
|
226 |
<th>Brand</th>
|
|
|
227 |
<th>Qty(pc)</th>
|
|
|
228 |
<th>Value</th>
|
|
|
229 |
|
|
|
230 |
</tr>
|
|
|
231 |
</thead>
|
|
|
232 |
<tbody>
|
|
|
233 |
|
|
|
234 |
#foreach( $brandStockPrice in $brandStockPrices )
|
|
|
235 |
<tr class="stockInfo" >
|
|
|
236 |
<td>$brandStockPrice.getBrand()</td>
|
|
|
237 |
<td>$brandStockPrice.getTotalQty()</td>
|
|
|
238 |
<td><span class="currency">$brandStockPrice.getTotalValue()</span></td>
|
|
|
239 |
</tr>
|
|
|
240 |
#end
|
|
|
241 |
</tbody>
|
|
|
242 |
</table>
|
|
|
243 |
</div>
|
|
|
244 |
</div>
|
|
|
245 |
#end
|
|
|
246 |
</div>
|
|
|
247 |
|
| 23796 |
amit.gupta |
248 |
#if($isAdmin)
|
| 23786 |
amit.gupta |
249 |
<div class="panel panel-default">
|
|
|
250 |
<div class="panel-heading">Brandwise Target and Performance</div>
|
|
|
251 |
<div class="panel-content">
|
|
|
252 |
<ul class="nav nav-tabs">
|
|
|
253 |
<li role="presentation" class="active brandLi"><a href="javascript:void(0)">Mobiles</a></li>
|
|
|
254 |
<li role="presentation" class="brandLi"><a href="javascript:void(0)">Accessories</a></li>
|
|
|
255 |
</ul>
|
|
|
256 |
|
|
|
257 |
<table class="brandPerformance table table-striped table-condensed table-bordered">
|
|
|
258 |
<thead>
|
|
|
259 |
<tr>
|
|
|
260 |
<th rowspan="2">Brand Name</th>
|
|
|
261 |
<th rowspan="2" align="center">Target Value</th>
|
|
|
262 |
<th colspan="2" align="center">Achieved</th>
|
|
|
263 |
<th colspan="2">Brand Share(%)</th>
|
|
|
264 |
</tr>
|
|
|
265 |
<tr>
|
|
|
266 |
<th>Value</th>
|
|
|
267 |
<th>Percentage</th>
|
|
|
268 |
<th>Target</th>
|
|
|
269 |
<th>Achieved</th>
|
|
|
270 |
</tr>
|
|
|
271 |
</thead>
|
|
|
272 |
<tbody>
|
|
|
273 |
#foreach($brandPerformance in $brandPerformanceList)
|
|
|
274 |
<tr>
|
|
|
275 |
<th>$brandPerformance.getBrandName()</th>
|
|
|
276 |
<td class="currency">$brandPerformance.getTarget()</td>
|
|
|
277 |
<td class="currency">$brandPerformance.getAchieved()</td>
|
|
|
278 |
<td>$brandPerformance.getAchievedPercentage()%</td>
|
|
|
279 |
<td>$brandPerformance.getBrandTargetShare()</td>
|
|
|
280 |
<td>$brandPerformance.getBrandAchievedShare()</td>
|
|
|
281 |
</tr>
|
|
|
282 |
#end
|
|
|
283 |
<tbody>
|
|
|
284 |
</tbody>
|
|
|
285 |
</table>
|
|
|
286 |
<table style="display:none" class="table brandPerformance table-striped table-condensed table-bordered">
|
|
|
287 |
<thead>
|
|
|
288 |
<tr>
|
|
|
289 |
<th rowspan="2">Brand Name</th>
|
|
|
290 |
<th rowspan="2" align="center">Target Value</th>
|
|
|
291 |
<th colspan="2" align="center">Achieved</th>
|
|
|
292 |
<th colspan="2">Brand Share(%)</th>
|
|
|
293 |
</tr>
|
|
|
294 |
<tr>
|
|
|
295 |
<th>Value</th>
|
|
|
296 |
<th>Percentage</th>
|
|
|
297 |
<th>Target</th>
|
|
|
298 |
<th>Achieved</th>
|
|
|
299 |
</tr>
|
|
|
300 |
</thead>
|
|
|
301 |
<tbody>
|
|
|
302 |
#foreach($brandPerformance in $accsBrandPerformanceList)
|
|
|
303 |
<tr>
|
|
|
304 |
<th>$brandPerformance.getBrandName()</th>
|
|
|
305 |
<td>$brandPerformance.getTarget()</td>
|
|
|
306 |
<td>$brandPerformance.getAchieved()</td>
|
|
|
307 |
<td>$brandPerformance.getAchievedPercentage()%</td>
|
|
|
308 |
<td>$brandPerformance.getBrandTargetShare()</td>
|
|
|
309 |
<td>$brandPerformance.getBrandAchievedShare()</td>
|
|
|
310 |
</tr>
|
|
|
311 |
#end
|
|
|
312 |
<tbody>
|
|
|
313 |
</tbody>
|
|
|
314 |
</table>
|
|
|
315 |
</div>
|
|
|
316 |
|
|
|
317 |
</div>
|
| 23796 |
amit.gupta |
318 |
#end
|
| 23405 |
amit.gupta |
319 |
</div>
|
|
|
320 |
</div>
|
|
|
321 |
</div>
|
| 25736 |
tejbeer |
322 |
|
|
|
323 |
|
| 23405 |
amit.gupta |
324 |
</section>
|
|
|
325 |
<script type="text/javascript">
|
| 23796 |
amit.gupta |
326 |
totalAmount = $totalAmount;
|
| 23405 |
amit.gupta |
327 |
/* Create an array with the values of all the input boxes in a column */
|
|
|
328 |
$.fn.dataTable.ext.order['dom-text'] = function ( settings, col )
|
|
|
329 |
{
|
|
|
330 |
return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
|
|
|
331 |
return $('input', td).val();
|
|
|
332 |
} );
|
|
|
333 |
}
|
|
|
334 |
|
|
|
335 |
/* Create an array with the values of all the input boxes in a column, parsed as numbers */
|
|
|
336 |
$.fn.dataTable.ext.order['dom-text-numeric'] = function ( settings, col )
|
|
|
337 |
{
|
|
|
338 |
return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
|
|
|
339 |
return $('input', td).val() * 1;
|
|
|
340 |
} );
|
|
|
341 |
}
|
|
|
342 |
|
|
|
343 |
/* Create an array with the values of all the select options in a column */
|
|
|
344 |
$.fn.dataTable.ext.order['dom-select'] = function ( settings, col )
|
|
|
345 |
{
|
|
|
346 |
return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
|
|
|
347 |
return $('select', td).val();
|
|
|
348 |
} );
|
|
|
349 |
}
|
|
|
350 |
|
|
|
351 |
/* Create an array with the values of all the checkboxes in a column */
|
|
|
352 |
$.fn.dataTable.ext.order['dom-checkbox'] = function ( settings, col )
|
|
|
353 |
{
|
|
|
354 |
return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
|
|
|
355 |
return $('input', td).prop('checked') ? '1' : '0';
|
|
|
356 |
} );
|
|
|
357 |
}
|
|
|
358 |
|
|
|
359 |
/* Initialise the table with the required column ordering data types */
|
| 23786 |
amit.gupta |
360 |
var customRetailers = ${customRetailers};
|
| 23405 |
amit.gupta |
361 |
$(document).ready(function() {
|
|
|
362 |
indentTable = $('#entire-catalog-table').DataTable({
|
| 23786 |
amit.gupta |
363 |
"scrollY":"600px",
|
| 23405 |
amit.gupta |
364 |
"columns": [
|
| 25736 |
tejbeer |
365 |
|
|
|
366 |
|
|
|
367 |
{ "visible": false }, null,null, null,
|
| 25721 |
tejbeer |
368 |
{ "orderDataType": "dom-text-numeric" }, null, null, null,null,null
|
| 23786 |
amit.gupta |
369 |
],
|
| 23796 |
amit.gupta |
370 |
"lengthMenu":[[25,50],[25,50]],
|
|
|
371 |
"order": []
|
| 23405 |
amit.gupta |
372 |
});
|
|
|
373 |
indentMap = {};
|
|
|
374 |
indentTable.rows().data().each(function(arr){
|
| 23796 |
amit.gupta |
375 |
var $input = $(arr[4]);
|
| 23405 |
amit.gupta |
376 |
quantity = parseInt($input.val(), 10);
|
|
|
377 |
if(quantity > 0){
|
| 25721 |
tejbeer |
378 |
var brandName = arr[1].split(" ")[0];
|
|
|
379 |
if(indentMap[brandName] == undefined) {
|
|
|
380 |
indentMap[brandName] = {};
|
|
|
381 |
}
|
|
|
382 |
indentMap[brandName][parseInt(arr[0])]
|
|
|
383 |
= {"initialQuantity": quantity, "quantity": quantity,
|
|
|
384 |
"sellingPrice":parseInt(arr[2]), "description": arr[1], "diff":0};
|
| 23405 |
amit.gupta |
385 |
}
|
| 25721 |
tejbeer |
386 |
})
|
| 23884 |
amit.gupta |
387 |
$("#partnerId").typeahead({
|
| 23786 |
amit.gupta |
388 |
source: customRetailers,
|
|
|
389 |
autoSelect: true,
|
|
|
390 |
displayText:function(item){return item.businessName + "-" + item.address.city;},
|
|
|
391 |
afterSelect: function(currentItem){
|
|
|
392 |
currentFofoId = currentItem.partnerId;
|
|
|
393 |
}
|
|
|
394 |
});
|
| 25701 |
amit.gupta |
395 |
populateIndentSummary();
|
| 23405 |
amit.gupta |
396 |
});
|
|
|
397 |
|
|
|
398 |
</script>
|