Subversion Repositories SmartDukaan

Rev

Rev 34682 | Rev 35459 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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