Subversion Repositories SmartDukaan

Rev

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

Rev 28339 Rev 28395
Line 292... Line 292...
292
	$("#order-items").find("tr:not(:first-child)").each(function(index, el) {
292
	$("#order-items").find("tr:not(:first-child)").each(function(index, el) {
293
		// console.log(el);
293
		// console.log(el);
294
		// console.log(index);
294
		// console.log(index);
295
		var $el = $(el);
295
		var $el = $(el);
296
		var $unitPriceElement = $el.find('.unitPrice');
296
		var $unitPriceElement = $el.find('.unitPrice');
-
 
297
		var $discountElement = $el.find('.discount');
297
 
298
 
298
		var itemId = parseInt($unitPriceElement.attr("itemId"));
299
		var itemId = parseInt($unitPriceElement.attr("itemId"));
299
		var unitPrice = parseFloat($unitPriceElement.val());
300
		var unitPrice = parseFloat($unitPriceElement.val());
-
 
301
		var discount = parseFloat($discountElement.val());
-
 
302
		if(isNaN(discount)) {
-
 
303
			discount = 0;
-
 
304
		}
300
		var qty = parseInt($unitPriceElement.attr("quantity"));
305
		var qty = parseInt($unitPriceElement.attr("quantity"));
301
		var tmpObj = { 'itemId': itemId, 'sellingPrice': unitPrice, 'quantity': qty };
306
		var tmpObj = { 'itemId': itemId, 'sellingPrice': unitPrice-discount, 'quantity': qty, 'discountAmount' : discount };
302
 
307
 
303
		if (orderObj['fofoOrderItems'][itemId] === undefined) {
308
		if (orderObj['fofoOrderItems'][itemId] === undefined) {
304
			tmpObj['serialNumberDetails'] = [];
309
			tmpObj['serialNumberDetails'] = [];
305
		} else {
310
		} else {
306
			// tmpObj['serialNumbers'] = orderObj['fofoLineItems'][itemId];
311
			// tmpObj['serialNumbers'] = orderObj['fofoLineItems'][itemId];