<?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')); ?>
<?php ($app_name ="Sky Lite"); ?>
<!DOCTYPE html>
  <html>
    <head>
      <meta charset="UTF-8">
      <title>Confirmation of Allotment</title>
      <style type="text/css">
        .container{
          /*border: 1px solid #000;*/
          width: 100%;

          margin-top: 2px;
          font-size: 13px;
          text-align: justify;
          text-justify:inter-word;
        /*   margin-left: 3%;
            margin-right:2%;*/
         }
        .letterimage
        {
            width:120px;
            height:100px;
            border:1px solid;
            margin-top:-6px;
        }
        .right_div
        {
            float:right;
        }
        .date_style
        {
            margin-top: -24px;
            margin-right: 20px;
        }
        .ref_style
        {
            margin-top: -25px;
            margin-right: 27px;
        }
        .hrstyle
        {
            border: 1px solid black;
        }

        header{
          position: fixed;
          top: 100%;
          left: 0px;
          right: 0px;
          height: 50px;

            /** Extra personal styles **/
            /*background-color: #03a9f4;
            color: white;*/
          /*  text-align: center;
            line-height: 35px;*/
        }

        footer {
            position: fixed;
            bottom: 200px;
            left: 50px;
            right: 50px;
            height: 50px; 

            /** Extra personal styles **/
            /*   background-color: #03a9f4;
            color: white;
            text-align: center;
            line-height: 35px;*/
        }

        .page{
            /*margin-top:10%; */
            margin-left: 2.5%;
            margin-right: 2.5%;
        }
      </style>
    </head>

    <body class="pdf-body" style="margin-top: 10%;margin-bottom: 18% !important; ">
        
        <footer>
               <hr align="left" width="25%" class = "hrstyle">
              <div>Authorised Signatory</div>
               <div>Skylite Builders</div>
               <br>
               <div>Date Printed: <?php echo e(EF::dateFormat($print_date)); ?></div>
        </footer>
        <div class="container page" >
          <div class = "right_div">
              <p class = "date_style">Date: <?php echo e(EF::dateFormat($booking->created_at)); ?><br>
               <b><?php echo e(strtoupper($booking->ref)); ?></b></p><br><br><br>
               
               <?php if(!isset($co_owner->id)): ?>
                 <img class = "letterimage" src="<?php echo e(EF::getFile($user->dp)); ?>"  >
                 <p ><br></p>
                   <p style = "margin-top: -10px; margin-left:27px;"><b>Reg No: <?php echo e($booking->reference_number); ?></b></p>
                <?php else: ?>
                  <img style = "width: 80px" class= "letterimage" src="<?php echo e(EF::getFile($user->dp)); ?>" >
                        <img style = "width: 80px" class= "letterimage" src="<?php echo e(EF::getFile($co_owner->dp)); ?>" >
                        
                        <p style = "margin-top:-160px; margin-right:20px;"><b>Reg No: <?php echo e($booking->reference_number); ?></b></p>
                <?php endif; ?>
          </div>
          <div>
            <?php if(!isset($co_owner->id)): ?>
                    <div style=" width: 80%; margin-right: 0px;">
                        <?php if($user->relation == "S/O"): ?>Mr. <?php elseif($user->relation == "D/O"): ?> Miss. <?php else: ?> Mrs. 
                        <?php endif; ?> <?php echo e(strtoupper($user->name)); ?> <br>
                        <?php if($user->relation == "S/O"): ?>
                        S / O: <?php echo e(strtoupper($user->fname)); ?>  <br>
                        <?php elseif($user->relation == "D/O"): ?>
                        D / O: <?php echo e(strtoupper($user->fname)); ?>  <br>
                        <?php elseif($user->relation == "W/O"): ?>
                        W / O: <?php echo e(strtoupper($user->fname)); ?>  <br>
                        <?php else: ?>
                        S / O: <?php echo e(strtoupper($user->fname)); ?>  <br>
                        <?php endif; ?>
                        CNIC NO: <?php echo e($user->cnic); ?>  <br>
                        <p style="width: 60%;">Address: <?php echo e(strtoupper($user->temp_address)); ?></p> 
                        <br><br>
                        Mobile: <?php echo e($user->contact); ?> <br>
                        Phone:  <?php echo e($user->other_contact); ?> <br><br>
                    </div>
                <?php else: ?>
                    <div style=" width: 35%;height: 170px;border:1px solid; display: inline-block;">
                        <span style="padding-left: 4px;">
                          <?php if($user->relation == "S/O"): ?>Mr. <?php elseif($user->relation == "D/O"): ?> Miss. <?php else: ?> Mrs. 
                          <?php endif; ?> <?php echo e(strtoupper($user->name)); ?>

                        </span> <br>
                        <span style="padding-left: 4px;">
                          <?php if($user->relation == "S/O"): ?>
                          S / O: <?php echo e(strtoupper($user->fname)); ?>  <br>
                          <?php elseif($user->relation == "D/O"): ?>
                          D / O: <?php echo e(strtoupper($user->fname)); ?>  <br>
                          <?php elseif($user->relation == "W/O"): ?>
                          W / O: <?php echo e(strtoupper($user->fname)); ?>  <br>
                          <?php else: ?>
                          S / O: <?php echo e(strtoupper($user->fname)); ?>  <br>
                          <?php endif; ?>
                        </span>
                        <span style="padding-left: 4px;">CNIC NO: <?php echo e($user->cnic); ?></span>  <br>
                        

                        <br><span style="padding-left: 4px;">Mobile: <?php echo e($user->contact); ?></span> <br>
                        <span style="padding-left: 4px;">Phone:  <?php echo e($user->other_contact); ?></span> <br>
                        <p style="width: 100%;padding-left: 4px;padding-right: 4px;word-spacing: normal;line-height: normal;margin-right: 3px;">Address: <?php echo e(strtoupper($user->temp_address)); ?> </p> 
                    </div>

                    <div style=" width: 35%;height: 170px; border:1px solid; display: inline-block;">
                        <span style="padding-left: 4px;">
                          <?php if($co_owner->relation == "S/O"): ?>Mr. <?php elseif($co_owner->relation == "D/O"): ?> Miss. <?php else: ?> Mrs. 
                          <?php endif; ?> <?php echo e(strtoupper($co_owner->name)); ?>

                        </span><br>
                        <span style="padding-left: 4px;">
                          <?php if($co_owner->relation == "S/O"): ?>
                            S / O: <?php echo e(strtoupper($co_owner->fname)); ?>  <br>
                          <?php elseif($co_owner->relation == "D/O"): ?>
                          D / O: <?php echo e(strtoupper($co_owner->fname)); ?>  <br>
                          <?php elseif($co_owner->relation == "W/O"): ?>
                          W / O: <?php echo e(strtoupper($co_owner->fname)); ?>  <br>
                          <?php else: ?>
                          S / O: <?php echo e(strtoupper($co_owner->fname)); ?>  <br>
                          <?php endif; ?>
                        </span>
                        <span style="padding-left: 4px;"> 
                          CNIC NO: <?php echo e($co_owner->cnic); ?>

                        </span>  <br>
                       

                        <br><span style="padding-left: 4px;">Mobile: <?php echo e($co_owner->contact); ?></span> <br>
                        <span style="padding-left: 4px;">Phone:  <?php echo e($co_owner->other_contact); ?></span> <br>
                        <p style="padding-left: 4px; width: 100%;word-spacing: normal;line-height: normal;">Address: <?php echo e(strtoupper($co_owner->temp_address)); ?></p>
                    </div>
                <?php endif; ?>
          </div>

          <div class = "subject_div">Subject: <b><u>CONFIRMATION OF ALLOTMENT - <?php echo e(strtoupper($booking->branch->name)); ?></u></b>
          </div>
          <div style = "line-height: 0.75rem;">
            <p style = "  font-family: Calibri Regular !important;"><b>Dear Sir/Madam,</b></p>
            <p>With reference to your application for booking of <?php echo e($plot->type); ?> in <?php echo e(strtoupper($booking->branch->name)); ?> <?php echo e(strtoupper($plot->location)); ?></p>
            <p>We are pleased to inform you that your application has been approved.</p>
            <p>Your allotment details are mentioned below:</p>
            <p>Type: <?php echo e($plot->type); ?> Category: <?php echo e(strtoupper($plot->category)); ?>,<?php echo e(strtoupper($plot->feature_description)); ?>,Registration no. <?php echo e($booking->reference_number); ?></p>
            <p>Size: <?php echo e(strtoupper($plot->size)); ?>, Location:<?php echo e($plot->location); ?></p>
          </div>

          <br>

          <div>
            <b style = "margin-left:10%; margin-right: 7%;" >Total Price: </b>Rs. <?php echo e(EF::numberFormat($plot->rate)); ?> <small>(Rupees <?php echo e(EF::numberToWords($plot->rate)); ?>)</small>
          </div>
          <div>
            <b style = "margin-left:10%;  margin-right: 1%;">Received Payment:</b> Rs. <?php echo e(EF::numberFormat($balancedetail['debit'])); ?>  <small>(Rupees <?php echo e(EF::numberToWords($balancedetail['debit'])); ?>)</small>
          </div>
          <div>
            <b style = "margin-left:10%; ">Balance Receivable: </b> Rs. <?php echo e(EF::numberFormat($balancedetail['credit'])); ?>  <small>(Rupees <?php echo e(EF::numberToWords($balancedetail['credit'])); ?>)</small>
          </div>
          <div>
            <b style = "margin-left:10%; margin-right: 4%;">Payment Term:</b><?php echo e($payment_term); ?>

          </div>
          <div style = "line-height: 0.75rem;">
            <p>This allotment is subject to the terms and conditions mentioned in the RESERVATION FORM. </p>
            <p>As per our construction schedule we are planning to complete the construction of the <?php echo e(strtoupper($booking->branch->name)); ?>, by <?php echo e(EF::dateFormat($booking->branch->end_date)); ?>.</p>
            <p>Therefore timely payment by the allottee is of vital importance.</p>
            <p>We acknowledge the receipt of payments as mentioned below:</p>
          </div>

          <table  style=" margin-top:3%; text-align: center; width:100%;">

            <thead>
              <tr>
                <th style = "width:15%;">Receipt No</th>
                <th style = "width:15%;">Date</th>
                <th style = "width:15%;">Ch #</th>
                <th style = "width:15%;">Drawn on</th>
                <th style = "width:40%;">Amount</th>
              </tr>
            </thead>

            <tbody>
                <?php $__currentLoopData = $payment_receipts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $rows): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

                  <?php if($rows->generic_type_id === EF::getGenericTableIndex()['Installment'] && in_array($rows->generic_id,$installment_list)): ?>
                    <tr>
                      <td><?php echo e($rows->receipt_no); ?></td>
                      <td><?php echo e(EF::dateFormat($rows->created_at)); ?></td>
                      <td><?php echo e($rows->instrument); ?></td>
                      <td><?php echo e($rows->drawn_on); ?></td>
                      <td><?php echo e(EF::numberFormat($rows->amount)); ?></td>
                    </tr>
                  <?php endif; ?>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </tbody>
          </table>
   
          <div class="description" style="margin-bottom: 30%">
              <p>All Receipts are enclosed for your record.</p>
              <p>The purchaser is responsible for following all the <b>organizational and governmental policies and taxes</b> as applicable from time to time.</p>
              <p >Once again we congratulate you for the confirmation of the <?php echo e($plot->type); ?> and assure you the best of co-operation and services.Please don't hesitate to contact us if you have any further questions or queries.</p>
          </div>

    


          <?php ($net_balance = 0); ?>

          <div class="row clear" style="page-break-before: always;">
            <div class = "right_div">
              <p style = "margin-top: -10px;" class = "date_style">Date: <?php echo e(EF::dateFormat($booking->created_at)); ?><br>
                <b><?php echo e(strtoupper($booking->ref)); ?></b></p>
              <p style = "margin-top: -10px;"><b>Reg No: <?php echo e($booking->reference_number); ?></b></p>
            </div>
            <div>
              <?php if($user->relation == "S/O"): ?>Mr. <?php elseif($user->relation == "D/O"): ?> Miss. <?php else: ?> Mrs. <?php endif; ?> <?php echo e(strtoupper($user->name)); ?> <br>
                <?php echo e(strtoupper($user->relation)); ?>: <?php echo e(strtoupper($user->fname)); ?>  <br>
            </div>

             <div class = "subject_div"><br><br>Subject: <b><u>Installment Schedule</u></b>
             </div>

             <div style = "line-height: 0.75rem;">
              <p style = "  font-family: Calibri Regular !important;"><b>Dear Sir/Madam,</b></p>
              <p>Mentioned below is the Installment Schedule which is done to be followed strictly as per the payment due dates. This will help us to complete the project timely and secure you from the late paymet penalties, as per day terms and conditions.</p>
             </div>
          </div>

          <div class="row clear">
            <h3><u>PAYMENT SCHEDULE</u></h3>
              <table  border="0" style="border-collapse: collapse; margin-top:3%;margin-bottom:33%; text-align: center; width:100%; font-size: 8.5pt;">
                <thead>
                  <tr>
                     <th>Description</th>
                      <th>Amount</th>
                      <th>Due Date</th>
                      <th>Balance</th>
                      <th>Payment</th>
                      <th>Net Balance</th>
                  </tr>
                  <tbody>
                    <?php ($totalamount = 0); ?>
                    <?php ($received = 0); ?>
                    <?php ($balance = 0 ); ?>
                    <?php ($short = 0); ?>

                    <!-- DOWN PAYMENT SECTION -->
                    <?php $__currentLoopData = $installment; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $rows): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                      <?php if($rows->type_of_installment === "Down Payment"): ?>
                        <tr>
                          <td><?php echo e($rows->description); ?> </td>
                          <td><?php echo e(EF::numberFormat($rows->amount)); ?></td>
                          <td><?php echo e(EF::dateFormat($rows->due_date)); ?></td>
                          <td><?php echo e(EF::numberFormat($rows->amount)); ?></td>
                          <td><?php echo e(EF::numberFormat($rows->received_amount)); ?></td>
                          <td><?php echo e(EF::numberFormat(($rows->amount)-($rows->received_amount))); ?></td>
                        </tr>
                      <?php endif; ?>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    <tr>
                      <th>Total Down Payment</th>
                      <th colspan="6"></th>
                    </tr>
                    <!-- END DOWN PAYMENT SECTION -->

                    <!-- INSTALLMENT SECTION -->
                    <?php $__currentLoopData = $installment; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $rows): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                      <?php if($rows->type_of_installment === "Installment"): ?>
                        <tr>
                            <td><?php echo e($rows->description); ?> </td>
                            <td><?php echo e(EF::numberFormat($rows->amount)); ?></td>
                            <td><?php echo e(EF::dateFormat($rows->due_date)); ?></td>
                            <td><?php echo e(EF::numberFormat($rows->amount)); ?></td>
                            <td><?php echo e(EF::numberFormat($rows->received_amount)); ?></td>
                            <?php if($rows->received_amount > 0): ?>
                              <?php ($net_balance += ($rows->amount)-($rows->received_amount)); ?>
                              <td><?php echo e(EF::numberFormat($net_balance)); ?></td>
                            <?php else: ?>
                              <td><?php echo e(EF::numberFormat(($rows->amount)-($rows->received_amount))); ?></td>
                            <?php endif; ?>
                            <?php ($totalamount = $totalamount +($rows->amount)); ?>
                            <?php ($received = $received +($rows->received_amount)); ?>
                            <?php ($balance = $balance +(($rows->amount)-($rows->received_amount))); ?>
                        </tr>
                      <?php endif; ?>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    <tr>
                      <th>Total Installment Amount</th>
                      <th><?php echo e(EF::numberFormat($totalamount)); ?></th>
                      <th></th>
                      <th><?php echo e(EF::numberFormat($totalamount)); ?></th>
                      <th><?php echo e(EF::numberFormat($received)); ?></th>
                      <th><?php echo e(EF::numberFormat($balance)); ?></th>
                    </tr>
                    <!-- END INSTALLMENT PAYMENT SECTION -->

                    <!-- OTHER PAYMENT SECTION -->
                    <?php $__currentLoopData = $installment; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $rows): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                      <?php if($rows->type_of_installment != "Installment" && $rows->type_of_installment != "Down Payment"): ?>
                          <tr>
                            <td><?php echo e($rows->description); ?> </td>
                            <td><?php echo e(EF::numberFormat($rows->amount)); ?></td>
                            <td><?php echo e(EF::dateFormat($rows->due_date)); ?></td>
                            <td><?php echo e(EF::numberFormat($rows->amount)); ?></td>
                            <td><?php echo e(EF::numberFormat($rows->received_amount)); ?></td>
                            <?php if($rows->received_amount > 0): ?>
                              <?php ($net_balance += ($rows->amount)-($rows->received_amount)); ?>
                              <td><?php echo e(EF::numberFormat($net_balance)); ?></td>
                            <?php else: ?>
                              <td><?php echo e(EF::numberFormat(($rows->amount)-($rows->received_amount))); ?></td>
                            <?php endif; ?>
                            <?php ($totalamount = $totalamount +($rows->amount)); ?>
                            <?php ($received = $received +($rows->received_amount)); ?>
                            <?php ($balance = $balance +(($rows->amount)-($rows->received_amount))); ?>
                          </tr>
                      <?php endif; ?>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                    <!-- END OTHER PAYMENT SECTION -->
                  </tbody>
                </thead>
              </table>
          </div>

          <br>
          <br>
          <br>
          <br>
          <br>
          <br>
          <br>
          <br>
          <br>
          <br>
          <br>
          <br>
          <br>
          <br>
          <br>
              <!-- INSTALLMENT PLAN -->
        </div>
    </body>
  </html>
<?php /**PATH /home/ubuntu/rebmgisplus/skylite/resources/views/documents/confirmation_of_allotment.blade.php ENDPATH**/ ?>