Subversion Repositories SmartDukaan

Rev

Rev 35458 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 35458 Rev 35459
Line 291... Line 291...
291
		}
291
		}
292
	});
292
	});
293
 
293
 
294
	$(document).on("click", ".cancellation",
294
	$(document).on("click", ".cancellation",
295
		function(e) {
295
		function(e) {
296
			var orderid = $(this).data('orderid');
296
			orderid = $(this).data('orderid');
297
			var itemId = $(this).data('itemid');
297
			itemId = $(this).data('itemid');
298
 
298
 
299
			doGetAjaxRequestHandler(context
299
			doGetAjaxRequestHandler(context
300
				+ "/getcancelOrderItems?itemId=" + itemId, function(
300
				+ "/getcancelOrderItems?itemId=" + itemId, function(
301
				response) {
301
				response) {
302
				$('.cancel-order-container .modal-content').html(response);
302
				$('.cancel-order-container .modal-content').html(response);
Line 306... Line 306...
306
 
306
 
307
	$(document).on("click", ".cancel-order-submit", function(e) {
307
	$(document).on("click", ".cancel-order-submit", function(e) {
308
		requestcancelOrder();
308
		requestcancelOrder();
309
	});
309
	});
310
	$(document).on("click", ".keepatab", function(e) {
310
	$(document).on("click", ".keepatab", function(e) {
311
		var orderid = $(this).data('orderid');
311
		orderid = $(this).data('orderid');
312
		cancelOrder(orderid, "KEEP_A_TAB");
312
		cancelOrder(orderid, "KEEP_A_TAB")
-
 
313
 
313
	});
314
	});
314
 
315
 
315
	$(document).on('click', ".request-cancel", function() {
316
	$(document).on('click', ".request-cancel", function() {
316
 
317
 
317
	});
318
	});
Line 320... Line 321...
320
 
321
 
321
	});
322
	});
322
 
323
 
323
	$(document).on("click", ".closeOrder",
324
	$(document).on("click", ".closeOrder",
324
		function(e) {
325
		function(e) {
325
			var orderid = $(this).data('orderid');
326
			orderid = $(this).data('orderid');
326
			if (confirm("Are you sure you want to close the order") === true) {
327
			if (confirm("Are you sure you want to close the order") == true) {
-
 
328
 
327
				doPostAjaxRequestHandler(context
329
				doPostAjaxRequestHandler(context
328
					+ "/closeOrder?orderId=" + orderid,
330
					+ "/closeOrder?orderId=" + orderd,
329
					function(response) {
331
					function(response) {
330
						if (response === 'true') {
332
						if (response == 'true') {
331
							alert("Successfully closed");
333
							alert("successfully close");
332
							loadtabOrder("main-content");
334
							loadtabOrder("main-content");
333
						}
335
						}
334
					});
336
					});
335
			}
337
			}
-
 
338
 
336
		});
339
		});
337
	$(document).on('change', '#notify-table :checkbox', function(e) {
340
	$(document).on('change', '#notify-table :checkbox', function(e) {
338
		var colormessage = [];
341
		var colormessage = [];
339
		$("#notify-table input[type=checkbox]:checked").each(function() {
342
		$("#notify-table input[type=checkbox]:checked").each(function() {
340
 
343
 
Line 743... Line 746...
743
		$('#' + domId).html(response);
746
		$('#' + domId).html(response);
744
	});
747
	});
745
}
748
}
746
function myFunction() {
749
function myFunction() {
747
	var val = $("#selectreason").val();
750
	var val = $("#selectreason").val();
-
 
751
	console.log(val);
748
	if (val === "other") {
752
	if (val == "other") {
749
		$("#textreason").show();
753
		$("#textreason").show();
750
	} else {
754
	} else {
751
		$("#textreason").hide();
755
		$("#textreason").hide();
752
	}
756
	}
753
}
-
 
754
 
757
 
-
 
758
}
755
function requestcancelOrder() {
759
function requestcancelOrder() {
756
	var jsonObject = {};
760
	var jsonObject = {};
757
	var orderIdsJson = [];
761
	var orderIdsJson = [];
-
 
762
 
758
	var val = $('#selectreason').val();
763
	val = $('#selectreason').val();
759
	var reason;
-
 
760
	if (val === "other") {
764
	if (val == "other") {
761
		reason = $('#textreason').val();
765
		reason = $('#textreason').val();
762
	} else {
766
	} else {
763
		reason = val;
767
		reason = val;
764
	}
768
	}
-
 
769
	console.log(reason);
765
 
770
 
766
	if (!reason) {
771
	if (reason == "" || reason == null || reason == undefined) {
767
		alert("Reason field can't be empty");
772
		alert("reason field can't be empty");
768
		return false;
773
		return false;
769
	}
774
	}
770
 
775
 
771
	var partnerOrderCheck = $("input[name='partnerOrderCheck']:checked").length;
776
	var partnerOrderCheck = $("input[name='partnerOrderCheck']:checked").length;
772
 
777