Subversion Repositories SmartDukaan

Rev

Rev 22629 | Rev 26633 | 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/>'));
25031 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/>'));
25031 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/>'));
25031 amit.gupta 29
	$('form#tempForm').append($('<input type = "radio" name = "physicalWarehouseId" value = "7678">UP-NSSPL/Noida</input><br/><br/>'));
30
	$('form#tempForm').append($('<input type = "radio" name = "physicalWarehouseId" value = "7681">HR-NSSPL/Faridabad</input><br/><br/>'));
31
	$('form#tempForm').append($('<input type = "radio" name = "physicalWarehouseId" value = "8468">UP-NSSPL/Lucknow</input><br/><br/>'));
7676 amar.kumar 32
	$('form#tempForm').append($('<input type = "submit"  value = "Submit"/>'));
33
 
34
	$.colorbox({
35
		inline : true,
36
        width : "325px",
12769 manish.sha 37
        height : "500px",
7676 amar.kumar 38
        opacity : "0.30",
39
        overlayClose :	true,
40
        escKey :	true,
41
        href : "#tempForm",
42
        onClosed : function() {
43
            $('#tempForm').remove();
44
        }
45
	});
46
	event.preventDefault();
47
	return false;
48
 
49
});
50
 
18041 manish.sha 51
$('a.warehousechangeprocess').live('click', function(){
52
	$('div#warehousechangeprocess').attr('style','color:blue;');
53
	$('div#warehousechangeprocess').show();
54
	setTimeout(function () {$('div#warehousechangeprocess').fadeOut('slow');}, 10000);
55
	$.ajax({
56
		type : "GET",
57
        url : "/inventory/inventory-reader!moveOrdersCorrectWarehouse",
58
        dataType  : 'json',
59
        success : function(response) {
60
        	$.each(response, function(key,value) {
61
        		$('div#warehousechangeprocess').attr('style','color:blue;');
62
        		$('div#warehousechangeprocess').text(value);
18047 manish.sha 63
        		$('div#warehousechangeprocess').show();
18041 manish.sha 64
        		setTimeout(function () {$('div#warehousechangeprocess').fadeOut('slow');}, 10000);
65
        	});
66
        },
67
        error : function() {
68
        	$('div#warehousechangeprocess').attr('style','color:red;');
69
        	$('div#warehousechangeprocess').text('Some Error Occured. Please Try After Some Time.');
70
        	$('div#warehousechangeprocess').show();
71
        	setTimeout(function () {$('div#warehousechangeprocess').fadeOut('slow');}, 10000);
72
        }
73
	});
74
 
75
});
7676 amar.kumar 76
 
18511 manish.sha 77
$('a.pendingPoReport').live('click', function(){
78
	$('div#pendingPoReport').attr('style','color:blue;');
79
	$('div#pendingPoReport').show();
80
	setTimeout(function () {$('div#pendingPoReport').fadeOut('slow');}, 10000);
81
	$.ajax({
82
		type : "GET",
18513 manish.sha 83
        url : "/inventory/inventory-reader!runPendingPurchaseOrderReport",
18511 manish.sha 84
        dataType  : 'json',
85
        success : function(response) {
86
        	$.each(response, function(key,value) {
87
        		$('div#pendingPoReport').attr('style','color:blue;');
88
        		$('div#pendingPoReport').text(value);
89
        		$('div#pendingPoReport').show();
90
        		setTimeout(function () {$('div#pendingPoReport').fadeOut('slow');}, 10000);
91
        	});
92
        },
93
        error : function() {
94
        	$('div#pendingPoReport').attr('style','color:red;');
95
        	$('div#pendingPoReport').text('Some Error Occured. Please Try After Some Time.');
96
        	$('div#pendingPoReport').show();
97
        	setTimeout(function () {$('div#pendingPoReport').fadeOut('slow');}, 10000);
98
        }
99
	});
100
 
101
});
102
 
7410 amar.kumar 103
function selectWarehouseForPOCreation() {
104
	$('#warehouse-selector-po-creation').show();
105
	$.colorbox({
106
		inline : true,
107
        width : "325px",
12769 manish.sha 108
        height : "500px",
7410 amar.kumar 109
        opacity : "0.30",
110
        overlayClose :	true,
111
        escKey :	true,
112
        href : "#warehouse-selector-po-creation",
113
        onClosed : function() {
114
            $("#warehouse-selector-po-creation").hide();
115
            $('#warehouse-selection-error').html("");
116
        }
117
	});
118
	event.preventDefault();
119
	return false;
120
}
121
 
122
function selectWarehouseForListingPO() {
123
	$('#warehouse-selector-po-recieve').show();
124
	$.colorbox({
125
		inline : true,
126
        width : "325px",
12769 manish.sha 127
        height : "500px",
7410 amar.kumar 128
        opacity : "0.30",
129
        overlayClose :	true,
130
        escKey :	true,
131
        href : "#warehouse-selector-po-recieve",
132
        onClosed : function() {
133
            $("#warehouse-selector-po-recieve").hide();
134
            $('#warehouse-selection-error').html("");
135
        }
136
	});
137
	event.preventDefault();
138
	return false;
139
}
140
 
141
function openPOCreationPage() {
142
	$.colorbox.close();
143
	warehouseId = $("#warehouse-selector-po-creation input[name='warehouse']:checked").val();
144
	if(warehouseId != 'undefined') {
145
		this.location.href = "/inventory/purchase-order/new?warehouseId="+warehouseId;
146
	} else {
147
		$('#warehouse-selection-error').html("<span>Please select warehouse</span>");
148
	}
149
}
150
 
151
function showOpenPOpage() {
152
	$.colorbox.close();
153
	warehouseId = $("#warehouse-selector-po-recieve input[name='warehouse']:checked").val();
154
	if(warehouseId != 'undefined') {
155
		this.location.href = "/inventory/purchase-order?warehouseId="+warehouseId;
156
	} else {
157
		$('#warehouse-selection-error').html("<span>Please select warehouse</span>");
158
	}
159
}