Subversion Repositories SmartDukaan

Rev

Rev 27171 | Rev 27583 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
23343 ashik.ali 1
$(function() {
2
	$(".good_inventory").live('click', function() {
24739 tejbeer 3
		loadGoodInventory("main-content", "");
23343 ashik.ali 4
	});
24739 tejbeer 5
 
23343 ashik.ali 6
	$(".catalog").live('click', function() {
27171 tejbeer 7
		// clear pendingOrderId
8
		if (typeof pendingPO != "undefined") {
26826 amit.gupta 9
			delete pendingPO;
10
			delete pendingPOCustomer;
11
		}
24739 tejbeer 12
		loadCatalog("main-content", "");
23343 ashik.ali 13
	});
27517 amit.gupta 14
 
15
	$('.view-invoices').live('click', function() {
16
		loadInvoice();
17
	});
24739 tejbeer 18
 
24658 tejbeer 19
	$(".review_order").live('click', function() {
20
		loadOrder("main-content");
21
	});
24739 tejbeer 22
 
26039 tejbeer 23
	$(".notify_cancel").live('click', function() {
24
		loadNotifyCancelOrder("main-content");
25
	});
26
 
24739 tejbeer 27
	$(".keep-a-tab").live('click', function() {
28
		loadtabOrder("main-content");
29
	});
25066 tejbeer 30
 
24917 tejbeer 31
	$(".notify_order").live('click', function() {
32
		loadnotifyOrder("main-content");
33
	});
25066 tejbeer 34
 
23343 ashik.ali 35
	$(".item_aging").live('click', function() {
36
		getInventoryItemAgingByInterval("main-content", "");
37
	});
24739 tejbeer 38
 
23343 ashik.ali 39
	$("#item-aging-search-button").live('click', function() {
40
		searchContent = $("#item-aging-search-text").val();
24739 tejbeer 41
		if (typeof (searchContent) == "undefined" || !searchContent) {
23343 ashik.ali 42
			searchContent = "";
43
		}
44
		getInventoryItemAgingByInterval("main-content", searchContent);
24739 tejbeer 45
	});
46
 
23343 ashik.ali 47
	$("#item-aging-search-text").live("keyup", function(e) {
48
		var keyCode = e.keyCode || e.which;
24739 tejbeer 49
		if (keyCode == 13) {
50
			$("#item-aging-search-button").click();
51
		}
23343 ashik.ali 52
	});
24739 tejbeer 53
 
23629 ashik.ali 54
	$("#item-aging-paginated .next").live('click', function() {
24739 tejbeer 55
		var end = $("#item-aging-paginated .end").text();
23629 ashik.ali 56
		getItemAgingNextPreviousItems(end, "");
57
		$("#item-aging-paginated .next").blur();
24739 tejbeer 58
	});
59
 
23343 ashik.ali 60
	$("#item-aging-paginated .previous").live('click', function() {
24739 tejbeer 61
		var start = $("#item-aging-paginated .start").text();
23343 ashik.ali 62
		getItemAgingNextPreviousItems(start - 11, "");
63
		$("#item-aging-paginated .previous").blur();
24739 tejbeer 64
	});
65
 
23343 ashik.ali 66
	$(".download_aging_report").live('click', function() {
67
		downloadAgingReport();
68
	});
24739 tejbeer 69
 
23637 amit.gupta 70
	$(".download_reports").live('click', function() {
71
		downloadReports();
72
	});
24739 tejbeer 73
 
23343 ashik.ali 74
	$(".item-ledger-report-download-page").live('click', function() {
75
		loadItemLedgerReportDownloadPage("main-content");
76
	});
24739 tejbeer 77
 
23343 ashik.ali 78
	$(".bad_inventory").live('click', function() {
24739 tejbeer 79
		loadBadInventory("main-content", "");
23343 ashik.ali 80
	});
24739 tejbeer 81
 
82
	$("#good-inventory-paginated .next").live(
83
			'click',
84
			function() {
85
				var searchText = $("#good-inventory-search-text").val();
86
				if (typeof (searchText) == "undefined" || !searchText) {
87
					searchText = "";
88
 
89
				}
90
				var params = {};
91
				params['searchTerm'] = searchText;
92
				loadPaginatedNextItems('/getPaginatedCurrentInventorySnapshot',
93
						params, 'good-inventory-paginated',
94
						'good-inventory-table', null);
95
				$(this).blur();
96
			});
97
 
98
	$("#good-inventory-paginated .previous").live(
99
			'click',
100
			function() {
101
				var searchText = $("#good-inventory-search-text").val();
102
				if (typeof (searchText) == "undefined" || !searchText) {
103
					searchText = "";
104
				}
105
				var params = {};
106
				params['searchTerm'] = searchText;
107
				loadPaginatedPreviousItems(
108
						'/getPaginatedCurrentInventorySnapshot', params,
109
						'good-inventory-paginated', 'good-inventory-table',
110
						null);
111
				$(this).blur();
112
			});
113
 
23343 ashik.ali 114
	$("#good-inventory-search-button").live('click', function() {
115
		var searchText = $("#good-inventory-search-text").val();
24739 tejbeer 116
		if (typeof (searchText) == "undefined" || !searchText) {
23343 ashik.ali 117
			searchText = "";
118
		}
119
		loadGoodInventorySearchInfo(searchText);
24739 tejbeer 120
	});
121
 
23343 ashik.ali 122
	$("#good-inventory-search-text").live("keyup", function(e) {
123
		var keyCode = e.keyCode || e.which;
24739 tejbeer 124
		if (keyCode == 13) {
125
			$("#good-inventory-search-button").click();
126
		}
23343 ashik.ali 127
	});
24739 tejbeer 128
 
129
	$("#catalog-paginated .next").live(
130
			'click',
131
			function() {
132
				var searchText = $("#catalog-search-text").val();
133
				if (typeof (searchText) == "undefined" || !searchText) {
134
					searchText = "";
135
				}
136
 
137
				var params = {};
138
				params['searchTerm'] = searchText;
139
				loadPaginatedNextItems('/getPaginatedCatalog', params,
140
						'catalog-paginated', 'catalog-table', null);
141
				$(this).blur();
142
			});
143
 
144
	$("#catalog-paginated .previous").live(
145
			'click',
146
			function() {
147
				var searchText = $("#catalog-search-text").val();
148
				if (typeof (searchText) == "undefined" || !searchText) {
149
					searchText = "";
150
				}
151
 
152
				var params = {};
153
				params['searchTerm'] = searchText;
154
				loadPaginatedPreviousItems('/getPaginatedCatalog', params,
155
						'catalog-paginated', 'catalog-table', null);
156
				$(this).blur();
157
			});
158
 
23343 ashik.ali 159
	$("#catalog-search-button").live('click', function() {
160
		var searchText = $("#catalog-search-text").val();
24739 tejbeer 161
		if (typeof (searchText) == "undefined" || !searchText) {
23343 ashik.ali 162
			searchText = "";
163
		}
164
		loadCatalogSearchInfo(searchText);
24739 tejbeer 165
	});
166
 
23343 ashik.ali 167
	$("#catalog-search-text").live("keyup", function(e) {
168
		var keyCode = e.keyCode || e.which;
24739 tejbeer 169
		if (keyCode == 13) {
170
			$("#catalog-search-button").click();
171
		}
23343 ashik.ali 172
	});
24917 tejbeer 173
 
25640 tejbeer 174
	$(".cancellation").live(
175
			"click",
176
			function(e) {
177
				orderid = $(this).data('orderid');
178
				itemId = $(this).data('itemid');
25066 tejbeer 179
 
25640 tejbeer 180
				doGetAjaxRequestHandler(context
181
						+ "/getcancelOrderItems?itemId=" + itemId, function(
182
						response) {
183
					$('.cancel-order-container .modal-content').html(response);
184
					$("#textreason").hide();
185
				});
186
			});
187
 
188
	$(".cancel-order-submit").live("click", function(e) {
24917 tejbeer 189
		requestcancelOrder();
190
	});
24739 tejbeer 191
	$(".keepatab").live("click", function(e) {
192
		orderid = $(this).data('orderid');
193
		cancelOrder(orderid, "KEEP_A_TAB")
24917 tejbeer 194
 
24739 tejbeer 195
	});
23343 ashik.ali 196
 
25066 tejbeer 197
	$(".request-cancel").live('click', function() {
198
 
199
	});
200
 
201
	$(".mk_button").on("click", function() {
202
 
203
	});
204
 
24917 tejbeer 205
	$(".closeOrder")
206
			.live(
207
					"click",
208
					function(e) {
209
						orderid = $(this).data('orderid');
210
						if (confirm("Are you sure you want to close the order") == true) {
24739 tejbeer 211
 
24917 tejbeer 212
							doPostAjaxRequestHandler(context
213
									+ "/closeOrder?orderId=" + orderd,
214
									function(response) {
215
										if (response == 'true') {
216
											alert("successfully close");
217
											loadtabOrder("main-content");
218
										}
219
									});
220
						}
221
 
222
					});
25066 tejbeer 223
	$('#notify-table').find(':checkbox').live('change', function(e) {
224
		var colormessage = [];
225
		$("#notify-table input[type=checkbox]:checked").each(function() {
24917 tejbeer 226
 
25066 tejbeer 227
			var row = $(this).closest("tr")[0];
228
			colormessage.push(row.cells[0].innerText);
229
 
230
			console.log(colormessage)
231
		});
232
 
233
		$("#colorValue").text(colormessage);
234
	});
235
 
25698 tejbeer 236
	$('#cancel-order-table').find(':checkbox').live('change', function(e) {
237
		var orderId = [];
238
 
239
		$("#cancel-order-table input[type=checkbox]:checked").each(function() {
240
			var currentRow = $(this).closest("tr");
241
 
242
			orderId.push(currentRow.find("td:eq(2)").html());
243
 
244
		});
245
 
246
		selectedOrderId = $('#orderIds').val(orderId);
247
		console.log(selectedOrderId);
248
	});
249
 
25066 tejbeer 250
	$('#overridemessage').live('change', function() {
251
		if ($(this).is(':checked')) {
252
			$('#textnotifymessage').show();
253
			$('#textnotifymessage').focus();
254
		} else {
255
			$('#textnotifymessage').hide();
256
		}
257
	});
258
 
26031 tejbeer 259
	$(".notify-cancel-order-submit")
260
			.live(
261
					"click",
262
					function(e) {
263
						var jsonObject = {};
264
						var orderAndItemIdsJson = [];
265
						var orderAndItemIds;
266
						var orderIds;
267
						var message;
268
						message = $('#textNotifyCancellationMessage').val();
269
 
270
						var partnerchecked = $("input[name='partnerCancelOrderCheck']:checked").length;
271
 
272
						if (!partnerchecked) {
273
							alert("You must check at least one partner.");
274
							return false;
275
						}
276
 
277
						if (message === "") {
278
							alert("message is required");
279
							return false;
280
						}
281
 
282
						$('#partner-cancel-order-table')
283
								.find('tr')
284
								.each(
285
										function() {
286
											var row = $(this);
287
 
288
											console.log(row);
289
											if (row
290
													.find(
291
															'input[name="partnerCancelOrderCheck"]')
292
													.is(':checked')) {
293
												var currentRow = $(this)
294
														.closest("tr");
295
 
296
												var col5 = currentRow.find(
297
														"td:eq(1)").html();
298
												var col6 = currentRow.find(
299
														"td:eq(2)").html();
300
 
301
												orderIds = {
302
													"orderId" : col6,
303
													"olditemId" : col5
304
												}
305
												orderAndItemIdsJson
306
														.push(orderIds)
307
 
308
											}
309
 
310
										});
311
 
312
						jsonObject['orderIds'] = orderAndItemIdsJson;
313
						jsonObject['message'] = message
314
						console.log(jsonObject)
315
 
316
						if (confirm("Are you sure you want to notify the order") == true) {
317
 
318
							doPostAjaxRequestWithJsonHandler(context
319
									+ "/notifyCancelOrder", JSON
320
									.stringify(jsonObject), function(response) {
321
								if (response == 'true') {
26043 tejbeer 322
									alert("successfully notify");
26031 tejbeer 323
									$('#notifyCancelOrder').modal('hide');
324
									$('.modal-backdrop').remove();
325
									loadOrder("main-content");
326
								}
327
							});
328
						}
329
 
330
					});
24917 tejbeer 331
	$(".notify-submit")
332
			.live(
333
					"click",
334
					function(e) {
335
 
336
						var jsonObject = {};
337
						var orderIdsJSon = [];
338
						var ItemIdsJson = [];
339
						var itemIds;
340
						var orderIds;
25066 tejbeer 341
						var message;
24917 tejbeer 342
 
25066 tejbeer 343
						if ($('#overridemessage').is(':checked')) {
344
							message = $('#textnotifymessage').val();
345
						} else {
25721 tejbeer 346
							message = $('#notifymsg').text();
25066 tejbeer 347
						}
348
 
349
						console.log(message);
24917 tejbeer 350
						var itemchecked = $("input[name='itemCheck']:checked").length;
351
 
352
						if (!itemchecked) {
353
							alert("You must check at least one item.");
354
							return false;
355
						}
356
						var partnerchecked = $("input[name='partnerCheck']:checked").length;
357
 
358
						if (!partnerchecked) {
359
							alert("You must check at least one partner.");
360
							return false;
361
						}
25640 tejbeer 362
 
363
						if (message === "") {
25066 tejbeer 364
							alert("message is required");
365
							return false;
366
						}
24917 tejbeer 367
 
368
						$('#notify-table')
369
								.find('tr')
370
								.each(
371
										function() {
372
											var row = $(this);
373
 
374
											console.log(row);
375
											if (row.find(
376
													'input[name="itemCheck"]')
377
													.is(':checked')) {
378
												var currentRow = $(this)
379
														.closest("tr");
380
 
381
												var col1 = currentRow
382
														.find(
383
																"td:eq(0) input[type='checkbox']")
384
														.val(); // get current
385
												// row 1st TD
386
												// value
387
												var col2 = currentRow
388
														.find(
389
																"td:eq(1) input[name='responseTime']")
390
														.data('daterangepicker').startDate
391
														.format(moment.HTML5_FMT.DATETIME_LOCAL_SECONDS);// get
392
												// current
393
												// row 2nd TD
394
												var col3 = currentRow
395
														.find(
396
																"td:eq(2) input[name='procuredDate']")
397
														.data('daterangepicker').startDate
398
														.format(moment.HTML5_FMT.DATETIME_LOCAL_SECONDS);
26031 tejbeer 399
												// get current
24917 tejbeer 400
												// row 3rd TD
401
 
402
												itemIds = {
403
													"itemId" : col1,
404
													"responseTime" : col2,
405
													"procuredTime" : col3
406
 
407
												}
408
												ItemIdsJson.push(itemIds);
409
											}
410
 
411
										});
412
 
413
						$('#notify-order-table').find('tr').each(
414
								function() {
415
									var row = $(this);
416
 
417
									console.log(row);
418
									if (row.find('input[name="partnerCheck"]')
419
											.is(':checked')) {
420
										var currentRow = $(this).closest("tr");
421
 
422
										var col5 = currentRow.find("td:eq(2)")
423
												.html();
424
										var col6 = currentRow.find("td:eq(1)")
425
												.html();
426
 
427
										orderIds = {
428
											"orderId" : col5,
429
											"olditemId" : col6
430
										}
431
										orderIdsJSon.push(orderIds)
432
									}
433
								});
434
 
435
						jsonObject['itemIds'] = ItemIdsJson;
436
						jsonObject['orderIds'] = orderIdsJSon;
25066 tejbeer 437
						jsonObject['message'] = message;
24917 tejbeer 438
 
439
						console.log(jsonObject)
440
 
441
						if (confirm("Are you sure you want to notify the order") == true) {
442
 
443
							doPostAjaxRequestWithJsonHandler(context
444
									+ "/notifyOrder", JSON
445
									.stringify(jsonObject), function(response) {
446
								if (response == 'true') {
26039 tejbeer 447
									alert("successfully notify");
25640 tejbeer 448
									$('#notifyOrder').modal('hide');
449
									$('.modal-backdrop').remove();
24917 tejbeer 450
									loadOrder("main-content");
451
								}
452
							});
453
						}
454
 
455
					});
456
 
26039 tejbeer 457
	$(".change-notify-request")
458
			.live(
459
					"click",
460
					function(e) {
461
 
462
						var jsonObject = {};
463
						var orderIdsJSon = [];
464
						var orderIds;
465
 
466
						$('#notify-cancel-order-list-table').find('tr').each(
467
								function() {
468
									var row = $(this);
469
 
470
									console.log(row);
471
									if (row.find(
472
											'input[name="cancelOrderCheck"]')
473
											.is(':checked')) {
474
										var currentRow = $(this).closest("tr");
475
										var col5 = currentRow.find("td:eq(1)")
476
												.html();
477
										var col6 = currentRow.find("td:eq(2)")
478
												.html();
479
 
480
										orderIds = {
481
											"orderId" : col6,
482
											"olditemId" : col5
483
										}
484
										orderIdsJSon.push(orderIds)
485
									}
486
								});
487
						console.log(orderIdsJSon)
488
						jsonObject['orderIds'] = orderIdsJSon;
489
						console.log(jsonObject)
490
						if (confirm("Are you sure you want to update notify order") == true) {
491
 
492
							doPostAjaxRequestWithJsonHandler(context
493
									+ "/changeNotifyCancelRequest", JSON
494
									.stringify(jsonObject), function(response) {
495
								if (response == 'true') {
496
									alert("successfully Update");
497
									$('#notifyCancelOrderList').modal('hide');
498
									$('.modal-backdrop').remove();
499
									loadNotifyCancelOrder("main-content");
500
								}
501
							});
502
						}
503
					});
504
 
24739 tejbeer 505
});
506
 
24917 tejbeer 507
function getItemColor(catalogId, itemId) {
508
	console.log(catalogId);
509
 
510
	doGetAjaxRequestHandler(context + "/getNotifyItemColor?catalogItemId="
511
			+ catalogId + "&itemId=" + itemId, function(response) {
512
		$('.notify-container .modal-content').html(response);
25066 tejbeer 513
		$('#textnotifymessage').hide();
24917 tejbeer 514
	});
515
}
516
 
26031 tejbeer 517
function getItems(catalogItemId) {
518
	doGetAjaxRequestHandler(context + "/getItems?catalogItemId="
519
			+ catalogItemId, function(response) {
520
		$('.notify-cancel-order-container .modal-content').html(response);
521
 
522
	});
523
}
524
 
24739 tejbeer 525
function loadGoodInventory(domId, search_text) {
526
	doGetAjaxRequestHandler(context
527
			+ "/getCurrentInventorySnapshot?searchTerm=" + search_text,
528
			function(response) {
529
				$('#' + domId).html(response);
530
			});
23343 ashik.ali 531
}
532
 
24739 tejbeer 533
function loadCatalog(domId, search_text) {
534
	doGetAjaxRequestHandler(context + "/getCatalog?searchTerm=" + search_text,
535
			function(response) {
536
				$('#' + domId).html(response);
537
			});
538
 
23343 ashik.ali 539
}
540
 
24739 tejbeer 541
function loadOrder(domId) {
542
	doGetAjaxRequestHandler(context + "/getInProcessOrder", function(response) {
24658 tejbeer 543
		$('#' + domId).html(response);
544
	});
24739 tejbeer 545
 
24658 tejbeer 546
}
547
 
24917 tejbeer 548
function loadtabOrder(domId) {
24739 tejbeer 549
	doGetAjaxRequestHandler(context + "/getKeepInTabOrder", function(response) {
23343 ashik.ali 550
		$('#' + domId).html(response);
551
	});
24739 tejbeer 552
 
23343 ashik.ali 553
}
554
 
25066 tejbeer 555
function loadnotifyOrder(domId) {
24917 tejbeer 556
	doGetAjaxRequestHandler(context + "/getAllNotifyOrder", function(response) {
557
		$('#' + domId).html(response);
558
	});
23343 ashik.ali 559
 
24917 tejbeer 560
}
561
 
24739 tejbeer 562
function getInventoryItemAgingByInterval(domId, searchContent) {
563
	doPostAjaxRequestWithJsonHandler(
564
			context + "/getInventoryItemAgingByInterval?searchContent="
565
					+ searchContent, JSON.stringify([ 5, 15, 30, 45 ]),
566
			function(response) {
567
				$('#' + domId).html(response);
568
			});
23343 ashik.ali 569
}
570
 
24739 tejbeer 571
function downloadAgingReport() {
572
	data = JSON.stringify([ 5, 15, 30, 45 ]), doAjaxPostDownload(context
573
			+ "/downloadInventoryItemAgingByInterval", data,
574
			"InventoryItemAging.xlsx");
575
 
576
}
577
 
578
function downloadReports() {
579
	doGetAjaxRequestHandler(context + "/reports", function(response) {
23637 amit.gupta 580
		$('#main-content').html(response);
581
	});
582
}
583
 
24739 tejbeer 584
function downloadItemLedgerReport() {
23343 ashik.ali 585
	console.log("downloadItemLedgerReport Button clicked")
24221 amit.gupta 586
	var dateWise = $("#dateWise").get(0).checked;
24739 tejbeer 587
	doAjaxGetDownload(context + "/itemLedger/complete/download?startDateTime="
588
			+ startDate + "&endDateTime=" + endDate + "&dateWise=" + dateWise,
23343 ashik.ali 589
			"ItemCompleteLedegerReport.xlsx");
590
}
591
 
24739 tejbeer 592
function getItemAgingNextPreviousItems(offset, searchContent) {
23343 ashik.ali 593
	console.log("getItemAgingNextPreviousItems() called");
24739 tejbeer 594
	doPostAjaxRequestWithJsonHandler(context
595
			+ "/getInventoryItemAgingByInterval?offset=" + offset
596
			+ "&searchContent=" + searchContent, JSON
597
			.stringify([ 5, 15, 30, 45 ]), function(response) {
23343 ashik.ali 598
		$('#main-content').html(response);
599
	});
24739 tejbeer 600
 
23343 ashik.ali 601
}
602
 
24739 tejbeer 603
function loadBadInventory(domId, search_text) {
604
	doGetAjaxRequestHandler(context + "/getBadInventorySnapshot?searchTerm="
605
			+ search_text, function(response) {
23343 ashik.ali 606
		$('#' + domId).html(response);
607
	});
608
}
609
 
24739 tejbeer 610
function loadGoodInventorySearchInfo(search_text) {
611
	loadGoodInventory("main-content", search_text);
23343 ashik.ali 612
}
613
 
24739 tejbeer 614
function loadCatalogSearchInfo(search_text) {
615
	loadCatalog("main-content", search_text);
23343 ashik.ali 616
}
617
 
24739 tejbeer 618
function loadItemLedgerReportDownloadPage(domId) {
619
	doGetAjaxRequestHandler(context + "/itemLedger/downloadPage", function(
620
			response) {
23343 ashik.ali 621
		$('#' + domId).html(response);
622
	});
24739 tejbeer 623
}
24917 tejbeer 624
function myFunction() {
25066 tejbeer 625
	var val = $("#selectreason").val();
626
	console.log(val);
627
	if (val == "other") {
628
		$("#textreason").show();
629
	} else {
630
		$("#textreason").hide();
631
	}
632
 
24917 tejbeer 633
}
25066 tejbeer 634
function requestcancelOrder() {
25640 tejbeer 635
	var jsonObject = {};
636
	var orderIdsJson = [];
25698 tejbeer 637
 
25066 tejbeer 638
	val = $('#selectreason').val();
639
	if (val == "other") {
640
		reason = $('#textreason').val();
641
	} else {
25146 tejbeer 642
		reason = val;
25066 tejbeer 643
	}
644
	console.log(reason);
25640 tejbeer 645
 
25066 tejbeer 646
	if (reason == "" || reason == null || reason == undefined) {
647
		alert("reason field can't be empty");
648
		return false;
649
	}
24739 tejbeer 650
 
25640 tejbeer 651
	var partnerOrderCheck = $("input[name='partnerOrderCheck']:checked").length;
24739 tejbeer 652
 
25640 tejbeer 653
	if (!partnerOrderCheck) {
654
		alert("You must check at least one order.");
655
		return false;
656
	}
657
 
25698 tejbeer 658
	var orderIds = $('#orderIds').val()
659
	selectedOrder = orderIds.split(',');
660
	console.log(selectedOrder);
661
	jsonObject['orderIds'] = selectedOrder;
25640 tejbeer 662
	jsonObject['reason'] = reason;
663
 
664
	console.log(jsonObject)
25698 tejbeer 665
 
25640 tejbeer 666
	if (confirm("Are you sure you want to cancel the order") == true) {
667
 
668
		doPostAjaxRequestWithJsonHandler(context + "/cancelOrder", JSON
669
				.stringify(jsonObject), function(response) {
670
			if (response == 'true') {
671
				alert("successfully cancel");
672
				$('#cancelOrder').modal('hide');
673
				$('.modal-backdrop').remove();
674
				loadOrder("main-content");
675
			}
676
		});
677
	}
25698 tejbeer 678
 
24917 tejbeer 679
}
26039 tejbeer 680
 
681
function loadNotifyCancelOrder(domId) {
682
	doGetAjaxRequestHandler(context + "/getNotifiedCancelOrder", function(
683
			response) {
684
		$('#' + domId).html(response);
685
	});
686
}
687
 
688
function getNotifyCancelItems(itemId, OrderId) {
689
	doGetAjaxRequestHandler(context + "/getNotifyItems?itemId=" + itemId,
690
			function(response) {
691
				$('.notify-cancel-order-Items-container .modal-content').html(
692
						response);
693
 
694
			});
695
}
27517 amit.gupta 696
 
697
function loadInvoice(serialNumber) {
698
	let url = `${context}/view-invoices`;
699
	if(typeof serialNumber != "undefined") {
700
		url = `${url}?serialNumber=${serialNumber}`;
701
		doAjaxGetDownload(url, `invoice-${serialNumber}.pdf`) 
702
	} else {
703
		doGetAjaxRequestHandler(url, function(response) {
704
			$('#main-content').html(response);
705
		});
706
	}
707
}