| 35886 |
amit |
1 |
<div class="modal-header">
|
|
|
2 |
<button type="button" class="close" data-dismiss="modal">×</button>
|
|
|
3 |
<h4 class="modal-title">Manage Partners - Offer #$offerId</h4>
|
|
|
4 |
</div>
|
|
|
5 |
|
|
|
6 |
<div class="modal-body" style="max-height:600px;overflow:auto">
|
|
|
7 |
|
|
|
8 |
## Current Partners
|
|
|
9 |
<h5 style="margin-bottom:10px;"><strong>Current Partners</strong></h5>
|
|
|
10 |
#if($offerPartners && $offerPartners.size() > 0)
|
|
|
11 |
<table class="table table-bordered table-sm" id="offer-partners-table" data-offerid="$offerId">
|
|
|
12 |
<thead>
|
|
|
13 |
<tr>
|
|
|
14 |
<th style="width:40px;"><input type="checkbox" id="select-all-partners"></th>
|
|
|
15 |
<th>Partner ID</th>
|
|
|
16 |
<th>Code</th>
|
|
|
17 |
<th>Name</th>
|
|
|
18 |
</tr>
|
|
|
19 |
</thead>
|
|
|
20 |
<tbody>
|
|
|
21 |
#foreach($partner in $offerPartners)
|
|
|
22 |
#set($retailer = $customRetailerMap.get($partner.getFofoId()))
|
|
|
23 |
<tr data-fofoid="$partner.getFofoId()">
|
|
|
24 |
<td><input type="checkbox" class="partner-checkbox" value="$partner.getFofoId()"></td>
|
|
|
25 |
<td>$partner.getFofoId()</td>
|
|
|
26 |
<td>#if($retailer)$retailer.getPartnerCode()#else-#end</td>
|
|
|
27 |
<td>#if($retailer)$retailer.getBusinessName()#else-#end</td>
|
|
|
28 |
</tr>
|
|
|
29 |
#end
|
|
|
30 |
</tbody>
|
|
|
31 |
</table>
|
|
|
32 |
|
|
|
33 |
<div style="margin-top:10px;">
|
|
|
34 |
<button class="btn btn-danger btn-sm remove-selected-partners" type="button">Remove Selected Partners</button>
|
|
|
35 |
</div>
|
|
|
36 |
|
|
|
37 |
## Remove options (hidden by default, shown when remove is clicked)
|
|
|
38 |
<div id="remove-options" style="display:none; margin-top:15px; padding:15px; border:1px solid #ddd; border-radius:4px; background:#f9f9f9;">
|
|
|
39 |
<div class="checkbox">
|
|
|
40 |
<label>
|
|
|
41 |
<input type="checkbox" id="create-new-offer-checkbox"> Create a new offer for removed partners with custom targets
|
|
|
42 |
</label>
|
|
|
43 |
</div>
|
|
|
44 |
|
|
|
45 |
<div id="custom-targets-section" style="display:none; margin-top:10px;">
|
|
|
46 |
<h5><strong>Set Targets for New Offer</strong></h5>
|
|
|
47 |
#if($offer.getTargetSlabs() && $offer.getTargetSlabs().size() > 0)
|
|
|
48 |
#set($slabIndex = 0)
|
|
|
49 |
#foreach($itemCriteriaPayout in $offer.getTargetSlabs().get(0).getItemCriteriaPayouts())
|
|
|
50 |
#foreach($payoutSlab in $itemCriteriaPayout.getPayoutSlabs())
|
|
|
51 |
#set($slabIndex = $slabIndex + 1)
|
|
|
52 |
<div class="form-group" style="margin-bottom:5px;">
|
|
|
53 |
<label>Target $slabIndex</label>
|
|
|
54 |
<input type="number" class="form-control new-offer-target" value="$payoutSlab.getOnwardsAmount()" style="width:200px;display:inline-block;">
|
|
|
55 |
</div>
|
|
|
56 |
#end
|
|
|
57 |
#end
|
|
|
58 |
#end
|
|
|
59 |
<div class="alert alert-warning" style="margin-top:10px;">
|
|
|
60 |
<strong>Note:</strong> New offer will be created as <strong>UNPUBLISHED</strong>. You must publish it manually from Offer History.
|
|
|
61 |
</div>
|
|
|
62 |
</div>
|
|
|
63 |
|
|
|
64 |
<button class="btn btn-primary btn-sm confirm-remove-partners" type="button" style="margin-top:10px;">Confirm Remove</button>
|
|
|
65 |
<button class="btn btn-default btn-sm cancel-remove-partners" type="button" style="margin-top:10px;">Cancel</button>
|
|
|
66 |
</div>
|
|
|
67 |
#else
|
|
|
68 |
<p style="text-align:center; color:#999;">No partners assigned to this offer via partner criteria.</p>
|
|
|
69 |
#end
|
|
|
70 |
|
|
|
71 |
<hr>
|
|
|
72 |
|
|
|
73 |
## Add Partners Section
|
|
|
74 |
<h5 style="margin-bottom:10px;"><strong>Add Partners</strong></h5>
|
|
|
75 |
<div class="form-group">
|
|
|
76 |
<select id="add-partner-select" class="form-control" multiple="multiple" style="width:100%;">
|
|
|
77 |
#foreach($entry in $allRetailersMap.entrySet())
|
|
|
78 |
<option value="$entry.getKey()">$entry.getValue().getPartnerCode() - $entry.getValue().getBusinessName()</option>
|
|
|
79 |
#end
|
|
|
80 |
</select>
|
|
|
81 |
</div>
|
|
|
82 |
<button class="btn btn-success btn-sm add-selected-partners" type="button">Add Selected Partners</button>
|
|
|
83 |
</div>
|
|
|
84 |
|
|
|
85 |
<div class="modal-footer">
|
|
|
86 |
<button type="button" data-dismiss="modal" class="btn btn-default">Close</button>
|
|
|
87 |
</div>
|
|
|
88 |
|
|
|
89 |
<script type="text/javascript">
|
|
|
90 |
$(function () {
|
|
|
91 |
$('#add-partner-select').chosen({
|
|
|
92 |
no_results_text: "No partner found",
|
|
|
93 |
placeholder_text_multiple: "Search and select partners..."
|
|
|
94 |
});
|
|
|
95 |
});
|
|
|
96 |
</script>
|