Subversion Repositories SmartDukaan

Rev

Rev 27190 | Rev 28055 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
27190 amit.gupta 1
<style>
2
 
3
	.btn:hover{
4
  		color: grey;
5
  		text-decoration: none;
6
	}
7
	.btn-info:hover{
8
  		color: grey;
9
  		text-decoration: none;
10
	}
11
}
12
</style>
13
<section class="wrapper">     
14
	<div class="row">
15
		<div class="col-lg-12">
16
			<h3 class="page-header"><i class="icon_document_alt"></i>Catalog Item Management</h3>
17
			<ol class="breadcrumb">
18
				<li><i class="fa fa-home"></i><a href="${rc.contextPath}/dashboard">Home</a></li>
19
				<li><i class="icon_document_alt"></i>PriceDrop</li>
20
				<li><button type="button" data-toggle="modal" class="btn btn-sm btn-primary mk_download_pricing" data-target="#addPricing">Download Pricing</li>
21
				<li><button type="button" data-toggle="modal" class="btn btn-sm btn-primary" data-target="#addPriceModal">Add/Update Pricing</li>
22
			</ol>
23
		</div>
24
	</div>
25
	<div class="form-group row">
26
		<div class="col-lg-8">
27
			<label for="typeaheaditem1">Item:</label>
28
	    	<input placeholder="Search Item" type="text" class="form-control typeahead" id="typeaheaditem1" name="Item" data-provide="typeahead" autocomplete="off">
29
	    </div>
30
		<div class="col-lg-4">
31
			<div>&nbsp;</div>
32
			<button type="button" class="btn btn-primary mk_pause_button">Active/Pause</button>
33
		</div>
34
	</div>	
35
</section>
36
<script type="text/javascript">
37
$(document).ready(function() {
38
	var start = moment().subtract(29, 'days');
39
	var end = moment();
40
 
41
  	priceDropTable = $('#priceDrop').find('table').DataTable({
42
  		pageLength: 20,
43
  		order:[[ 5, 'desc' ]]
44
	});
45
 
46
 
27618 tejbeer 47
  	getItemAheadOptions($("#typeaheaditem"),true,function(selectedItem){
27190 amit.gupta 48
		currentItem = selectedItem;
49
		doGetAjaxRequestHandler(context+"/item-pricing/"+currentItem.itemId, function(response){
50
			response = JSON.parse(response);
51
			$('#oldDp').html(response.dp);
52
			$('#oldMop').html(response.mop);
53
			$('#oldTp').html(response.tp);
54
			$('#oldNlc').html(response.nlc);
55
		});
56
	});
27618 tejbeer 57
	getItemAheadOptions($("#typeaheaditem1"),true, function(selectedItem){
27190 amit.gupta 58
		currentItem = selectedItem;
59
		doGetAjaxRequestHandler(context+"/item-pricing/"+currentItem.itemId, function(response){
60
			$('.mk_pause_button').data("id", currentItem.catalogId);
61
			$('.mk_pause_button').data("description", currentItem.itemDescription);
62
			response = JSON.parse(response);
63
			$("#mop").val(response.mop);
64
			$("#mrp").val(response.mrp);
65
			$("#dp").val(response.dp);
66
			$("#tp").val(response.tp);
67
			$('#dpValue').html("DP -" + response.dp);
68
			$('#mopValue').html("MOP -" + response.mop);
69
			$('#mrpValue').html("MRP -"+ response.mrp);
70
			$('#tpValue').html("TP -"+ response.tp);
71
		});
72
	});
73
	affectedDateInput=$('#affectedDate');
74
	affectedDateInput.daterangepicker(getSingleDatePicker(), dateRangeCallback);
75
	$("#newPriceDropModal").on('hidden.bs.modal', function () {
76
	      $("#pdForm").trigger("reset");
77
	});
78
	$("#addPriceModal").on('hidden.bs.modal', function () {
79
	      $("#pdForm1").trigger("reset");
80
	});
81
});
82
</script>