Subversion Repositories SmartDukaan

Rev

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

Rev 28350 Rev 28352
Line 65... Line 65...
65
				return false;
65
				return false;
66
			}
66
			}
67
 
67
 
68
		});
68
		});
69
 
69
 
70
	$(document).on('click', ".pendingOrderItemCancel",
-
 
71
		function() {
-
 
72
 
-
 
73
			var orderItemId = $(this).data('orderitemid');
-
 
74
			if (confirm("Are you sure you want to cancel the order item!") == true) {
-
 
75
				doPostAjaxRequestHandler(context
-
 
76
					+ "/cancelPendingOrderItem?id="
-
 
77
					+ orderItemId, function(response) {
-
 
78
						if (response == 'true') {
-
 
79
							alert("successfully Cancel");
-
 
80
							loadPendingOrder("main-content");
-
 
81
						}
-
 
82
					});
-
 
83
 
-
 
84
				return false;
-
 
85
			}
-
 
86
 
-
 
87
		});
-
 
88
 
70
 
89
	$(document).on('click', ".pendingOrderItemDelivered",
71
	$(document).on('click', ".pendingOrderItemDelivered",
90
		function() {
72
		function() {
91
 
73
 
92
			var orderItemId = $(this).data('poitemid');
74
			var orderItemId = $(this).data('poitemid');
Line 141... Line 123...
141
				return false;
123
				return false;
142
			}
124
			}
143
 
125
 
144
		});
126
		});
145
 
127
 
-
 
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
 
146
	$(document).on('click', ".sale-history", function() {
173
	$(document).on('click', ".sale-history", function() {
147
		console.log("Sale History Button Clicked...")
174
		console.log("Sale History Button Clicked...")
148
		saleHistory("main-content", "", "", startDate, endDate);
175
		saleHistory("main-content", "", "", startDate, endDate);
149
	});
176
	});
150
 
177