<!DOCTYPE html>
<html>
<head>

  <title>Due Installment Report</title>


  <style type="text/css">


    *{

        margin: 0;
     }

     /* GENERAL CSS APPLY ALL SECTIONS*/


  *{
    margin: 0;
  /*  padding-top: 6px;*/
  }
  .margin{
    padding-top: 2px;
  }

  .title{

    text-align: center;
    font-weight: bold;
  }


  .container1{

    margin-left: 7%;
    margin-right: 5%;

  }

  .image-section1{

    width: 100px;
    height: 100px;


    text-align: center;
    position: absolute;
    margin-left:  -5%;
/*    top:  -500%;*/
bottom:  10%;


  }

  .title1{

    text-align: center;
    margin-top: 2%;
    background: #a8a8a8;
    color: #fff;
    width: 30%;
    height: 2%;
    border-radius: 15px;
    vertical-align: middle;
    line-height: 29px;
    margin-left: 34.5%;
  }



  .clear{

    clear: both;
  }

  .top-section{
    margin-left: 4%;
  }

  input[type=text]
  {



    border-top: 0;
    border-right: 0;
    border-left: 0;
    border-bottom: 1px solid;
    font-size: 12px;
    text-align: center;
    background-color: transparent;

  }

/*  #START=> APPARTMENT SECTION */
  .main-section .row .col{


    width: 25%;
    margin-right: 30px;
    padding-right: 10px;
    float: left;
  }

  .main-section .row{

    /*margin-left: 4%;*/


  }

  .main-section .col label{
    font-size: 8.5pt;
    /*font-weight: bold;*/
  }

  label,span{
    font-size: 8.5pt;

  }



  .main-section .row .col .check{
    vertical-align: middle;
    margin-top: 10px;
    margin-right:  90px;
  }

/*  #END=> APPARTMENT SECTION */







/*  #END=> OFFICE USE SECTION */

/*  #START=>  IMAGE SECTION */

 .image-section{

    width: 85px;
    height: 85px;

    border: 1px solid #000;
    text-align: center;
    position: absolute;
    margin-left:  83%;
    top:  18%;


  }



  small{
    font-size: 12px;
    margin-left: 15;
  }

     .container{


     }

    .print-buttons{
        display: flex;
        justify-content: right;
    }

    .excel{
        border: none;
        background-color: #FFFFFF;
        cursor: pointer;
    }

    .pdf{
        border: none;
        background-color: #FFFFFF;
        cursor: pointer;
    }


  </style>
</head>

<body style="margin:3% 7.5% 4% 7.5%;">
      
        @if($format)   
          <br> 
        @include('documents.report_logo')
          <br>
        @endif

      <header>
        <div  class="header">
           <br><strong>Due Installment Report</strong> </center>
        </div>
      </header>


     <div class="container">
        <div class="main-section">

    <!-- CUSTOMER SECTION -->
        <!-- ROW-1 -->




    <div class="row clear margin">


          <div class="col margin" style="width: 85%">
            <label>Title: {{$title}}</label>
          </div>

          <div class="col margin" style="width: 25%">
            <label>Date: <span >{{EF::dateFormat(date('y-m-d'))}}</span></label>
          </div>



      </div>


    <!-- END CUSTOMER SECTION -->

    <div class="row margin clear">

      <div class="col" style="width: 100%;">
        <table  border="1" style="border-collapse: collapse; margin-top:3%; text-align: center; width:100%; font-size: 8.5pt;">
          <thead>
            <tr>

              <th>#</th>
              <th>Booking Date</th>
              <th>Customer</th>
              <th>Cnic</th>
              <th>Contact</th>
              <th>Reg No.</th>
              <th>Plot No</th>
              <th>Block</th>
              <th>Category</th>
              <th>Dimension</th>
              <th>Size</th>
              <th>Agreed Amount</th>
               


               {{--
              <th>Due Amount</th>

              <th>Received Amount</th>

              <th>Balance</th>
               --}}
            
            

              <th>Due Installments </th>
              


          </tr>

          </thead>
            <tbody>
              
      
              @foreach($installment_list as $installment)
            
                 @php($descriptions = '')

                 @php($received_amount = '')


                 @foreach($installment as $rows)

                  @php($descriptions .= $rows->description. ', ')

                  @php($due_amount = $rows->sum('amount'))

                  @php($received_amount = $rows->sum('received_amount'))


                   @php($balance = $rows->sum('actual_amount') - $rows->sum('received_amount') )

                

                 @endforeach

                      <tr>
                          <td>{{$loop->iteration}}</td>
                          <td style="width:10% !important;">{{EF::dateFormat($rows->booking->created_at)}}</td>
                          <td>{{$rows->user->name}}</td>
                          <td style="width:10% !important;">{{$rows->user->cnic}}</td>
                          <td style="width:10% !important;">{{$rows->user->contact}}</td>
                          <td style="width:10% !important;">{{$rows->booking->file_number}}</td>
                          <td>{{$rows->booking->plot->plot_id}}</td>
                          <td>{{$rows->booking->plot->block_name}}</td>
                          <td>{{$rows->booking->plot->category}}</td>
                          <td>{{$rows->booking->plot->dimensions}}</td>
                          <td>{{$rows->booking->plot->size}}</td>
                          <td>{{EF::numberFormat($rows->booking->agreed_amount)}}</td>
                            
                          {{-- 

                          <td>{{EF::numberFormat($due_amount)}}</td>

                          <td>{{EF::numberFormat($received_amount)}}</td>

                          <td>{{EF::numberFormat($balance)}}</td>

                          --}}


                          <td style="width:20% !important;">{{rtrim($descriptions , ', ')}}</td>
                      </tr>
          

              @endforeach
          </tbody>
         
        </table>
      </div>

    </div>


        </div>
     </div>

</body>
</html>
