statement

mail@pastecode.io avatar
unknown
plain_text
a year ago
18 kB
3
Indexable
Never
<style>
    .statement-request-filter .hide {
      display: none !important;
      transition: all 0.2s ease-in !important;
    }
  
    .statement-request-filter {
      display: flex;
      gap: 1rem;
      align-items: center;
      padding: 1rem;
    }
    .statement-request-filter input[type="text"],
    .statement-request-filter input[type="date"],
    .statement-request-filter select {
      padding: 0.8rem 1.5rem !important;
      outline: none;
      border: none;
      border-radius: 8px;
      font-size: 15px;
      border: 1px solid rgba(0, 0, 0, 0.377);
      cursor: pointer;
    }
  
    .equityOption {
      background-color: #f3f6f9;
      border-radius: 10px;
    }
  
    .sendOption .rad-label {
      display: flex;
      align-items: center;
  
      border-radius: 100px;
      padding: 14px 16px;
      margin: 10px 0;
  
      cursor: pointer;
      transition: .3s;
      border: 1px solid transparent !important;
    }
  
    .equityOption .rad-label {
      display: flex;
      align-items: center;
  
      border-radius: 10px;
      padding: 14px 16px;
      margin: 10px 0;
  
      cursor: pointer;
      transition: .3s;
      border: 1px solid transparent !important;
    }
  
    .sendOption .rad-label p,
    .equityOption .rad-label p {
      margin: 0;
      margin-left: 1rem;
    }
  
    .sendOption .rad-label:hover {
  
      background: hsla(0, 0%, 63%, 0.14);
    }
  
    .sendOption .rad-label-background,
    .equityOption .rad-label-background {
      background-color: #00000028;
    }
  
    .sendOption .rad-input,
    .equityOption .rad-input {
      position: absolute;
      left: 0;
      top: 0;
      width: 1px;
      height: 1px;
      opacity: 0;
      z-index: -1;
    }
  
    .sendOption .rad-design {
      width: 22px;
      height: 22px;
      border-radius: 100px;
  
      background: linear-gradient(to right bottom, #7088d6, #405189);
      position: relative;
    }
  
    .equityOption .rad-design {
      width: 22px;
      height: 22px;
      border-radius: 100px;
  
      background: linear-gradient(to right bottom, #1e85e6, #1462ac);
      position: relative;
    }
  
    .sendOption .rad-design::before,
    .equityOption .rad-design::before {
      content: '';
  
      display: inline-block;
      width: inherit;
      height: inherit;
      border-radius: inherit;
  
      background: hsl(0, 0%, 90%);
      transform: scale(1.1);
      transition: .3s;
    }
  
    .sendOption .rad-input:checked+.rad-design::before,
    .equityOption .rad-input:checked+.rad-design::before {
      transform: scale(0);
    }
  
    .sendOption .rad-text,
    .equityOption .rad-text {
      margin-left: 14px;
      font-size: 15px;
      font-weight: 500;
  
      transition: .3s;
    }
  
  </style>

<%- include('../include/header.ejs') %>
    <%- include('../include/navbar.ejs') %>
        <!-- ============================================================== -->
        <!-- Start right Content here -->
        <!-- ============================================================== -->
        <div class="main-content">
            <div class="page-content">
                <div class="container-fluid">
                    <!-- start page title -->
                    <div class="row">
                        <div class="col-12">
                            <div class="page-title-box d-sm-flex align-items-center justify-content-between">
                                <h4 class="mb-sm-0">Statement Request</h4>
                                <div class="page-title-right">
                                    <ol class="breadcrumb m-0">
                                        <li class="breadcrumb-item"><a href="javascript: void(0);">Statement Request</a>
                                        </li>
                                        <li class="breadcrumb-item active">Statement Request</a></li>
                                    </ol>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- end page title -->
                    <div class="row">
                        <form action="#" method="post" class="statement-request-filter d-flex flex-column flex-md-row flex-wrap card">
          
                        <div class="d-flex flex-column flex-md-row gap-3 flex-wrap">
                          <div style="display: flex; flex-direction: column;">
                            <label for="" class="form-label fw-semibold">Select report</label>
          
                            <select name="statement-request-selector" id="selectReport">
                              <option value="desabled" disabled>Select report</option>
                              <option value="CombinedLedger">Combined Ledger</option>
                              <option value="Fund-transaction-Report">Fund transaction Report</option>
                              <option value="Commodity-Ledger">Commodity Ledger</option>
                              <option value="Equity-Ledger">Equity Ledger</option>
                              <option value="FNO-Ledger">FNO Ledger</option>
                              <option value="Currency-Ledger">Currency Ledger</option>
                              <option value="FNO-P&L-Statement">FNO P&L Statement</option>
                              <option value="Equity-P&L-Statement">Equity P&L Statement</option>
                              <option value="CD-P&L-Statement">CD P&L Statement</option>
                              <option value="Commodity-P&L-Statement">Commodity P&L Statement</option>
                              <option value="Trade-Report-Details-Datewise">Trade Report Details - Datewise</option>
                              <option value="Trade-Report-Details-Scriptwise">Trade-Report-Details-Scriptwise</option>
                              <option value="Dividend">Dividend</option>
                              <option value="Client-Master-List">Client Master List</option>
                              <option value="DP-Holding">DP Holding</option>
                              <option value="DP-Transaction">DP Transaction</option>
                            </select>
                          </div>
                          <div style="display: flex; flex-direction: column;">
                            <label for="" class="form-label fw-semibold">Select Client code</label>
                            <input type="text" class="form-control" placeholder="Enter client code" onkeyup="this.value = this.value.charAt(0).toUpperCase() + this.value.slice(1);" class="clientCodeText" id="client_code">
            <input type="hidden" class="form-control" id="report_name" value="TradeListing">
            <span class="text-danger" id="client_code_err"></span>
        </div>
                          <div style="display: flex; flex-direction: row; gap: 1rem;" class="daterangeDiv">
                            <div style="display: flex; flex-direction: column;">
                                <label for="" class="form-label fw-semibold">From Date</label>
                                <div class="form-icon right" style="width: 100%;">
                                  <input type="text" class="form-control form-control-icon" id="from_date" data-provider="flatpickr" data-date-format="d-m-Y"  placeholder="Select dates" width="">
                                  <i class="ri-calendar-2-fill"></i>
                                </div>
                                <span class="text-danger" id="client_code_err"></span>
                              </div>
                              <div style="display: flex; flex-direction: column;">
                                <label for="" class="form-label fw-semibold">To Date</label>
                                <div class="form-icon right" style="width: 100%;">
                                  <input type="text" class="form-control form-control-icon" id="to_date" data-provider="flatpickr" data-date-format="d-m-Y"  placeholder="Select dates" width="">
                                  <i class="ri-calendar-2-fill"></i>
                                </div>
                                <span class="text-danger" id="client_code_err"></span>
                              </div>

                          </div>
          
                        </div>
                        <div class="d-flex flex-md-row flex-wrap equityOption hide">
          
                          <label class="rad-label">
                            <input type="radio" class="rad-input" name="equityOption" value="excel">
                            <div class="rad-design"></div>
                            <p class="rad-text">Equity</p>
                          </label>
          
                          <label class="rad-label">
                            <input type="radio" class="rad-input" name="equityOption" value="pdf">
                            <div class="rad-design"></div>
                            <p class="rad-text">F&O</p>
                          </label>
                          <label class="rad-label">
                            <input type="radio" class="rad-input" name="equityOption" value="pdf">
                            <div class="rad-design"></div>
                            <p class="rad-text">CD</p>
                          </label>
                          <label class="rad-label">
                            <input type="radio" class="rad-input" name="equityOption" value="pdf">
                            <div class="rad-design"></div>
                            <p class="rad-text">Commodity</p>
                          </label>
                        </div>
                        <div class="d-flex flex-md-row sendOption pt-lg-4">
          
                          <label class="rad-label">
                            <input type="radio" class="rad-input" name="sendOption" value="excel">
                            <div class="rad-design"></div>
                            <p class="rad-text">Excel</p>
                          </label>
          
                          <label class="rad-label">
                            <input type="radio" class="rad-input" name="sendOption" value="pdf">
                            <div class="rad-design"></div>
                            <p class="rad-text">PDF</p>
                          </label>
                        </div>
                        <div class="d-flex flex-md-row gap-3 flex-wrap pt-lg-4">
          
                          <button class="custom-secondary-btn"><span style="margin-right: 0.5rem; margin-top: 0.5rem;"><i class="ri-send-plane-line"></span></i>Mail</button>
                          <button class="custom-primary-btn"><span style="margin-right: 0.5rem;"><i class="bx bx-download"></span></i>Download</button>
                        </div>
                      </form>
                  </div>
                </div>
                <!-- container-fluid -->
            </div>
            <div class="col-lg-12 col-sm-12 col-xs-12" id="ledgerDetail_response"> 
                       
            </div>
            <!-- End Page-content -->
            <%- include('../include/header.ejs') %>
        </div>
        <!-- end main content-->
        </div>
        <!-- END layout-wrapper -->
 <%- include('../include/scripts.ejs') %>
 <link rel="stylesheet" href="https://code.jquery.com/ui/1.13.2/themes/base/jquery-ui.css">
 <script src="https://code.jquery.com/ui/1.13.2/jquery-ui.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.min.js" defer></script>
 <script>        
    $(function(){    
       $("#client_code").autocomplete({            
       source:function(req,res){            
           $.ajax({     
               url: 'client-master-search',            
               dataType: "jsonp",            
               type: 'GET',            
               data:req,                  
               success: function (data){
                   if(data[0].name != undefined && data[0].name){
                       res(data)    
                   }else{
                   $("#client_code").html("")        
                   }                      
               },            
               error: function (err) {            
                   console.log(err);            
               }
           });            
       },
       minLength:1,            
       select:function(event,ui){            
           if(ui.item){               
               $("#client_code").val(ui.item.name)            
           }            
       }            
       })  
   })
   function getReportNameWiseData(){
               $("#get_api_response").html('')
               $('.btn-adv').html("Request");
               const document_name = $('#document_name').find(":selected").text();
               const document_id = $('#document_name').val();
               if(document_name =='Combined Ledger' || document_name =='Fund transaction Report' || document_name=='CommodityLedger' || document_name=='Equity Ledger' || document_name=='FNO Ledger' || document_name=='Currency Ledger' || document_name =='Dividend' || document_name == "Dp Transaction" || document_name =="LT-ST Report" || document_name=="All Segment P&L"){
                   $(".ledgerDiv").show();
                   $("#tradelisting_div").hide(); 
               }
               else if(document_name =='OutstandingPosition'){
                   $("#as_on_date_div").show()
               }
               else if(document_name =='FNO P&L Statement' || document_name =='Equity P&L Statement' || document_name =='CD P&L Statement' || document_name =='Commodity P&L Statement'){
                 $(".ledgerDiv").show();
               }
               else if(document_name == "DP_Holding"){
                 $(".ledgerDiv").hide();
               }
               else if(document_name=="Trade Report Details -Datewise" || document_name == "Trade Report Details -Scripwise"){
                 $(".ledgerDiv").show();
                 $("#tradelisting_div").show();
               }
               else{
                 $("#as_on_date_div").hide()
                 $(".ledgerDiv").hide();
                 $("#tradelisting_div").hide();
               }
               var formData = {
                   'document_id': document_id
               };
               $.ajax({
                   type: 'POST',
                   url: '/get-reportnamewise-details',
                   data: JSON.stringify(formData),
                   contentType: "application/json",
                   //Accept: "application/text",
                   dataType: "json",       
                   success: function (data) {
                       console.log("HELLO",data)
                       $("#report_name").val(data.data[0]['report_name'])
                       $("#api_url").val(data.data[0]['api_url'])
                       $("#report_type").val(data.data[0]['report_type'])
                       $("#report_name_id").val(data.data[0]['_id'])
                   },
                   error: function (err) {                        
                       console.log(err);
                   }
               }); 
           }
   </script>
   <script>
    const labels = document.querySelectorAll('.sendOption .rad-label');
    labels.forEach(function(item) {
      item.addEventListener('click', () => {
        labels.forEach(label => {
          label.classList.remove('rad-label-background');
        });
        let radio = item.querySelector('input')
  
        radio.checked = true
        item.classList.add('rad-label-background')
      });
  
    })
    const datePickers = document.querySelector(".daterangeDiv");
    const selectElement = document.getElementById("selectReport");
    const equityElement = document.querySelector(".equityOption");
    console.log(equityElement);
    selectElement.addEventListener("change", function() {
      if (selectElement.value == 'Commodity-Ledger' || selectElement.value == 'Client-Master-List' || selectElement.value == 'DP-Holding') {
        datePickers.classList.add('hide')
      } else {
        datePickers.classList.remove('hide')
  
      }
      if (selectElement.value == 'Trade-Report-Details-Datewise' || selectElement.value == 'Trade-Report-Details-Scriptwise') {
        equityElement.classList.remove('hide')
      } else {
        equityElement.classList.add('hide')
      }
    });
  </script>
   <script>        
    $(function(){    
       $("#client_code").autocomplete({            
       source:function(req,res){            
           $.ajax({     
               url: 'client-master-search',            
               dataType: "jsonp",            
               type: 'GET',            
               data:req,                  
               success: function (data){
                   if(data[0].name != undefined && data[0].name){
                       res(data)    
                   }else{
                   $("#client_code").html("")        
                   }                      
               },            
               error: function (err) {            
                   console.log(err);            
               }
           });            
       },
       minLength:1,            
       select:function(event,ui){            
           if(ui.item){               
               $("#client_code").val(ui.item.name)            
           }            
       }            
       })  
   })
   </script>