Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
7410 amar.kumar 1
$(function() {
2
	$(function() {
9829 amar.kumar 3
		transferLotTable = $('#transfer-lots-table').dataTable({
7410 amar.kumar 4
			"sPaginationType": "full_numbers",
5
            "aaSorting" : [ [ 4, 'asc' ] ],
6
            "bAutoWidth": true,
7
            "iDisplayLength" : 50,
8
            "sDom" : 'T<"clear">lfrtip',
9
            "oTableTools" : {
10
                "sSwfPath" : "swf/copy_cvs_xls_pdf.swf"
11
            },
12
        });
13
	});
14
 
7716 amar.kumar 15
	/*$('#transfer-lot-receive-button').live('click', function() {
16
		var transferLotId = $(this).attr('transferLotId');
17
		$('#transfer-lot-updation-box').show();
18
		$('#update-transfer-lot').attr('transferLotId',transferLotId);
19
		$.colorbox({
20
			inline : true,
21
	        width : "325px",
22
	        height : "125px",
23
	        opacity : "0.30",
24
	        overlayClose :	true,
25
	        escKey :	true,
26
	        href : "#transfer-lot-updation-box",
27
	        onClosed : function() {
28
	            $("#transfer-lot-updation-box").hide();
29
	            $('#update-transfer-lot').removeAttr('transferLotId');
30
	        }
31
		});
32
	});*/
33
 
7410 amar.kumar 34
	$('#transfer-lot-receive-button').live('click', function() {
35
		var transferLotId = $(this).attr('transferLotId');
36
		$('#transfer-lot-updation-box').show();
37
		$('#update-transfer-lot').attr('transferLotId',transferLotId);
38
		$.colorbox({
39
			inline : true,
40
	        width : "325px",
41
	        height : "125px",
42
	        opacity : "0.30",
43
	        overlayClose :	true,
44
	        escKey :	true,
45
	        href : "#transfer-lot-updation-box",
46
	        onClosed : function() {
47
	            $("#transfer-lot-updation-box").hide();
48
	            $('#update-transfer-lot').removeAttr('transferLotId');
49
	        }
50
		});
51
	});
52
 
53
 
54
	$('#update-transfer-lot').live('click', function () {
55
		$.ajax({
56
			type : "POST",
57
			url : "/inventory/transfer-lot!markTransferLotAsReceived",
58
			data : "id="+$(this).attr('transferLotId')+"&remoteTransferRefNumber="+$('#transfer-lot-reference-number').val(),
59
			success : function(response) {
60
				alert("Successfully marked Transfer Lot as Recieved");
61
			},
62
			error : function(response) {
63
				alert("Error in marking Transfer Lot as Recieved");
64
			}
65
 
66
		});
67
	});
68
	/*$.ajax({
69
		type : "POST",
70
        url : "/inventory/transfer-lot!markTransferred",
71
        param : "id="+id+"&remoteTransferRefNumber=dummy",
72
        success : function(response) {
73
        	alert("Marked inventory lot as recieved");
74
        }
75
		error : function(response) {
76
        	alert("Failed to mark inventory lot as received");
77
        } 
78
	});*/
79
	$('#show-transfer-lot-items').live('click', function() {
80
		$.ajax({
81
			type : "GET",
82
			url : "/inventory/transfer-lot!getTransferLotItems?id="+$(this).attr('transferLotId'),
83
			success : function(response) {
84
				$.colorbox({
85
					inline : true,
86
			        width : "400px",
87
			        height : "500px",
88
			        opacity : "0.30",
89
			        overlayClose :	true,
90
			        escKey :	true,
91
			        href : $(response),
92
			        onClosed : function() {
93
			            //TODO
94
			        }
95
				});
96
			},
97
			error : function(response) {
98
				alert("Error in fetching Transfer Lot Items");
99
			}
100
		});
101
	});
102
	$('#add-transfer-lineitem').live('click', function(){
103
		/*var transfer-lot-line-item = '<tr ><td ><input type="text" class="itemId" name="" onkeypress="return disableEnterKey(event)" /></td>'+
104
			'<td ><input class="itemNumber" type="text" tabindex="$tabIndex" onkeypress="return disableEnterKey(event)"/></td>'+
105
            '<td ><input class="serialNumber" type="text" tabindex="$tabIndex" onkeypress="return disableEnterKey(event)"/></td>'+
106
            '<td ><input class="quantity" type="text" value="1" onkeypress="return disableEnterKey(event)"/></td></tr>';*/
107
//		$(transfer-lot-line-item).appendTo('#transfer-items-body')
108
		$('<tr ><td ><input type="text" class="itemId" name="" onkeypress="return disableEnterKey(event)" /></td>'+
109
				'<td ><input class="itemNumber" type="text" tabindex="$tabIndex" onkeypress="return disableEnterKey(event)"/></td>'+
110
	            '<td ><input class="serialNumber" type="text" tabindex="$tabIndex" onkeypress="return disableEnterKey(event)"/></td>'+
111
	            '<td ><input class="quantity" type="text" value="1" onkeypress="return disableEnterKey(event)"/></td></tr>').appendTo('#transfer-items-body')
112
	});
113
 
114
 
115
});