| 25093 |
amit.gupta |
1 |
var saleSearchObj = saleSearchObj || {};
|
|
|
2 |
saleSearchObj.searchText = "";
|
|
|
3 |
saleSearchObj.searchType = "";
|
|
|
4 |
saleSearchObj.startTime = "";
|
|
|
5 |
saleSearchObj.endTime = "";
|
| 23343 |
ashik.ali |
6 |
|
|
|
7 |
$(function() {
|
| 23973 |
govind |
8 |
|
| 27754 |
amit.gupta |
9 |
$(document).on('click', ".pending_fofo_order", function() {
|
| 26647 |
tejbeer |
10 |
console.log("Helloo")
|
|
|
11 |
loadPendingOrder("main-content");
|
|
|
12 |
});
|
|
|
13 |
|
| 28339 |
tejbeer |
14 |
$(document).on('click', ".billed_order_item", function() {
|
|
|
15 |
console.log("Helloo")
|
|
|
16 |
loadBilledOrder("main-content");
|
|
|
17 |
});
|
|
|
18 |
|
|
|
19 |
$(document).on('click', ".unsettled_order_item", function() {
|
| 28350 |
tejbeer |
20 |
|
| 28339 |
tejbeer |
21 |
loadUnsettledOrder("main-content");
|
|
|
22 |
});
|
|
|
23 |
|
|
|
24 |
$(document).on('click', ".settled_order_item", function() {
|
| 28350 |
tejbeer |
25 |
|
| 28339 |
tejbeer |
26 |
loadSettledOrder("main-content");
|
|
|
27 |
});
|
|
|
28 |
|
| 28350 |
tejbeer |
29 |
$(document).on('click', ".verified_order_item", function() {
|
| 28339 |
tejbeer |
30 |
|
| 28350 |
tejbeer |
31 |
loadVerifiedOrder("main-content");
|
|
|
32 |
});
|
| 28339 |
tejbeer |
33 |
|
| 28350 |
tejbeer |
34 |
|
|
|
35 |
|
| 28339 |
tejbeer |
36 |
$(document).on('click', ".claim_raised_order_item", function() {
|
|
|
37 |
console.log("Helloo")
|
|
|
38 |
loadClaimedOrder("main-content");
|
|
|
39 |
});
|
|
|
40 |
|
| 27755 |
amit.gupta |
41 |
$(document).on('click', "button.pendingOrderDetail",
|
| 27819 |
tejbeer |
42 |
function() {
|
|
|
43 |
doGetAjaxRequestHandler(context
|
|
|
44 |
+ "/getPendingOrderItem?orderId=" + $(this).data('orderid'), function(
|
|
|
45 |
response) {
|
|
|
46 |
$('.pending-order-container').html(response);
|
| 26647 |
tejbeer |
47 |
});
|
| 27819 |
tejbeer |
48 |
});
|
| 26647 |
tejbeer |
49 |
|
| 27755 |
amit.gupta |
50 |
$(document).on('click', ".pendingOrderCancel",
|
| 27819 |
tejbeer |
51 |
function() {
|
| 26721 |
tejbeer |
52 |
|
| 27819 |
tejbeer |
53 |
var orderId = $(this).data('orderid');
|
|
|
54 |
console.log(orderId);
|
|
|
55 |
if (confirm("Are you sure you want to cancel the order!") == true) {
|
|
|
56 |
doPostAjaxRequestHandler(context
|
|
|
57 |
+ "/cancelPendingOrder?id=" + orderId,
|
|
|
58 |
function(response) {
|
|
|
59 |
if (response == 'true') {
|
|
|
60 |
alert("successfully Cancel");
|
|
|
61 |
loadPendingOrder("main-content");
|
| 26721 |
tejbeer |
62 |
}
|
|
|
63 |
});
|
|
|
64 |
|
| 27819 |
tejbeer |
65 |
return false;
|
|
|
66 |
}
|
|
|
67 |
|
|
|
68 |
});
|
|
|
69 |
|
| 26721 |
tejbeer |
70 |
|
| 28339 |
tejbeer |
71 |
$(document).on('click', ".pendingOrderItemDelivered",
|
|
|
72 |
function() {
|
|
|
73 |
|
|
|
74 |
var orderItemId = $(this).data('poitemid');
|
|
|
75 |
if (confirm("Are you sure you want to delivered the order item!") == true) {
|
|
|
76 |
doPostAjaxRequestHandler(context
|
|
|
77 |
+ "/deliveredPendingOrderItem?id="
|
|
|
78 |
+ orderItemId, function(response) {
|
|
|
79 |
if (response == 'true') {
|
|
|
80 |
alert("successfully delivered marked");
|
|
|
81 |
loadBilledOrder("main-content");
|
|
|
82 |
}
|
|
|
83 |
});
|
|
|
84 |
|
|
|
85 |
return false;
|
|
|
86 |
}
|
|
|
87 |
|
|
|
88 |
});
|
|
|
89 |
|
|
|
90 |
$(document).on('click', ".raiseClaim",
|
|
|
91 |
function() {
|
|
|
92 |
|
|
|
93 |
var orderItemId = $(this).data('poitemid');
|
|
|
94 |
if (confirm("Are you sure you want to raise the claim!") == true) {
|
|
|
95 |
doPostAjaxRequestHandler(context
|
|
|
96 |
+ "/raiseClaimOrderItem?id="
|
|
|
97 |
+ orderItemId, function(response) {
|
|
|
98 |
if (response == 'true') {
|
|
|
99 |
alert("successfully claim raised");
|
|
|
100 |
loadClaimedOrder("main-content");
|
|
|
101 |
}
|
|
|
102 |
});
|
|
|
103 |
|
|
|
104 |
return false;
|
|
|
105 |
}
|
|
|
106 |
|
|
|
107 |
});
|
|
|
108 |
|
| 28350 |
tejbeer |
109 |
$(document).on('click', ".verify-order-item",
|
|
|
110 |
function() {
|
|
|
111 |
|
|
|
112 |
var orderItemId = $(this).data('poitemid');
|
|
|
113 |
if (confirm("Are you sure you want to verify the order!") == true) {
|
|
|
114 |
doPostAjaxRequestHandler(context
|
|
|
115 |
+ "/verifyOrderItem?id="
|
|
|
116 |
+ orderItemId, function(response) {
|
|
|
117 |
if (response == 'true') {
|
|
|
118 |
alert("successfully verified");
|
|
|
119 |
loadPendingOrder("main-content");
|
|
|
120 |
}
|
|
|
121 |
});
|
|
|
122 |
|
|
|
123 |
return false;
|
|
|
124 |
}
|
|
|
125 |
|
|
|
126 |
});
|
|
|
127 |
|
| 28352 |
tejbeer |
128 |
$(document).on('click', ".cancel-order-item",
|
|
|
129 |
function() {
|
|
|
130 |
|
|
|
131 |
var orderItemId = $(this).data('poitemid');
|
|
|
132 |
doGetAjaxRequestHandler(context
|
|
|
133 |
+ "/getPendingOrderItemById?id=" + orderItemId, function(response) {
|
|
|
134 |
$('.cancel-online-order-container .modal-content').html(response);
|
|
|
135 |
});
|
|
|
136 |
});
|
|
|
137 |
|
|
|
138 |
|
|
|
139 |
$(document).on('click', ".cancel-pending-order",
|
|
|
140 |
function() {
|
|
|
141 |
var orderItemId = $(this).data('poitemid');
|
|
|
142 |
var reason = $('#selectCancelreason').val();
|
|
|
143 |
console.log(reason)
|
|
|
144 |
|
|
|
145 |
if (reason === "") {
|
|
|
146 |
alert("Reason is required");
|
|
|
147 |
return false;
|
|
|
148 |
}
|
|
|
149 |
if (reason == null) {
|
|
|
150 |
alert("Reason is required");
|
|
|
151 |
return false;
|
|
|
152 |
}
|
|
|
153 |
if (confirm("Are you sure you want to cancel the order!") == true) {
|
|
|
154 |
doPostAjaxRequestHandler(context
|
|
|
155 |
+ "/cancelPendingOrderItem?id="
|
|
|
156 |
+ orderItemId + "&reason=" + reason, function(response) {
|
|
|
157 |
if (response == 'true') {
|
|
|
158 |
alert("successfully cancel");
|
|
|
159 |
$('#cancelOnlineOrder').modal('hide');
|
|
|
160 |
$('.modal-backdrop').remove();
|
|
|
161 |
|
|
|
162 |
loadPendingOrder("main-content");
|
|
|
163 |
|
|
|
164 |
}
|
|
|
165 |
});
|
|
|
166 |
|
|
|
167 |
return false;
|
|
|
168 |
|
|
|
169 |
}
|
|
|
170 |
|
|
|
171 |
});
|
|
|
172 |
|
| 27754 |
amit.gupta |
173 |
$(document).on('click', ".sale-history", function() {
|
| 23343 |
ashik.ali |
174 |
console.log("Sale History Button Clicked...")
|
| 23973 |
govind |
175 |
saleHistory("main-content", "", "", startDate, endDate);
|
| 23343 |
ashik.ali |
176 |
});
|
| 24880 |
govind |
177 |
|
| 27754 |
amit.gupta |
178 |
$(document).on('click', ".insurance-policy-details", function() {
|
| 24880 |
govind |
179 |
console.log("insurance-policy-details");
|
|
|
180 |
insurancePolicyDetails("main-content");
|
|
|
181 |
});
|
|
|
182 |
|
| 27861 |
tejbeer |
183 |
$(document).on('change', '.fofoLineItemAmount',
|
|
|
184 |
function() {
|
|
|
185 |
var amount = 0;
|
|
|
186 |
var oldtotalAmount = 0;
|
|
|
187 |
console.log(oldtotalAmount)
|
|
|
188 |
$('#fofo-item-table')
|
|
|
189 |
.find('tr')
|
|
|
190 |
.each(
|
|
|
191 |
function() {
|
|
|
192 |
var row = $(this);
|
|
|
193 |
console.log(row);
|
|
|
194 |
|
|
|
195 |
var currentRow = $(this)
|
|
|
196 |
.closest("tr");
|
|
|
197 |
|
|
|
198 |
var col5 = currentRow.find(
|
|
|
199 |
"td:eq(3) input[type='number']").val();
|
|
|
200 |
|
|
|
201 |
|
|
|
202 |
oldtotalAmount = currentRow.find(
|
|
|
203 |
"td:eq(5)").html();
|
|
|
204 |
|
|
|
205 |
console.log(col5);
|
|
|
206 |
if (col5 != undefined) {
|
|
|
207 |
if (col5 != 0) {
|
|
|
208 |
amount = amount + parseInt(col5, 10);
|
|
|
209 |
|
|
|
210 |
}
|
|
|
211 |
}
|
|
|
212 |
});
|
|
|
213 |
|
|
|
214 |
|
|
|
215 |
|
|
|
216 |
$("#totalAmount").text(amount);
|
|
|
217 |
|
|
|
218 |
});
|
|
|
219 |
|
| 27755 |
amit.gupta |
220 |
$(document).on('click', ".updatePaymentDetails",
|
| 27819 |
tejbeer |
221 |
function() {
|
|
|
222 |
console
|
|
|
223 |
.log("updatePaymentDetails target Button Clicked...");
|
|
|
224 |
var i = 1;
|
| 27861 |
tejbeer |
225 |
var paymentOptionsTotalAmount = 0;
|
| 27819 |
tejbeer |
226 |
var invoiceNumber = $(this).data('invoicenumber');
|
|
|
227 |
var fofoId = $(this).data('fofoid');
|
| 27861 |
tejbeer |
228 |
var totalAmount = $('#editAmount').val();
|
| 27819 |
tejbeer |
229 |
var totalNumberOfPaymentOptionId = $(this).data(
|
|
|
230 |
'totalnumberofpaymentoptionid');
|
|
|
231 |
console.log("totalNumberOfPaymentOptionId"
|
|
|
232 |
+ totalNumberOfPaymentOptionId);
|
|
|
233 |
var referenceId = $(this).data('orderid');
|
|
|
234 |
var referenceType = "ORDER";
|
|
|
235 |
var createdTimeStamp = $(this).data('createddatetime');
|
|
|
236 |
console.log(createdTimeStamp);
|
|
|
237 |
console.log(fofoId);
|
|
|
238 |
console.log(referenceId);
|
|
|
239 |
console.log(invoiceNumber);
|
|
|
240 |
console.log(referenceType);
|
|
|
241 |
var paymentOptionTransactionModels = [];
|
| 27861 |
tejbeer |
242 |
var jsonObject = {};
|
| 27819 |
tejbeer |
243 |
var inputvalues = {};
|
|
|
244 |
$('.paymentOptions input')
|
|
|
245 |
.each(
|
| 24105 |
govind |
246 |
function() {
|
| 27819 |
tejbeer |
247 |
console.log($(this).val())
|
| 27861 |
tejbeer |
248 |
paymentOptionsTotalAmount += parseInt($(this).val(), 10)
|
| 27819 |
tejbeer |
249 |
if (!isFinite($(this).val())) {
|
|
|
250 |
return;
|
|
|
251 |
}
|
|
|
252 |
inputvalues = {};
|
|
|
253 |
inputvalues['paymentOptionId'] = $(
|
|
|
254 |
this).data(
|
|
|
255 |
'payment-option-id');
|
|
|
256 |
inputvalues['amount'] = $(this)
|
|
|
257 |
.val();
|
|
|
258 |
inputvalues['createdTimeStamp'] = createdTimeStamp;
|
| 24105 |
govind |
259 |
console
|
| 27819 |
tejbeer |
260 |
.log(inputvalues['createdTimeStamp']);
|
|
|
261 |
if (!inputvalues['amount']) {
|
|
|
262 |
inputvalues['amount'] = "0";
|
| 24880 |
govind |
263 |
}
|
| 27819 |
tejbeer |
264 |
console.log("inputvalues['amount']"
|
|
|
265 |
+ inputvalues['amount']);
|
|
|
266 |
paymentOptionTransactionModels
|
|
|
267 |
.push(inputvalues);
|
|
|
268 |
});
|
|
|
269 |
if (paymentOptionTransactionModels.length != totalNumberOfPaymentOptionId) {
|
|
|
270 |
alert("Sending less or more paymentOptionIds for"
|
|
|
271 |
+ fofoId);
|
|
|
272 |
return false;
|
|
|
273 |
}
|
| 27861 |
tejbeer |
274 |
|
|
|
275 |
|
|
|
276 |
|
|
|
277 |
var ItemIdsAmountArray = [];
|
|
|
278 |
var itemIdsAmount;
|
|
|
279 |
$('#fofo-item-table')
|
|
|
280 |
.find('tr')
|
|
|
281 |
.each(
|
|
|
282 |
function() {
|
|
|
283 |
var row = $(this);
|
|
|
284 |
console.log(row);
|
|
|
285 |
|
|
|
286 |
|
|
|
287 |
|
|
|
288 |
var currentRow = $(this)
|
|
|
289 |
.closest("tr");
|
|
|
290 |
|
|
|
291 |
var itemId = currentRow.find(
|
|
|
292 |
"td:eq(0)").html();
|
|
|
293 |
|
|
|
294 |
var col5 = currentRow.find(
|
|
|
295 |
"td:eq(3) input[type='number']").val();
|
|
|
296 |
var fofoItemId = currentRow.find(
|
|
|
297 |
"td:eq(3) input[type='hidden']").val();
|
|
|
298 |
console.log(itemId)
|
|
|
299 |
|
|
|
300 |
console.log(col5);
|
|
|
301 |
if (col5 != undefined) {
|
|
|
302 |
if (col5 != 0) {
|
|
|
303 |
|
|
|
304 |
itemIdsAmount = {
|
|
|
305 |
"fofoItemId": fofoItemId,
|
|
|
306 |
"amount": col5,
|
|
|
307 |
"itemId": itemId
|
|
|
308 |
|
|
|
309 |
}
|
|
|
310 |
console.log(itemIdsAmount);
|
|
|
311 |
ItemIdsAmountArray.push(itemIdsAmount);
|
|
|
312 |
|
|
|
313 |
console.log(ItemIdsAmountArray)
|
|
|
314 |
}
|
|
|
315 |
}
|
|
|
316 |
});
|
|
|
317 |
|
|
|
318 |
|
|
|
319 |
var totalAmount = $("#totalAmount").html();
|
|
|
320 |
console.log(totalAmount)
|
|
|
321 |
console.log(paymentOptionsTotalAmount)
|
|
|
322 |
if (paymentOptionsTotalAmount != totalAmount) {
|
|
|
323 |
alert("Payment Options and Total Amount are not Same");
|
|
|
324 |
return false;
|
|
|
325 |
}
|
|
|
326 |
|
| 27819 |
tejbeer |
327 |
console.log(paymentOptionTransactionModels);
|
| 27861 |
tejbeer |
328 |
jsonObject['paymentOptionTransactionModel'] = paymentOptionTransactionModels;
|
|
|
329 |
jsonObject['itemAmountModel'] = ItemIdsAmountArray;
|
|
|
330 |
|
|
|
331 |
console.log(jsonObject);
|
| 27819 |
tejbeer |
332 |
if (confirm("Are you sure you want to update paymentTransaction!") == true) {
|
|
|
333 |
doPutAjaxRequestWithJsonHandler(
|
|
|
334 |
context
|
|
|
335 |
+ "/updatePaymentTransaction?referenceId="
|
|
|
336 |
+ referenceId + "&referenceType="
|
|
|
337 |
+ referenceType + "&fofoId="
|
| 27861 |
tejbeer |
338 |
+ fofoId + "&totalAmount=" + totalAmount,
|
| 27819 |
tejbeer |
339 |
JSON
|
| 27861 |
tejbeer |
340 |
.stringify(jsonObject),
|
| 27819 |
tejbeer |
341 |
function(response) {
|
|
|
342 |
if (response === 'true') {
|
|
|
343 |
alert("successfully added");
|
|
|
344 |
loadSearchOrderDetails(
|
|
|
345 |
invoiceNumber,
|
|
|
346 |
"search-order-details-container");
|
| 24105 |
govind |
347 |
}
|
|
|
348 |
});
|
| 27819 |
tejbeer |
349 |
}
|
| 24105 |
govind |
350 |
|
| 27819 |
tejbeer |
351 |
});
|
|
|
352 |
|
| 27755 |
amit.gupta |
353 |
$(document).on('change', '#searchType',
|
| 27819 |
tejbeer |
354 |
function() {
|
|
|
355 |
var searchType = $("#searchType option:selected").val();
|
|
|
356 |
var searchTypevalue = $(this).find('option:selected').text();
|
|
|
357 |
;
|
|
|
358 |
saleSearchObj.searchType = searchType;
|
|
|
359 |
console.log("selected searchType = " + searchType);
|
| 24105 |
govind |
360 |
|
| 27819 |
tejbeer |
361 |
saleHistory("main-content", saleSearchObj.searchType, "",
|
|
|
362 |
startDate, endDate);
|
| 24105 |
govind |
363 |
|
| 27819 |
tejbeer |
364 |
$("#sale-history-search-text").val('');
|
|
|
365 |
});
|
| 23973 |
govind |
366 |
|
| 27755 |
amit.gupta |
367 |
$(document).on('click', "#sale-history-search-button",
|
| 27819 |
tejbeer |
368 |
function() {
|
|
|
369 |
var searchType = $("#searchType option:selected").val();
|
|
|
370 |
console.log("searchType = " + searchType);
|
|
|
371 |
$("#searchType").removeClass("border-highlight");
|
|
|
372 |
saleSearchObj.searchText = $(
|
|
|
373 |
"#sale-history-search-text").val();
|
|
|
374 |
saleSearchObj.searchType = searchType;
|
|
|
375 |
saleSearchObj.startTime = startDate;
|
|
|
376 |
saleSearchObj.endTime = endDate;
|
|
|
377 |
if (typeof (saleSearchObj.searchText) == "undefined"
|
|
|
378 |
|| !saleSearchObj.searchText) {
|
|
|
379 |
saleSearchObj.searchText = "";
|
|
|
380 |
}
|
|
|
381 |
saleHistorySearchInfo(saleSearchObj.searchType,
|
|
|
382 |
saleSearchObj.searchText,
|
|
|
383 |
saleSearchObj.startTime, saleSearchObj.endTime);
|
|
|
384 |
});
|
| 27755 |
amit.gupta |
385 |
$(document).on('click', "#invoice-download-button",
|
| 27819 |
tejbeer |
386 |
function() {
|
|
|
387 |
var searchType = $("#searchType option:selected").val();
|
|
|
388 |
console.log("searchType = " + searchType);
|
|
|
389 |
$("#searchType").removeClass("border-highlight");
|
|
|
390 |
saleSearchObj.searchText = $(
|
|
|
391 |
"#sale-history-search-text").val();
|
|
|
392 |
saleSearchObj.searchType = searchType;
|
|
|
393 |
saleSearchObj.startTime = startDate;
|
|
|
394 |
saleSearchObj.endTime = endDate;
|
|
|
395 |
if (typeof (saleSearchObj.searchText) == "undefined"
|
|
|
396 |
|| !saleSearchObj.searchText) {
|
|
|
397 |
saleSearchObj.searchText = "";
|
|
|
398 |
}
|
|
|
399 |
downloadInvoices(saleSearchObj.searchType,
|
|
|
400 |
saleSearchObj.searchText,
|
|
|
401 |
saleSearchObj.startTime, saleSearchObj.endTime);
|
|
|
402 |
});
|
| 23973 |
govind |
403 |
|
| 27754 |
amit.gupta |
404 |
$(document).on('click', ".search-order", function() {
|
| 23584 |
ashik.ali |
405 |
console.log("search-order clicked")
|
|
|
406 |
loadSearchOrder("main-content");
|
| 23973 |
govind |
407 |
});
|
|
|
408 |
|
| 27819 |
tejbeer |
409 |
$(document).on('click', ".invoices-cancel", function() {
|
|
|
410 |
console.log("searc-order clicked")
|
|
|
411 |
loadInvoiceSearchOrder("main-content");
|
|
|
412 |
});
|
|
|
413 |
|
| 27755 |
amit.gupta |
414 |
$(document).on('click', "#search-order-button",
|
| 27819 |
tejbeer |
415 |
function() {
|
|
|
416 |
console.log("search-order-button clicked")
|
|
|
417 |
var invoiceNumber = $("#search-order-text").val();
|
|
|
418 |
loadSearchOrderDetails(invoiceNumber,
|
|
|
419 |
"search-order-details-container");
|
|
|
420 |
});
|
| 23973 |
govind |
421 |
|
| 27819 |
tejbeer |
422 |
$(document).on('click', "#search-invoice-button",
|
|
|
423 |
function() {
|
|
|
424 |
console.log("search-order-button clicked")
|
|
|
425 |
var invoiceNumber = $("#search-invoice-text").val();
|
|
|
426 |
console.log(invoiceNumber);
|
|
|
427 |
loadSearchOrderDetails(invoiceNumber,
|
|
|
428 |
"search-order-details-container");
|
|
|
429 |
});
|
|
|
430 |
|
|
|
431 |
|
|
|
432 |
|
|
|
433 |
$(document).on('click', "#cancel-invoice-button",
|
|
|
434 |
function() {
|
|
|
435 |
var invoiceNumber = $("#search-invoice-text").val();
|
|
|
436 |
console.log(invoiceNumber);
|
|
|
437 |
if (confirm("Are you sure you want to cancel the order !") == true) {
|
|
|
438 |
doPostAjaxRequestHandler(context
|
|
|
439 |
+ "/cancelOrderByInvoice?invoiceNumbers="
|
|
|
440 |
+ invoiceNumber, function(response) {
|
|
|
441 |
if (response == 'true') {
|
|
|
442 |
alert("Successfully Cancel");
|
|
|
443 |
loadInvoiceSearchOrder("main-content");
|
|
|
444 |
}
|
|
|
445 |
});
|
|
|
446 |
|
|
|
447 |
return false;
|
|
|
448 |
}
|
|
|
449 |
});
|
|
|
450 |
|
| 27755 |
amit.gupta |
451 |
$(document).on('click', "#sale-history-paginated .next",
|
| 27819 |
tejbeer |
452 |
function() {
|
|
|
453 |
var params = {};
|
|
|
454 |
params['searchType'] = saleSearchObj.searchType;
|
|
|
455 |
params['searchValue'] = saleSearchObj.searchText;
|
|
|
456 |
params['startTime'] = walletHistory.startTime;
|
|
|
457 |
params['endTime'] = walletHistory.endTime;
|
|
|
458 |
loadPaginatedNextItems('/getPaginatedSaleHistory', params,
|
|
|
459 |
'sale-history-paginated', 'sale-history-table',
|
|
|
460 |
'sale-details-container');
|
|
|
461 |
$(this).blur();
|
|
|
462 |
});
|
| 27755 |
amit.gupta |
463 |
$(document).on('click', "#insurance-paginated .next",
|
| 27819 |
tejbeer |
464 |
function() {
|
|
|
465 |
loadPaginatedNextItems('/insuranceDetailsPaginated', null,
|
|
|
466 |
'insurance-paginated', 'insurance-details-table',
|
|
|
467 |
'insurance-policy-details-container');
|
|
|
468 |
$(this).blur();
|
|
|
469 |
});
|
| 27755 |
amit.gupta |
470 |
$(document).on('click', "#insurance-paginated .previous",
|
| 27819 |
tejbeer |
471 |
function() {
|
|
|
472 |
loadPaginatedNextItems('/insuranceDetailsPaginated', null,
|
|
|
473 |
'insurance-paginated', 'insurance-details-table',
|
|
|
474 |
'insurance-policy-details-container');
|
|
|
475 |
$(this).blur();
|
|
|
476 |
});
|
| 23973 |
govind |
477 |
|
| 27755 |
amit.gupta |
478 |
$(document).on('click', "#sale-history-paginated .previous",
|
| 27819 |
tejbeer |
479 |
function() {
|
|
|
480 |
var params = {};
|
|
|
481 |
params['searchType'] = saleSearchObj.searchType;
|
|
|
482 |
params['searchValue'] = saleSearchObj.searchText;
|
|
|
483 |
params['startTime'] = walletHistory.startTime;
|
|
|
484 |
params['endTime'] = walletHistory.endTime;
|
|
|
485 |
loadPaginatedPreviousItems('/getPaginatedSaleHistory', params,
|
|
|
486 |
'sale-history-paginated', 'sale-history-table',
|
|
|
487 |
'sale-details-container');
|
|
|
488 |
$(this).blur();
|
|
|
489 |
});
|
| 23973 |
govind |
490 |
|
|
|
491 |
// grn-details
|
|
|
492 |
|
| 27754 |
amit.gupta |
493 |
$(document).on('click', ".sale-details", function() {
|
| 23654 |
amit.gupta |
494 |
orderId = $(this).attr('data');
|
| 23973 |
govind |
495 |
console.log("orderId = " + orderId);
|
|
|
496 |
loadSaleDetails(orderId, "sale-details-container");
|
| 23343 |
ashik.ali |
497 |
});
|
| 27861 |
tejbeer |
498 |
|
|
|
499 |
$(document).on('click', "#editamountbutton", function() {
|
|
|
500 |
$('#editAmount').show();
|
|
|
501 |
});
|
|
|
502 |
|
|
|
503 |
|
|
|
504 |
|
|
|
505 |
|
|
|
506 |
|
| 23343 |
ashik.ali |
507 |
});
|
|
|
508 |
|
| 23973 |
govind |
509 |
function loadSaleDetails(orderId, domId) {
|
|
|
510 |
doGetAjaxRequestHandler(context + "/saleDetails?orderId=" + orderId,
|
| 27819 |
tejbeer |
511 |
function(response) {
|
|
|
512 |
$('#' + domId).html(response);
|
|
|
513 |
});
|
| 23343 |
ashik.ali |
514 |
}
|
|
|
515 |
|
| 26647 |
tejbeer |
516 |
function loadPendingOrder(domId) {
|
|
|
517 |
doGetAjaxRequestHandler(context + "/pendingOrders", function(response) {
|
|
|
518 |
$('#' + domId).html(response);
|
|
|
519 |
|
|
|
520 |
});
|
|
|
521 |
}
|
|
|
522 |
|
| 28339 |
tejbeer |
523 |
function loadClaimedOrder(domId) {
|
|
|
524 |
doGetAjaxRequestHandler(context + "/claimedOrders", function(response) {
|
|
|
525 |
$('#' + domId).html(response);
|
|
|
526 |
|
|
|
527 |
});
|
|
|
528 |
}
|
|
|
529 |
|
|
|
530 |
|
|
|
531 |
function loadBilledOrder(domId) {
|
|
|
532 |
doGetAjaxRequestHandler(context + "/billedOrders", function(response) {
|
|
|
533 |
$('#' + domId).html(response);
|
|
|
534 |
|
|
|
535 |
});
|
|
|
536 |
}
|
|
|
537 |
|
|
|
538 |
|
|
|
539 |
|
|
|
540 |
function loadUnsettledOrder(domId) {
|
|
|
541 |
doGetAjaxRequestHandler(context + "/unsettledOrders", function(response) {
|
|
|
542 |
$('#' + domId).html(response);
|
|
|
543 |
|
|
|
544 |
});
|
|
|
545 |
}
|
|
|
546 |
|
|
|
547 |
|
|
|
548 |
function loadSettledOrder(domId) {
|
|
|
549 |
doGetAjaxRequestHandler(context + "/settledOrders", function(response) {
|
|
|
550 |
$('#' + domId).html(response);
|
|
|
551 |
|
|
|
552 |
});
|
|
|
553 |
}
|
| 23973 |
govind |
554 |
function loadSearchOrder(domId) {
|
|
|
555 |
doGetAjaxRequestHandler(context + "/getSearchOrder", function(response) {
|
| 23584 |
ashik.ali |
556 |
$('#' + domId).html(response);
|
|
|
557 |
});
|
|
|
558 |
}
|
|
|
559 |
|
| 27819 |
tejbeer |
560 |
function loadInvoiceSearchOrder(domId) {
|
|
|
561 |
console.log("Hello");
|
|
|
562 |
doGetAjaxRequestHandler(context + "/getInvoiceSearchOrder", function(response) {
|
| 23584 |
ashik.ali |
563 |
$('#' + domId).html(response);
|
|
|
564 |
});
|
|
|
565 |
}
|
|
|
566 |
|
| 27819 |
tejbeer |
567 |
function loadSearchOrderDetails(invoiceNumber, domId) {
|
|
|
568 |
doGetAjaxRequestHandler(context + "/searchOrderDetails?invoiceNumber="
|
|
|
569 |
+ invoiceNumber, function(response) {
|
|
|
570 |
$('#' + domId).html(response);
|
| 27861 |
tejbeer |
571 |
$('#editAmount').hide();
|
|
|
572 |
|
| 27819 |
tejbeer |
573 |
});
|
|
|
574 |
}
|
|
|
575 |
|
| 23973 |
govind |
576 |
function saleHistory(domId, searchType, searchValue, startTime, endTime) {
|
|
|
577 |
doGetAjaxRequestHandler(context + "/saleHistory?searchType=" + searchType
|
| 27819 |
tejbeer |
578 |
+ "&searchValue=" + searchValue + "&startTime=" + startTime
|
|
|
579 |
+ "&endTime=" + endTime, function(response) {
|
|
|
580 |
$('#' + domId).html(response);
|
|
|
581 |
});
|
| 23343 |
ashik.ali |
582 |
}
|
|
|
583 |
|
| 23973 |
govind |
584 |
function saleHistorySearchInfo(searchType, searchText, startTime, endTime) {
|
| 23343 |
ashik.ali |
585 |
saleHistory("main-content", searchType, searchText, startTime, endTime);
|
| 24105 |
govind |
586 |
|
|
|
587 |
}
|
| 24880 |
govind |
588 |
function insurancePolicyDetails(domId) {
|
|
|
589 |
doGetAjaxRequestHandler(context + "/insuranceDetails", function(response) {
|
|
|
590 |
$('#' + domId).html(response);
|
|
|
591 |
});
|
|
|
592 |
}
|
| 25093 |
amit.gupta |
593 |
|
|
|
594 |
function downloadInvoices(searchType, searchValue, startTime, endTime) {
|
|
|
595 |
doAjaxGetDownload(context + "/downloadInvoices?searchType=" + searchType
|
| 27819 |
tejbeer |
596 |
+ "&searchValue=" + searchValue + "&startTime=" + startTime
|
|
|
597 |
+ "&endTime=" + endTime, "invoices.pdf");
|
| 25093 |
amit.gupta |
598 |
}
|
| 28350 |
tejbeer |
599 |
|
|
|
600 |
function loadVerifiedOrder(domId) {
|
|
|
601 |
doGetAjaxRequestHandler(context + "/verifiedOrders", function(response) {
|
|
|
602 |
$('#' + domId).html(response);
|
|
|
603 |
});
|
|
|
604 |
}
|