Rev 24049 | Rev 24055 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
<style>.btn:hover{color: grey;text-decoration: none;}.btn-info:hover{color: grey;text-decoration: none;}}</style><section class="wrapper"><div class="row"><div class="col-lg-12"><h3 class="page-header"><i class="icon_document_alt"></i>PriceDrop</h3><ol class="breadcrumb"><li><i class="fa fa-home"></i><a href="${rc.contextPath}/dashboard">Home</a></li><li><i class="icon_document_alt"></i>PriceDrop</li><li><button type="button" data-toggle="modal" class="btn btn-sm btn-primary mk_new_price_drop" data-target="#newPriceDropModal">Add new</li><li><button type="button" data-toggle="modal" class="btn btn-sm btn-primary mk_download_pricing" data-target="#addPricing">Download Pricing</li><div id="addPriceModal" class="modal fade" role="dialog"><div class="modal-dialog"><!-- Modal content--><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal">×</button><h4 class="modal-title">Add Pricing</h4></div><div class="modal-body"><form id="pdForm1"><div class="form-group row"><div class="col-lg-6"><input placeholder="Search Item" type="text" class="form-control typeahead" id="typeaheaditem1" name="Item" data-provide="typeahead" autocomplete="off"></div><div class="col-lg-3"><input type="text" class="form-control" id="dp" placeholder="DP" type="text"/></div><div class="col-lg-3"><input type="text" class="form-control" id="mop" placeholder="MOP" type="text"/></div></div><div class="form-group row"><div class="col-lg-3"><button type="button" class="btn btn-primary add-pricing">Add Pricing</button></div></div></form></div></div><!-- Modal --><div id="newPriceDropModal" class="modal fade" role="dialog"><div class="modal-dialog"><!-- Modal content--><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal">×</button><h4 class="modal-title">Add Price Drop</h4></div><div class="modal-body"><form id="pdForm"><div class="form-group row"><div class="col-lg-6"><input placeholder="Search Item" type="text" class="form-control typeahead" id="typeaheaditem" name="Item" data-provide="typeahead" autocomplete="off"></div><div class="col-lg-3"><input type="text" class="form-control" id="affectedDate" placeholder="Affected on" type="text"/></div><div class="col-lg-3"><button type="button" class="btn btn-primary download-imeis">Download IMEIs</button></div><!--<div class="col-lg-4 checkbox"><label><input id="allColors" type="checkbox" value="">Apply to all Colors</label></div>--></div><div class="form-group row"><div class="col-lg-4"><label for="dpDrop">MOP:(<span id="oldMop"></span>)</label><input type="number" class="form-control" id="newMop"></div><div class="col-lg-3"><button type="button" class="btn btn-primary update-mop">Update MOP</button></div></div><div class="form-group row"><div class="col-lg-3"><label for="priceDrop">Drop Announced:</label><input type="number" class="form-control" id="pd"></div><div class="col-lg-3"><label for="dp">Current DP</label><input type="number" readonly class="form-control" id="dp"></div><div class="col-lg-3"><label for="newTp">TP:(<span id="oldTp"></span>)</label><input type="number" class="form-control" id="newTp"></div><div class="col-lg-3"><label for="newNlc">NLC:(<span id="oldNlc"></span>)</label><input type="number" class="form-control" id="newNlc"></div></div></form></div><div class="modal-footer"><button type="button" class="addPriceDrop btn btn-primary">Add Price Drop</button><button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button></div></div></div></div></ol></div></div><div class="price-drop-table"><div class="row"><div class="col-lg-12" id="priceDrop" ><table class="table table-striped table-condensed table-bordered"><thead><tr><th>Item Name</th><th>Old DP</th><th>Price Drop</th><th>Mop</th><th>TP</th><th>NLC </th><th>Affected On</th><th>Created On</th><th>Price Drop In</th><th>Partner Payout</th><th>Processed On</th><th>Download IMEIs</th></tr></thead><tbody>#foreach($priceDrop in $priceDrops )<tr data-pricedropid="$priceDrop.getId()"><td>$catalogDescription.get($priceDrop.getCatalogItemId())</td><td>$priceDrop.getOldDp()</td><td>$priceDrop.getAmount()</td><td>$priceDrop.getMop()</td><td>$priceDrop.getTp()</td><td>$priceDrop.getNlc()</td><td>$priceDrop.getAffectedOn().format($dateFormatter)</td><td>$priceDrop.getCreatedOn().format($dateTimeFormatter)</td>#if($priceDrop.getProcessTimestamp())<td>$priceDrop.getPriceDropIn()</td><td>$priceDrop.getPartnerPayout()</td><td>$priceDrop.getProcessTimestamp().format($dateTimeFormatter)</td>#else<td><input type="number" name="priceDropIn" placeholder = "Price Drop In" class="form-control price-drop-in input-sm"/></td><td><input type="number" name="partnerPayout" placeholder = "Partner Payout" class="form-control partner-payout input-sm"/></td><td><input class="btn btn-info btn-sm mk_process_price_drop" data-cashback="$priceDrop.getId()" type="submit" value="Process"/></td>#end<td><input class="downloadtotalIMEI btn btn-info btn-sm" value="Download" type="submit" /></td></tr>#end</tbody></table></div></div></div></section><script type="text/javascript">$(document).ready(function() {var start = moment().subtract(29, 'days');var end = moment();priceDropTable = $('#priceDrop').find('table').DataTable({"pageLength": 20,order:[[ 5, 'desc' ]]});customItems = $customItems;itemAhead = $("#typeaheaditem").typeahead({source: customItems,autoSelect: false,displayText:function(item){return item.itemDescription;},afterSelect: function(selectedItem){console.log(selectedItem);currentItem = selectedItem;doGetAjaxRequestHandler(context+"/item-pricing/"+currentItem.itemId, function(response){response = JSON.parse(response);$('#dp').val(response.dp);$('#oldMop').html(response.mop);$('#oldTp').html(response.tp);$('#oldNlc').html(response.nlc);});}});itemAhead1 = $("#typeaheaditem1").typeahead({source: newCustomItems,autoSelect: false,displayText:function(item){return item.itemDescription;},afterSelect: function(selectedItem){console.log(selectedItem);currentItem1 = selectedItem;}});});affectedDateInput=$('#affectedDate');affectedDateInput.daterangepicker(getSingleDatePicker(), dateRangeCallback);$("#newPriceDropModal").on('hidden.bs.modal', function () {$("#pdForm").trigger("reset");});$("#addPriceModal").on('hidden.bs.modal', function () {$("#pdForm1").trigger("reset");});</script>