Subversion Repositories SmartDukaan

Rev

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