Subversion Repositories SmartDukaan

Rev

Rev 31158 | Rev 31180 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<section>


<!--<style>
        .table-striped > tbody > tr:nth-child(odd) > td{
                background: white;
                background-color: white;
        }
        .table-striped > tbody > tr:nth-child(even) > td{
                background: white;
                background-color:white;
        }
        .table-striped > tbody > tr:hover > td,
        .table-striped > tbody > tr:hover {
                background-color: #e98c8f;
                color:white;
        }
        .btn:hover{
                color: grey;
                text-decoration: none;
        }
        .btn-primary:hover{
                color: grey;
                text-decoration: none;
        }
        .sale-details{
                cursor:pointer;
        }
        
        thead input {
        width: 50%;
    }
</style>-->

<section class="wrapper">
        <div class="row">
                <div class="col-lg-12">
                        <h3 class="page-header"><i class="icon_document_alt"></i>Details</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>Partner Franchise Detail</li>                                              
                        </ol>
                </div>
        </div>
        
        
<div class="row" >
 
      <div class="row col-lg-4">
                <canvas id="chart-partnerType" style="width:auto"></canvas>
               </div>
                
                
                
            <div class = "row col-lg-6">
                          
        <div class="form-group col-lg-3">
            <label>Exclude Partner Type</label>
            <select multiple class="criteria-partnertype chosen-select">
                #foreach ($partnerType in $partnerTypes)
                <option value="$partnerType">$partnerType</option>
                #end
                      <option value="GREY">GREY</option>
          
            </select>
        </div>
        
       <div class="form-group col-lg-2" style="margin-top:20px">

            <input type="button" class="btn btn-default fileterRowsOnPartnerType"
                   value="submit">
        </div>
        
        </div>
</div>

 
<div class="row">
                                        
                                <div class="col-lg-12">
                                 <table id="authretailerstats" class="table table-striped table-advance table-hover" style="width:100%">
                                 <thead>
                                        <tr>
                                        <th>Stores</th>
                                        <th>Code</th>
                                        <th>Category</th>
                                        <th>Manager</th>
                                    <th>LMS</th>
                                        <th>LMTD</th>
                                        <th>MTD</th>
                                        <th>Sale Diff</th>
                                        <th>LM.S</th>
                                        <th>LMTD.S</th>
                                        <th>MTD.S</th>
                                    <th>Unbilled Activated Stock</th>
                                    <th>Wallet Amount</th>
                                        <th>In Stock Invest</th>
                                        <th>Total Invest</th>
                                        <th>Short Invest</th>
                                    <th>Pending Indent</th>
                                        <th>Today Tertiary</th>
                                        <th>Invest ok</th>
                                        <th>Ticket</th>
                                        </tr>
                                 </thead>
                                <tbody>
                                    #foreach($name in $fofoIdAndallValues.keySet())
                                        <tr>
                                     <td>$fofoIdAndPartnerMap.get($name).getBusinessName()  ($fofoIdAndPartnerMap.get($name).getAddress().getCity())</td>
                                     <td>$fofoIdAndPartnerMap.get($name).getCode()</td>
                                     <td>$fofoIdAndallValues.get($name).getPartnerType()</td>
                                     <td>$fofoIdAndallValues.get($name).getAuthUser()</td>
                                     <td class="currency lmsSale" data-fofoid="$fofoIdAndPartnerMap.get($name).getPartnerId()" data-toggle="modal" data-target="#brandLMSSale">$fofoIdAndallValues.get($name).getLms()</td>    
                                     <td class="currency  lmtdSale" data-fofoid="$fofoIdAndPartnerMap.get($name).getPartnerId()" data-toggle="modal" data-target="#brandLMtdSale">$fofoIdAndallValues.get($name).getLmtd()</td>
                                     
                                     #if($fofoIdAndallValues.get($name).getMtd() <= 0 )
                                     <td class="currency mtdSale" data-fofoid="$fofoIdAndPartnerMap.get($name).getPartnerId()" data-toggle="modal" data-target="#brandMtdSale" style="color:red">$fofoIdAndallValues.get($name).getMtd()</td>
                                    #else
                                     <td class="currency mtdSale" data-fofoid="$fofoIdAndPartnerMap.get($name).getPartnerId()" data-toggle="modal" data-target="#brandMtdSale">$fofoIdAndallValues.get($name).getMtd()</td>
                                    #end
                                    
                                     #if($fofoIdAndallValues.get($name).getSaleDiff() <= 0 )
                                     <td class="currency" style="color:red">$fofoIdAndallValues.get($name).getSaleDiff()</td>
                                     #else
                                       <td class="currency">$fofoIdAndallValues.get($name).getSaleDiff()</td>
                                  #end
                                  
                                     <td class="currency lmsSecSale" data-fofoid="$fofoIdAndPartnerMap.get($name).getPartnerId()" data-toggle="modal" data-target="#brandSecSale">$fofoIdAndallValues.get($name).getSecondarylms()</td>    
                                     <td class="currency  lmtdSecSale" data-fofoid="$fofoIdAndPartnerMap.get($name).getPartnerId()" data-toggle="modal" data-target="#brandSecSale">$fofoIdAndallValues.get($name).getSecondarylmtd()</td>
                                   #if($fofoIdAndallValues.get($name).getSecondarymtd() <= 0)
                                   
                                     <td class="currency mtdSecSale" data-fofoid="$fofoIdAndPartnerMap.get($name).getPartnerId()" data-toggle="modal" data-target="#brandSecSale" style="color:red">$fofoIdAndallValues.get($name).getSecondarymtd()</td>
                                   #else
                                    <td class="currency mtdSecSale" data-fofoid="$fofoIdAndPartnerMap.get($name).getPartnerId()" data-toggle="modal" data-target="#brandSecSale">$fofoIdAndallValues.get($name).getSecondarymtd()</td>
                                   #end
                                   #if($fofoIdAndallValues.get($name).getInvestment().getActivatedStockAmount() > 20000)
                                      <td class="currency" id="activatedStock" data-fofoid="$fofoIdAndPartnerMap.get($name).getPartnerId()" data-toggle="modal" data-target="#activateStock" style="color:red">$fofoIdAndallValues.get($name).getInvestment().getActivatedStockAmount()</td> 
                                  #else
                                     <td class="currency" id="activatedStock" data-fofoid="$fofoIdAndPartnerMap.get($name).getPartnerId()" data-toggle="modal" data-target="#activateStock">$fofoIdAndallValues.get($name).getInvestment().getActivatedStockAmount()</td> 
                                    #end
                                     #if($fofoIdAndallValues.get($name).getWalletAmount() > 50000)
                                     <td class="currency" style="color:red">$fofoIdAndallValues.get($name).getWalletAmount()</td>
                                     #else
                                     <td class="currency">$fofoIdAndallValues.get($name).getWalletAmount()</td>
                                     #end
                                     <td class="currency instock" data-fofoid="$fofoIdAndPartnerMap.get($name).getPartnerId()" data-toggle="modal" data-target="#inStockItem" >$fofoIdAndallValues.get($name).getInvestment().getInStockAmount()</td>
                                  
                                  
                                     <td class="currency"  id="investment" data-fofoid="$fofoIdAndPartnerMap.get($name).getPartnerId()" data-toggle="modal" data-target="#partnerInvestment" >$fofoIdAndallValues.get($name).getInvestment().getTotalInvestment()</td>
                                 
                                                #set($realInvestment = $fofoIdAndallValues.get($name).getInvestment().getTotalInvestment() + $fofoIdAndallValues.get($name).getInvestment().getShortInvestment() )      
                                          
                                          
                                            #set($realpercent = ($fofoIdAndallValues.get($name).getInvestment().getTotalInvestment() / $realInvestment)*100)
                                          
                                 
                                  
                                     
                                      #if($realpercent < 75)
                                     <td class="currency" style="color:red">$fofoIdAndallValues.get($name).getInvestment().getShortInvestment()</td>  
                                     #else
                                      <td class="currency">$fofoIdAndallValues.get($name).getInvestment().getShortInvestment()</td>  
                                    
                                     #end 
                                     <td class="currency" id="indent"  data-fofoid="$fofoIdAndPartnerMap.get($name).getPartnerId()" data-toggle="modal" data-target="#itemWiseIndent">$fofoIdAndallValues.get($name).getInvestment().getUnbilledAmount()</td>
                                 <td class="tertiary"  data-fofoid="$fofoIdAndPartnerMap.get($name).getPartnerId()" data-toggle="modal" data-target="#itemWiseTertiary">$fofoIdAndallValues.get($name).getTodayTertiary()</td>
                                 <td>$fofoIdAndallValues.get($name).getInvestment_ok()</td>  
                                 <td class="openticket" data-fofoid="$fofoIdAndPartnerMap.get($name).getPartnerId()" data-toggle="modal" data-target="#openTicketModel">$fofoIdAndallValues.get($name).getTicket()</td>
                                        </tr>
                                        #end
                            </tbody>
                        </table>
                                                </div>
                                                
                        
                        </div>
                        
                        
 <div id="itemWiseTertiary" class="modal" role="dialog">
          <div class="modal-dialog">
            <div class="modal-content">
             
    </div>
   </div>
 </div>
 
 
  <div id="itemWiseIndent" class="modal" role="dialog">
          <div class="modal-dialog">
            <div class="modal-content">
             
    </div>
   </div>
 </div>
                        
<div id="inStockItem" class="modal" role="dialog">
          <div class="modal-dialog">
            <div class="modal-content">
             
    </div>
   </div>
 </div>

 
  <div id="partnerInvestment" class="modal" role="dialog">
          <div class="modal-dialog">
            <div class="modal-content">
             
    </div>
   </div>
 </div>         


 
  <div id="activateStock" class="modal" role="dialog">
          <div class="modal-dialog">
            <div class="modal-content">
             
    </div>
   </div>
 </div> 
 
   <div id="brandMtdSale" class="modal" role="dialog">
          <div class="modal-dialog">
            <div class="modal-content">
             
    </div>
   </div>
 </div> 
 
  <div id="brandLMtdSale" class="modal" role="dialog">
          <div class="modal-dialog">
            <div class="modal-content">
             
    </div>
   </div>
 </div> 
 
   <div id="brandLMSSale" class="modal" role="dialog">
          <div class="modal-dialog">
            <div class="modal-content">
             
    </div>
   </div>
 </div> 
 
   <div id="openTicketModel" class="modal" role="dialog">
          <div class="modal-dialog">
            <div class="modal-content">
             
    </div>
   </div>
 </div> 
 
    <div id="brandSecSale" class="modal" role="dialog">
          <div class="modal-dialog">
            <div class="modal-content">
             
    </div>
   </div>
 </div> 
</section>

 <style>
                    canvas {
        -moz-user-select: none;
        -webkit-user-select: none;
        -ms-user-select: none;
    }
</style>

<script type="text/javascript">


$(document).ready(function() {

 $("select.criteria-partnertype").chosen({no_results_text: "Oops, nothing found!"});
 
 
 $.fn.dataTable.ext.search.push(function (settings, data, dataIndex) {
 
   var partnerTypes =  $("select.criteria-partnertype").val();
   
   console.log(partnerTypes);
   var tablePartnerType = data[2];
   var lastMonthSale = data[4];
   
   console.log(lastMonthSale)
   lastMonthSale = lastMonthSale.replace(/,/g, "");
   
   console.log(lastMonthSale)
    if (partnerTypes.includes("GREY")) {
      if(parseInt(lastMonthSale) < 200000)
        return false;
    }
   
   
     if (partnerTypes.includes("BRONZE")) {
      if(parseInt(lastMonthSale) > 200000)
        return false;
    }
   if (!partnerTypes.includes(tablePartnerType)) {
        return true;
    }
    return false;
});

    $('#authretailerstats thead tr').clone(true).appendTo( '#authretailerstats thead' );
    $('#authretailerstats thead tr:eq(1) th').each( function (i) {
        var title = $(this).text();
        $(this).html( '<input type="text" style = "width:60%;" placeholder="Search '+title+'" />' );
 
        $( 'input', this ).on( 'keyup change', function () {
            if ( table.column(i).search() !== this.value ) {
                table
                    .column(i)
                    .search( this.value )
                    .draw();
            }
        } );
    } )
  var table = $('#authretailerstats').DataTable( {
   "lengthMenu": [10, 25, 50, 75, 100, 250, 1000],
            "scrollX": true,
           
        orderCellsTop: true,
        fixedHeader: true
    } );
    
                $(document).on('click', ".fileterRowsOnPartnerType", function() {
        table.draw()
        });
});
</script>


<script type="text/javascript">

$('#authretailerstats').on('click', '.tertiary', function(){
        var fofoId = $(this).data('fofoid');
                        
                                
                                doGetAjaxRequestHandler(context + "/getItemWiseTertiary?fofoId="
                                                + fofoId, function(response) {

                                        $('#itemWiseTertiary .modal-content').html(response);

                                });
});


$('#authretailerstats').on('click', '#indent', function(){
        var fofoId = $(this).data('fofoid');
                        
                                
                                doGetAjaxRequestHandler(context + "/getItemWiseIndent?fofoId="
                                                + fofoId, function(response) {

                                        $('#itemWiseIndent .modal-content').html(response);

                                });
});



$('#authretailerstats').on('click', '#investment', function(){
        var fofoId = $(this).data('fofoid');
                                doGetAjaxRequestHandler(context + "/getPartnerInvestment?fofoId="
                                                + fofoId, function(response) {

                                        $('#partnerInvestment .modal-content').html(response);

                                });
});

$('#authretailerstats').on('click', '#activatedStock', function(){
        var fofoId = $(this).data('fofoid');
                                doGetAjaxRequestHandler(context + "/getPatnerActivateStock?fofoId="
                                                + fofoId, function(response) {

                                        $('#activateStock .modal-content').html(response);

                                });
});


$('#authretailerstats').on('click', '.mtdSale', function(){
        var fofoId = $(this).data('fofoid');
                                doGetAjaxRequestHandler(context + "/getPatnerBrandWiseMTDSale?fofoId="
                                                + fofoId, function(response) {

                                        $('#brandMtdSale .modal-content').html(response);

                                });
});

$('#authretailerstats').on('click', '.lmtdSale', function(){
        var fofoId = $(this).data('fofoid');
                                doGetAjaxRequestHandler(context + "/getPatnerBrandWiseLMTDSale?fofoId="
                                                + fofoId, function(response) {

                                        $('#brandLMtdSale .modal-content').html(response);

                                });
});


$('#authretailerstats').on('click', '.instock', function(){
        var fofoId = $(this).data('fofoid');
                                doGetAjaxRequestHandler(context + "/getPatnerInStock?fofoId="
                                                + fofoId, function(response) {
                                        $('#inStockItem .modal-content').html(response);

                                });
});

$('#authretailerstats').on('click', '.lmsSale', function(){
        var fofoId = $(this).data('fofoid');
 
                                doGetAjaxRequestHandler(context + "/getPatnerBrandWiseLMSSale?fofoId="
                                                + fofoId, function(response) {
                                        $('#brandLMSSale .modal-content').html(response);

                                });
});

$('#authretailerstats').on('click', '.lmsSecSale', function(){
        var fofoId = $(this).data('fofoid');
                $("#brand-secondary-model .modal-body").empty();
                                doGetAjaxRequestHandler(context + "/getPartnerSecondarySale?fofoId="
                                                + fofoId+"&timeValue=lms" , function(response) {
                                        $('#brandSecSale .modal-content').html(response);

                                });
});

$('#authretailerstats').on('click', '.mtdSecSale', function(){
        var fofoId = $(this).data('fofoid');
                $("#brand-secondary-model .modal-body").empty();
                                doGetAjaxRequestHandler(context + "/getPartnerSecondarySale?fofoId="
                                                + fofoId+"&timeValue=mtd" , function(response) {
                                        $('#brandSecSale .modal-content').html(response);

                                });
});

$('#authretailerstats').on('click', '.lmtdSecSale', function(){
        var fofoId = $(this).data('fofoid');
                $("#brand-secondary-model .modal-body").empty();
                                doGetAjaxRequestHandler(context + "/getPartnerSecondarySale?fofoId="
                                                + fofoId+"&timeValue=lmtd" , function(response) {
                                        $('#brandSecSale .modal-content').html(response);

                                });
});

$('#authretailerstats').on('click', '.openticket', function(){
        var fofoId = $(this).data('fofoid');
                                doGetAjaxRequestHandler(context + "/getOpenTicketByFofoId?fofoId="
                                                + fofoId, function(response) {
                                        $('#openTicketModel .modal-content').html(response);

                                });
});

</script>

<script type="text/javascript">
    
        var config = $chartPieMap;
      
        var ctx = document.getElementById('chart-partnerType').getContext('2d');
        var bar = new Chart(ctx, config);
</script>