Subversion Repositories SmartDukaan

Rev

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