Subversion Repositories SmartDukaan

Rev

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