Subversion Repositories SmartDukaan

Rev

Rev 27071 | Rev 28568 | 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" data-target="#newPriceDropModal">Add new Price Drop</li>
                                <li><button type="button" data-toggle="modal" class="btn btn-sm btn-primary" data-target="#addPriceModal">Add/Update Pricing</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" 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/Update Pricing</h4>
                                      </div>
                                      <div class="modal-body">
                                        <form id="pdForm1">
                                                <div class="form-group row">
                                                                <div class="col-lg-8">
                                                                        <label for="typeaheaditem1">Item:</label>
                                                                <input placeholder="Search Item" type="text" class="form-control typeahead" id="typeaheaditem1" name="Item" data-provide="typeahead" autocomplete="off">
                                                            </div>
                                                                <div class="col-lg-4">
                                                                <div>&nbsp;</div>
                                                                <button type="button" class="btn btn-primary mk_pause_button">Active/Pause</button>
                                                            </div>
                                                        </div>
                                                <div class="form-group row">
                                                            <div class="col-lg-2">
                                                                <label id="tpValue">TP - </label>
                                                                    <input type="text" class="form-control" id="tp" placeholder="TP" type="text"/>
                                                                </div>
                                                            <div class="col-lg-2">
                                                                <label id="dpValue">DP - </label>
                                                                    <input type="text" class="form-control" id="dp" placeholder="DP" type="text"/>
                                                                </div>
                                                            <div class="col-lg-2">
                                                                <label id="mopValue">MOP - </label>
                                                                    <input type="text" class="form-control" id="mop" placeholder="MOP" type="text"/>
                                                                </div>
                                                            <div class="col-lg-2">
                                                                <label id="mrpValue">MRP -</label>
                                                                    <input type="text" class="form-control" id="mrp" placeholder="MRP" type="text"/>
                                                                </div>
                                                        </div>
                                        </form>
                                        </div>  
                                        <div class="modal-footer">
                                                <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
                                                <button type="button" class="btn btn-primary add-pricing">Add Pricing</button>
                                    </div>
                                                                
                                        </div>
                                </div>
                          </div>
                                
                          <div id="viewImeisModal" class="modal" 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="statusForm">
                                                  <div class="form-group row">
                                                        <div class="col-lg-12 row">
                                                        <input placeholder="Imeis to approve/reject" type="text" class="form-control mk_imeis_text" aria-label="...">
                                                        </div>
                                                        <div class="col-lg-9">
                                                                <div class="input-group">
                                                                <input placeholder="Rejection reason" type="text" class="form-control mk_rejection_reason" aria-label="...">
                                                                <div class="input-group-btn">
                                                                        <button type="button" class="btn btn-primary" onclick="updatePriceDropImeis('rejected')">Rejected</button>
                                                                </div><!-- /input-group -->
                                                        </div>
                                                    </div>
                                                    <div class="col-lg-3">                                                                              
                                                                <button type="button" class="btn btn-primary" onclick="updatePriceDropImeis('approved')">Approved</button>
                                                        </div>
                                                  </div>
                                                  <div class="form-group row">
                                                        <div class="col-lg-4">
                                                                <h3>Pending (<span class="mk_pending_count"></span>)</h3>
                                                                <select multiple class="mk_pending" style="width:90%;height:400px">
                                                                </select>
                                                        </div>
                                                        <div class="col-lg-4">
                                                                <h3>Rejected (<span class="mk_rejected_count"></span>)</h3>
                                                                <select multiple class="mk_rejected" style="width:90%;height:400px">
                                                                </select>
                                                        </div>
                                                        <div class="col-lg-4">
                                                                <h3>Approved (<span class="mk_approved_count"></span>)</h3>
                                                                <select multiple class="mk_approved" style="width:90%;height:400px">
                                                                </select>
                                                        </div>
                                                  </div>
                                                </form>
                                          </div>
                                      <div class="modal-footer">
                                        <button type="button" class="closePriceDrop btn btn-primary">Close Price Dop</button>
                                        <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
                                      </div>
                                        </div>  
                                </div>
                        </div>          
                                <!-- Modal -->
                                <div id="newPriceDropModal" class="modal" 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-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-3">
                                                            <label for="dpDrop">MOP:(<span id="oldMop"></span>)</label>
                                                            <input type="number" class="form-control" id="newMop">
                                                        </div>
                                                        <div class="col-lg-3">
                                                                <label for="dp">DP:(<span id="oldDp"></span>)</label>
                                                            <input type="number" class="form-control" id="newDp">
                                                        </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>
                                                </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>Drop Id</th>
                                                        <th>Item Name</th>
                                                        <th>TP</th>
                                                        <th>DP</th>
                                                        <th>Mop</th>
                                                        <th>Price Drop</th>
                                                        <th>New DP</th>
                                                        <th>Affected On</th>
                                                        <th>Created On</th>
                                                        <th>Payout</th>
                                                        <th>Processed On</th>
                                                        <th>Download IMEIs</th>
                                                        
                                    </tr>
                                </thead>
                                        <tbody>
                                                #foreach($priceDrop in $priceDrops )
                                                <tr data-pricedropid="$priceDrop.getId()">
                                                        <td>$priceDrop.getId()</td>
                                                        <td>$catalogDescription.get($priceDrop.getCatalogItemId())</td>
                                                        <td class="currency">$priceDrop.getTp()</td>
                                                        <td class="currency">$priceDrop.getOldDp()</td>
                                                        <td class="currency">$priceDrop.getMop()</td>
                                                        <td class="currency">$priceDrop.getAmount()</td>
                                                        <td class="currency">$priceDrop.getNewDp()</td>
                                                        <td>$priceDrop.getAffectedOn().format($dateFormatter)</td>
                                                        <td>$priceDrop.getCreatedOn().format($dateFormatter)</td>
                                                        <td>
                                                                #if($priceDrop.getProcessTimestamp())
                                                                        $priceDrop.getProcessTimestamp().format($dateTimeFormatter)<br>
                                                                        <input type="number" name="partnerPayout" readonly value="$priceDrop.getAutoPartnerPayout()" class="form-control partner-payout input-sm"/>
                                                                #else
                                                                        <input type="number" name="partnerPayout" value="$priceDrop.getAutoPartnerPayout()" class="form-control partner-payout input-sm"/>
                                                                #end
                                                        </td>
                                                        <td>
                                                                <input class="btn btn-info btn-sm mk_view_imeis" data-toggle="modal" data-target="#viewImeisModal" type="submit" value="Process Manually"/>
                                                                <input class="btn btn-info btn-sm mk_auto_process" data-activatedonly="false" type="submit" value="Process All"/><br>
                                                                <input class="btn btn-info btn-sm mk_auto_process" data-activatedonly="true" type="submit" value="Process Activated Only"/>
                                                        </td>
                                                        <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' ]]
        });
  
  
        getItemAheadOptions($("#typeaheaditem"),true,function(selectedItem){
                currentItem = selectedItem;
                doGetAjaxRequestHandler(context+"/item-pricing/"+currentItem.itemId, function(response){
                        response = JSON.parse(response);
                        $('#oldDp').html(response.dp);
                        $('#oldMop').html(response.mop);
                        $('#oldTp').html(response.tp);
                        $('#oldNlc').html(response.nlc);
                });
        });
        getItemAheadOptions($("#typeaheaditem1"),true, function(selectedItem){
                currentItem = selectedItem;
                doGetAjaxRequestHandler(context+"/item-pricing/"+currentItem.itemId, function(response){
                        $('.mk_pause_button').data("id", currentItem.catalogId);
                        $('.mk_pause_button').data("description", currentItem.itemDescription);
                        response = JSON.parse(response);
                        $("#mop").val(response.mop);
                        $("#mrp").val(response.mrp);
                        $("#dp").val(response.dp);
                        $("#tp").val(response.tp);
                        $('#dpValue').html("DP -" + response.dp);
                        $('#mopValue').html("MOP -" + response.mop);
                        $('#mrpValue').html("MRP -"+ response.mrp);
                        $('#tpValue').html("TP -"+ response.tp);
                });
        });
        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>