| 35971 |
aman |
1 |
<style>
|
|
|
2 |
#fullStockPaymentTable td {
|
|
|
3 |
vertical-align: middle !important;
|
|
|
4 |
}
|
|
|
5 |
|
|
|
6 |
#fullStockPaymentTable .action-btns {
|
|
|
7 |
display: inline-flex;
|
|
|
8 |
gap: 4px;
|
|
|
9 |
flex-wrap: nowrap;
|
|
|
10 |
align-items: center;
|
|
|
11 |
}
|
|
|
12 |
|
|
|
13 |
.fsp-past-entries-table {
|
|
|
14 |
margin-bottom: 15px;
|
|
|
15 |
}
|
|
|
16 |
|
|
|
17 |
.fsp-past-entries-table th {
|
|
|
18 |
background: #f5f5f5;
|
|
|
19 |
font-size: 12px;
|
|
|
20 |
}
|
|
|
21 |
|
|
|
22 |
.fsp-past-entries-table td {
|
|
|
23 |
font-size: 12px;
|
|
|
24 |
}
|
|
|
25 |
</style>
|
|
|
26 |
<section class="wrapper">
|
|
|
27 |
<div class="row">
|
|
|
28 |
<div class="col-lg-12">
|
|
|
29 |
<h3 class="page-header"><i class="icon_document_alt"></i>FULL STOCK PAYMENT</h3>
|
|
|
30 |
<ol class="breadcrumb">
|
|
|
31 |
<li><i class="fa fa-home"></i><a href="${rc.contextPath}/dashboard">Home</a></li>
|
|
|
32 |
<li><i class="icon_document_alt"></i>Full Stock Payment</li>
|
|
|
33 |
</ol>
|
|
|
34 |
</div>
|
|
|
35 |
</div>
|
|
|
36 |
|
|
|
37 |
<div class="col-lg-12">
|
|
|
38 |
<table class="table table-border table-condensed table-bordered" id="fullStockPaymentTable" style="width:100%">
|
|
|
39 |
<thead class="row htable" style="background:#F5F5F5;">
|
|
|
40 |
<tr style="color:black;">
|
|
|
41 |
<th>ID</th>
|
|
|
42 |
<th>Partner Name</th>
|
|
|
43 |
<th>Code</th>
|
|
|
44 |
<th>City</th>
|
|
|
45 |
<th>RBM</th>
|
|
|
46 |
<th style="text-align:right;">Total Approved</th>
|
|
|
47 |
<th style="text-align:center;">Entries</th>
|
|
|
48 |
<th style="text-align:center;">Action</th>
|
|
|
49 |
</tr>
|
|
|
50 |
</thead>
|
|
|
51 |
<tbody>
|
|
|
52 |
#foreach($st in $eligibleTimelines)
|
|
|
53 |
#set($obId = $st.getOnboardingId())
|
|
|
54 |
#set($panel = $panelMap.get($obId))
|
|
|
55 |
#if($panel)
|
|
|
56 |
#set($payments = $paymentsByOnboardingId.get($obId))
|
|
|
57 |
#set($approvedAmt = 0)
|
|
|
58 |
#if($approvedFspAmountByOnboardingId.get($obId))
|
|
|
59 |
#set($approvedAmt = $approvedFspAmountByOnboardingId.get($obId))
|
|
|
60 |
#end
|
|
|
61 |
## Count entries by status
|
|
|
62 |
#set($pendingCount = 0)
|
|
|
63 |
#set($approvedCount = 0)
|
|
|
64 |
#set($rejectedCount = 0)
|
|
|
65 |
#if($payments && $payments.size() > 0)
|
|
|
66 |
#foreach($p in $payments)
|
|
|
67 |
#if($p.getPaymentStatus() == $PENDING)
|
|
|
68 |
#set($pendingCount = $pendingCount + 1)
|
|
|
69 |
#elseif($p.getPaymentStatus() == $APPROVED)
|
|
|
70 |
#set($approvedCount = $approvedCount + 1)
|
|
|
71 |
#elseif($p.getPaymentStatus() == $REJECTED)
|
|
|
72 |
#set($rejectedCount = $rejectedCount + 1)
|
|
|
73 |
#end
|
|
|
74 |
#end
|
|
|
75 |
#end
|
|
|
76 |
<tr>
|
|
|
77 |
<td>$obId</td>
|
|
|
78 |
<td>$!panel.getOutLetName()</td>
|
|
|
79 |
<td>$!panel.getCode()</td>
|
|
|
80 |
<td>$!panel.getCity()</td>
|
|
|
81 |
<td>
|
|
|
82 |
#if($panel.getAuthId() != 0 && $authUseMap.get($panel.getAuthId()))
|
|
|
83 |
$authUseMap.get($panel.getAuthId()).getName()
|
|
|
84 |
#end
|
|
|
85 |
</td>
|
|
|
86 |
<td style="text-align:right; font-weight:bold;">
|
|
|
87 |
#if($approvedAmt > 0)
|
|
|
88 |
$approvedAmt
|
|
|
89 |
#else
|
|
|
90 |
-
|
|
|
91 |
#end
|
|
|
92 |
</td>
|
|
|
93 |
<td style="text-align:center;">
|
|
|
94 |
#if($payments && $payments.size() > 0)
|
|
|
95 |
#if($approvedCount > 0)
|
|
|
96 |
<span class="label label-success"
|
|
|
97 |
style="font-size:11px;">$approvedCount Approved</span>
|
|
|
98 |
#end
|
|
|
99 |
#if($pendingCount > 0)
|
|
|
100 |
<span class="label label-warning"
|
|
|
101 |
style="font-size:11px;">$pendingCount Pending</span>
|
|
|
102 |
#end
|
|
|
103 |
#if($rejectedCount > 0)
|
|
|
104 |
<span class="label label-danger"
|
|
|
105 |
style="font-size:11px;">$rejectedCount Rejected</span>
|
|
|
106 |
#end
|
|
|
107 |
#else
|
|
|
108 |
<span class="label label-default" style="font-size:11px;">No Entries</span>
|
|
|
109 |
#end
|
|
|
110 |
</td>
|
|
|
111 |
<td style="text-align:center;">
|
|
|
112 |
<div class="action-btns">
|
|
|
113 |
## View button for everyone to see entry history
|
|
|
114 |
#if($payments && $payments.size() > 0)
|
|
|
115 |
<button type="button" class="btn btn-info btn-sm fsp-view-entries-btn"
|
|
|
116 |
data-id="$obId" data-partner-name="$!panel.getOutLetName()">
|
|
|
117 |
<i class="fa fa-eye"></i> View
|
|
|
118 |
</button>
|
|
|
119 |
#end
|
|
|
120 |
## Upload button always available for non-approvers
|
|
|
121 |
#if(!$isApprover)
|
|
|
122 |
<button type="button" class="btn btn-primary btn-sm fsp-upload-btn"
|
|
|
123 |
data-id="$obId" data-partner-name="$!panel.getOutLetName()">
|
|
|
124 |
<i class="fa fa-upload"></i> Upload
|
|
|
125 |
</button>
|
|
|
126 |
#end
|
| 35977 |
aman |
127 |
## Manual Accept button for approvers (only when approved amount >= 5 lakh)
|
|
|
128 |
#if($isApprover && $approvedAmt >= 500000)
|
| 35971 |
aman |
129 |
<button type="button" class="btn btn-success btn-sm fsp-manual-accept-btn"
|
|
|
130 |
data-onboarding-id="$obId" data-partner-name="$!panel.getOutLetName()">
|
|
|
131 |
<i class="fa fa-check"></i> Accept
|
|
|
132 |
</button>
|
|
|
133 |
#end
|
|
|
134 |
</div>
|
|
|
135 |
</td>
|
|
|
136 |
</tr>
|
|
|
137 |
#end
|
|
|
138 |
#end
|
|
|
139 |
</tbody>
|
|
|
140 |
</table>
|
|
|
141 |
</div>
|
|
|
142 |
|
|
|
143 |
<!-- Upload Payment Modal -->
|
|
|
144 |
<div class="modal fade" id="fullStockPaymentModal" role="dialog">
|
|
|
145 |
<div class="modal-dialog modal-lg">
|
|
|
146 |
<div class="modal-content">
|
|
|
147 |
<div class="modal-header">
|
|
|
148 |
<button type="button" class="close" data-dismiss="modal">×</button>
|
|
|
149 |
<h4 class="modal-title">Full Stock Payment - <span id="fsp-modal-partner-name"></span></h4>
|
|
|
150 |
</div>
|
|
|
151 |
<div class="modal-body">
|
|
|
152 |
<input type="hidden" id="fsp-onboarding-id">
|
|
|
153 |
|
|
|
154 |
<!-- Past Entries Section -->
|
|
|
155 |
<div id="fsp-past-entries-section">
|
|
|
156 |
<h5 style="font-weight:bold; margin-bottom:10px;">Past Entries</h5>
|
|
|
157 |
<div id="fsp-past-entries-container">
|
|
|
158 |
<p class="text-muted">Loading...</p>
|
|
|
159 |
</div>
|
|
|
160 |
<hr>
|
|
|
161 |
</div>
|
|
|
162 |
|
|
|
163 |
<!-- Upload Form -->
|
|
|
164 |
<h5 style="font-weight:bold; margin-bottom:10px;">New Payment Entry</h5>
|
|
|
165 |
<form name="fullStockPaymentForm" id="fullStockPaymentForm" method="post">
|
|
|
166 |
<div class="row">
|
|
|
167 |
<div class="col-lg-3 col-md-3 col-sm-6">
|
|
|
168 |
<div class="form-group">
|
|
|
169 |
<label>Amount:</label>
|
|
|
170 |
<input type="number" name="collectedAmount" class="form-control"
|
|
|
171 |
placeholder="Enter amount" required>
|
|
|
172 |
</div>
|
|
|
173 |
</div>
|
|
|
174 |
<div class="col-lg-3 col-md-3 col-sm-6">
|
|
|
175 |
<div class="form-group">
|
|
|
176 |
<label>Payment Mode:</label>
|
|
|
177 |
<select class="form-control" name="paymentMode" required>
|
|
|
178 |
<option value="" selected disabled>Select mode</option>
|
|
|
179 |
<option value="UPI">UPI</option>
|
|
|
180 |
<option value="Cheque">Cheque</option>
|
|
|
181 |
<option value="IMPS">IMPS</option>
|
|
|
182 |
<option value="NEFT">NEFT</option>
|
|
|
183 |
<option value="RTGS">RTGS</option>
|
|
|
184 |
</select>
|
|
|
185 |
</div>
|
|
|
186 |
</div>
|
|
|
187 |
<div class="col-lg-3 col-md-3 col-sm-6">
|
|
|
188 |
<div class="form-group">
|
|
|
189 |
<label>Reference No:</label>
|
|
|
190 |
<input type="text" name="paymentReferenceNo" class="form-control"
|
|
|
191 |
placeholder="Enter reference no" required>
|
|
|
192 |
</div>
|
|
|
193 |
</div>
|
|
|
194 |
<div class="col-lg-3 col-md-3 col-sm-6">
|
|
|
195 |
<div class="form-group">
|
|
|
196 |
<label>Bank Name:</label>
|
|
|
197 |
<select class="form-control" name="bankName" required>
|
|
|
198 |
<option value="" selected disabled>Select bank</option>
|
|
|
199 |
<option value="HDFC Bank Limited">HDFC Bank Limited</option>
|
|
|
200 |
<option value="Indusind Bank Ltd">Indusind Bank Ltd</option>
|
|
|
201 |
</select>
|
|
|
202 |
</div>
|
|
|
203 |
</div>
|
|
|
204 |
</div>
|
|
|
205 |
<div class="row">
|
|
|
206 |
<div class="col-lg-3 col-md-3 col-sm-6">
|
|
|
207 |
<div class="form-group">
|
|
|
208 |
<label>Reference Date:</label>
|
|
|
209 |
<input type="date" name="referenceDate" class="form-control" required>
|
|
|
210 |
</div>
|
|
|
211 |
</div>
|
|
|
212 |
<div class="col-lg-3 col-md-3 col-sm-6">
|
|
|
213 |
<div class="form-group">
|
|
|
214 |
<label>Attachment:</label>
|
|
|
215 |
<input type="hidden" id="fsp-attachment-id" name="attachment">
|
|
|
216 |
<input type="file" class="form-control" id="fsp-attachment-file" required>
|
|
|
217 |
</div>
|
|
|
218 |
</div>
|
|
|
219 |
</div>
|
|
|
220 |
</form>
|
|
|
221 |
</div>
|
|
|
222 |
<div class="modal-footer">
|
|
|
223 |
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
|
|
224 |
<button type="button" class="btn btn-primary" id="fsp-submit-btn">
|
|
|
225 |
<i class="fa fa-paper-plane"></i> Submit Payment
|
|
|
226 |
</button>
|
|
|
227 |
</div>
|
|
|
228 |
</div>
|
|
|
229 |
</div>
|
|
|
230 |
</div>
|
|
|
231 |
|
|
|
232 |
<!-- View Entries Modal (read-only history) -->
|
|
|
233 |
<div class="modal fade" id="fspViewEntriesModal" role="dialog">
|
|
|
234 |
<div class="modal-dialog modal-lg">
|
|
|
235 |
<div class="modal-content">
|
|
|
236 |
<div class="modal-header">
|
|
|
237 |
<button type="button" class="close" data-dismiss="modal">×</button>
|
|
|
238 |
<h4 class="modal-title">Payment History - <span id="fsp-view-partner-name"></span></h4>
|
|
|
239 |
</div>
|
|
|
240 |
<div class="modal-body">
|
|
|
241 |
<div id="fsp-view-entries-container">
|
|
|
242 |
<p class="text-muted">Loading...</p>
|
|
|
243 |
</div>
|
|
|
244 |
</div>
|
|
|
245 |
<div class="modal-footer">
|
|
|
246 |
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
|
|
247 |
</div>
|
|
|
248 |
</div>
|
|
|
249 |
</div>
|
|
|
250 |
</div>
|
|
|
251 |
|
|
|
252 |
<!-- Document View Modal -->
|
|
|
253 |
<div class="modal fade" id="fspDocViewModal" role="dialog">
|
|
|
254 |
<div class="modal-dialog modal-lg">
|
|
|
255 |
<div class="modal-content">
|
|
|
256 |
<div class="modal-header">
|
|
|
257 |
<button type="button" class="close" data-dismiss="modal">×</button>
|
|
|
258 |
<h4 class="modal-title">Payment Proof</h4>
|
|
|
259 |
</div>
|
|
|
260 |
<div class="modal-body" style="text-align:center;">
|
|
|
261 |
<img id="fsp-doc-preview" src="" style="max-width:100%; max-height:500px;">
|
|
|
262 |
</div>
|
|
|
263 |
<div class="modal-footer">
|
|
|
264 |
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
|
|
265 |
</div>
|
|
|
266 |
</div>
|
|
|
267 |
</div>
|
|
|
268 |
</div>
|
|
|
269 |
|
|
|
270 |
</section>
|
|
|
271 |
|
|
|
272 |
<script type="text/javascript">
|
|
|
273 |
// Build past entries data from server-side
|
|
|
274 |
var fspPastEntries = {};
|
|
|
275 |
#foreach($st in $eligibleTimelines)
|
|
|
276 |
#set($obId = $st.getOnboardingId())
|
|
|
277 |
#set($payments = $paymentsByOnboardingId.get($obId))
|
|
|
278 |
#if($payments && $payments.size() > 0)
|
|
|
279 |
fspPastEntries[$obId] = [
|
|
|
280 |
#foreach($p in $payments)
|
|
|
281 |
{
|
|
|
282 |
id: $p.getId(),
|
|
|
283 |
amount: $p.getCollectedAmount(),
|
|
|
284 |
mode: '$!p.getPaymentMode()',
|
|
|
285 |
refNo: '$!p.getPaymentReferenceNo()',
|
|
|
286 |
bank: '$!p.getBankName()',
|
|
|
287 |
refDate: '$!p.getReferenceDate()',
|
|
|
288 |
status: '$p.getPaymentStatus()',
|
|
|
289 |
attachment: $p.getAttachment(),
|
|
|
290 |
submitDate: '$!p.getSubmitTimestamp()'
|
|
|
291 |
}#if($foreach.hasNext),#end
|
|
|
292 |
#end
|
|
|
293 |
];
|
|
|
294 |
#end
|
|
|
295 |
#end
|
|
|
296 |
|
|
|
297 |
$(document).ready(function () {
|
|
|
298 |
if ($.fn.DataTable.isDataTable('#fullStockPaymentTable')) {
|
|
|
299 |
$('#fullStockPaymentTable').DataTable().destroy();
|
|
|
300 |
}
|
|
|
301 |
$('#fullStockPaymentTable').DataTable({
|
|
|
302 |
"scrollX": true,
|
|
|
303 |
"order": [[0, "desc"]],
|
|
|
304 |
"pageLength": 25
|
|
|
305 |
});
|
|
|
306 |
});
|
|
|
307 |
|
|
|
308 |
// Unbind previous handlers to prevent duplicates on AJAX reload
|
|
|
309 |
$(document).off('click', '.fsp-view-doc-btn');
|
|
|
310 |
$(document).off('click', '.fsp-view-entries-btn');
|
|
|
311 |
$(document).off('click', '.fsp-upload-btn');
|
|
|
312 |
$(document).off('input', '#fsp-attachment-file');
|
|
|
313 |
$(document).off('click', '#fsp-submit-btn');
|
|
|
314 |
$(document).off('click', '.fsp-manual-accept-btn');
|
|
|
315 |
|
|
|
316 |
// Build entries table HTML (reusable)
|
|
|
317 |
function buildEntriesTableHtml(entries) {
|
|
|
318 |
if (!entries || entries.length === 0) {
|
|
|
319 |
return '<p class="text-muted">No entries found</p>';
|
|
|
320 |
}
|
|
|
321 |
var html = '<table class="table table-bordered table-condensed fsp-past-entries-table">';
|
|
|
322 |
html += '<thead><tr><th>Amount</th><th>Mode</th><th>Ref No</th><th>Bank</th><th>Ref Date</th><th>Status</th><th>Doc</th></tr></thead>';
|
|
|
323 |
html += '<tbody>';
|
|
|
324 |
for (var i = 0; i < entries.length; i++) {
|
|
|
325 |
var e = entries[i];
|
|
|
326 |
var statusLabel = '';
|
|
|
327 |
if (e.status === 'PENDING') {
|
|
|
328 |
statusLabel = '<span class="label label-warning">PENDING</span>';
|
|
|
329 |
} else if (e.status === 'APPROVED') {
|
|
|
330 |
statusLabel = '<span class="label label-success">APPROVED</span>';
|
|
|
331 |
} else if (e.status === 'REJECTED') {
|
|
|
332 |
statusLabel = '<span class="label label-danger">REJECTED</span>';
|
|
|
333 |
}
|
|
|
334 |
var docLink = e.attachment > 0
|
|
|
335 |
? '<button type="button" class="btn btn-info btn-xs fsp-view-doc-btn" data-doc-url="' + context + '/document/' + e.attachment + '"><i class="fa fa-eye"></i></button>'
|
|
|
336 |
: '-';
|
|
|
337 |
html += '<tr><td>' + e.amount + '</td><td>' + e.mode + '</td><td>' + e.refNo + '</td><td>' + e.bank + '</td><td>' + e.refDate + '</td><td>' + statusLabel + '</td><td>' + docLink + '</td></tr>';
|
|
|
338 |
}
|
|
|
339 |
html += '</tbody></table>';
|
|
|
340 |
return html;
|
|
|
341 |
}
|
|
|
342 |
|
|
|
343 |
// View document in modal
|
|
|
344 |
$(document).on('click', '.fsp-view-doc-btn', function () {
|
|
|
345 |
var docUrl = $(this).data('doc-url');
|
|
|
346 |
$('#fsp-doc-preview').attr('src', docUrl);
|
|
|
347 |
$('#fspDocViewModal').modal('show');
|
|
|
348 |
});
|
|
|
349 |
|
|
|
350 |
// View entries history (read-only, for everyone)
|
|
|
351 |
$(document).on('click', '.fsp-view-entries-btn', function () {
|
|
|
352 |
var onboardingId = $(this).data('id');
|
|
|
353 |
var partnerName = $(this).data('partner-name');
|
|
|
354 |
$('#fsp-view-partner-name').text(partnerName);
|
|
|
355 |
var entries = fspPastEntries[onboardingId] || [];
|
|
|
356 |
$('#fsp-view-entries-container').html(buildEntriesTableHtml(entries));
|
|
|
357 |
$('#fspViewEntriesModal').modal('show');
|
|
|
358 |
});
|
|
|
359 |
|
|
|
360 |
// Set onboarding ID and show past entries when upload modal opens
|
|
|
361 |
$(document).on('click', '.fsp-upload-btn', function () {
|
|
|
362 |
var onboardingId = $(this).data('id');
|
|
|
363 |
var partnerName = $(this).data('partner-name');
|
|
|
364 |
$('#fsp-onboarding-id').val(onboardingId);
|
|
|
365 |
$('#fsp-modal-partner-name').text(partnerName);
|
|
|
366 |
// Reset form
|
|
|
367 |
$('#fullStockPaymentForm')[0].reset();
|
|
|
368 |
$('#fsp-attachment-id').val('');
|
|
|
369 |
|
|
|
370 |
// Populate past entries
|
|
|
371 |
var entries = fspPastEntries[onboardingId] || [];
|
|
|
372 |
$('#fsp-past-entries-container').html(buildEntriesTableHtml(entries));
|
|
|
373 |
|
|
|
374 |
// Show modal
|
|
|
375 |
$('#fullStockPaymentModal').modal('show');
|
|
|
376 |
});
|
|
|
377 |
|
|
|
378 |
// File upload handler
|
|
|
379 |
$(document).on('input', '#fsp-attachment-file', function () {
|
|
|
380 |
if (confirm('Confirm file upload ?')) {
|
|
|
381 |
var file = this.files[0];
|
|
|
382 |
uploadDocument(file, function (documentId) {
|
|
|
383 |
$('#fsp-attachment-id').val(documentId);
|
|
|
384 |
});
|
|
|
385 |
}
|
|
|
386 |
});
|
|
|
387 |
|
|
|
388 |
// Submit payment
|
|
|
389 |
$(document).on('click', '#fsp-submit-btn', function () {
|
|
|
390 |
var formData = objectifyForm($("form[name='fullStockPaymentForm']").serializeArray());
|
|
|
391 |
var onboardingId = $('#fsp-onboarding-id').val();
|
|
|
392 |
|
|
|
393 |
// Validate
|
|
|
394 |
if (!formData.collectedAmount || formData.collectedAmount.trim() === '') {
|
|
|
395 |
alert("Amount is required!");
|
|
|
396 |
return;
|
|
|
397 |
}
|
|
|
398 |
if (!formData.paymentMode || formData.paymentMode === 'Select mode') {
|
|
|
399 |
alert("Payment mode is required!");
|
|
|
400 |
return;
|
|
|
401 |
}
|
|
|
402 |
if (!formData.paymentReferenceNo || formData.paymentReferenceNo.trim() === '') {
|
|
|
403 |
alert("Reference number is required!");
|
|
|
404 |
return;
|
|
|
405 |
}
|
|
|
406 |
if (!formData.bankName || formData.bankName === 'Select bank') {
|
|
|
407 |
alert("Bank name is required!");
|
|
|
408 |
return;
|
|
|
409 |
}
|
|
|
410 |
if (!formData.referenceDate || formData.referenceDate.trim() === '') {
|
|
|
411 |
alert("Reference date is required!");
|
|
|
412 |
return;
|
|
|
413 |
}
|
|
|
414 |
if (!formData.attachment || formData.attachment.trim() === '') {
|
|
|
415 |
alert("Please upload payment proof!");
|
|
|
416 |
return;
|
|
|
417 |
}
|
|
|
418 |
|
|
|
419 |
var jsonData = JSON.stringify(formData);
|
|
|
420 |
|
|
|
421 |
if (confirm("Are you sure you want to submit this payment?")) {
|
|
|
422 |
doPostAjaxRequestWithJsonHandler(
|
|
|
423 |
context + "/fullStockPaymentSubmit?onboardingId=" + onboardingId,
|
|
|
424 |
jsonData,
|
|
|
425 |
function (response) {
|
|
|
426 |
alert("Payment submitted successfully!");
|
|
|
427 |
// Close modal and remove backdrop before replacing content
|
|
|
428 |
$('#fullStockPaymentModal').modal('hide');
|
|
|
429 |
$('.modal-backdrop').remove();
|
|
|
430 |
$('body').removeClass('modal-open');
|
|
|
431 |
// Reload panel
|
|
|
432 |
doGetAjaxRequestHandler(context + "/fullStockPaymentPanel", function (response) {
|
|
|
433 |
$('#main-content').html(response);
|
|
|
434 |
});
|
|
|
435 |
}
|
|
|
436 |
);
|
|
|
437 |
}
|
|
|
438 |
});
|
|
|
439 |
|
|
|
440 |
// Manual Accept (Kamini marks FULL_STOCK_PAYMENT done)
|
|
|
441 |
$(document).on('click', '.fsp-manual-accept-btn', function () {
|
|
|
442 |
var onboardingId = $(this).data('onboarding-id');
|
|
|
443 |
var partnerName = $(this).data('partner-name');
|
|
|
444 |
if (confirm("Are you sure you want to mark FULL STOCK PAYMENT as complete for " + partnerName + "?\n\nThis will mark the store timeline entry.")) {
|
|
|
445 |
doPutAjaxRequestHandler(
|
|
|
446 |
context + "/fullStockPaymentManualAccept?onboardingId=" + onboardingId,
|
|
|
447 |
function (response) {
|
|
|
448 |
alert("Full Stock Payment marked as complete for " + partnerName);
|
|
|
449 |
$('.modal-backdrop').remove();
|
|
|
450 |
$('body').removeClass('modal-open');
|
|
|
451 |
doGetAjaxRequestHandler(context + "/fullStockPaymentPanel", function (response) {
|
|
|
452 |
$('#main-content').html(response);
|
|
|
453 |
});
|
|
|
454 |
}
|
|
|
455 |
);
|
|
|
456 |
}
|
|
|
457 |
});
|
|
|
458 |
</script>
|