Subversion Repositories SmartDukaan

Rev

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