Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
23819 govind 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>PriceDrop</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>
23868 amit.gupta 20
				<li><button type="button" data-toggle="modal" class="btn btn-sm btn-primary mk_new_price_drop" data-target="#newPriceDropModal">Add new</li>
21
				<!-- Modal -->
22
				<div id="newPriceDropModal" class="modal fade" role="dialog">
23
				  <div class="modal-dialog">
24
 
25
				    <!-- Modal content-->
26
				    <div class="modal-content">
27
				      <div class="modal-header">
28
				        <button type="button" class="close" data-dismiss="modal">&times;</button>
29
				        <h4 class="modal-title">Add Price Drop</h4>
30
				      </div>
31
				      <div class="modal-body">
32
			      		<form id="pdForm">
23876 amit.gupta 33
						  <div class="form-group row">
23951 amit.gupta 34
					  			<div class="col-lg-6">
23876 amit.gupta 35
							    	<input placeholder="Search Item" type="text" class="form-control typeahead" id="typeaheaditem" name="Item" data-provide="typeahead" autocomplete="off">
36
							    </div>
23951 amit.gupta 37
							    <div class="col-lg-3">
38
								    <input type="text" class="form-control" id="affectedDate" placeholder="Affected on" type="text"/>
39
								</div>
40
							    <div class="col-lg-3">
41
									<button type="button" class="btn btn-primary download-imeis">Download IMEIs</button>
42
								</div>
43
							    <!--<div class="col-lg-4 checkbox">
23876 amit.gupta 44
								  <label><input id="allColors" type="checkbox" value="">Apply to all Colors</label>
23951 amit.gupta 45
								</div>-->
23868 amit.gupta 46
						  </div>
47
						  <div class="form-group row">
24019 amit.gupta 48
							<div class="col-lg-4">
24049 amit.gupta 49
							    <label for="dpDrop">MOP:(<span id="oldMop"></span>)</label>
24019 amit.gupta 50
							    <input type="number" class="form-control" id="newMop">
23868 amit.gupta 51
							</div>
24019 amit.gupta 52
						    <div class="col-lg-3">
53
								<button type="button" class="btn btn-primary update-mop">Update MOP</button>
54
							</div>
23951 amit.gupta 55
 
23868 amit.gupta 56
						  </div>
57
						  <div class="form-group row">
24049 amit.gupta 58
						  	<div class="col-lg-3">
59
						  		<label for="priceDrop">Drop Announced:</label>
24019 amit.gupta 60
							    <input type="number" class="form-control" id="pd">
23868 amit.gupta 61
							</div>
24049 amit.gupta 62
						  	<div class="col-lg-3">
63
						  		<label for="dp">Current DP</label>
24047 amit.gupta 64
							    <input type="number" readonly class="form-control" id="dp">
65
							</div>
24048 amit.gupta 66
							<div class="col-lg-3">
24049 amit.gupta 67
							    <label for="newTp">TP:(<span id="oldTp"></span>)</label>
23868 amit.gupta 68
							    <input type="number" class="form-control" id="newTp">
69
							</div>
24048 amit.gupta 70
							<div class="col-lg-3">
24049 amit.gupta 71
							    <label for="newNlc">NLC:(<span id="oldNlc"></span>)</label>
23868 amit.gupta 72
							    <input type="number" class="form-control" id="newNlc">
73
							</div>
74
						  </div>
75
						</form>
76
				      </div>
77
				      <div class="modal-footer">
23951 amit.gupta 78
						  <button type="button" class="addPriceDrop btn btn-primary">Add Price Drop</button>
23868 amit.gupta 79
				        <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
80
				      </div>
81
				    </div>
82
 
83
				  </div>
84
				</div>
23819 govind 85
			</ol>
86
		</div>
87
	</div>
88
 
89
    <div class="price-drop-table">
90
	  <div class="row">
91
			<div class="col-lg-12" id="priceDrop" >
92
				<table class="table table-striped table-condensed table-bordered">
93
	    			<thead>
94
			            <tr>
23968 amit.gupta 95
							<th>Item Name</th>
96
							<th>Old DP</th>
97
							<th>Price Drop</th>
24047 amit.gupta 98
							<th>Mop</th>
23968 amit.gupta 99
							<th>TP</th>
100
							<th>NLC </th>
101
							<th>Affected On</th>
23876 amit.gupta 102
							<th>Created On</th>
23968 amit.gupta 103
							<th>Price Drop In</th>
23876 amit.gupta 104
							<th>Partner Payout</th>
105
							<th>Processed On</th>
106
							<th>Download IMEIs</th>
23819 govind 107
 
108
			            </tr>
109
			        </thead>
110
					<tbody>
111
						#foreach($priceDrop in $priceDrops )
23968 amit.gupta 112
						<tr data-pricedropid="$priceDrop.getId()">
113
							<td>$catalogDescription.get($priceDrop.getCatalogItemId())</td>
114
							<td>$priceDrop.getOldDp()</td>
23819 govind 115
							<td>$priceDrop.getAmount()</td>
24047 amit.gupta 116
							<td>$priceDrop.getMop()</td>
23968 amit.gupta 117
							<td>$priceDrop.getTp()</td>
118
							<td>$priceDrop.getNlc()</td>
23868 amit.gupta 119
							<td>$priceDrop.getAffectedOn().format($dateFormatter)</td>
23876 amit.gupta 120
							<td>$priceDrop.getCreatedOn().format($dateTimeFormatter)</td>
23819 govind 121
							#if($priceDrop.getProcessTimestamp())
23876 amit.gupta 122
							<td>$priceDrop.getPriceDropIn()</td>
123
							<td>$priceDrop.getPartnerPayout()</td>
23868 amit.gupta 124
							<td>$priceDrop.getProcessTimestamp().format($dateTimeFormatter)</td>	
23819 govind 125
							#else
23876 amit.gupta 126
							<td>
23968 amit.gupta 127
									<input type="number" name="priceDropIn" placeholder = "Price Drop In"   class="form-control price-drop-in input-sm"/>
23876 amit.gupta 128
							</td>
129
							<td>
23968 amit.gupta 130
									<input type="number" name="partnerPayout" placeholder = "Partner Payout"   class="form-control partner-payout input-sm"/>
23876 amit.gupta 131
							</td>
132
							<td>
23968 amit.gupta 133
								<input class="btn btn-info btn-sm mk_process_price_drop" data-cashback="$priceDrop.getId()" type="submit" value="Process"/>
23876 amit.gupta 134
							</td>
23819 govind 135
							#end
23876 amit.gupta 136
							<td>
137
								<input class="downloadtotalIMEI btn btn-info btn-sm" value="Download" type="submit" />
138
							</td>
139
						</tr>
23819 govind 140
						#end
141
					</tbody>
142
				</table>
143
				</div>
144
				</div>
145
				</div>
146
				</section>
147
 
148
				<script type="text/javascript">
149
$(document).ready(function() {
23868 amit.gupta 150
	    var start = moment().subtract(29, 'days');
151
    	var end = moment();
152
 
23819 govind 153
  priceDropTable = $('#priceDrop').find('table').DataTable({
24047 amit.gupta 154
  "pageLength": 20,
23819 govind 155
  order:[[ 5, 'desc' ]]
156
  });
23868 amit.gupta 157
  customItems = $customItems;
158
  itemAhead = $("#typeaheaditem").typeahead({
159
	  source: customItems,
160
	  autoSelect: false,
161
	  displayText:function(item){return item.itemDescription;},
23876 amit.gupta 162
	  afterSelect:	function(selectedItem){
163
	  					console.log(selectedItem);
164
	  					currentItem = selectedItem;
24047 amit.gupta 165
	  					doGetAjaxRequestHandler(context+"/item-pricing/"+currentItem.itemId, function(response){
166
	  						response = JSON.parse(response);
167
							$('#dp').val(response.dp);
24049 amit.gupta 168
							$('#oldMop').html(response.mop);
169
							$('#oldTp').html(response.tp);
170
							$('#oldNlc').html(response.nlc);
24047 amit.gupta 171
						});
23868 amit.gupta 172
	  				}
173
	});
23819 govind 174
  });
23868 amit.gupta 175
  affectedDateInput=$('#affectedDate');
23886 amit.gupta 176
  affectedDateInput.daterangepicker(getSingleDatePicker(), dateRangeCallback);
23868 amit.gupta 177
  $("#newPriceDropModal").on('hidden.bs.modal', function () {
178
            $("#pdForm").trigger("reset");
179
  });
23819 govind 180
</script>