| 33507 |
tejus.loha |
1 |
$(document).on('click', ".onboarding-form1", function () {
|
|
|
2 |
doGetAjaxRequestHandler(`${context}/onboardingForm`,
|
|
|
3 |
function (response) {
|
|
|
4 |
$('#' + 'main-content').html(response);
|
|
|
5 |
});
|
|
|
6 |
});
|
|
|
7 |
|
| 33577 |
tejus.loha |
8 |
|
|
|
9 |
$(document).on('change', "#maritalStatus", function () {
|
|
|
10 |
let maritalStatus = $(this).val();
|
|
|
11 |
console.log("maritalStatus - " + maritalStatus);
|
|
|
12 |
if (maritalStatus == 1) {
|
|
|
13 |
$(".loiAnniversaryDate").removeClass('hide-model');
|
|
|
14 |
$(".loiAnniversaryDate").addClass('show-model');
|
|
|
15 |
} else {
|
|
|
16 |
$(".loiAnniversaryDate").removeClass('show-model');
|
|
|
17 |
$(".loiAnniversaryDate").addClass('hide-model');
|
|
|
18 |
}
|
|
|
19 |
|
|
|
20 |
});
|
|
|
21 |
// $(document).on('click', ".submitLoiForm", function () {
|
|
|
22 |
// console.log("submitLoiForm clicked");
|
|
|
23 |
// $("#Loi_Form").validate({
|
|
|
24 |
// rules: {
|
|
|
25 |
// firstName: {required: true},
|
|
|
26 |
// lastName: {required: true},
|
|
|
27 |
// mobile: {
|
|
|
28 |
// required: true,
|
|
|
29 |
// minlength: 10,
|
|
|
30 |
// maxlength: 10
|
|
|
31 |
// },
|
|
|
32 |
// landline: {required: false},
|
|
|
33 |
// email: {
|
|
|
34 |
// required: true,
|
|
|
35 |
// email: true
|
|
|
36 |
// },
|
|
|
37 |
// dob: {required: true, data: true},
|
|
|
38 |
// anniversaryDate: {required: false,},
|
|
|
39 |
// panNo: {
|
|
|
40 |
// required: true,
|
|
|
41 |
// minlength: 10,
|
|
|
42 |
// maxlength: 10
|
|
|
43 |
// },
|
|
|
44 |
// adharNo: {
|
|
|
45 |
// required: true,
|
|
|
46 |
// minlength: 10,
|
|
|
47 |
// maxlength: 10
|
|
|
48 |
// },
|
|
|
49 |
// gstNo: {required: true},
|
|
|
50 |
// bankName: {required: true},
|
|
|
51 |
// ifscCode: {required: true},
|
|
|
52 |
// accountNo: {required: true},
|
|
|
53 |
//
|
|
|
54 |
// },
|
|
|
55 |
// messages: {
|
|
|
56 |
// firstName: {required: "Please fill First Name"},
|
|
|
57 |
// lastName: {required: "Please fill Last Name"},
|
|
|
58 |
// mobile: {required: "Please fill 10 Digit Mobile Number"},
|
|
|
59 |
// email: {required: "Please fill email"},
|
|
|
60 |
// dob: {required: "Please fill Date of Birth", data: true},
|
|
|
61 |
// anniversaryDate: {required: false,},
|
|
|
62 |
// panNo: {required: "Please fill Pan Number"},
|
|
|
63 |
// adharNo: {required: "Please fill 12 digit Aadhar Number"},
|
|
|
64 |
// gstNo: {required: "Please fill GST No"},
|
|
|
65 |
// bankName: {required: "Please fill Bank Name"},
|
|
|
66 |
// ifscCode: {required: "Please fill Ifsc Code"},
|
|
|
67 |
// accountNo: {required: "Please fill Account Number"},
|
|
|
68 |
// },
|
|
|
69 |
// submitHandler: function (form, event) {
|
|
|
70 |
// console.log("submit handler");
|
|
|
71 |
// event.preventDefault();
|
|
|
72 |
// let loiFormData = {};
|
|
|
73 |
// loiFormData['firstName'] = $('input[name="firstName"]').val();
|
|
|
74 |
// loiFormData['lastName'] = $('input[name="lastName"]').val();
|
|
|
75 |
// loiFormData['mobile'] = $('input[name="mobile"]').val();
|
|
|
76 |
// loiFormData['email'] = $('input[name="email"]').val();
|
|
|
77 |
// loiFormData['dob'] = $('input[name="dob"]').val();
|
|
|
78 |
// loiFormData['city'] = $('input[name="city"]').val();
|
|
|
79 |
// loiFormData['anniversaryDate'] = $('input[name="anniversaryDate"]').val();
|
|
|
80 |
// loiFormData['panNo'] = $('input[name="panNo"]').val();
|
|
|
81 |
// loiFormData['adharNo'] = $('input[name="adharNo"]').val();
|
|
|
82 |
// loiFormData['gstNo'] = $('input[name="gstNo"]').val();
|
|
|
83 |
// loiFormData['adharNo'] = $('input[name="adharNo"]').val();
|
|
|
84 |
// loiFormData['bankName'] = $('input[name="bankName"]').val();
|
|
|
85 |
// loiFormData['ifscCode'] = $('input[name="ifscCode"]').val();
|
|
|
86 |
// loiFormData['accountNo'] = $('input[name="accountNo"]').val();
|
|
|
87 |
// loiFormData['businessType'] = $('input[name="businessType"]').val();
|
|
|
88 |
// loiFormData['companyName'] = $('input[name="companyName"]').val();
|
|
|
89 |
// loiFormData['gstPin'] = $('input[name="gstPin"]').val();
|
|
|
90 |
// loiFormData['gstState'] = $('input[name="gstState"]').val();
|
|
|
91 |
// loiFormData['gstCity'] = $('input[name="gstCity"]').val();
|
|
|
92 |
// loiFormData['gstDistrict'] = $('input[name="gstDistrict"]').val();
|
|
|
93 |
// loiFormData['bankName'] = $('input[name="bankName"]').val();
|
|
|
94 |
// loiFormData['agreeWalletValue'] = $('input[name="agreeWalletValue"]').val();
|
|
|
95 |
// loiFormData['storeArea'] = $('input[name="storeArea"]').val();
|
|
|
96 |
// loiFormData['storePotential'] = $('input[name="storePotential"]').val();
|
|
|
97 |
// loiFormData['totaCommitmentAmount'] = $('input[name="totaCommitmentAmount"]').val();
|
|
|
98 |
// loiFormData['lessCommitReason'] = $('input[name="lessCommitReason"]').val();
|
|
|
99 |
// loiFormData['vivoCommitmentAmount'] = $('input[name="vivoCommitmentAmount"]').val();
|
|
|
100 |
// loiFormData['oppoCommitmentAmount'] = $('input[name="oppoCommitmentAmount"]').val();
|
|
|
101 |
// loiFormData['samsungCommitmentAmount'] = $('input[name="samsungCommitmentAmount"]').val();
|
|
|
102 |
// loiFormData['xiaomiCommitmentAmount'] = $('input[name="xiaomiCommitmentAmount"]').val();
|
|
|
103 |
// loiFormData['accessoriesCommitmentAmount'] = $('input[name="accessoriesCommitmentAmount"]').val();
|
|
|
104 |
// loiFormData['otherBrandsCommitmentAmount'] = $('input[name="otherBrandsCommitmentAmount"]').val();
|
|
|
105 |
// loiFormData['agreedBrandFees'] = $('input[name="agreedBrandFees"]').val();
|
|
|
106 |
// loiFormData['brandFeesCollected'] = $('input[name="brandFeesCollected"]').val();
|
|
|
107 |
// loiFormData['paymentMode'] = $('input[name="paymentMode"]').val();
|
|
|
108 |
// loiFormData['paymentReferenceNo'] = $('input[name="paymentReferenceNo"]').val();
|
|
|
109 |
// loiFormData['paymentMode'] = $('input[name="paymentMode"]').val();
|
|
|
110 |
// //let formData = objectifyForm($("form[name='Loi_Form']").serializeArray());
|
|
|
111 |
// if (confirm("Are you sure to submit form ?")) {
|
|
|
112 |
// let jsonData = JSON.stringify(loiFormData);
|
|
|
113 |
// console.log("jsonData - ", jsonData);
|
|
|
114 |
// doPostAjaxRequestWithJsonHandler(`${context}/submitLoiForm`, jsonData, function (response) {
|
|
|
115 |
// if (response) {
|
|
|
116 |
// alert("Your LOI form Submitted successfully ");
|
|
|
117 |
// pendingLoiForm("main-content");
|
|
|
118 |
//
|
|
|
119 |
// } else {
|
|
|
120 |
// alert("Your LOI form not Submitted , try again ");
|
|
|
121 |
//
|
|
|
122 |
// }
|
|
|
123 |
// });
|
|
|
124 |
// }
|
|
|
125 |
// }
|
|
|
126 |
//
|
|
|
127 |
// });
|
|
|
128 |
//
|
|
|
129 |
// });
|
|
|
130 |
|
|
|
131 |
$(document).on('click', ".submitLoiForm", function () {
|
|
|
132 |
// Gather input values
|
|
|
133 |
const referId = $('select[name="referId"]').val();
|
|
|
134 |
const billingAddress = $('select[name="billingAddress"]').val();
|
|
|
135 |
const firstName = $('input[name="firstName"]').val();
|
|
|
136 |
const lastName = $('input[name="lastName"]').val();
|
|
|
137 |
const mobile = $('input[name="mobile"]').val();
|
|
|
138 |
const email = $('input[name="email"]').val();
|
|
|
139 |
const landline = $('input[name="landline"]').val();
|
|
|
140 |
const dob = $('input[name="dob"]').val();
|
|
|
141 |
var maritalStatus = $('select[name="maritalStatus"]').val();
|
|
|
142 |
console.log("maritalStatus - ", maritalStatus);
|
|
|
143 |
const anniversaryDate = $('input[name="anniversaryDate"]').val();
|
|
|
144 |
const panNo = $('input[name="panNo"]').val();
|
|
|
145 |
const adharNo = $('input[name="adharNo"]').val();
|
|
|
146 |
const gstNo = $('input[name="gstNo"]').val();
|
|
|
147 |
const bankName = $('input[name="bankName"]').val();
|
|
|
148 |
const ifscCode = $('input[name="ifscCode"]').val();
|
|
|
149 |
const accountNo = $('input[name="accountNo"]').val();
|
|
|
150 |
const businessType = $('select[name="businessType"]').val();
|
|
|
151 |
const companyName = $('input[name="companyName"]').val();
|
|
|
152 |
const gstPin = $('input[name="gstPin"]').val();
|
|
|
153 |
const gstState = $('input[name="gstState"]').val();
|
|
|
154 |
const gstCity = $('input[name="gstCity"]').val();
|
|
|
155 |
const gstDistrict = $('input[name="gstDistrict"]').val();
|
|
|
156 |
const agreeWalletValue = $('select[name="agreeWalletValue"]').val();
|
|
|
157 |
const storeArea = $('input[name="storeArea"]').val();
|
|
|
158 |
const storePotential = $('input[name="storePotential"]').val();
|
|
|
159 |
const lessCommitReason = $('input[name="lessCommitReason"]').val();
|
|
|
160 |
const vivoCommitmentAmount = $('input[name="vivoCommitmentAmount"]').val();
|
|
|
161 |
const oppoCommitmentAmount = $('input[name="oppoCommitmentAmount"]').val();
|
|
|
162 |
const samsungCommitmentAmount = $('input[name="samsungCommitmentAmount"]').val();
|
|
|
163 |
const xiaomiCommitmentAmount = $('input[name="xiaomiCommitmentAmount"]').val();
|
|
|
164 |
const accessoriesCommitmentAmount = $('input[name="accessoriesCommitmentAmount"]').val();
|
|
|
165 |
const otherBrandsCommitmentAmount = $('input[name="otherBrandsCommitmentAmount"]').val();
|
|
|
166 |
const totalCommit = $('input[name="totaCommitmentAmount"]').val();
|
|
|
167 |
console.log("totalCommit - ", totalCommit);
|
|
|
168 |
let minCommint = totalCommit >= storePotential * (70 / 100);
|
|
|
169 |
const agreedBrandFees = $('select[name="agreedBrandFees"]').val();
|
|
|
170 |
console.log("agreedBrandFees - ", agreedBrandFees);
|
|
|
171 |
const brandFeesCollected = $('input[name="brandFeesCollected"]').val();
|
|
|
172 |
const paymentMode = $('select[name="paymentMode"]').val();
|
|
|
173 |
console.log("paymentMode - ", paymentMode);
|
|
|
174 |
const paymentReferenceNo = $('input[name="paymentReferenceNo"]').val();
|
|
|
175 |
|
|
|
176 |
|
|
|
177 |
let missingFields = [];
|
|
|
178 |
if (!firstName) missingFields.push('First Name');
|
|
|
179 |
if (!referId) missingFields.push('Refer by');
|
|
|
180 |
if (!lastName) missingFields.push('Last Name');
|
|
|
181 |
if (mobile.length < 10 || !mobile) {
|
|
|
182 |
missingFields.push('Mobile number should be 10 digit');
|
|
|
183 |
}
|
|
|
184 |
if (!minCommint) {
|
|
|
185 |
if (!lessCommitReason) missingFields.push('Less Commit Reason');
|
|
|
186 |
}
|
|
|
187 |
if (!maritalStatus) missingFields.push('Marital Status');
|
|
|
188 |
if (maritalStatus == 1) {
|
|
|
189 |
if (!anniversaryDate) missingFields.push('Anniversary Date');
|
|
|
190 |
}
|
|
|
191 |
if (!email) missingFields.push('Email');
|
|
|
192 |
if (!dob) missingFields.push('dob(Date of Birth)');
|
|
|
193 |
if (!panNo) missingFields.push('Pan Number');
|
|
|
194 |
if (!adharNo) missingFields.push('Aadhar Number');
|
|
|
195 |
if (!gstNo) missingFields.push('GST Number');
|
|
|
196 |
if (!bankName) missingFields.push('Bank Name');
|
|
|
197 |
if (!ifscCode) missingFields.push('IFSC code');
|
|
|
198 |
if (!accountNo) missingFields.push('Account Number');
|
|
|
199 |
if (!businessType) missingFields.push('businessType');
|
|
|
200 |
if (!companyName) missingFields.push('Company Name');
|
|
|
201 |
if (!agreeWalletValue) missingFields.push('Agree Wallet Value');
|
|
|
202 |
if (!storeArea) missingFields.push('storeArea');
|
|
|
203 |
if (!storePotential) missingFields.push('Store Potential');
|
|
|
204 |
if (!oppoCommitmentAmount) missingFields.push('Oppo Commitment');
|
|
|
205 |
if (!vivoCommitmentAmount) missingFields.push('Vivo Commitment');
|
|
|
206 |
if (!samsungCommitmentAmount) missingFields.push('Samsung Commitment');
|
|
|
207 |
if (!xiaomiCommitmentAmount) missingFields.push('Xiaomi Commitment');
|
|
|
208 |
if (!accessoriesCommitmentAmount) missingFields.push('Accessories Commitment');
|
|
|
209 |
if (!otherBrandsCommitmentAmount) missingFields.push('other Brands Commitment');
|
|
|
210 |
if (!agreedBrandFees) missingFields.push('Agreed Brand Fees');
|
|
|
211 |
if (!brandFeesCollected) missingFields.push('Brand Fees Collected');
|
|
|
212 |
if (!paymentMode) missingFields.push('Payment Mode');
|
|
|
213 |
if (!paymentReferenceNo) missingFields.push('Payment Reference No');
|
|
|
214 |
if (!brandFeesCollected) missingFields.push('Brand Fees Collected');
|
|
|
215 |
|
|
|
216 |
if (missingFields.length > 0) {
|
|
|
217 |
alert('The following fields are required: ' + missingFields.join(', '));
|
|
|
218 |
return;
|
|
|
219 |
}
|
|
|
220 |
|
|
|
221 |
const loiFormData = {
|
|
|
222 |
referId: referId,
|
|
|
223 |
businessType: businessType,
|
|
|
224 |
firstName: firstName,
|
|
|
225 |
lastName: lastName,
|
|
|
226 |
mobile: mobile,
|
|
|
227 |
email: email,
|
|
|
228 |
landline: landline,
|
|
|
229 |
dob: dob,
|
|
|
230 |
anniversaryDate: anniversaryDate,
|
|
|
231 |
panNo: panNo,
|
|
|
232 |
adharNo: adharNo,
|
|
|
233 |
gstNo: gstNo,
|
|
|
234 |
bankName: bankName,
|
|
|
235 |
ifscCode: ifscCode,
|
|
|
236 |
accountNo: accountNo,
|
|
|
237 |
companyName: companyName,
|
|
|
238 |
gstPin: gstPin,
|
|
|
239 |
gstState: gstState,
|
|
|
240 |
gstCity: gstCity,
|
|
|
241 |
gstDistrict: gstDistrict,
|
|
|
242 |
agreeWalletValue: agreeWalletValue,
|
|
|
243 |
storeArea: storeArea,
|
|
|
244 |
storePotential: storePotential,
|
|
|
245 |
lessCommitReason: lessCommitReason,
|
|
|
246 |
vivoCommitmentAmount: vivoCommitmentAmount,
|
|
|
247 |
oppoCommitmentAmount: oppoCommitmentAmount,
|
|
|
248 |
samsungCommitmentAmount: samsungCommitmentAmount,
|
|
|
249 |
xiaomiCommitmentAmount: xiaomiCommitmentAmount,
|
|
|
250 |
accessoriesCommitmentAmount: accessoriesCommitmentAmount,
|
|
|
251 |
otherBrandsCommitmentAmount: otherBrandsCommitmentAmount,
|
|
|
252 |
agreedBrandFees: agreedBrandFees,
|
|
|
253 |
brandFeesCollected: brandFeesCollected,
|
|
|
254 |
paymentMode: paymentMode,
|
|
|
255 |
paymentReferenceNo: paymentReferenceNo,
|
|
|
256 |
billingAddress: billingAddress
|
|
|
257 |
};
|
|
|
258 |
console.log("form data - ", loiFormData);
|
|
|
259 |
if (confirm("Are you sure to submit the form ?")) {
|
|
|
260 |
doPostAjaxRequestWithJsonHandler(`${context}/submitLoiForm`, JSON.stringify(loiFormData), function (response) {
|
|
|
261 |
console.log('responsee', response);
|
| 33507 |
tejus.loha |
262 |
if (response) {
|
|
|
263 |
alert("Your LOI form Submitted successfully ");
|
|
|
264 |
pendingLoiForm("main-content");
|
|
|
265 |
|
|
|
266 |
} else {
|
|
|
267 |
alert("Your LOI form not Submitted , try again ");
|
|
|
268 |
doGetAjaxRequestHandler(`${context}/onboardingForm`,
|
|
|
269 |
function (response) {
|
|
|
270 |
$('#' + 'main-content').html(response);
|
|
|
271 |
});
|
|
|
272 |
}
|
|
|
273 |
});
|
|
|
274 |
}
|
|
|
275 |
});
|
| 33577 |
tejus.loha |
276 |
// $(document).on('click', ".submitLoiForm", function () {
|
|
|
277 |
// if (confirm("Are you sure to submit form ?")) {
|
|
|
278 |
// let formData = objectifyForm($("form[name='Loi_Form']").serializeArray());
|
|
|
279 |
// for (var key in formData) {
|
|
|
280 |
// if ((formData.hasOwnProperty(key) && formData[key].trim() === '')||formData[key].trim() !== null) {
|
|
|
281 |
// alert("The (" + key + ") value is blank please fill this field !");
|
|
|
282 |
// return false;
|
|
|
283 |
// }
|
|
|
284 |
// }
|
|
|
285 |
// let jsonData = JSON.stringify(formData);
|
|
|
286 |
// doPostAjaxRequestWithJsonHandler(`${context}/submitLoiForm`, jsonData, function (response) {
|
|
|
287 |
// if (response) {
|
|
|
288 |
// alert("Your LOI form Submitted successfully ");
|
|
|
289 |
// pendingLoiForm("main-content");
|
|
|
290 |
//
|
|
|
291 |
// } else {
|
|
|
292 |
// alert("Your LOI form not Submitted , try again ");
|
|
|
293 |
// doGetAjaxRequestHandler(`${context}/onboardingForm`,
|
|
|
294 |
// function (response) {
|
|
|
295 |
// $('#' + 'main-content').html(response);
|
|
|
296 |
// });
|
|
|
297 |
// }
|
|
|
298 |
// });
|
|
|
299 |
// } else {
|
|
|
300 |
// //nothing to do now
|
|
|
301 |
// }
|
|
|
302 |
//
|
|
|
303 |
// });
|
| 33507 |
tejus.loha |
304 |
$(document).on('click', ".updateOnboardingForm", function () {
|
|
|
305 |
let loiId = $(this).val();
|
|
|
306 |
console.log("form id - ", loiId);
|
|
|
307 |
doGetAjaxRequestHandler(context + "/updateOnboardingForm?loiId=" + loiId,
|
|
|
308 |
function (response) {
|
|
|
309 |
$('#' + 'main-content').html(response);
|
|
|
310 |
});
|
|
|
311 |
});
|
|
|
312 |
|
| 33577 |
tejus.loha |
313 |
$(document).on('click', ".updateLoiFormData", function () {
|
| 33507 |
tejus.loha |
314 |
let loiId = $(this).val();
|
|
|
315 |
let formData = {};
|
|
|
316 |
let jsonData = JSON.stringify(objectifyForm($("form[name='Loi_Form']").serializeArray())).trim();
|
| 33577 |
tejus.loha |
317 |
doPostAjaxRequestWithJsonHandler(`${context}/updateLoiFormData?loiId=` + loiId, jsonData, function (response) {
|
| 33507 |
tejus.loha |
318 |
if (response) {
|
|
|
319 |
alert("LOI Form Updated Successfully..");
|
|
|
320 |
}
|
|
|
321 |
pendingLoiForm("main-content");
|
|
|
322 |
});
|
|
|
323 |
|
|
|
324 |
});
|
|
|
325 |
|
|
|
326 |
$(document).on('click', ".pending-onboarding-form", function () {
|
|
|
327 |
doGetAjaxRequestHandler(`${context}/pendingOnboardingForm`,
|
|
|
328 |
function (response) {
|
|
|
329 |
$('#' + 'main-content').html(response);
|
|
|
330 |
});
|
|
|
331 |
});
|
|
|
332 |
$(document).on('click', "#addBrandFeePayment", function () {
|
|
|
333 |
let formData = objectifyForm($("form[name='brandFeeCollectionForm']").serializeArray());
|
|
|
334 |
let loiId = $(this).val();
|
|
|
335 |
console.log("form id -", loiId);
|
|
|
336 |
for (var key in formData) {
|
|
|
337 |
if (formData.hasOwnProperty(key) && formData[key].trim() === '') {
|
|
|
338 |
alert("The (" + key + ") value is blank please fill this field !");
|
|
|
339 |
return false;
|
|
|
340 |
}
|
|
|
341 |
}
|
|
|
342 |
let jsonData = JSON.stringify(formData);
|
| 33525 |
tejus.loha |
343 |
if (confirm("Are you sure all payment details are correct ? once payment is add ,you can't able to change details.")) {
|
|
|
344 |
doPostAjaxRequestWithJsonHandler(`${context}/brandfeeCollection?loiId=` + loiId, jsonData, function (response) {
|
|
|
345 |
console.log("brand collection...");
|
|
|
346 |
if (response) {
|
|
|
347 |
alert("Payment add successfully...");
|
|
|
348 |
pendingLoiForm("main-content");
|
| 33507 |
tejus.loha |
349 |
|
| 33525 |
tejus.loha |
350 |
} else {
|
|
|
351 |
//console
|
|
|
352 |
}
|
|
|
353 |
});
|
|
|
354 |
} else {
|
|
|
355 |
//Do nothing
|
|
|
356 |
}
|
| 33507 |
tejus.loha |
357 |
|
|
|
358 |
});
|
|
|
359 |
|
|
|
360 |
$(document).on('click', ".generateLoi", function () {
|
|
|
361 |
let loiId = $(this).val();
|
|
|
362 |
console.log("form id - ", loiId);
|
|
|
363 |
doGetAjaxRequestHandler(context + "/generateLoi?loiId=" + loiId,
|
|
|
364 |
function (response) {
|
|
|
365 |
$('#' + 'main-content').html(response);
|
|
|
366 |
});
|
|
|
367 |
});
|
|
|
368 |
|
|
|
369 |
$(document).on('click', "#LOI_otp", function () {
|
|
|
370 |
let loiId = $(this).val();
|
|
|
371 |
console.log("loiId-", loiId);
|
| 33577 |
tejus.loha |
372 |
if (confirm("Are you sure to send OTP ?")) {
|
|
|
373 |
doPostAjaxRequestHandler(`${context}/loiAcceptanceOtp?loiId=` + loiId,
|
|
|
374 |
function (response) {
|
|
|
375 |
alert(response);
|
|
|
376 |
doGetAjaxRequestHandler(context + "/generateLoi?loiId=" + loiId,
|
|
|
377 |
function (response) {
|
|
|
378 |
$('#' + 'main-content').html(response);
|
|
|
379 |
});
|
|
|
380 |
});
|
|
|
381 |
} else {
|
|
|
382 |
alert("OTP not send .");
|
|
|
383 |
}
|
|
|
384 |
|
| 33507 |
tejus.loha |
385 |
});
|
|
|
386 |
|
|
|
387 |
|
|
|
388 |
$(document).on('click', ".onboardingFormDone", function () {
|
|
|
389 |
let loiId = $(this).val();
|
|
|
390 |
var loi = $(document).find(".upload-form-loi input[type=file]").val();
|
|
|
391 |
console.log("form id - ", loiId);
|
|
|
392 |
doPostAjaxRequestHandler(`${context}/uploadLoi?loiId=${loiId}&loi=${loi}`,
|
|
|
393 |
function (response) {
|
|
|
394 |
$('#' + 'main-content').html(response);
|
|
|
395 |
});
|
|
|
396 |
});
|
|
|
397 |
|
|
|
398 |
//confirmPayment
|
| 33525 |
tejus.loha |
399 |
$(document).on('click', ".paymentConfirmBtn", function () {
|
|
|
400 |
let approval = $(this).data('approval');
|
| 33507 |
tejus.loha |
401 |
let bfcId = $(this).val();
|
| 33525 |
tejus.loha |
402 |
let description = "All details are correct";
|
|
|
403 |
if (confirm("Are you sure to confirm this payment ?")) {
|
|
|
404 |
doPutAjaxRequestHandler(`${context}/feePaymentApproval?bfcId=${bfcId}&feePaymentStatus=${approval}&description=${description}`,
|
|
|
405 |
function (response) {
|
|
|
406 |
if (response) {
|
|
|
407 |
alert("Payment is confirm successfully");
|
|
|
408 |
}
|
|
|
409 |
pendingLoiForm("main-content");
|
|
|
410 |
});
|
|
|
411 |
} else {
|
|
|
412 |
//do nothing
|
|
|
413 |
}
|
|
|
414 |
});
|
|
|
415 |
|
|
|
416 |
$(document).on('click', ".paymentRejectBtn", function () {
|
| 33507 |
tejus.loha |
417 |
let approval = $(this).data('approval');
|
| 33525 |
tejus.loha |
418 |
let bfcId = $(this).val();
|
|
|
419 |
let description;
|
|
|
420 |
description = prompt("Reason for rejection..");
|
|
|
421 |
if (description !== null) {
|
|
|
422 |
if (confirm("Are you sure to Reject this payment ?")) {
|
|
|
423 |
doPutAjaxRequestHandler(`${context}/feePaymentApproval?bfcId=${bfcId}&feePaymentStatus=${approval}&description=${description}`,
|
|
|
424 |
function (response) {
|
|
|
425 |
if (!response) {
|
|
|
426 |
alert("Payment is rejected successfully");
|
|
|
427 |
}
|
|
|
428 |
pendingLoiForm("main-content");
|
|
|
429 |
});
|
|
|
430 |
} else {
|
|
|
431 |
//do nothing
|
|
|
432 |
}
|
|
|
433 |
} else {
|
|
|
434 |
alert("Please mention the reason as description and try again");
|
|
|
435 |
}
|
| 33507 |
tejus.loha |
436 |
});
|
|
|
437 |
$(document).on('click', ".upload-document-form", function () {
|
|
|
438 |
let loiId = $(this).val();
|
|
|
439 |
doPutAjaxRequestHandler(`${context}/uploadDocumentForm?loiId=${loiId}`,
|
|
|
440 |
function (response) {
|
|
|
441 |
$('#' + 'main-content').html(response);
|
|
|
442 |
});
|
|
|
443 |
});
|
|
|
444 |
$(document).on('input', 'table#OnboardingDocumentTable input[type=file]', function () {
|
|
|
445 |
if (confirm('Confirm file upload ?')) {
|
|
|
446 |
var fileSelector = $(this)[0];
|
|
|
447 |
if (fileSelector != undefined
|
|
|
448 |
&& fileSelector.files[0] != undefined) {
|
|
|
449 |
var file = this.files[0];
|
|
|
450 |
console.log("file", file);
|
|
|
451 |
let fileInput = $(this);
|
|
|
452 |
console.log("fileInput", file);
|
|
|
453 |
uploadDocument(file, function (documentId) {
|
|
|
454 |
console.log("documentIdzzz : ", documentId);
|
|
|
455 |
fileInput.closest('td').find(".documentId").val(documentId);
|
|
|
456 |
});
|
|
|
457 |
}
|
|
|
458 |
}
|
|
|
459 |
});
|
|
|
460 |
$(document).on('click', ".mk_docApproval", function () {
|
|
|
461 |
let loiId = $(this).data('form_id');
|
|
|
462 |
let docMasterId = $(this).data('doc_master_id');
|
|
|
463 |
let flag = $(this).data('flag');
|
|
|
464 |
console.log("flag -", flag);
|
|
|
465 |
doPutAjaxRequestHandler(`${context}/documentVerify?loiId=${loiId}&docMasterId=${docMasterId}&flag=${flag}`,
|
|
|
466 |
function (response) {
|
|
|
467 |
alert(response);
|
|
|
468 |
doPutAjaxRequestHandler(`${context}/uploadDocumentForm?loiId=${loiId}`,
|
|
|
469 |
function (response) {
|
|
|
470 |
$('#' + 'main-content').html(response);
|
|
|
471 |
});
|
|
|
472 |
|
|
|
473 |
});
|
|
|
474 |
});
|
|
|
475 |
$(document).on('click', "#uploadDocumentbtn1", function () {
|
|
|
476 |
if (confirm("Are you sure to upload all documents ?")) {
|
|
|
477 |
var loiId = $(this).val();
|
|
|
478 |
var loiDocModels = [];
|
|
|
479 |
console.log("loiId -", loiId);
|
|
|
480 |
$("#OnboardingDocumentTable > tbody > tr").each(function (rowIndex) {
|
|
|
481 |
var marsterId = $(this).find(".masterId").val();
|
|
|
482 |
var docId = $(this).find(".documentId").val();
|
|
|
483 |
var docName = $(this).find(".documentName").val();
|
|
|
484 |
console.log("marsterId -", marsterId);
|
|
|
485 |
var loiDocModel = {
|
|
|
486 |
documentId: docId,
|
|
|
487 |
documentName: docName,
|
|
|
488 |
documentMasterId: marsterId
|
|
|
489 |
};
|
|
|
490 |
loiDocModels.push(loiDocModel);
|
|
|
491 |
});
|
|
|
492 |
console.log(loiDocModels);
|
|
|
493 |
var loiDocModelData = JSON.stringify(loiDocModels);
|
|
|
494 |
doPostAjaxRequestWithJsonHandler(`${context}/uploadOnboardingDocument?loiId=${loiId}`, loiDocModelData, function (response) {
|
|
|
495 |
console.log('response-', response);
|
|
|
496 |
pendingLoiForm("main-content");
|
|
|
497 |
});
|
|
|
498 |
} else {
|
|
|
499 |
//Nothing to do
|
|
|
500 |
}
|
|
|
501 |
|
|
|
502 |
|
|
|
503 |
});
|
|
|
504 |
$(document).on('click', ".documnet-verifed", function () {
|
|
|
505 |
let loiId = $(this).val();
|
|
|
506 |
if (confirm("Are you sure to verify All document ?")) {
|
|
|
507 |
doPutAjaxRequestHandler(`${context}/documentApproved?loiId=${loiId}`,
|
|
|
508 |
function (response) {
|
|
|
509 |
alert(response);
|
|
|
510 |
pendingLoiForm("main-content");
|
|
|
511 |
});
|
|
|
512 |
} else {
|
|
|
513 |
console.log(" All docs not verify");
|
|
|
514 |
//Nothing
|
|
|
515 |
}
|
|
|
516 |
});
|
|
|
517 |
$(document).on('click', ".loiFormComplete", function () {
|
|
|
518 |
let loiId = $(this).val();
|
|
|
519 |
if (confirm("Are you sure all things are done ?")) {
|
|
|
520 |
doPutAjaxRequestHandler(`${context}/loiFormComplete?loiId=${loiId}`,
|
|
|
521 |
function (response) {
|
|
|
522 |
alert(response);
|
|
|
523 |
});
|
|
|
524 |
pendingLoiForm("main-content");
|
|
|
525 |
|
|
|
526 |
} else {
|
|
|
527 |
console.log("Loi form not completed !");
|
|
|
528 |
//Nothing
|
|
|
529 |
}
|
|
|
530 |
});
|
|
|
531 |
$(document).on('click', ".deleteLoiForm", function () {
|
|
|
532 |
let loiId = $(this).val();
|
|
|
533 |
if (confirm("Are you sure to delete ?")) {
|
|
|
534 |
doPutAjaxRequestHandler(`${context}/deleteLoiForm?loiId=${loiId}`,
|
|
|
535 |
function (response) {
|
|
|
536 |
if (response) {
|
|
|
537 |
alert("Loi form deleted ");
|
|
|
538 |
} else {
|
|
|
539 |
//nothing to do
|
|
|
540 |
}
|
|
|
541 |
});
|
|
|
542 |
doGetAjaxRequestHandler(`${context}/pendingOnboardingForm`,
|
|
|
543 |
function (response) {
|
|
|
544 |
$('#' + 'main-content').html(response);
|
|
|
545 |
});
|
|
|
546 |
|
|
|
547 |
} else {
|
|
|
548 |
console.log("");
|
|
|
549 |
//Nothing
|
|
|
550 |
}
|
|
|
551 |
});
|
|
|
552 |
|
|
|
553 |
$(document).on('click', ".CompletedLoiForm", function () {
|
|
|
554 |
doPutAjaxRequestHandler(`${context}/completedLoiForms`,
|
|
|
555 |
function (response) {
|
|
|
556 |
$('#' + 'main-content').html(response);
|
|
|
557 |
});
|
|
|
558 |
});
|
|
|
559 |
|
|
|
560 |
$(document).on('click', "#createNewOnboardingPanel", function () {
|
|
|
561 |
let loiId = $(this).val();
|
|
|
562 |
let authId = $(this).closest('tr').find('.authId').val();
|
|
|
563 |
if (authId != " ") {
|
|
|
564 |
|
|
|
565 |
doPutAjaxRequestHandler(`${context}/createNewOnboardingPanel?loiId=${loiId}&authId=${authId}`,
|
|
|
566 |
function (response) {
|
|
|
567 |
if (response) {
|
|
|
568 |
doPutAjaxRequestHandler(`${context}/completedLoiForms`,
|
|
|
569 |
function (response) {
|
|
|
570 |
$('#' + 'main-content').html(response);
|
|
|
571 |
});
|
|
|
572 |
} else {
|
|
|
573 |
//nothing
|
|
|
574 |
}
|
|
|
575 |
|
|
|
576 |
});
|
|
|
577 |
} else {
|
|
|
578 |
alert("Please choose RBM ");
|
|
|
579 |
}
|
|
|
580 |
|
|
|
581 |
});
|
|
|
582 |
|
|
|
583 |
function pendingLoiForm(domId) {
|
|
|
584 |
doGetAjaxRequestHandler(`${context}/pendingOnboardingForm`,
|
|
|
585 |
function (response) {
|
|
|
586 |
$('#' + domId).html(response);
|
|
|
587 |
});
|
|
|
588 |
}
|