Subversion Repositories SmartDukaan

Rev

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

Rev 27618 Rev 27754
Line 1... Line 1...
1
$(function() {
1
$(function() {
2
	$(".good_inventory").live('click', function() {
2
	$(document).on('click', ".good_inventory", function() {
3
		loadGoodInventory("main-content", "");
3
		loadGoodInventory("main-content", "");
4
	});
4
	});
5
 
5
 
6
	$(".catalog").live('click', function() {
6
	$(document).on('click', ".catalog", function() {
7
		// clear pendingOrderId
7
		// clear pendingOrderId
8
		if (typeof pendingPO != "undefined") {
8
		if (typeof pendingPO != "undefined") {
9
			delete pendingPO;
9
			delete pendingPO;
10
			delete pendingPOCustomer;
10
			delete pendingPOCustomer;
11
		}
11
		}
12
		loadCatalog("main-content", "");
12
		loadCatalog("main-content", "");
13
	});
13
	});
14
	var accesories = false;
14
	var accesories = false;
15
	$('.accesoriesClass').live('click', function() {
15
	$(document).on('click', '.accesoriesClass', function() {
16
		accesories = true;
16
		accesories = true;
17
 
17
 
18
		doGetAjaxRequestHandler(context + "/getCatalog?accesories=" + true,
18
		doGetAjaxRequestHandler(context + "/getCatalog?accesories=" + true,
19
			function(response) {
19
			function(response) {
20
				$('#main-content').html(response);
20
				$('#main-content').html(response);
Line 22... Line 22...
22
 
22
 
23
 
23
 
24
	});
24
	});
25
 
25
 
26
	var brand = null;
26
	var brand = null;
27
	$('.cover').live('click', function() {
27
	$(document).on('click', '.cover', function() {
28
		console.log('hello');
28
		console.log('hello');
29
 
29
 
30
		brand = $(this).data('stockbrand');
30
		brand = $(this).data('stockbrand');
31
		console.log(brand);
31
		console.log(brand);
32
		doGetAjaxRequestHandler(context + "/getCatalog?brand=" + brand,
32
		doGetAjaxRequestHandler(context + "/getCatalog?brand=" + brand,
33
			function(response) {
33
			function(response) {
34
				$('#main-content').html(response);
34
				$('#main-content').html(response);
35
			});
35
			});
36
	});
36
	});
37
 
37
 
38
	$('.add-compare-checkbox').live('change', function() {
38
	$(document).on('change', '.add-compare-checkbox', function() {
39
 
39
 
40
		let catalogitemid = [$(this).data("catalogitemid")];
40
		let catalogitemid = [$(this).data("catalogitemid")];
41
		let checked = $(this).is(':checked');
41
		let checked = $(this).is(':checked');
42
		console.log(checked);
42
		console.log(checked);
43
		$cbToModify = $(this).closest('table').find('tr').find('input:checkbox').filter(function() {
43
		$cbToModify = $(this).closest('table').find('tr').find('input:checkbox').filter(function() {
Line 63... Line 63...
63
		console.log(count);
63
		console.log(count);
64
		$cbToModify.prop("checked", checked).prop("disabled", checked);
64
		$cbToModify.prop("checked", checked).prop("disabled", checked);
65
 
65
 
66
	});
66
	});
67
 
67
 
68
	$("#Go-compare-button").live('click', function() {
68
	$(document).on('click', "#Go-compare-button", function() {
69
 
69
 
70
		console.log('helo');
70
		console.log('helo');
71
		var gocatalogitemid = [];
71
		var gocatalogitemid = [];
72
 
72
 
73
		$('table').find('input[type="checkbox"]:enabled:checked').each(function(el) {
73
		$('table').find('input[type="checkbox"]:enabled:checked').each(function(el) {
Line 91... Line 91...
91
		loadSimilarCatalog("main-content", "");
91
		loadSimilarCatalog("main-content", "");
92
	});
92
	});
93
 
93
 
94
 
94
 
95
 
95
 
96
	$('.view-invoices').live('click', function() {
96
	$(document).on('click', '.view-invoices', function() {
97
		loadInvoice();
97
		loadInvoice();
98
	});
98
	});
99
 
99
 
100
 
100
 
101
	$(".review_order").live('click', function() {
101
	$(document).on('click', ".review_order", function() {
102
		loadOrder("main-content");
102
		loadOrder("main-content");
103
	});
103
	});
104
 
104
 
105
	$(".notify_cancel").live('click', function() {
105
	$(document).on('click', ".notify_cancel", function() {
106
		loadNotifyCancelOrder("main-content");
106
		loadNotifyCancelOrder("main-content");
107
	});
107
	});
108
 
108
 
109
	$(".keep-a-tab").live('click', function() {
109
	$(document).on('click', ".keep-a-tab", function() {
110
		loadtabOrder("main-content");
110
		loadtabOrder("main-content");
111
	});
111
	});
112
 
112
 
113
	$(".notify_order").live('click', function() {
113
	$(document).on('click', ".notify_order", function() {
114
		loadnotifyOrder("main-content");
114
		loadnotifyOrder("main-content");
115
	});
115
	});
116
 
116
 
117
	$(".item_aging").live('click', function() {
117
	$(document).on('click', ".item_aging", function() {
118
		getInventoryItemAgingByInterval("main-content", "");
118
		getInventoryItemAgingByInterval("main-content", "");
119
	});
119
	});
120
 
120
 
121
	$("#item-aging-search-button").live('click', function() {
121
	$(document).on('click', "#item-aging-search-button", function() {
122
		searchContent = $("#item-aging-search-text").val();
122
		searchContent = $("#item-aging-search-text").val();
123
		if (typeof (searchContent) == "undefined" || !searchContent) {
123
		if (typeof (searchContent) == "undefined" || !searchContent) {
124
			searchContent = "";
124
			searchContent = "";
125
		}
125
		}
126
		getInventoryItemAgingByInterval("main-content", searchContent);
126
		getInventoryItemAgingByInterval("main-content", searchContent);
127
	});
127
	});
128
 
128
 
129
	$("#item-aging-search-text").live("keyup", function(e) {
129
	$(document).on("keyup", "#item-aging-search-text", function(e) {
130
		var keyCode = e.keyCode || e.which;
130
		var keyCode = e.keyCode || e.which;
131
		if (keyCode == 13) {
131
		if (keyCode == 13) {
132
			$("#item-aging-search-button").click();
132
			$("#item-aging-search-button").click();
133
		}
133
		}
134
	});
134
	});
135
 
135
 
136
	$("#item-aging-paginated .next").live('click', function() {
136
	$(document).on('click', "#item-aging-paginated .next", function() {
137
		var end = $("#item-aging-paginated .end").text();
137
		var end = $("#item-aging-paginated .end").text();
138
		getItemAgingNextPreviousItems(end, "");
138
		getItemAgingNextPreviousItems(end, "");
139
		$("#item-aging-paginated .next").blur();
139
		$("#item-aging-paginated .next").blur();
140
	});
140
	});
141
 
141
 
142
	$("#item-aging-paginated .previous").live('click', function() {
142
	$(document).on('click', "#item-aging-paginated .previous", function() {
143
		var start = $("#item-aging-paginated .start").text();
143
		var start = $("#item-aging-paginated .start").text();
144
		getItemAgingNextPreviousItems(start - 11, "");
144
		getItemAgingNextPreviousItems(start - 11, "");
145
		$("#item-aging-paginated .previous").blur();
145
		$("#item-aging-paginated .previous").blur();
146
	});
146
	});
147
 
147
 
148
	$(".download_aging_report").live('click', function() {
148
	$(document).on('click', ".download_aging_report", function() {
149
		downloadAgingReport();
149
		downloadAgingReport();
150
	});
150
	});
151
 
151
 
152
	$(".download_reports").live('click', function() {
152
	$(document).on('click', ".download_reports", function() {
153
		downloadReports();
153
		downloadReports();
154
	});
154
	});
155
 
155
 
156
	$(".item-ledger-report-download-page").live('click', function() {
156
	$(document).on('click', ".item-ledger-report-download-page", function() {
157
		loadItemLedgerReportDownloadPage("main-content");
157
		loadItemLedgerReportDownloadPage("main-content");
158
	});
158
	});
159
 
159
 
160
	$(".bad_inventory").live('click', function() {
160
	$(document).on('click', ".bad_inventory", function() {
161
		loadBadInventory("main-content", "");
161
		loadBadInventory("main-content", "");
162
	});
162
	});
163
 
163
 
164
	$("#good-inventory-paginated .next").live(
164
	$("#good-inventory-paginated .next").live(
165
		'click',
165
		'click',
Line 191... Line 191...
191
				'good-inventory-paginated', 'good-inventory-table',
191
				'good-inventory-paginated', 'good-inventory-table',
192
				null);
192
				null);
193
			$(this).blur();
193
			$(this).blur();
194
		});
194
		});
195
 
195
 
196
	$("#good-inventory-search-button").live('click', function() {
196
	$(document).on('click', "#good-inventory-search-button", function() {
197
		var searchText = $("#good-inventory-search-text").val();
197
		var searchText = $("#good-inventory-search-text").val();
198
		if (typeof (searchText) == "undefined" || !searchText) {
198
		if (typeof (searchText) == "undefined" || !searchText) {
199
			searchText = "";
199
			searchText = "";
200
		}
200
		}
201
		loadGoodInventorySearchInfo(searchText);
201
		loadGoodInventorySearchInfo(searchText);
202
	});
202
	});
203
 
203
 
204
	$("#good-inventory-search-text").live("keyup", function(e) {
204
	$(document).on("keyup", "#good-inventory-search-text", function(e) {
205
		var keyCode = e.keyCode || e.which;
205
		var keyCode = e.keyCode || e.which;
206
		if (keyCode == 13) {
206
		if (keyCode == 13) {
207
			$("#good-inventory-search-button").click();
207
			$("#good-inventory-search-button").click();
208
		}
208
		}
209
	});
209
	});
Line 269... Line 269...
269
			loadPaginatedCatalogPreviousItem('/getPaginatedCatalog', params,
269
			loadPaginatedCatalogPreviousItem('/getPaginatedCatalog', params,
270
				'catalog-paginated', 'catalog-table', null);
270
				'catalog-paginated', 'catalog-table', null);
271
			$(this).blur();
271
			$(this).blur();
272
		});
272
		});
273
 
273
 
274
	$("#catalog-search-button").live('click', function() {
274
	$(document).on('click', "#catalog-search-button", function() {
275
		var searchText = $("#catalog-search-text").val();
275
		var searchText = $("#catalog-search-text").val();
276
		if (typeof (searchText) == "undefined" || !searchText) {
276
		if (typeof (searchText) == "undefined" || !searchText) {
277
			searchText = "";
277
			searchText = "";
278
		}
278
		}
279
		loadCatalogSearchInfo(searchText);
279
		loadCatalogSearchInfo(searchText);
280
	});
280
	});
281
 
281
 
282
	$("#catalog-search-text").live("keyup", function(e) {
282
	$(document).on("keyup", "#catalog-search-text", function(e) {
283
		var keyCode = e.keyCode || e.which;
283
		var keyCode = e.keyCode || e.which;
284
		if (keyCode == 13) {
284
		if (keyCode == 13) {
285
			$("#catalog-search-button").click();
285
			$("#catalog-search-button").click();
286
		}
286
		}
287
	});
287
	});
Line 298... Line 298...
298
				$('.cancel-order-container .modal-content').html(response);
298
				$('.cancel-order-container .modal-content').html(response);
299
				$("#textreason").hide();
299
				$("#textreason").hide();
300
			});
300
			});
301
		});
301
		});
302
 
302
 
303
	$(".cancel-order-submit").live("click", function(e) {
303
	$(document).on("click", ".cancel-order-submit", function(e) {
304
		requestcancelOrder();
304
		requestcancelOrder();
305
	});
305
	});
306
	$(".keepatab").live("click", function(e) {
306
	$(document).on("click", ".keepatab", function(e) {
307
		orderid = $(this).data('orderid');
307
		orderid = $(this).data('orderid');
308
		cancelOrder(orderid, "KEEP_A_TAB")
308
		cancelOrder(orderid, "KEEP_A_TAB")
309
 
309
 
310
	});
310
	});
311
 
311
 
312
	$(".request-cancel").live('click', function() {
312
	$(document).on('click', ".request-cancel", function() {
313
 
313
 
314
	});
314
	});
315
 
315
 
316
	$(".mk_button").on("click", function() {
316
	$(".mk_button").on("click", function() {
317
 
317
 
Line 333... Line 333...
333
							}
333
							}
334
						});
334
						});
335
				}
335
				}
336
 
336
 
337
			});
337
			});
338
	$('#notify-table').find(':checkbox').live('change', function(e) {
338
	$(document).on('change', '#notify-table').find(':checkbox', function(e) {
339
		var colormessage = [];
339
		var colormessage = [];
340
		$("#notify-table input[type=checkbox]:checked").each(function() {
340
		$("#notify-table input[type=checkbox]:checked").each(function() {
341
 
341
 
342
			var row = $(this).closest("tr")[0];
342
			var row = $(this).closest("tr")[0];
343
			colormessage.push(row.cells[0].innerText);
343
			colormessage.push(row.cells[0].innerText);
Line 346... Line 346...
346
		});
346
		});
347
 
347
 
348
		$("#colorValue").text(colormessage);
348
		$("#colorValue").text(colormessage);
349
	});
349
	});
350
 
350
 
351
	$('#cancel-order-table').find(':checkbox').live('change', function(e) {
351
	$(document).on('change', '#cancel-order-table').find(':checkbox', function(e) {
352
		var orderId = [];
352
		var orderId = [];
353
 
353
 
354
		$("#cancel-order-table input[type=checkbox]:checked").each(function() {
354
		$("#cancel-order-table input[type=checkbox]:checked").each(function() {
355
			var currentRow = $(this).closest("tr");
355
			var currentRow = $(this).closest("tr");
356
 
356
 
Line 360... Line 360...
360
 
360
 
361
		selectedOrderId = $('#orderIds').val(orderId);
361
		selectedOrderId = $('#orderIds').val(orderId);
362
		console.log(selectedOrderId);
362
		console.log(selectedOrderId);
363
	});
363
	});
364
 
364
 
365
	$('#overridemessage').live('change', function() {
365
	$(document).on('change', '#overridemessage', function() {
366
		if ($(this).is(':checked')) {
366
		if ($(this).is(':checked')) {
367
			$('#textnotifymessage').show();
367
			$('#textnotifymessage').show();
368
			$('#textnotifymessage').focus();
368
			$('#textnotifymessage').focus();
369
		} else {
369
		} else {
370
			$('#textnotifymessage').hide();
370
			$('#textnotifymessage').hide();