Subversion Repositories SmartDukaan

Rev

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