Subversion Repositories SmartDukaan

Rev

Rev 22383 | Rev 25031 | 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
 
22382 amit.gupta 11
	/*$('form#tempForm').append($('<input type = "radio" name = "physicalWarehouseId" value = "7">Mahipalpur</input>'));
7676 amar.kumar 12
	$('form#tempForm').append($('<input type = "radio" name = "physicalWarehouseId" value = "12">Goregaon</input></br>'));
13
	$('form#tempForm').append($('<input type = "radio" name = "physicalWarehouseId" value = "13">Biwandi</input>'));
10864 manish.sha 14
	$('form#tempForm').append($('<input type = "radio" name = "physicalWarehouseId" value = "16">Mum-Amazon</input><br/>'));
15
	$('form#tempForm').append($('<input type = "radio" name = "physicalWarehouseId" value = "1765">Bangalore</input>'));
16
	$('form#tempForm').append($('<input type = "radio" name = "physicalWarehouseId" value = "1768">Bangalore-SR</input><br/>'));
12729 manish.sha 17
	$('form#tempForm').append($('<input type = "radio" name = "physicalWarehouseId" value = "1771">BAN-AMZ/Bangalore</input><br/>'));
12769 manish.sha 18
	$('form#tempForm').append($('<input type = "radio" name = "physicalWarehouseId" value = "2857">HR-SORPL/Gurgaon</input><br/>'));
12729 manish.sha 19
	$('form#tempForm').append($('<input type = "radio" name = "physicalWarehouseId" value = "2854">HR-FK/Gurgaon</input><br/>'));
13938 manish.sha 20
	$('form#tempForm').append($('<input type = "radio" name = "physicalWarehouseId" value = "4699">DL-FK/Mahipalpur-Delhi</input><br/>'));
21
	$('form#tempForm').append($('<input type = "radio" name = "physicalWarehouseId" value = "5314">DL-SD/Samalkha-Delhi</input><br/>'));	
13051 manish.sha 22
	$('form#tempForm').append($('<input type = "radio" name = "physicalWarehouseId" value = "3931">HR-FK/Gurgaon-S</input><br/>'));
12769 manish.sha 23
	$('form#tempForm').append($('<input type = "radio" name = "physicalWarehouseId" value = "3298">TG-SORPL/Hyderabad</input><br/>'));
15387 manish.sha 24
	$('form#tempForm').append($('<input type = "radio" name = "physicalWarehouseId" value = "5623">DL-AMZ/Amazon-Delhi</input><br/>'));
22382 amit.gupta 25
	$('form#tempForm').append($('<input type = "radio" name = "physicalWarehouseId" value = "3295">HR-AMZ/Mewat</input><br/><br/>'));*/
20709 amit.gupta 26
	$('form#tempForm').append($('<input type = "radio" name = "physicalWarehouseId" value = "7441">HR-AMPL/Gurgaon</input><br/><br/>'));
22382 amit.gupta 27
	$('form#tempForm').append($('<input type = "radio" name = "physicalWarehouseId" value = "7480">DL-AMPL/Delhi</input><br/><br/>'));
22629 amit.gupta 28
	$('form#tempForm').append($('<input type = "radio" name = "physicalWarehouseId" value = "7573">DL-NSSPL/Delhi</input><br/><br/>'));
29
	$('form#tempForm').append($('<input type = "radio" name = "physicalWarehouseId" value = "7678">DL-SOPL/HSPS</input><br/><br/>'));
30
	$('form#tempForm').append($('<input type = "radio" name = "physicalWarehouseId" value = "7681">HR-SOPL/HSPS</input><br/><br/>'));
7676 amar.kumar 31
	$('form#tempForm').append($('<input type = "submit"  value = "Submit"/>'));
32
 
33
	$.colorbox({
34
		inline : true,
35
        width : "325px",
12769 manish.sha 36
        height : "500px",
7676 amar.kumar 37
        opacity : "0.30",
38
        overlayClose :	true,
39
        escKey :	true,
40
        href : "#tempForm",
41
        onClosed : function() {
42
            $('#tempForm').remove();
43
        }
44
	});
45
	event.preventDefault();
46
	return false;
47
 
48
});
49
 
18041 manish.sha 50
$('a.warehousechangeprocess').live('click', function(){
51
	$('div#warehousechangeprocess').attr('style','color:blue;');
52
	$('div#warehousechangeprocess').show();
53
	setTimeout(function () {$('div#warehousechangeprocess').fadeOut('slow');}, 10000);
54
	$.ajax({
55
		type : "GET",
56
        url : "/inventory/inventory-reader!moveOrdersCorrectWarehouse",
57
        dataType  : 'json',
58
        success : function(response) {
59
        	$.each(response, function(key,value) {
60
        		$('div#warehousechangeprocess').attr('style','color:blue;');
61
        		$('div#warehousechangeprocess').text(value);
18047 manish.sha 62
        		$('div#warehousechangeprocess').show();
18041 manish.sha 63
        		setTimeout(function () {$('div#warehousechangeprocess').fadeOut('slow');}, 10000);
64
        	});
65
        },
66
        error : function() {
67
        	$('div#warehousechangeprocess').attr('style','color:red;');
68
        	$('div#warehousechangeprocess').text('Some Error Occured. Please Try After Some Time.');
69
        	$('div#warehousechangeprocess').show();
70
        	setTimeout(function () {$('div#warehousechangeprocess').fadeOut('slow');}, 10000);
71
        }
72
	});
73
 
74
});
7676 amar.kumar 75
 
18511 manish.sha 76
$('a.pendingPoReport').live('click', function(){
77
	$('div#pendingPoReport').attr('style','color:blue;');
78
	$('div#pendingPoReport').show();
79
	setTimeout(function () {$('div#pendingPoReport').fadeOut('slow');}, 10000);
80
	$.ajax({
81
		type : "GET",
18513 manish.sha 82
        url : "/inventory/inventory-reader!runPendingPurchaseOrderReport",
18511 manish.sha 83
        dataType  : 'json',
84
        success : function(response) {
85
        	$.each(response, function(key,value) {
86
        		$('div#pendingPoReport').attr('style','color:blue;');
87
        		$('div#pendingPoReport').text(value);
88
        		$('div#pendingPoReport').show();
89
        		setTimeout(function () {$('div#pendingPoReport').fadeOut('slow');}, 10000);
90
        	});
91
        },
92
        error : function() {
93
        	$('div#pendingPoReport').attr('style','color:red;');
94
        	$('div#pendingPoReport').text('Some Error Occured. Please Try After Some Time.');
95
        	$('div#pendingPoReport').show();
96
        	setTimeout(function () {$('div#pendingPoReport').fadeOut('slow');}, 10000);
97
        }
98
	});
99
 
100
});
101
 
7410 amar.kumar 102
function selectWarehouseForPOCreation() {
103
	$('#warehouse-selector-po-creation').show();
104
	$.colorbox({
105
		inline : true,
106
        width : "325px",
12769 manish.sha 107
        height : "500px",
7410 amar.kumar 108
        opacity : "0.30",
109
        overlayClose :	true,
110
        escKey :	true,
111
        href : "#warehouse-selector-po-creation",
112
        onClosed : function() {
113
            $("#warehouse-selector-po-creation").hide();
114
            $('#warehouse-selection-error').html("");
115
        }
116
	});
117
	event.preventDefault();
118
	return false;
119
}
120
 
121
function selectWarehouseForListingPO() {
122
	$('#warehouse-selector-po-recieve').show();
123
	$.colorbox({
124
		inline : true,
125
        width : "325px",
12769 manish.sha 126
        height : "500px",
7410 amar.kumar 127
        opacity : "0.30",
128
        overlayClose :	true,
129
        escKey :	true,
130
        href : "#warehouse-selector-po-recieve",
131
        onClosed : function() {
132
            $("#warehouse-selector-po-recieve").hide();
133
            $('#warehouse-selection-error').html("");
134
        }
135
	});
136
	event.preventDefault();
137
	return false;
138
}
139
 
140
function openPOCreationPage() {
141
	$.colorbox.close();
142
	warehouseId = $("#warehouse-selector-po-creation input[name='warehouse']:checked").val();
143
	if(warehouseId != 'undefined') {
144
		this.location.href = "/inventory/purchase-order/new?warehouseId="+warehouseId;
145
	} else {
146
		$('#warehouse-selection-error').html("<span>Please select warehouse</span>");
147
	}
148
}
149
 
150
function showOpenPOpage() {
151
	$.colorbox.close();
152
	warehouseId = $("#warehouse-selector-po-recieve input[name='warehouse']:checked").val();
153
	if(warehouseId != 'undefined') {
154
		this.location.href = "/inventory/purchase-order?warehouseId="+warehouseId;
155
	} else {
156
		$('#warehouse-selection-error').html("<span>Please select warehouse</span>");
157
	}
158
}