Subversion Repositories SmartDukaan

Rev

Rev 23783 | Rev 24435 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 23783 Rev 23886
Line 1... Line 1...
1
var grnhistory= grnhistory || {};
1
var grnhistory= grnhistory || {};
2
grnhistory.searchText = "";
2
grnhistory.searchText = "";
3
grnhistory.searchType = "";
3
grnhistory.searchType = "";
4
grnhistory.startTime = "0";
4
grnhistory.startTime = "0";
5
grnhistory.endTime = "0";
5
grnhistory.endTime = "0";
-
 
6
dateRangeCallback(moment(), moment());
6
 
7
 
7
$(function() {
8
$(function() {
8
	$(".new_grn").live('click', function() {
9
	$(".new_grn").live('click', function() {
9
		loadNewGrn("main-content");
10
		loadNewGrn("main-content");
10
	});
11
	});
11
 
12
 
12
	$(".grn_history").live('click', function() {
13
	$(".grn_history").live('click', function() {
13
		loadGrnHistory("main-content","","","0","0");
14
		loadGrnHistory("main-content","","",startDate,endDate);
14
	});
15
	});
15
	
16
	
16
	$(".pending_grn").live('click', function() {
17
	$(".pending_grn").live('click', function() {
17
		loadPendingGrn("main-content", "", "", "0", "0");
18
		loadPendingGrn("main-content");
18
	});
19
	});
19
 
20
 
20
	$("td.startGrnSerialized").live('click', function() {
21
	$("td.startGrnSerialized").live('click', function() {
21
		var invoiceNumber = $(this).attr('invoiceNumber');
22
		var invoiceNumber = $(this).attr('invoiceNumber');
22
		var quantity = $(this).attr('quantity');
23
		var quantity = $(this).attr('quantity');
Line 175... Line 176...
175
	});
176
	});
176
 
177
 
177
	$("#grn-history-search-button").live('click', function() {
178
	$("#grn-history-search-button").live('click', function() {
178
		grnhistory.searchText = $("#grn-history-search-text").val();
179
		grnhistory.searchText = $("#grn-history-search-text").val();
179
		grnhistory.searchType = "purchaseReference";
180
		grnhistory.searchType = "purchaseReference";
180
		grnhistory.startTime = "0";
181
		grnhistory.startTime = startDate;
181
		grnhistory.endTime = "0";
182
		grnhistory.endTime = endDate;
182
		if (typeof (grnhistory.searchText) == "undefined" || !grnhistory.searchText){
183
		if (typeof (grnhistory.searchText) == "undefined" || !grnhistory.searchText){
183
			grnhistory.searchText = "";
184
			grnhistory.searchText = "";
184
		}
185
		}
185
		loadGrnHistorySearchInfo(grnhistory.searchText,grnhistory.searchType,grnhistory.startTime,grnhistory.endTime);
186
		loadGrnHistorySearchInfo(grnhistory.searchText,grnhistory.searchType,grnhistory.startTime,grnhistory.endTime);
186
    });
187
    });
Line 214... Line 215...
214
		
215
		
215
    });
216
    });
216
	
217
	
217
	$("#grn-history-date-button").live('click', function() {
218
	$("#grn-history-date-button").live('click', function() {
218
		var dateRange = $('#reportrange span').text();
219
		var dateRange = $('#reportrange span').text();
219
		grnhistory.startTime = new Date(dateRange.split("-")[0]).getTime();
220
		grnhistory.startTime = startDate;
220
		grnhistory.endTime = new Date(dateRange.split("-")[1]).getTime();
221
		grnhistory.endTime = endDate;
221
		grnhistory.searchType = "dateFilter";
222
		grnhistory.searchType = "dateFilter";
222
		grnhistory.searchText = "";
223
		grnhistory.searchText = "";
223
		loadGrnHistorySearchInfo(grnhistory.searchText,grnhistory.searchType,grnhistory.startTime,grnhistory.endTime);
224
		loadGrnHistorySearchInfo(grnhistory.searchText,grnhistory.searchType,grnhistory.startTime,grnhistory.endTime);
224
    });
225
    });
225
 
226