Subversion Repositories SmartDukaan

Rev

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