| 33865 |
tejus.loha |
1 |
$(function () {
|
| 30866 |
tejbeer |
2 |
|
| 33865 |
tejus.loha |
3 |
$(document).on('click', ".sd-credit", function () {
|
| 31020 |
tejbeer |
4 |
|
| 33865 |
tejus.loha |
5 |
loadSdCredit("main-content");
|
|
|
6 |
});
|
| 30859 |
tejbeer |
7 |
|
|
|
8 |
|
| 33865 |
tejus.loha |
9 |
$(document).on('click', ".sanction-request", function () {
|
| 30859 |
tejbeer |
10 |
|
| 33865 |
tejus.loha |
11 |
loadSanctionRequest("main-content");
|
|
|
12 |
});
|
| 30859 |
tejbeer |
13 |
|
| 34355 |
ranu |
14 |
$(document).on('click', ".rbm-sanction-request", function () {
|
| 30859 |
tejbeer |
15 |
|
| 34355 |
ranu |
16 |
loadRBML2SanctionRequest("main-content");
|
|
|
17 |
});
|
|
|
18 |
|
|
|
19 |
|
| 33865 |
tejus.loha |
20 |
$(document).on('click', ".loan-summary", function () {
|
| 30859 |
tejbeer |
21 |
|
| 33865 |
tejus.loha |
22 |
loadLoanDetail("main-content");
|
|
|
23 |
});
|
| 30859 |
tejbeer |
24 |
|
|
|
25 |
|
| 33865 |
tejus.loha |
26 |
$(document).on('click', ".sanction-order-hold", function () {
|
| 30929 |
tejbeer |
27 |
|
| 33865 |
tejus.loha |
28 |
loadSanctionHoldOrder("main-content");
|
|
|
29 |
});
|
| 30929 |
tejbeer |
30 |
|
|
|
31 |
|
| 33865 |
tejus.loha |
32 |
$(document).on('click', ".sanction-order-unhold", function () {
|
| 31020 |
tejbeer |
33 |
|
| 33865 |
tejus.loha |
34 |
loadSanctionUnholdOrder("main-content");
|
|
|
35 |
});
|
|
|
36 |
var table = $('#sdCredit').DataTable();
|
|
|
37 |
$(document).on('dblclick', '#sdCredit tbody tr', function () {
|
|
|
38 |
console.log("dblclick");
|
|
|
39 |
var data = table.row(this).data();
|
| 31020 |
tejbeer |
40 |
|
|
|
41 |
|
| 33865 |
tejus.loha |
42 |
$(this).find(":input").attr('disabled', false).show();
|
| 31020 |
tejbeer |
43 |
|
| 33865 |
tejus.loha |
44 |
/* $(this).find("input[name=interestRate]").attr('disabled', true);
|
|
|
45 |
$(this).find("input[name=freeDays]").attr('disabled', true);
|
|
|
46 |
$(this).find("input[name=creditDays]").attr('disabled', true);
|
|
|
47 |
*/
|
| 31020 |
tejbeer |
48 |
|
| 33865 |
tejus.loha |
49 |
});
|
| 32439 |
tejbeer |
50 |
|
| 33865 |
tejus.loha |
51 |
$(document).on('input', 'table#sdCredit input[type=file]', function () {
|
|
|
52 |
if (confirm('Confirm upload ?')) {
|
|
|
53 |
var fileSelector = $(this)[0];
|
|
|
54 |
if (fileSelector != undefined
|
|
|
55 |
&& fileSelector.files[0] != undefined) {
|
|
|
56 |
var url = `${context}/document-upload`;
|
|
|
57 |
console.log(url);
|
|
|
58 |
var file = this.files[0];
|
|
|
59 |
console.log("file" + file);
|
|
|
60 |
let fileInput = $(this);
|
|
|
61 |
console.log("fileInput" + file);
|
|
|
62 |
doAjaxUploadRequestHandler(
|
|
|
63 |
url,
|
|
|
64 |
'POST',
|
|
|
65 |
file,
|
|
|
66 |
function (response) {
|
|
|
67 |
console.log(response);
|
|
|
68 |
var documentId = response.response.document_id;
|
|
|
69 |
console.log("documentId : " + documentId);
|
|
|
70 |
fileInput.closest('td').find("input[type=hidden]").val(documentId);
|
|
|
71 |
});
|
|
|
72 |
// alert("Retailer Shop Document
|
|
|
73 |
// is required");
|
|
|
74 |
}
|
|
|
75 |
} else {
|
|
|
76 |
// Do nothing!
|
|
|
77 |
}
|
|
|
78 |
});
|
| 32439 |
tejbeer |
79 |
|
| 30859 |
tejbeer |
80 |
|
| 33865 |
tejus.loha |
81 |
$(document).on('click', ".reset-hard-limit", function () {
|
|
|
82 |
var id = $(this).data('id');
|
| 33894 |
tejus.loha |
83 |
const self = this;
|
| 33865 |
tejus.loha |
84 |
if (confirm("Are you sure you want to reset hard limit")) {
|
| 33894 |
tejus.loha |
85 |
var hardLimitInput = $(this).closest('td').find('input[name="hardLimit"]');
|
| 33865 |
tejus.loha |
86 |
doPutAjaxRequestHandler(`${context}/resetHardLimit?id=${id}`, function (response) {
|
|
|
87 |
if (response) {
|
|
|
88 |
alert("Hard Limit reset.");
|
|
|
89 |
hardLimitInput.val('false');
|
| 33894 |
tejus.loha |
90 |
$(self).closest('td').find('.reset-hard-limit').hide();
|
|
|
91 |
|
| 33865 |
tejus.loha |
92 |
}
|
|
|
93 |
});
|
|
|
94 |
}
|
|
|
95 |
});
|
| 30951 |
tejbeer |
96 |
|
| 35534 |
amit |
97 |
$(document).on('click', '.add-credit-exception', function () {
|
|
|
98 |
var row = $(this).closest("tr");
|
| 35535 |
amit |
99 |
var fofoId = $(this).data('fofoId');
|
| 35534 |
amit |
100 |
var partnerName = $(row).find("td:eq(2)").text().trim();
|
|
|
101 |
|
|
|
102 |
if (confirm("Are you sure you want to add credit exception for today for " + partnerName + "?")) {
|
|
|
103 |
doPostAjaxRequestHandler(context + "/addCreditBlockedException?fofoId=" + fofoId, function (response) {
|
|
|
104 |
if (response === 'true' || response === true) {
|
|
|
105 |
alert("Credit exception added successfully for today!");
|
|
|
106 |
} else {
|
|
|
107 |
alert("Failed to add credit exception. Please try again.");
|
|
|
108 |
}
|
|
|
109 |
});
|
|
|
110 |
}
|
|
|
111 |
});
|
|
|
112 |
|
| 33865 |
tejus.loha |
113 |
$(document).on('click', '.credit-requirement-send', function () {
|
|
|
114 |
var row = $(this).closest("tr");
|
|
|
115 |
console.log(row);
|
|
|
116 |
var rowIndex = $(this).closest('tr').prevAll().length;
|
|
|
117 |
console.log(rowIndex);
|
|
|
118 |
var fofoId = $(row).find("td:eq(0)").text();
|
| 30859 |
tejbeer |
119 |
|
| 33865 |
tejus.loha |
120 |
var securityCheck = $(row).find("input[type=hidden]").val();
|
| 30859 |
tejbeer |
121 |
|
|
|
122 |
|
| 33865 |
tejus.loha |
123 |
console.log(securityCheck);
|
| 30859 |
tejbeer |
124 |
|
|
|
125 |
|
| 33865 |
tejus.loha |
126 |
var limit = $(row).find("td:eq(5) input[type='text']").val();
|
|
|
127 |
var interest = $(row).find("td:eq(9) input[type='text']").val();
|
|
|
128 |
var freedays = $(row).find("td:eq(10) input[type='text']").val();
|
|
|
129 |
var creditDays = $(row).find("td:eq(11) input[type='text']").val();
|
| 30866 |
tejbeer |
130 |
|
| 30871 |
tejbeer |
131 |
|
| 30859 |
tejbeer |
132 |
var sdCreditReq = {};
|
|
|
133 |
sdCreditReq['fofoId'] = fofoId
|
|
|
134 |
sdCreditReq['securityCheck'] = securityCheck
|
|
|
135 |
sdCreditReq['limit'] = limit
|
|
|
136 |
sdCreditReq['interest'] = interest
|
|
|
137 |
sdCreditReq['freeDays'] = freedays
|
|
|
138 |
sdCreditReq['creditDays'] = creditDays
|
|
|
139 |
|
| 33865 |
tejus.loha |
140 |
var jsonObject = JSON.stringify(sdCreditReq);
|
| 30859 |
tejbeer |
141 |
|
|
|
142 |
console.log(jsonObject);
|
| 33865 |
tejus.loha |
143 |
if (confirm("Are you sure you want to submit the request")) {
|
| 30859 |
tejbeer |
144 |
doAjaxRequestWithJsonHandler(context + "/creditRequirement", "POST", jsonObject, function(response) {
|
|
|
145 |
row.html(response);
|
|
|
146 |
row.css("background-color", "#F8F8FF");
|
|
|
147 |
|
| 33865 |
tejus.loha |
148 |
});
|
|
|
149 |
}
|
| 30859 |
tejbeer |
150 |
|
|
|
151 |
|
| 33865 |
tejus.loha |
152 |
})
|
| 30859 |
tejbeer |
153 |
|
| 33865 |
tejus.loha |
154 |
$(document).on('click', '.sanction-request-send', function () {
|
|
|
155 |
var row = $(this).closest("tr");
|
|
|
156 |
console.log(row);
|
|
|
157 |
var rowIndex = $(this).closest('tr').prevAll().length;
|
|
|
158 |
console.log(rowIndex);
|
|
|
159 |
var id = $(row).find("td:eq(0)").text();
|
| 30859 |
tejbeer |
160 |
|
|
|
161 |
|
| 33865 |
tejus.loha |
162 |
var approvalAmount = $(row).find(".approveamount input[type='text']").val();
|
|
|
163 |
var freedays = $(row).find(".freedays input[type='text']").val();
|
| 30859 |
tejbeer |
164 |
|
| 31020 |
tejbeer |
165 |
|
| 33865 |
tejus.loha |
166 |
var status = $(row).find(".sanctionstatus option:selected").val();
|
| 30859 |
tejbeer |
167 |
|
| 33865 |
tejus.loha |
168 |
var stockHold = $(row).find(".stockholdcheckbox input[type='checkbox']").is(":checked") ? true : false;
|
| 31020 |
tejbeer |
169 |
|
|
|
170 |
|
| 33865 |
tejus.loha |
171 |
console.log(freedays)
|
| 30859 |
tejbeer |
172 |
|
| 33865 |
tejus.loha |
173 |
var sanctionReq = {};
|
|
|
174 |
sanctionReq['id'] = id
|
|
|
175 |
sanctionReq['status'] = status
|
|
|
176 |
sanctionReq['approvalAmount'] = approvalAmount
|
|
|
177 |
sanctionReq['freeDays'] = freedays
|
| 30859 |
tejbeer |
178 |
|
| 33865 |
tejus.loha |
179 |
sanctionReq['stockHold'] = stockHold
|
| 31020 |
tejbeer |
180 |
|
|
|
181 |
|
| 33865 |
tejus.loha |
182 |
var jsonObject = JSON.stringify(sanctionReq);
|
| 30859 |
tejbeer |
183 |
|
| 33865 |
tejus.loha |
184 |
console.log(jsonObject);
|
|
|
185 |
if (confirm("Are you sure you want to submit the request") == true) {
|
|
|
186 |
doAjaxRequestWithJsonHandler(context + "/sanctionRequest", "POST", jsonObject, function (response) {
|
|
|
187 |
row.html(response);
|
|
|
188 |
row.css("background-color", "#F8F8FF");
|
| 30859 |
tejbeer |
189 |
|
| 33865 |
tejus.loha |
190 |
});
|
|
|
191 |
}
|
| 30859 |
tejbeer |
192 |
|
|
|
193 |
|
| 33865 |
tejus.loha |
194 |
})
|
| 31020 |
tejbeer |
195 |
|
| 34355 |
ranu |
196 |
$(document).on('click', '.l2-sanction-approval-send', function () {
|
|
|
197 |
var row = $(this).closest("tr");
|
|
|
198 |
console.log(row);
|
|
|
199 |
var rowIndex = $(this).closest('tr').prevAll().length;
|
|
|
200 |
console.log(rowIndex);
|
|
|
201 |
var id = $(row).find("td:eq(0)").text();
|
| 31020 |
tejbeer |
202 |
|
| 34355 |
ranu |
203 |
|
|
|
204 |
var approvalAmount = $(row).find(".approveamount input[type='text']").val();
|
|
|
205 |
var freedays = $(row).find(".freedays input[type='text']").val();
|
|
|
206 |
|
|
|
207 |
|
|
|
208 |
var status = $(row).find(".sanctionstatus option:selected").val();
|
|
|
209 |
|
|
|
210 |
var stockHold = $(row).find(".stockholdcheckbox input[type='checkbox']").is(":checked") ? true : false;
|
|
|
211 |
|
|
|
212 |
|
|
|
213 |
console.log(freedays)
|
|
|
214 |
|
|
|
215 |
var sanctionReq = {};
|
|
|
216 |
sanctionReq['id'] = id
|
|
|
217 |
sanctionReq['status'] = status
|
|
|
218 |
sanctionReq['approvalAmount'] = approvalAmount
|
|
|
219 |
sanctionReq['freeDays'] = freedays
|
|
|
220 |
|
|
|
221 |
sanctionReq['stockHold'] = stockHold
|
|
|
222 |
|
|
|
223 |
|
|
|
224 |
var jsonObject = JSON.stringify(sanctionReq);
|
|
|
225 |
|
|
|
226 |
console.log(jsonObject);
|
|
|
227 |
if (confirm("Are you sure you want to submit the request") == true) {
|
|
|
228 |
doAjaxRequestWithJsonHandler(context + "/rbmL2ApprovalSanctionRequest", "POST", jsonObject, function (response) {
|
|
|
229 |
row.html(response);
|
|
|
230 |
row.css("background-color", "#F8F8FF");
|
|
|
231 |
|
|
|
232 |
});
|
|
|
233 |
}
|
|
|
234 |
|
|
|
235 |
|
|
|
236 |
})
|
|
|
237 |
|
|
|
238 |
|
| 33865 |
tejus.loha |
239 |
$(document).on('click', '.sanction-request-unhold', function () {
|
|
|
240 |
var row = $(this).closest("tr");
|
|
|
241 |
console.log(row);
|
|
|
242 |
var transactionId = $(row).find("td:eq(3)").text();
|
|
|
243 |
if (confirm("Are you sure you want to Unhold the request") == true) {
|
| 31020 |
tejbeer |
244 |
|
| 33865 |
tejus.loha |
245 |
doPostAjaxRequestHandler(context + "/unholdOrder?transactionId="
|
|
|
246 |
+ transactionId, function (response) {
|
|
|
247 |
if (response == 'true') {
|
|
|
248 |
alert("unhold successfully");
|
|
|
249 |
loadSanctionUnholdOrder("main-content");
|
|
|
250 |
}
|
| 31020 |
tejbeer |
251 |
|
| 33865 |
tejus.loha |
252 |
});
|
|
|
253 |
}
|
| 31020 |
tejbeer |
254 |
|
|
|
255 |
|
| 33865 |
tejus.loha |
256 |
})
|
| 31020 |
tejbeer |
257 |
|
| 33865 |
tejus.loha |
258 |
});
|
| 31020 |
tejbeer |
259 |
|
| 30859 |
tejbeer |
260 |
function loadSdCredit(domId) {
|
|
|
261 |
|
| 33865 |
tejus.loha |
262 |
doGetAjaxRequestHandler(context + "/getSDCreditReq", function (
|
|
|
263 |
response) {
|
|
|
264 |
$('#' + domId).html(response);
|
|
|
265 |
});
|
| 30859 |
tejbeer |
266 |
}
|
|
|
267 |
|
|
|
268 |
function loadSanctionRequest(domId) {
|
| 33865 |
tejus.loha |
269 |
doGetAjaxRequestHandler(context + "/getSanctionRequest", function (
|
|
|
270 |
response) {
|
|
|
271 |
$('#' + domId).html(response);
|
|
|
272 |
});
|
| 30859 |
tejbeer |
273 |
}
|
| 30929 |
tejbeer |
274 |
|
| 34355 |
ranu |
275 |
function loadRBML2SanctionRequest(domId) {
|
|
|
276 |
doGetAjaxRequestHandler(context + "/getRbmL2SanctionRequest", function (
|
|
|
277 |
response) {
|
|
|
278 |
$('#' + domId).html(response);
|
|
|
279 |
});
|
|
|
280 |
}
|
|
|
281 |
|
| 30929 |
tejbeer |
282 |
function loadLoanDetail(domId) {
|
|
|
283 |
|
| 33865 |
tejus.loha |
284 |
doGetAjaxRequestHandler(context + "/getLoans", function (
|
|
|
285 |
response) {
|
|
|
286 |
$('#' + domId).html(response);
|
|
|
287 |
});
|
| 30929 |
tejbeer |
288 |
}
|
| 31020 |
tejbeer |
289 |
|
|
|
290 |
|
|
|
291 |
function loadSanctionHoldOrder(domId) {
|
|
|
292 |
|
| 33865 |
tejus.loha |
293 |
doGetAjaxRequestHandler(context + "/getSanctionHoldOrder", function (
|
|
|
294 |
response) {
|
|
|
295 |
$('#' + domId).html(response);
|
|
|
296 |
});
|
| 31020 |
tejbeer |
297 |
}
|
| 32439 |
tejbeer |
298 |
|
|
|
299 |
function loadSanctionUnholdOrder(domId) {
|
|
|
300 |
|
| 33865 |
tejus.loha |
301 |
doGetAjaxRequestHandler(context + "/getSanctionUnholdOrder", function (
|
|
|
302 |
response) {
|
|
|
303 |
$('#' + domId).html(response);
|
|
|
304 |
});
|
| 32439 |
tejbeer |
305 |
}
|
|
|
306 |
|
|
|
307 |
|