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