Subversion Repositories SmartDukaan

Rev

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