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