| 32203 |
amit.gupta |
1 |
<div class="modal-header">
|
|
|
2 |
<button type="button" class="close" id="cancel-model" data-dismiss="modal">×</button>
|
|
|
3 |
<h4 class="modal-title">Terms & Conditions</h4>
|
|
|
4 |
</div>
|
|
|
5 |
<div class="modal-body" style="height:500px;overflow:auto">
|
|
|
6 |
<div style="margin-top: 15px;" class="offer-margin-table">
|
|
|
7 |
|
| 35415 |
amit |
8 |
## Offer Description
|
| 32203 |
amit.gupta |
9 |
<div class="row">
|
|
|
10 |
<div class="col-lg-12">
|
| 35415 |
amit |
11 |
<div style="font-size:20px; font-weight:bold" class="pull-left">
|
|
|
12 |
$vmUtils.html($offer.getDescription())
|
|
|
13 |
</div>
|
| 32203 |
amit.gupta |
14 |
</div>
|
|
|
15 |
</div>
|
| 35415 |
amit |
16 |
|
| 35396 |
amit |
17 |
<div class="row">
|
| 35415 |
amit |
18 |
## Base Criteria Section (if applicable)
|
| 32203 |
amit.gupta |
19 |
#if($offer.isBaseCriteria())
|
| 36537 |
amit |
20 |
<div class="col-lg-12">
|
|
|
21 |
<h5 style="text-align: left">Base Criteria - </h5>
|
|
|
22 |
<div style="text-align:left">$offer.getItemCriteriaString()</div>
|
|
|
23 |
</div>
|
| 32203 |
amit.gupta |
24 |
#end
|
| 35415 |
amit |
25 |
|
|
|
26 |
## Main Offer Table
|
| 32203 |
amit.gupta |
27 |
<div class="col-lg-12">
|
|
|
28 |
<table class="table table-bordered table-sm">
|
| 35415 |
amit |
29 |
|
|
|
30 |
## ===== TABLE HEADER =====
|
| 32203 |
amit.gupta |
31 |
<thead>
|
| 36537 |
amit |
32 |
<tr>
|
|
|
33 |
<th rowspan="2">Models</th>
|
|
|
34 |
<th rowspan="2">Target</th>
|
| 35415 |
amit |
35 |
|
| 36537 |
amit |
36 |
## Base Sale columns - only for retailers (not admin)
|
|
|
37 |
#if(!$isAdmin)
|
|
|
38 |
#if($offer.isActivation())
|
|
|
39 |
<th colspan="2">Base Sale</th>
|
|
|
40 |
#else
|
|
|
41 |
<th rowspan="2">Billed</th>
|
| 35415 |
amit |
42 |
#end
|
| 36537 |
amit |
43 |
#end
|
| 35415 |
amit |
44 |
|
| 36537 |
amit |
45 |
## Model Sale columns - only for retailers when baseCriteria=true
|
|
|
46 |
#if(!$isAdmin && $offer.isBaseCriteria())
|
|
|
47 |
#if($offer.isActivation())
|
|
|
48 |
<th colspan="2">Model Sale</th>
|
|
|
49 |
#else
|
|
|
50 |
<th rowspan="2">Billed</th>
|
| 35415 |
amit |
51 |
#end
|
| 36537 |
amit |
52 |
#end
|
| 35668 |
amit |
53 |
|
| 36537 |
amit |
54 |
<th rowspan="2">Payout Rate</th>
|
| 35675 |
amit |
55 |
|
| 36537 |
amit |
56 |
## Est. Payout column - only for retailers
|
|
|
57 |
#if(!$isAdmin)
|
|
|
58 |
<th rowspan="2">Est. Payout</th>
|
|
|
59 |
#end
|
|
|
60 |
</tr>
|
| 35415 |
amit |
61 |
|
|
|
62 |
## Sub-headers for Activation offers (Billed/Activated) - only for retailers
|
|
|
63 |
#if(!$isAdmin && $offer.isActivation())
|
|
|
64 |
<tr>
|
|
|
65 |
<th style="background-color: darkgray">Billed</th>
|
|
|
66 |
<th>Activated</th>
|
| 35668 |
amit |
67 |
#if($offer.isBaseCriteria())
|
| 36537 |
amit |
68 |
<th style="background-color: darkgray">Billed</th>
|
|
|
69 |
<th>Activated</th>
|
| 35668 |
amit |
70 |
#end
|
| 35415 |
amit |
71 |
</tr>
|
| 35396 |
amit |
72 |
#end
|
| 35415 |
amit |
73 |
</thead>
|
|
|
74 |
|
|
|
75 |
## ===== TABLE BODY =====
|
|
|
76 |
<tbody>
|
| 36537 |
amit |
77 |
#foreach($itemCriteriaPayout in $offer.getTargetSlabs().get(0).getItemCriteriaPayouts())
|
| 35415 |
amit |
78 |
|
| 36537 |
amit |
79 |
## Set up model variables for this criteria (with null guard for admin view)
|
|
|
80 |
#if($offer.getCriteriaQtyAmountModel())
|
|
|
81 |
#set($criteriaItemQtyModel = $offer.getCriteriaQtyAmountModel().get($itemCriteriaPayout.getItemCriteria().getId()))
|
|
|
82 |
#if($offer.isBaseCriteria())
|
|
|
83 |
#set($baseItemCriteriaQtyAmountModel = $offer.getCriteriaQtyAmountModel().get(0))
|
|
|
84 |
#else
|
|
|
85 |
#set($baseItemCriteriaQtyAmountModel = $criteriaItemQtyModel)
|
|
|
86 |
#end
|
| 35668 |
amit |
87 |
#end
|
| 35415 |
amit |
88 |
|
| 36537 |
amit |
89 |
## Helper variables for readability
|
|
|
90 |
#set($isQuantityPayout = $offer.getPayoutType().name().equals("QUANTITY"))
|
|
|
91 |
#set($isSellinOrSellout = $offer.isSellin() || $offer.isSellout())
|
|
|
92 |
#set($isPercentage = $itemCriteriaPayout.getAmountType().name().equals("PERCENTAGE"))
|
|
|
93 |
#set($isFixed = $itemCriteriaPayout.getAmountType().name().equals("FIXED"))
|
| 35415 |
amit |
94 |
|
| 36537 |
amit |
95 |
#foreach($payoutSlab in $itemCriteriaPayout.getPayoutSlabs())
|
|
|
96 |
#set($rowspan = $itemCriteriaPayout.getPayoutSlabs().size())
|
|
|
97 |
#set($isFirstRow = $velocityCount == 1)
|
|
|
98 |
#set($selectedStyle = "")
|
|
|
99 |
#if($payoutSlab.isSelected())
|
|
|
100 |
#set($selectedStyle = "background-color: lightgreen")
|
|
|
101 |
#end
|
| 35396 |
amit |
102 |
|
| 36537 |
amit |
103 |
<tr>
|
|
|
104 |
## Column 1: Models (only on first row with rowspan)
|
|
|
105 |
#if($isFirstRow)
|
|
|
106 |
<td style="text-align:left" rowspan="$rowspan">
|
|
|
107 |
#if($itemCriteriaPayout.getItemCriteriaString() && $itemCriteriaPayout.getItemCriteriaString().trim() !=
|
|
|
108 |
"" && $itemCriteriaPayout.getItemCriteriaString() != "All Brands")
|
|
|
109 |
$itemCriteriaPayout.getItemCriteriaString()
|
|
|
110 |
#else
|
|
|
111 |
$offer.getItemCriteriaString()
|
|
|
112 |
#end
|
|
|
113 |
<br>
|
|
|
114 |
#if($itemCriteriaPayout.getStartDate() && $itemCriteriaPayout.getEndDate())
|
|
|
115 |
<span style="font-weight: bold;">Payout Date - </span>
|
|
|
116 |
<span>$itemCriteriaPayout.getStartDate().format($dateFormatter) to $itemCriteriaPayout.getEndDate().format($dateFormatter)</span>
|
|
|
117 |
#end
|
|
|
118 |
#if(!$isAdmin)
|
|
|
119 |
#if($itemCriteriaPayout.getNextSlab() && $itemCriteriaPayout.getNextSlab().getOnwardsAmount() > 1)
|
|
|
120 |
<br>
|
|
|
121 |
<span style="color:#e67e22; font-size:13px;">
|
|
|
122 |
#if($isQuantityPayout)
|
| 35745 |
amit |
123 |
Just <strong>$itemCriteriaPayout.getShortValue() pcs</strong> away from next slab
|
|
|
124 |
(<strong>$itemCriteriaPayout.getNextSlab().getOnwardsAmount() pcs</strong>)!
|
| 36537 |
amit |
125 |
#else
|
|
|
126 |
Just <strong>Rs.<span
|
|
|
127 |
class="currency">$itemCriteriaPayout.getShortValue()</span></strong> away from next slab
|
|
|
128 |
(<strong>Rs.<span
|
|
|
129 |
class="currency">$itemCriteriaPayout.getNextSlab().getOnwardsAmount()</span></strong>)!
|
|
|
130 |
#end
|
|
|
131 |
</span>
|
|
|
132 |
#elseif($itemCriteriaPayout.getCurrentSlab())
|
|
|
133 |
<br>
|
|
|
134 |
<span style="color:#27ae60; font-size:13px;">
|
| 35745 |
amit |
135 |
Max slab achieved! Earning highest payout rate.
|
|
|
136 |
</span>
|
| 36537 |
amit |
137 |
#end
|
|
|
138 |
#end
|
|
|
139 |
</td>
|
| 35745 |
amit |
140 |
#end
|
| 35396 |
amit |
141 |
|
| 36537 |
amit |
142 |
## Column 2: Target
|
|
|
143 |
#if($isQuantityPayout)
|
|
|
144 |
<td style="$selectedStyle">$payoutSlab.getOnwardsAmount() pcs Onwards</td>
|
|
|
145 |
#else
|
|
|
146 |
<td style="$selectedStyle">Rs.<span
|
|
|
147 |
class="currency">$payoutSlab.getOnwardsAmount()</span> Onwards
|
|
|
148 |
</td>
|
|
|
149 |
#end
|
| 35415 |
amit |
150 |
|
| 36537 |
amit |
151 |
## Column 3-4: Base Sale (Billed/Activated) - ONLY FOR RETAILERS
|
|
|
152 |
#if(!$isAdmin)
|
|
|
153 |
#if($isQuantityPayout)
|
|
|
154 |
#if($isSellinOrSellout)
|
|
|
155 |
<td>$baseItemCriteriaQtyAmountModel.getQty()</td>
|
|
|
156 |
#else
|
|
|
157 |
#if($isFirstRow)
|
|
|
158 |
<td rowspan="$rowspan">$baseItemCriteriaQtyAmountModel.getQty()</td>
|
|
|
159 |
<td rowspan="$rowspan">$baseItemCriteriaQtyAmountModel.getActivationQty()</td>
|
|
|
160 |
#end
|
|
|
161 |
#end
|
| 35396 |
amit |
162 |
#else
|
| 36537 |
amit |
163 |
#if($isSellinOrSellout)
|
|
|
164 |
<td><span
|
|
|
165 |
class="currency">$baseItemCriteriaQtyAmountModel.getAmount()</span>
|
|
|
166 |
</td>
|
|
|
167 |
#else
|
|
|
168 |
#if($isFirstRow)
|
|
|
169 |
<td rowspan="$rowspan"><span class="currency"
|
|
|
170 |
style="color: darkgrey">$baseItemCriteriaQtyAmountModel.getAmount()</span>
|
|
|
171 |
</td>
|
|
|
172 |
<td rowspan="$rowspan"><span
|
|
|
173 |
class="currency">$baseItemCriteriaQtyAmountModel.getActivationAmount()</span>
|
|
|
174 |
</td>
|
|
|
175 |
#end
|
| 35396 |
amit |
176 |
#end
|
|
|
177 |
#end
|
| 36537 |
amit |
178 |
#end
|
|
|
179 |
|
|
|
180 |
## Column 5-6: Model Sale (Billed/Activated) - ONLY FOR RETAILERS when baseCriteria=true
|
|
|
181 |
#if(!$isAdmin && $offer.isBaseCriteria() && $isFirstRow)
|
|
|
182 |
#if($isPercentage)
|
|
|
183 |
#if($isSellinOrSellout)
|
|
|
184 |
<td><span class="currency">$criteriaItemQtyModel.getAmount()</span></td>
|
|
|
185 |
#else
|
|
|
186 |
<td rowspan="$rowspan"><span
|
|
|
187 |
class="currency">$criteriaItemQtyModel.getAmount()</span></td>
|
|
|
188 |
<td rowspan="$rowspan"><span
|
|
|
189 |
class="currency">$criteriaItemQtyModel.getActivationAmount()</span>
|
|
|
190 |
</td>
|
|
|
191 |
#end
|
|
|
192 |
#elseif($isFixed)
|
|
|
193 |
#if($isSellinOrSellout)
|
|
|
194 |
<td>$criteriaItemQtyModel.getQty()</td>
|
|
|
195 |
#else
|
|
|
196 |
<td rowspan="$rowspan">$criteriaItemQtyModel.getQty()</td>
|
|
|
197 |
<td rowspan="$rowspan">$criteriaItemQtyModel.getActivationQty()</td>
|
|
|
198 |
#end
|
| 35396 |
amit |
199 |
#else
|
| 36537 |
amit |
200 |
#if($isSellinOrSellout)
|
|
|
201 |
<td rowspan="$rowspan">$criteriaItemQtyModel.getQty()</td>
|
|
|
202 |
#else
|
|
|
203 |
<td rowspan="$rowspan">$criteriaItemQtyModel.getQty()</td>
|
|
|
204 |
<td rowspan="$rowspan">$criteriaItemQtyModel.getActivationQty()</td>
|
| 35396 |
amit |
205 |
#end
|
|
|
206 |
#end
|
|
|
207 |
#end
|
|
|
208 |
|
| 36537 |
amit |
209 |
## Column 7: Payout On
|
| 35415 |
amit |
210 |
#if($isPercentage)
|
| 36537 |
amit |
211 |
<td style="$selectedStyle">$payoutSlab.getPayoutAmount()%</td>
|
| 35415 |
amit |
212 |
#elseif($isFixed)
|
| 36537 |
amit |
213 |
<td style="$selectedStyle">Rs.<span
|
|
|
214 |
class="currency">$payoutSlab.getPayoutAmount()</span> per pc
|
|
|
215 |
</td>
|
| 32203 |
amit.gupta |
216 |
#else
|
| 36537 |
amit |
217 |
<td style="$selectedStyle">Rs.<span
|
|
|
218 |
class="currency">$payoutSlab.getPayoutAmount()</span></td>
|
| 32203 |
amit.gupta |
219 |
#end
|
| 35668 |
amit |
220 |
|
| 36537 |
amit |
221 |
## Column 8: Est. Payout - ONLY FOR RETAILERS on first row
|
|
|
222 |
#if(!$isAdmin && $isFirstRow && $criteriaItemQtyModel)
|
|
|
223 |
<td rowspan="$rowspan">Rs.<span
|
|
|
224 |
class="currency">$criteriaItemQtyModel.getFinalPayout()</span></td>
|
|
|
225 |
#end
|
|
|
226 |
</tr>
|
| 35675 |
amit |
227 |
#end
|
| 32203 |
amit.gupta |
228 |
#end
|
|
|
229 |
</tbody>
|
|
|
230 |
</table>
|
| 33713 |
tejus.loha |
231 |
<br>
|
| 32203 |
amit.gupta |
232 |
</div>
|
|
|
233 |
</div>
|
|
|
234 |
</div>
|
|
|
235 |
|
| 35415 |
amit |
236 |
## Notes and Terms Section
|
| 32203 |
amit.gupta |
237 |
<div class="row">
|
|
|
238 |
<div class="col-lg-12">
|
|
|
239 |
<ul id="descriptionMenu" style="text-align:left">
|
|
|
240 |
#if($offer.getOfferNotes() && !$offer.getOfferNotes().equals(""))
|
| 36537 |
amit |
241 |
<li>Note - $vmUtils.html($offer.getOfferNotes())</li>
|
| 32203 |
amit.gupta |
242 |
#end
|
|
|
243 |
</ul>
|
|
|
244 |
|
| 35396 |
amit |
245 |
<div class="termContainer ck-content" style="text-align:left">
|
| 34045 |
amit.gupta |
246 |
$offer.getTerms()
|
| 32203 |
amit.gupta |
247 |
</div>
|
|
|
248 |
</div>
|
|
|
249 |
</div>
|
|
|
250 |
|
| 35925 |
amit |
251 |
## Edit Targets & Payouts Section - Admin Only
|
| 36501 |
amit |
252 |
#if($isFinanceTeam)
|
| 36537 |
amit |
253 |
<div class="row" style="margin-top:20px;">
|
|
|
254 |
<div class="col-lg-12">
|
|
|
255 |
<h5><strong>Edit Targets & Payouts</strong></h5>
|
|
|
256 |
#if($offer.getTargetSlabs() && $offer.getTargetSlabs().size() > 0)
|
|
|
257 |
<table class="table table-bordered table-sm" id="edit-slabs-table" data-offerid="$offer.getId()">
|
|
|
258 |
<thead>
|
| 35925 |
amit |
259 |
<tr>
|
| 36537 |
amit |
260 |
<th>Models</th>
|
|
|
261 |
<th>Slab</th>
|
|
|
262 |
<th>Target</th>
|
|
|
263 |
<th>Payout</th>
|
|
|
264 |
</tr>
|
|
|
265 |
</thead>
|
|
|
266 |
<tbody>
|
|
|
267 |
#foreach($itemCriteriaPayout in $offer.getTargetSlabs().get(0).getItemCriteriaPayouts())
|
|
|
268 |
#set($slabIndex = 0)
|
|
|
269 |
#foreach($payoutSlab in $itemCriteriaPayout.getPayoutSlabs())
|
|
|
270 |
#set($slabIndex = $slabIndex + 1)
|
|
|
271 |
<tr>
|
|
|
272 |
#if($slabIndex == 1)
|
|
|
273 |
<td rowspan="$itemCriteriaPayout.getPayoutSlabs().size()"
|
|
|
274 |
style="vertical-align:middle;">
|
|
|
275 |
#if($itemCriteriaPayout.getItemCriteriaString() && $itemCriteriaPayout.getItemCriteriaString().trim() !=
|
|
|
276 |
"" && $itemCriteriaPayout.getItemCriteriaString() != "All Brands")
|
| 36054 |
amit |
277 |
$itemCriteriaPayout.getItemCriteriaString()
|
|
|
278 |
#else
|
| 36537 |
amit |
279 |
$offer.getItemCriteriaString()
|
|
|
280 |
#end
|
|
|
281 |
</td>
|
|
|
282 |
#end
|
|
|
283 |
<td>Slab $slabIndex</td>
|
|
|
284 |
<td><input type="number" class="form-control form-control-sm edit-slab-target"
|
|
|
285 |
data-slabid="$payoutSlab.getId()" value="$payoutSlab.getOnwardsAmount()"
|
|
|
286 |
style="width:120px;"></td>
|
|
|
287 |
<td>
|
|
|
288 |
<div style="display:flex;align-items:center;gap:4px;">
|
|
|
289 |
<input type="number" step="0.01"
|
|
|
290 |
class="form-control form-control-sm edit-slab-payout"
|
|
|
291 |
data-slabid="$payoutSlab.getId()"
|
|
|
292 |
value="$payoutSlab.getPayoutAmount()" style="width:120px;">
|
|
|
293 |
#if($itemCriteriaPayout.getAmountType().name() == "PERCENTAGE")
|
|
|
294 |
%#elseif($itemCriteriaPayout.getAmountType().name() == "FIXED")/pc#else
|
|
|
295 |
(fixed)#end
|
|
|
296 |
</div>
|
|
|
297 |
</td>
|
|
|
298 |
</tr>
|
| 36054 |
amit |
299 |
#end
|
| 35925 |
amit |
300 |
#end
|
| 36537 |
amit |
301 |
</tbody>
|
|
|
302 |
</table>
|
|
|
303 |
<button class="btn btn-primary btn-sm update-offer-slabs" type="button" style="margin-top:5px;">
|
|
|
304 |
Update Targets & Payouts
|
|
|
305 |
</button>
|
|
|
306 |
#else
|
|
|
307 |
<p style="color:#999;">No target slabs found for this offer.</p>
|
| 35886 |
amit |
308 |
#end
|
| 36537 |
amit |
309 |
</div>
|
| 35886 |
amit |
310 |
</div>
|
|
|
311 |
#end
|
|
|
312 |
</div>
|
|
|
313 |
|
| 32203 |
amit.gupta |
314 |
<div class="modal-footer">
|
|
|
315 |
<button type="button" data-dismiss="modal" class="btn btn-default cancel-description">Dismiss</button>
|
| 35415 |
amit |
316 |
</div>
|