Subversion Repositories SmartDukaan

Rev

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

Rev 25721 Rev 26031
Line 241... Line 241...
241
		} else {
241
		} else {
242
			$('#textnotifymessage').hide();
242
			$('#textnotifymessage').hide();
243
		}
243
		}
244
	});
244
	});
245
 
245
 
-
 
246
	$(".notify-cancel-order-submit")
-
 
247
			.live(
-
 
248
					"click",
-
 
249
					function(e) {
-
 
250
						var jsonObject = {};
-
 
251
						var orderAndItemIdsJson = [];
-
 
252
						var orderAndItemIds;
-
 
253
						var orderIds;
-
 
254
						var message;
-
 
255
						message = $('#textNotifyCancellationMessage').val();
-
 
256
 
-
 
257
						var partnerchecked = $("input[name='partnerCancelOrderCheck']:checked").length;
-
 
258
 
-
 
259
						if (!partnerchecked) {
-
 
260
							alert("You must check at least one partner.");
-
 
261
							return false;
-
 
262
						}
-
 
263
 
-
 
264
						if (message === "") {
-
 
265
							alert("message is required");
-
 
266
							return false;
-
 
267
						}
-
 
268
 
-
 
269
						$('#partner-cancel-order-table')
-
 
270
								.find('tr')
-
 
271
								.each(
-
 
272
										function() {
-
 
273
											var row = $(this);
-
 
274
 
-
 
275
											console.log(row);
-
 
276
											if (row
-
 
277
													.find(
-
 
278
															'input[name="partnerCancelOrderCheck"]')
-
 
279
													.is(':checked')) {
-
 
280
												var currentRow = $(this)
-
 
281
														.closest("tr");
-
 
282
 
-
 
283
												var col5 = currentRow.find(
-
 
284
														"td:eq(1)").html();
-
 
285
												var col6 = currentRow.find(
-
 
286
														"td:eq(2)").html();
-
 
287
 
-
 
288
												orderIds = {
-
 
289
													"orderId" : col6,
-
 
290
													"olditemId" : col5
-
 
291
												}
-
 
292
												orderAndItemIdsJson
-
 
293
														.push(orderIds)
-
 
294
 
-
 
295
											}
-
 
296
 
-
 
297
										});
-
 
298
 
-
 
299
						jsonObject['orderIds'] = orderAndItemIdsJson;
-
 
300
						jsonObject['message'] = message
-
 
301
						console.log(jsonObject)
-
 
302
 
-
 
303
						if (confirm("Are you sure you want to notify the order") == true) {
-
 
304
 
-
 
305
							doPostAjaxRequestWithJsonHandler(context
-
 
306
									+ "/notifyCancelOrder", JSON
-
 
307
									.stringify(jsonObject), function(response) {
-
 
308
								if (response == 'true') {
-
 
309
									alert("successfully Add");
-
 
310
									$('#notifyCancelOrder').modal('hide');
-
 
311
									$('.modal-backdrop').remove();
-
 
312
									loadOrder("main-content");
-
 
313
								}
-
 
314
							});
-
 
315
						}
-
 
316
 
-
 
317
					});
246
	$(".notify-submit")
318
	$(".notify-submit")
247
			.live(
319
			.live(
248
					"click",
320
					"click",
249
					function(e) {
321
					function(e) {
250
 
322
 
Line 309... Line 381...
309
												var col3 = currentRow
381
												var col3 = currentRow
310
														.find(
382
														.find(
311
																"td:eq(2) input[name='procuredDate']")
383
																"td:eq(2) input[name='procuredDate']")
312
														.data('daterangepicker').startDate
384
														.data('daterangepicker').startDate
313
														.format(moment.HTML5_FMT.DATETIME_LOCAL_SECONDS);
385
														.format(moment.HTML5_FMT.DATETIME_LOCAL_SECONDS);
314
												; // get current
386
												// get current
315
												// row 3rd TD
387
												// row 3rd TD
316
 
388
 
317
												itemIds = {
389
												itemIds = {
318
													"itemId" : col1,
390
													"itemId" : col1,
319
													"responseTime" : col2,
391
													"responseTime" : col2,
Line 379... Line 451...
379
		$('.notify-container .modal-content').html(response);
451
		$('.notify-container .modal-content').html(response);
380
		$('#textnotifymessage').hide();
452
		$('#textnotifymessage').hide();
381
	});
453
	});
382
}
454
}
383
 
455
 
-
 
456
function getItems(catalogItemId) {
-
 
457
	doGetAjaxRequestHandler(context + "/getItems?catalogItemId="
-
 
458
			+ catalogItemId, function(response) {
-
 
459
		$('.notify-cancel-order-container .modal-content').html(response);
-
 
460
 
-
 
461
	});
-
 
462
}
-
 
463
 
384
function loadGoodInventory(domId, search_text) {
464
function loadGoodInventory(domId, search_text) {
385
	doGetAjaxRequestHandler(context
465
	doGetAjaxRequestHandler(context
386
			+ "/getCurrentInventorySnapshot?searchTerm=" + search_text,
466
			+ "/getCurrentInventorySnapshot?searchTerm=" + search_text,
387
			function(response) {
467
			function(response) {
388
				$('#' + domId).html(response);
468
				$('#' + domId).html(response);