Subversion Repositories SmartDukaan

Rev

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