Subversion Repositories SmartDukaan

Rev

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

Rev 23888 Rev 24052
Line 76... Line 76...
76
            return false; // required to block normal submit since you used ajax
76
            return false; // required to block normal submit since you used ajax
77
         }
77
         }
78
	});
78
	});
79
    
79
    
80
	$("input.unitPrice").change(function() {
80
	$("input.unitPrice").change(function() {
81
		console.log("unitPrice blur called");
-
 
82
		var $element = $(this);
81
		var $element = $(this);
83
		var unitPrice = parseFloat($element.val());
82
		var unitPrice = parseFloat($element.val());
84
		if(!isNaN(unitPrice)) {
83
		if(!isNaN(unitPrice)) {
85
			var itemType = parseFloat($(this).closest('tr').find('.serialNumber').attr("itemType"));
84
			var itemType = parseFloat($(this).closest('tr').find('.serialNumber').attr("itemType"));
86
			var mopPrice = parseFloat($(this).attr('mopPrice'));
85
			var mopPrice = parseFloat($(this).attr('mopPrice'));
87
			var dp = parseFloat($(this).attr('dp'));
86
			var dp = parseFloat($(this).attr('dp'));
-
 
87
			var mrp = parseFloat($(this).attr('mrp'));
-
 
88
			if(mrp != 0 && unitPrice > mrp) {
-
 
89
				alert("Selling Price should not be greater than MRP");
-
 
90
				$element.addClass("border-highlight");
88
			if(!accessoriesDeals && unitPrice < mopPrice){
91
			} else if(!accessoriesDeals && unitPrice < mopPrice){
89
				alert("Selling Price must be greater than equal to MOP");
92
				alert("Selling Price must be greater than equal to MOP");
90
				$element.addClass("border-highlight");
93
				$element.addClass("border-highlight");
91
			}else if(itemType=='SERIALIZED' && unitPrice < mop){
94
			}else if(itemType=='SERIALIZED' && unitPrice < mop){
92
				alert("Selling Price must be greater than equal to MOP");
95
				alert("Selling Price must be greater than equal to MOP");
93
				$element.addClass("border-highlight");
96
				$element.addClass("border-highlight");
Line 109... Line 112...
109
						break;
112
						break;
110
					}
113
					}
111
				});
114
				});
112
			}
115
			}
113
		}
116
		}
114
	}).focus(function(){
-
 
115
		console.log("unitPrice focus called");
-
 
116
		var $element = $(this);
-
 
117
		$element.closest('tr').find('.insuranceAmount').attr("placeholder", "");
-
 
118
	});
117
	});
119
	
118
	
120
	$( "input.phone").change(function() {
119
	$( "input.phone").change(function() {
121
		console.log("phone blur called");
120
		console.log("phone blur called");
122
		var mobileNumber = $(this).val();
121
		var mobileNumber = $(this).val();