Subversion Repositories SmartDukaan

Rev

Rev 11353 | Rev 25114 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4687 mandeep.dh 1
$(function() {
5361 mandeep.dh 2
    $('select.item').live('change', function() {
5369 mandeep.dh 3
        var tr = $(this).parent().parent();
5496 mandeep.dh 4
        var option = $(this).find('option:selected');
5369 mandeep.dh 5
 
5496 mandeep.dh 6
        $(tr).find('.serialNumber').removeClass('required').addClass(option.attr('hasSerialNumber'));
7
        $(tr).find('.itemNumber').removeClass('required').addClass(option.attr('hasItemNumber'));
8
 
9
        if (option.attr('hasSerialNumber') == 'required' || option.val() == -1) {
5369 mandeep.dh 10
            $(tr).find('.quantity').attr('readonly', true);
5496 mandeep.dh 11
            $(tr).find('.quantity').val(1.0);
5361 mandeep.dh 12
        }
13
        else {
5496 mandeep.dh 14
            $(tr).find('.quantity').removeAttr('readonly');
5361 mandeep.dh 15
        }
5110 mandeep.dh 16
 
5361 mandeep.dh 17
        return true;
18
    });
7410 amar.kumar 19
 
11350 manish.sha 20
    $('#instructionsLink').live('click', function() {
21
    	$('div#instrctionsDiv').show();
22
    	$.colorbox({
23
            inline : true,
24
            width : "500px",
11353 manish.sha 25
            height : "360px",
11350 manish.sha 26
            href : "div#instrctionsDiv",
27
            onClosed : function() {
28
                $("div#instrctionsDiv").hide();
29
            }
30
		});
31
    });
32
 
18668 manish.sha 33
    $("select#selectItemType").change(function () {
34
    	var selectType = $(this).val();
35
    	if(selectType=='SERIALIZED'){
36
    		$("div#selectItem").show();
37
    	}else{
38
    		$("select#bulkScanUploadItem").val("-1");
39
    		$("div#selectItem").hide();
40
    	}
41
    });
42
 
7410 amar.kumar 43
    /*$('#transfer-items-button').live('click', function(){
44
    	var transferWarehouseId = $('input[name="transferWarehouseId"]').val();
45
    	$.ajax({
46
    		type : "GET",
47
            url : "/inventory/purchase!setTransferItemsOption",
48
            data : "transferWarehouseId="+transferWarehouseId,
49
            success : function(response) {
50
                $('div#item-transfer-warehouse-selector').html("Items will be transferred to Warehouse ");
51
                $('form#scanItem').append($('<input type = "hidden" name="transferWarehouseId" value="12">'));
52
            }
53
    	});
54
    });*/
5110 mandeep.dh 55
});