Subversion Repositories SmartDukaan

Rev

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

Rev 24019 Rev 24052
Line 34... Line 34...
34
						}
34
						}
35
					}
35
					}
36
			);
36
			);
37
		}
37
		}
38
	});
38
	});
-
 
39
	$("button.add-pricing").live('click', function() {
-
 
40
		if($("#typeaheaditem1").val().trim().length == 0){
-
 
41
			alert("Please choose Item");
-
 
42
			return;
-
 
43
		}
-
 
44
		var mop = $("#mop").val();
-
 
45
		var dp = $("#dp").val();
-
 
46
		var mrp = $("#mrp").val();
-
 
47
		if(isNan(dp) || isNan(mop)) {
-
 
48
			alert("DP/MOP/MRP should be a number");
-
 
49
		}
-
 
50
		if(confirm("Are you sure?")) {
-
 
51
			var obj = {
-
 
52
					itemId:currentItem1.itemId,
-
 
53
					mop:parseFloat(mop),
-
 
54
					dp:parseFloat(dp),
-
 
55
					mrp:parseFloat(mrp)
-
 
56
			}
-
 
57
			doPostAjaxRequestWithJsonHandler(
-
 
58
					context+"/add-pricing", JSON.stringify(obj),
-
 
59
					function(response) {
-
 
60
						if (response == 'true') {
-
 
61
							$('#newPriceDropModal').find('button.close').trigger('click');
-
 
62
							setTimeout(() => {
-
 
63
								alert("PriceDrop added successfully")
-
 
64
								loadPriceDrop("main-content");
-
 
65
							}, 500);
-
 
66
						} else {
-
 
67
							alert("Something went wrong pls try after sometime");
-
 
68
						}
-
 
69
					}
-
 
70
			);
-
 
71
		}
-
 
72
		
-
 
73
	});
39
	$("button.addPriceDrop").live('click', function() {
74
	$("button.addPriceDrop").live('click', function() {
40
		if($("#typeaheaditem").val().trim().length == 0){
75
		if($("#typeaheaditem").val().trim().length == 0){
41
			alert("Please choose Item");
76
			alert("Please choose Item");
42
			return;
77
			return;
43
		}
78
		}
-
 
79
 
44
		var priceDrop = $("#pd").val();
80
		var priceDrop = $("#pd").val();
45
		var newTp = $("#newTp").val();
81
		var newTp = $("#newTp").val();
46
		var newMop = $("#newMop").val();
82
		var newMop = $("#newMop").val();
47
		var newNlc = $("#newNlc").val();
83
		var newNlc = $("#newNlc").val();
48
		var affectedOn = $("#affectedDate").val();
84
		var affectedOn = $("#affectedDate").val();