Subversion Repositories SmartDukaan

Rev

Rev 23868 | Rev 23886 | 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>
                                <!-- 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">&times;</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-8">
                                                                <input placeholder="Search Item" type="text" class="form-control typeahead" id="typeaheaditem" name="Item" data-provide="typeahead" autocomplete="off">
                                                            </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="priceDrop">Price Drop Announced:</label>
                                                            <input type="number" class="form-control" id="pd">
                                                        </div>
                                                        <div class="col-lg-4">
                                                            <label for="dpDrop">Affected On:</label>
                                                            <input type="text" class="form-control" id="affectedDate" placeholder="DD/MM/YYYY" type="text"/>
                                                        </div>
                                                  </div>
                                                  <div class="form-group row">
                                                        <div class="col-lg-4">
                                                            <label for="dpDrop">New MOP:</label>
                                                            <input type="number" class="form-control" id="newMop">
                                                        </div>
                                                        <div class="col-lg-4">
                                                            <label for="dpDrop">New Transfer Price:</label>
                                                            <input type="number" class="form-control" id="newTp">
                                                        </div>
                                                        <div class="col-lg-4">
                                                            <label for="dpDrop">New NLC:</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">Submit</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 Id</th>
                                                        <th>Item Description</th>
                                                        <th>Price Drop<br/>Amount</th>
                                                        <th>Affetced On</th>
                                                        <th>Created On</th>
                                                        <th>Partner Payout</th>
                                                        <th>Price Drop In</th>
                                                        <th>Processed On</th>
                                                        <th>Download IMEIs</th>
                                                        
                                    </tr>
                                </thead>
                                        <tbody>
                                                #foreach($priceDrop in $priceDrops )
                                                <tr data-priceDropId="$priceDrop.getId()">
                                                        <td>$priceDrop.getItemId()</td>
                                                        <td>$tagListingMap.get($priceDrop.getItemId()).getItemDescription()</td>
                                                        <td>$priceDrop.getAmount()</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 phone input-sm"/>
                                                        </td>
                                                        <td>
                                                                        <input type="number" name="partnerPayout" placeholder = "Partner Payout"   class="form-control phone input-sm"/>
                                                        </td>
                                                        <td>
                                                                <input class="btn btn-info btn-sm" data-cashback="$priceDrop.getId()" type="submit" value="Process" id="cashTopartner"/>
                                                        </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": 10,
  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;
                                        }
        });
  });
  affectedDateInput=$('#affectedDate');
  affectedDateInput.daterangepicker({
    todayHighlight: true,
    startDate: moment(),
    maxDate: moment(),
    autoclose: true,
    autoUpdateInput: true,
    singleDatePicker: true,
    locale: {
                        format: 'DD/MM/YYYY'
                }
  }, dateRangeCallback);
  $("#newPriceDropModal").on('hidden.bs.modal', function () {
            $("#pdForm").trigger("reset");
  });
</script>