Subversion Repositories SmartDukaan

Rev

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

Rev 28651 Rev 29009
Line 75... Line 75...
75
			// ajax
75
			// ajax
76
		}
76
		}
77
	});
77
	});
78
 
78
 
79
	$("input.unitPrice").on('change', function() {
79
	$("input.unitPrice").on('change', function() {
-
 
80
		error = true;
80
		var $element = $(this);
81
		var $element = $(this);
81
		var unitPrice = parseFloat($element.val());
82
		var unitPrice = parseFloat($element.val());
82
		if (!isNaN(unitPrice)) {
83
		if (!isNaN(unitPrice)) {
83
			var itemType = parseFloat($(this).closest('tr').find('.serialNumber').attr("itemType"));
84
			var itemType = parseFloat($(this).closest('tr').find('.serialNumber').attr("itemType"));
84
			var mopPrice = parseFloat($(this).attr('mopPrice'));
85
			var mopPrice = parseFloat($(this).attr('mopPrice'));
Line 99... Line 100...
99
			} else if (itemType == 'NON_SERIALIZED' && unitPrice < dp) {
100
			} else if (itemType == 'NON_SERIALIZED' && unitPrice < dp) {
100
				alert("Selling Price must be greater than equal to DP");
101
				alert("Selling Price must be greater than equal to DP");
101
				$element.addClass("border-highlight");
102
				$element.addClass("border-highlight");
102
			} else {
103
			} else {
103
				$element.removeClass("border-highlight");
104
				$element.removeClass("border-highlight");
-
 
105
				error = false;
104
			}
106
			}
105
			// Clear insurance values if price changes
107
			// Clear insurance values if price changes
106
			$(this).closest('tr').find('.insuranceid').val("");
108
			$(this).closest('tr').find('.insuranceid').val("");
107
			$(this).closest('tr').find('.insuranceamount').val("0");
109
			$(this).closest('tr').find('.insuranceamount').val("0");
108
		}
110
		}
Line 187... Line 189...
187
	});
189
	});
188
 
190
 
189
}
191
}
190
function validateOrderDetails() {
192
function validateOrderDetails() {
191
	var sNumbers = [];
193
	var sNumbers = [];
192
	var error = false;
-
 
193
	$("form#cd input.serialNumber").each(function() {
194
	$("form#cd input.serialNumber").each(function() {
194
		var input = $(this).val().trim();
195
		var input = $(this).val().trim();
195
		var itemType = $(this).attr("itemType");
196
		var itemType = $(this).attr("itemType");
196
		$(this).removeClass("border-highlight");
197
		$(this).removeClass("border-highlight");
197
		if (sNumbers.indexOf(input) != -1 || (itemType === 'SERIALIZED' && !input)) {
198
		if (sNumbers.indexOf(input) != -1 || (itemType === 'SERIALIZED' && !input)) {