
@php($message = 'Booking Form against booking details (Article Name:"'.$booking->plot->plot_id.' "Type:" '.$booking->plot->type .'") has been viewed')
    @php(EF::createLogs($message,'document'))
    <!DOCTYPE html>
<html>
<head>

  <title>Customer Summary</title>


  <style type="text/css">

    
    *{

        margin: 0;
     }

     /* GENERAL CSS APPLY ALL SECTIONS*/


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

  .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: 12px;
    /*font-weight: bold;*/
  }

  

  .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{

        
     }


  </style>
</head>

<body style="margin:3% 7.5% 4% 7.5%;">
      
   @include('letters.pdf_letter_header')

     <br>

     <div class="container">
        <div class="main-section">
           <center> <h3>CUSTOMER SUMMARY</h3></center>
      @include('documents.customer_info')
      @include('documents.plot_info')
      @include('documents.payment_history')


      <div class="row clear">
          <table border="1" style="border-collapse: collapse; margin-top:3%; text-align: center; width:100%;">
            <thead>
              <tr>
              <th colspan="8" style="background: #E0E0E0; ">Outstanding Installment Plan</th>
                
              </tr>
              <tr>

                 <th style ="width:5%;" >Sr. </th>
                 <th>Description</th>

                  <th>Actual Amount</th>

                  <th>Amount</th>

                  <th>Received</th>

                  <th>Balance</th>

                  <th>Status</th>

                  <th style="width: 15%;">Date</th>
              </tr>
              <tbody>
                @php ($totalamount = 0)
                @php($received = 0)
                @php($balance = 0 )
                @php($short = 0)
          @foreach($installment as $rows)
          @if($rows->received_amount < $rows->amount)
          <tr>
            <td>{{$loop->iteration}} </td>
               <td>{{$rows->description}} </td>
                <td>{{EF::numberFormat($rows->actual_amount)}}</td>
                 <td>{{EF::numberFormat($rows->amount)}}</td>
                  <td>{{EF::numberFormat($rows->received_amount)}}</td>
                    <td>{{EF::numberFormat(($rows->amount)-($rows->received_amount))}}</td>
                    @if($rows->received_amount >= $rows->amount)
                        <td>Paid</td>
                        @else 
                           <td>Unpaid</td>
                           @endif

                        <td>{{EF::dateFormat($rows->due_date)}}</td>
                        @php($totalamount = $totalamount +($rows->amount))
                          @php($received = $received +($rows->received_amount))
                             @php($balance = $balance +(($rows->amount)-($rows->received_amount)))
                            



          </tr>
          @endif
          @endforeach
          <tr>
            @php ($short = $booking->getShortAmount($booking->id))
                <th colspan="2" style="background: #E0E0E0; ">Total</th>
                 <th  style="background: #E0E0E0; ">{{EF::numberFormat($booking->agreed_amount)}}</th>
                  <th  style="background: #E0E0E0; ">{{EF::numberFormat($totalamount)}}</th>
                   <th  style="background: #E0E0E0; ">{{EF::numberFormat($received)}}</th>
                    <th  style="background: #E0E0E0; ">{{EF::numberFormat($balance)}}</th>
                     <th colspan="2"  style="background: #E0E0E0; ">Short: {{EF::numberFormat($short)}}</th>


          </tr>
        </tbody>
            </thead>
          </table>
      </div>
              <!-- INSTALLMENT PLAN -->
        
        </div>
     </div>

</body>
</html>