Subversion Repositories SmartDukaan

Rev

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