Subversion Repositories SmartDukaan

Rev

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

Rev 23882 Rev 24168
Line 2... Line 2...
2
	$(".create-item").live('click', function() {
2
	$(".create-item").live('click', function() {
3
		loadCreateItem("main-content");
3
		loadCreateItem("main-content");
4
	});
4
	});
5
	
5
	
6
	$(".scan-in-items").live('click', function() {
6
	$(".scan-in-items").live('click', function() {
-
 
7
		getAuthorisedWarehouses(function(warehouseId){
7
		loadScanInItems("main-content");
8
			loadScanInItems(warehouseId, "main-content");
-
 
9
		});
8
	});
10
	});
9
	
11
	
10
	$(".scan-in-partner-items").live('click', function() {
12
	$(".scan-in-partner-items").live('click', function() {
11
		loadScanInPartnerItems("main-content");
13
		loadScanInPartnerItems("main-content");
12
	});
14
	});
Line 161... Line 163...
161
		var warehouseId = $(this).val();
163
		var warehouseId = $(this).val();
162
		loadWarehouseInstructionItemsByWarehouseId("warehouse-instruction-items-container", warehouseId);
164
		loadWarehouseInstructionItemsByWarehouseId("warehouse-instruction-items-container", warehouseId);
163
	});
165
	});
164
	
166
	
165
	$(".scan-out-items").live('click', function() {
167
	$(".scan-out-items").live('click', function() {
-
 
168
		getAuthorisedWarehouses(function(warehouseId){
166
		loadScanOutItems("main-content");
169
			loadScanOutItems(warehouseId, "main-content");
-
 
170
		});
167
	});
171
	});
168
	
172
	
169
	$("#scanOutItemButton").live('click', function() {
173
	$("#scanOutItemButton").live('click', function() {
170
		var warehouseId = $("#scanOutItemModel .warehouseId").val();
174
		var warehouseId = $("#scanOutItemModel .warehouseId").val();
171
		if(warehouseId == ""){
175
		if(warehouseId == ""){
Line 233... Line 237...
233
		loadPaginatedPreviousItems('/getPaginatedItems', null, 'items-paginated', 'items-table', null);
237
		loadPaginatedPreviousItems('/getPaginatedItems', null, 'items-paginated', 'items-table', null);
234
		$(this).blur();
238
		$(this).blur();
235
    });
239
    });
236
	
240
	
237
	$("#scan-in-items-paginated .next").live('click', function() {
241
	$("#scan-in-items-paginated .next").live('click', function() {
-
 
242
		var warehouseId = $('input[name="warehouseId]');
238
		loadPaginatedNextItems('/getPaginatedScanInItems', null, 'scan-in-items-paginated', 'scan-in-items-table', null);
243
		loadPaginatedNextItems('/getPaginatedScanInItems/' + warehouseId, null, 'scan-in-items-paginated', 'scan-in-items-table', null);
239
		$(this).blur();
244
		$(this).blur();
240
    });
245
    });
241
	
246
	
242
	$("#scan-in-items-paginated .previous").live('click', function() {
247
	$("#scan-in-items-paginated .previous").live('click', function() {
243
		loadPaginatedPreviousItems('/getPaginatedScanInItems', null, 'scan-in-items-paginated', 'scan-in-items-table', null);
248
		loadPaginatedPreviousItems('/getPaginatedScanInItems', null, 'scan-in-items-paginated', 'scan-in-items-table', null);
Line 276... Line 281...
276
});
281
});
277
 
282
 
278
function scanInItemDialog(){
283
function scanInItemDialog(){
279
	var itemId = $('#items-for-scan-in').val();
284
	var itemId = $('#items-for-scan-in').val();
280
	var itemDescription = $('#items-for-scan-in option:selected').text();
285
	var itemDescription = $('#items-for-scan-in option:selected').text();
281
	var warehouseId = $('#warehouses-for-scan-in').val();
286
	var warehouseId = $('#warehouseId').val();
282
	var warehouseName = $('#warehouses-for-scan-in option:selected').text();
287
	var warehouseName = $('#warehouseName').val();
283
	var itemType = $('#items-for-scan-in option:selected').attr('itemType');
288
	var itemType = $('#items-for-scan-in option:selected').attr('itemType');
284
	var quantity = parseInt($('#quantity').val());
289
	var quantity = parseInt($('#quantity').val());
285
	if(quantity == undefined || quantity == "" || quantity <= 0 || isNaN(quantity)){
290
	if(quantity == undefined || quantity == "" || quantity <= 0 || isNaN(quantity)){
286
		quantity = 1;
291
		quantity = 1;
287
	}
292
	}
288
	console.log("itemId : "+itemId);
-
 
289
	console.log("itemDescription : "+itemDescription);
-
 
290
	console.log("warehouseId : "+warehouseId);
-
 
291
	console.log("warehouseName : "+warehouseName);
-
 
292
	console.log("itemType : "+itemType);
-
 
293
	console.log("quantity : "+quantity);
-
 
294
	
-
 
295
	$("#scanInItemModel .itemId").val(itemId);
293
	$("#scanInItemModel .itemId").val(itemId);
296
	$("#scanInItemModel .warehouseId").val(warehouseId);
294
	$("#scanInItemModel .warehouseId").val(warehouseId);
297
	
295
	
298
	$(".modal-body .itemInformation>span").text(itemDescription);
296
	$(".modal-body .itemInformation>span").text(itemDescription);
299
	$(".modal-body .warehouseName>span").text(warehouseName);
297
	$(".modal-body .warehouseName>span").text(warehouseName);
Line 450... Line 448...
450
	doGetAjaxRequestHandler(context+"/createItem", function(response){
448
	doGetAjaxRequestHandler(context+"/createItem", function(response){
451
		$('#' + domId).html(response);
449
		$('#' + domId).html(response);
452
	});
450
	});
453
}
451
}
454
 
452
 
455
function loadScanInItems(domId){
453
function loadScanInItems(warehouseId, domId){
456
	doGetAjaxRequestHandler(context+"/getScanInItems", function(response){
454
	doGetAjaxRequestHandler(context+"/getScanInItems/" + warehouseId, function(response){
457
		$('#' + domId).html(response);
455
		$('#' + domId).html(response);
458
	});
456
	});
459
}
457
}
460
 
458
 
461
function loadScanInPartnerItems(domId){
459
function loadScanInPartnerItems(domId){
Line 469... Line 467...
469
        $('#' + domId).html(response);
467
        $('#' + domId).html(response);
470
    });
468
    });
471
}
469
}
472
 
470
 
473
 
471
 
474
function loadScanOutItems(domId){
472
function loadScanOutItems(warehouseId, domId){
475
	doGetAjaxRequestHandler(context+"/getScanOutItems", function(response){
473
	doGetAjaxRequestHandler(context+"/getScanOutItems/" + warehouseId, function(response){
476
		$('#' + domId).html(response);
474
		$('#' + domId).html(response);
477
	});
475
	});
478
}
476
}
479
 
477
 
480
function loadWarehouseItemSerialNumbers(domId, itemId, warehouseId){
478
function loadWarehouseItemSerialNumbers(domId, itemId, warehouseId){