Subversion Repositories SmartDukaan

Rev

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

Rev 25737 Rev 25778
Line 1... Line 1...
1
$(function(){
1
$(function(){
2
	$(document).on('click', 'button.mk_plan_select', function(){
2
	$(document).on('click', 'button.mk_plan_select', function(){
-
 
3
		$itemDetails = $('div.itemdetails');
-
 
4
		if($itemDetails.find('.ram').val()==='') {
-
 
5
			bootbox.alert('Mobile RAM is required');
-
 
6
			return;
-
 
7
		}
-
 
8
		if($itemDetails.find('.memory').val()==='') {
-
 
9
			bootbox.alert('Mobile Memory is required');
-
 
10
			return;
-
 
11
		}
-
 
12
		if($itemDetails.find('#dgmfgdate').val()==='') {
-
 
13
			bootbox.alert('Mobile Mfg Date is required');
-
 
14
			return;
-
 
15
		}
-
 
16
		$orderItemRow = $(planCheckedOn).closest('td');
3
		$(planCheckedOn).closest('td').find('.insuranceid').val($(this).data('key'));
17
		$orderItemRow.find('.insuranceid').val($(this).data('key'));
4
		$(planCheckedOn).closest('td').find('.insuranceamount').val($(this).data('amount'));
18
		$orderItemRow.find('.insuranceamount').val($(this).data('amount'));
-
 
19
		$orderItemRow.find('.ram').val($itemDetails.find('.dgram').val());
-
 
20
		$orderItemRow.find('.memory').val($itemDetails.find('.dgmemory').val());
-
 
21
		$orderItemRow.find('.mfgdate').val(startDate);
5
		$('#mobilePlansModal').modal('hide');
22
		$('#mobilePlansModal').modal('hide');
6
		calculateTotalAmount();
23
		calculateTotalAmount();
7
	});
24
	});
8
  
25
  
9
	$(".mk_restore").live('click', function() {
26
	$(".mk_restore").live('click', function() {
Line 51... Line 68...
51
	$(".create-order").live('click', function() {
68
	$(".create-order").live('click', function() {
52
		checkout("main-content");
69
		checkout("main-content");
53
	});
70
	});
54
	
71
	
55
	$(".mk_check_plans").live('click', function(){
72
	$(".mk_check_plans").live('click', function(){
-
 
73
		$('div.itemdetails').find('input').val('');
56
		var mop = parseFloat($(this).data("mop"));
74
		var mop = parseFloat($(this).data("mop"));
57
		var sellingPrice = $(this).val();
75
		var sellingPrice = $(this).val();
58
		var itemId = $(this).closest(".input-group").find("input.insuranceamount").attr("itemid");
76
		var itemId = $(this).closest(".input-group").find("input.insuranceamount").attr("itemid");
59
		if(!isNaN(sellingPrice) && parseFloat(sellingPrice) >= mop){
77
		if(!isNaN(sellingPrice) && parseFloat(sellingPrice) >= mop){
60
			price = paeseFloat(sellingPrice);
78
			price = paeseFloat(sellingPrice);
Line 100... Line 118...
100
				templateArr = [`<div class="row col-lg-6">${templateArr.join('')}</div>`];
118
				templateArr = [`<div class="row col-lg-6">${templateArr.join('')}</div>`];
101
			}
119
			}
102
		}
120
		}
103
		htmlArr.push(`<div class="row"><h4>${key}</h4>${templateArr.join('')}</div>`);
121
		htmlArr.push(`<div class="row"><h4>${key}</h4>${templateArr.join('')}</div>`);
104
	}
122
	}
105
	$('#mobilePlansModal').find('.modal-body').html(htmlArr.join(''));
123
	$('#mobilePlansModal').find('.insurancedetails').html(htmlArr.join(''));
106
	$('#mobilePlansModal').modal({show: true});
124
	$('#mobilePlansModal').modal({show: true});
107
 
125
 
108
}
126
}
109
 
127
 
110
 
128