Subversion Repositories SmartDukaan

Rev

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