Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
7410 amar.kumar 1
 
7676 amar.kumar 2
 
3
function closeColorBox(){
4
	$.colorbox.close();
5
}
6
 
7
$('.link-requiring-warehouse-selection').live('click', function(){
8
	var linkurl = $(this).attr('href');
9
	$('<form id = "tempForm" onsubmit = "closeColorBox() "style = "text-align:center" method = "GET" action = "'+ linkurl +'">').appendTo('body');
10
 
22629 amit.gupta 11
	$('form#tempForm').append($('<input type = "radio" name = "physicalWarehouseId" value = "7573">DL-NSSPL/Delhi</input><br/><br/>'));
25031 amit.gupta 12
	$('form#tempForm').append($('<input type = "radio" name = "physicalWarehouseId" value = "7678">UP-NSSPL/Noida</input><br/><br/>'));
31475 amit.gupta 13
	$('form#tempForm').append($('<input type = "radio" name = "physicalWarehouseId" value = "9349">UP-NSSPL/Saharanpur</input><br/><br/>'));
25031 amit.gupta 14
	$('form#tempForm').append($('<input type = "radio" name = "physicalWarehouseId" value = "7681">HR-NSSPL/Faridabad</input><br/><br/>'));
15
	$('form#tempForm').append($('<input type = "radio" name = "physicalWarehouseId" value = "8468">UP-NSSPL/Lucknow</input><br/><br/>'));
26633 amit.gupta 16
	$('form#tempForm').append($('<input type = "radio" name = "physicalWarehouseId" value = "7720">DL-NSSPL/Delhi-HR</input><br/><br/>'));
27717 amit.gupta 17
	$('form#tempForm').append($('<input type = "radio" name = "physicalWarehouseId" value = "8889">Punjab</input><br/><br/>'));
28821 amit.gupta 18
	$('form#tempForm').append($('<input type = "radio" name = "physicalWarehouseId" value = "8947">Rajasthan</input><br/><br/>'));
31131 amit.gupta 19
	$('form#tempForm').append($('<input type = "radio" name = "physicalWarehouseId" value = "9203">Uttarakhand</input><br/><br/>'));
7676 amar.kumar 20
	$('form#tempForm').append($('<input type = "submit"  value = "Submit"/>'));
21
 
22
	$.colorbox({
23
		inline : true,
24
        width : "325px",
12769 manish.sha 25
        height : "500px",
7676 amar.kumar 26
        opacity : "0.30",
27
        overlayClose :	true,
28
        escKey :	true,
29
        href : "#tempForm",
30
        onClosed : function() {
31
            $('#tempForm').remove();
32
        }
33
	});
34
	event.preventDefault();
35
	return false;
36
 
37
});
38
 
18041 manish.sha 39
$('a.warehousechangeprocess').live('click', function(){
40
	$('div#warehousechangeprocess').attr('style','color:blue;');
41
	$('div#warehousechangeprocess').show();
42
	setTimeout(function () {$('div#warehousechangeprocess').fadeOut('slow');}, 10000);
43
	$.ajax({
44
		type : "GET",
45
        url : "/inventory/inventory-reader!moveOrdersCorrectWarehouse",
46
        dataType  : 'json',
47
        success : function(response) {
48
        	$.each(response, function(key,value) {
49
        		$('div#warehousechangeprocess').attr('style','color:blue;');
50
        		$('div#warehousechangeprocess').text(value);
18047 manish.sha 51
        		$('div#warehousechangeprocess').show();
18041 manish.sha 52
        		setTimeout(function () {$('div#warehousechangeprocess').fadeOut('slow');}, 10000);
53
        	});
54
        },
55
        error : function() {
56
        	$('div#warehousechangeprocess').attr('style','color:red;');
57
        	$('div#warehousechangeprocess').text('Some Error Occured. Please Try After Some Time.');
58
        	$('div#warehousechangeprocess').show();
59
        	setTimeout(function () {$('div#warehousechangeprocess').fadeOut('slow');}, 10000);
60
        }
61
	});
62
 
63
});
7676 amar.kumar 64
 
18511 manish.sha 65
$('a.pendingPoReport').live('click', function(){
66
	$('div#pendingPoReport').attr('style','color:blue;');
67
	$('div#pendingPoReport').show();
68
	setTimeout(function () {$('div#pendingPoReport').fadeOut('slow');}, 10000);
69
	$.ajax({
70
		type : "GET",
18513 manish.sha 71
        url : "/inventory/inventory-reader!runPendingPurchaseOrderReport",
18511 manish.sha 72
        dataType  : 'json',
73
        success : function(response) {
74
        	$.each(response, function(key,value) {
75
        		$('div#pendingPoReport').attr('style','color:blue;');
76
        		$('div#pendingPoReport').text(value);
77
        		$('div#pendingPoReport').show();
78
        		setTimeout(function () {$('div#pendingPoReport').fadeOut('slow');}, 10000);
79
        	});
80
        },
81
        error : function() {
82
        	$('div#pendingPoReport').attr('style','color:red;');
83
        	$('div#pendingPoReport').text('Some Error Occured. Please Try After Some Time.');
84
        	$('div#pendingPoReport').show();
85
        	setTimeout(function () {$('div#pendingPoReport').fadeOut('slow');}, 10000);
86
        }
87
	});
88
 
89
});
90
 
7410 amar.kumar 91
function selectWarehouseForPOCreation() {
92
	$('#warehouse-selector-po-creation').show();
93
	$.colorbox({
94
		inline : true,
95
        width : "325px",
12769 manish.sha 96
        height : "500px",
7410 amar.kumar 97
        opacity : "0.30",
98
        overlayClose :	true,
99
        escKey :	true,
100
        href : "#warehouse-selector-po-creation",
101
        onClosed : function() {
102
            $("#warehouse-selector-po-creation").hide();
103
            $('#warehouse-selection-error').html("");
104
        }
105
	});
106
	event.preventDefault();
107
	return false;
108
}
109
 
110
function selectWarehouseForListingPO() {
111
	$('#warehouse-selector-po-recieve').show();
112
	$.colorbox({
113
		inline : true,
114
        width : "325px",
12769 manish.sha 115
        height : "500px",
7410 amar.kumar 116
        opacity : "0.30",
117
        overlayClose :	true,
118
        escKey :	true,
119
        href : "#warehouse-selector-po-recieve",
120
        onClosed : function() {
121
            $("#warehouse-selector-po-recieve").hide();
122
            $('#warehouse-selection-error').html("");
123
        }
124
	});
125
	event.preventDefault();
126
	return false;
127
}
128
 
129
function openPOCreationPage() {
130
	$.colorbox.close();
131
	warehouseId = $("#warehouse-selector-po-creation input[name='warehouse']:checked").val();
132
	if(warehouseId != 'undefined') {
133
		this.location.href = "/inventory/purchase-order/new?warehouseId="+warehouseId;
134
	} else {
135
		$('#warehouse-selection-error').html("<span>Please select warehouse</span>");
136
	}
137
}
138
 
139
function showOpenPOpage() {
140
	$.colorbox.close();
141
	warehouseId = $("#warehouse-selector-po-recieve input[name='warehouse']:checked").val();
142
	if(warehouseId != 'undefined') {
143
		this.location.href = "/inventory/purchase-order?warehouseId="+warehouseId;
144
	} else {
145
		$('#warehouse-selection-error').html("<span>Please select warehouse</span>");
146
	}
147
}