Subversion Repositories SmartDukaan

Rev

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

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