Subversion Repositories SmartDukaan

Rev

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

Rev 24457 Rev 26013
Line 120... Line 120...
120
		doPostAjaxRequestWithJsonHandler(context+"/scanSerialized", postData, function(response){
120
		doPostAjaxRequestWithJsonHandler(context+"/scanSerialized", postData, function(response){
121
			if(typeof loaderDialogObj!="undefined")
121
			if(typeof loaderDialogObj!="undefined")
122
				loaderDialogObj.modal('hide');
122
				loaderDialogObj.modal('hide');
123
			setTimeout(function(){
123
			setTimeout(function(){
124
				bootbox.alert("Purchase booked successfully");
124
				bootbox.alert("Purchase booked successfully");
125
				$("#scanModel").one("hidden.bs.modal", function () {
-
 
126
					$("#purchase-reference-submit-button").click();
125
				$("#purchase-reference-submit-button").click();
127
				});
-
 
128
				$('#scanModel').modal('hide');
126
				$('#scanModel').modal('hide');
129
			}, 300);
127
			}, 300);
130
		});
128
		});
131
		return false;
129
		return false;
132
	});
130
	});
Line 141... Line 139...
141
		var itemId = $("#scanNonSerializedModel .itemId").val();
139
		var itemId = $("#scanNonSerializedModel .itemId").val();
142
		var quantity = $("#scanNonSerializedModel .quantity").val();
140
		var quantity = $("#scanNonSerializedModel .quantity").val();
143
		var postData = JSON.stringify({"itemId":parseInt(itemId),"invoiceNumber":invoiceNumber,"quantity":parseInt(quantity)});
141
		var postData = JSON.stringify({"itemId":parseInt(itemId),"invoiceNumber":invoiceNumber,"quantity":parseInt(quantity)});
144
		doPostAjaxRequestWithJsonHandler(context+"/scanNonSerialized", postData, function(response){
142
		doPostAjaxRequestWithJsonHandler(context+"/scanNonSerialized", postData, function(response){
145
			if(typeof loaderDialogObj!="undefined")
143
			if(typeof loaderDialogObj!="undefined")
-
 
144
			{
146
				loaderDialogObj.modal('hide');
145
				loaderDialogObj.modal('hide');
-
 
146
			}
-
 
147
			$("#purchase-reference-submit-button").click();
147
			setTimeout(function(){
148
			setTimeout(function(){
148
				bootbox.alert("Purchase booked successfully");
149
				bootbox.alert("Purchase booked successfully");
149
				$("#scanModel").one("hidden.bs.modal", function () {
-
 
150
					$("#purchase-reference-submit-button").click();
-
 
151
				});
-
 
152
				$('#scanModel').modal('hide');
150
				$('#scanModel').modal('hide');
153
			}, 300);
151
			}, 300);
154
		});
152
		});
155
		return false;
153
		return false;
156
	});
154
	});
Line 192... Line 190...
192
			grnhistory.searchText = "";
190
			grnhistory.searchText = "";
193
		}
191
		}
194
		loadGrnHistorySearchInfo(grnhistory.searchText,grnhistory.searchType,grnhistory.startTime,grnhistory.endTime);
192
		loadGrnHistorySearchInfo(grnhistory.searchText,grnhistory.searchType,grnhistory.startTime,grnhistory.endTime);
195
    });
193
    });
196
	
194
	
-
 
195
	$("#grn-history-download-button").live('click', function() {
-
 
196
		grnhistory.searchText = $("#grn-history-search-text").val();
-
 
197
		grnhistory.searchType = "purchaseReference";
-
 
198
		grnhistory.startTime = startDate;
-
 
199
		grnhistory.endTime = endDate;
-
 
200
		if (typeof (grnhistory.searchText) == "undefined" || !grnhistory.searchText){
-
 
201
			grnhistory.searchText = "";
-
 
202
		}
-
 
203
		downloadPurchaseInvoices(grnhistory.searchText,grnhistory.searchType,grnhistory.startTime,grnhistory.endTime);
-
 
204
	});
-
 
205
	
197
	$("#grn-history-search-text").live("keyup", function(e) {
206
	$("#grn-history-search-text").live("keyup", function(e) {
198
		var keyCode = e.keyCode || e.which;
207
		var keyCode = e.keyCode || e.which;
199
    	if(keyCode == 13){
208
    	if(keyCode == 13){
200
        	$("#grn-history-search-button").click();
209
        	$("#grn-history-search-button").click();
201
    	}
210
    	}
Line 285... Line 294...
285
 
294
 
286
function loadGrnHistorySearchInfo(search_text,searchType,startTime,endTime){
295
function loadGrnHistorySearchInfo(search_text,searchType,startTime,endTime){
287
	loadGrnHistory("main-content",search_text,searchType,startTime,endTime);
296
	loadGrnHistory("main-content",search_text,searchType,startTime,endTime);
288
}
297
}
289
 
298
 
-
 
299
function downloadPurchaseInvoice(search_text,searchType,startTime,endTime){
-
 
300
	purchaseInvoice_url = context+"/grnHistory?purchaseReference="+purchase_reference+"&searchType="+searchType 
-
 
301
	+"&startTime="+startTime +"&endTime="+endTime;
-
 
302
}
-
 
303
 
290
function findDuplicateSerialNumbers(value){
304
function findDuplicateSerialNumbers(value){
291
    var result = $("#grnImeiInformation :input[value='" + value + "']").length - 1;
305
    var result = $("#grnImeiInformation :input[value='" + value + "']").length - 1;
292
    return result;
306
    return result;
293
}
307
}
294
 
308