Subversion Repositories SmartDukaan

Rev

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