Subversion Repositories SmartDukaan

Rev

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