Subversion Repositories SmartDukaan

Rev

Rev 35890 | Rev 36054 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 35890 Rev 35925
Line 225... Line 225...
225
            </div>
225
            </div>
226
        </div>
226
        </div>
227
    </div>
227
    </div>
228
</div>
228
</div>
229
 
229
 
230
    ## Edit Targets Section - Admin Only
230
    ## Edit Targets & Payouts Section - Admin Only
231
    #if($isAdmin)
231
    #if($isAdmin)
232
    <div class="row" style="margin-top:20px;">
232
    <div class="row" style="margin-top:20px;">
233
        <div class="col-lg-12">
233
        <div class="col-lg-12">
234
            <h5><strong>Edit Targets</strong></h5>
234
            <h5><strong>Edit Targets & Payouts</strong></h5>
-
 
235
            #if($offer.getTargetSlabs() && $offer.getTargetSlabs().size() > 0)
235
            <div id="edit-targets-section" data-offerid="$offer.getId()">
236
            <table class="table table-bordered table-sm" id="edit-slabs-table" data-offerid="$offer.getId()">
-
 
237
                <thead>
-
 
238
                    <tr>
-
 
239
                        <th>Models</th>
-
 
240
                        <th>Slab</th>
-
 
241
                        <th>Target</th>
-
 
242
                        <th>Payout</th>
-
 
243
                    </tr>
-
 
244
                </thead>
-
 
245
                <tbody>
236
                #if($offer.getTargetSlabs() && $offer.getTargetSlabs().size() > 0)
246
                #foreach($itemCriteriaPayout in $offer.getTargetSlabs().get(0).getItemCriteriaPayouts())
237
                    #set($targetIndex = 0)
247
                    #set($slabIndex = 0)
238
                    #foreach($payoutSlab in $offer.getTargetSlabs().get(0).getItemCriteriaPayouts().get(0).getPayoutSlabs())
248
                    #foreach($payoutSlab in $itemCriteriaPayout.getPayoutSlabs())
239
                        #set($targetIndex = $targetIndex + 1)
249
                        #set($slabIndex = $slabIndex + 1)
-
 
250
                        <tr>
-
 
251
                            #if($slabIndex == 1)
-
 
252
                            <td rowspan="$itemCriteriaPayout.getPayoutSlabs().size()" style="vertical-align:middle;">
-
 
253
                                $itemCriteriaPayout.getItemCriteriaString()
-
 
254
                            </td>
-
 
255
                            #end
-
 
256
                            <td>Slab $slabIndex</td>
240
                        <div class="form-group form-inline" style="margin-bottom:5px;">
257
                            <td><input type="number" class="form-control form-control-sm edit-slab-target"
-
 
258
                                       data-slabid="$payoutSlab.getId()" value="$payoutSlab.getOnwardsAmount()" style="width:120px;"></td>
-
 
259
                            <td>
241
                            <label style="width:80px;">Target $targetIndex</label>
260
                                <div style="display:flex;align-items:center;gap:4px;">
-
 
261
                                    <input type="number" step="0.01" class="form-control form-control-sm edit-slab-payout"
242
                            <input type="number" class="form-control edit-target-value" value="$payoutSlab.getOnwardsAmount()" style="width:180px;">
262
                                           data-slabid="$payoutSlab.getId()" value="$payoutSlab.getPayoutAmount()" style="width:120px;">
-
 
263
                                    #if($itemCriteriaPayout.getAmountType().name() == "PERCENTAGE")%#elseif($itemCriteriaPayout.getAmountType().name() == "FIXED")/pc#else(fixed)#end
-
 
264
                                </div>
-
 
265
                            </td>
243
                        </div>
266
                        </tr>
244
                    #end
267
                    #end
245
                    <button class="btn btn-primary btn-sm update-offer-targets" type="button" style="margin-top:5px;">Update Targets</button>
-
 
246
                #else
-
 
247
                    <p style="color:#999;">No target slabs found for this offer.</p>
-
 
248
                #end
268
                #end
-
 
269
                </tbody>
249
            </div>
270
            </table>
-
 
271
            <button class="btn btn-primary btn-sm update-offer-slabs" type="button" style="margin-top:5px;">Update Targets & Payouts</button>
-
 
272
            #else
-
 
273
                <p style="color:#999;">No target slabs found for this offer.</p>
-
 
274
            #end
250
        </div>
275
        </div>
251
    </div>
276
    </div>
252
    #end
277
    #end
253
</div>
278
</div>
254
 
279