<?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>


<?php if(EF::getUrl() != "letterdata"): ?>
<style type="text/css">
  

 .container{
  
  /*border: 1px solid #000;*/
  width: 100%;
  margin-left: 2%;
  margin-right: -15;
  margin-top:2%;
  font-size: 14px;
  font-family: "Calibri"!important;
  text-align: justify;
  text-justify:inter-word;
  line-height: 14pt;



 }
.letterimage
 {
 
    
    width:100px;
    height:100px; 
    border:1px solid;
    margin-top:-14px;


 }

  .right_div
 {
      float:right;
 }
 .date_style
 {
    margin-top: -41px;
    margin-right: 20px;
 }
 
.ref_style
 {
    
    margin-top: -25px;
    margin-right: 27px; 
 }

 .left_div
 {
      float:left;
 }
 .hrstyle
 {
     border: 1px solid black;
 }


 footer {
    position: fixed; 
    bottom: 160px !important; 
    left: 100px; 
    right: 20px;
}

.footerinfo{
    font-size: 14px;
    margin-left: 20px;
    padding-top: 5px;
    margin-bottom: 40px;
}

</style>
<?php endif; ?>

<?php if(EF::getUrl() == "letterdata"): ?>
<style type="text/css">
.letterimage
 {
 
  
    width:120px;
    height:100px; 
    border:1px solid;  
    margin-right:-109px;
   

 }
 .right_div
 {
      float:right;
 }

 .left_div
 {
      float:left;
 }
 .date_style
 {
    float:right;
    margin-top: -41px;
    margin-right: 20px;
 }
 .ref_style
 {
    float:right;
    margin-top: -25px;
    margin-right: 27px; 
 }
  .hrstyle
 {
     border: 1px solid black;
 }

 footer {
    position: fixed; 
    bottom: 2000px; 
    left: 100px; 
    right: 20px;
}

.footerinfo{
    font-size: 14px;
    margin-left: 20px;
    padding-top: 5px;
}

</style>
<?php endif; ?>

</head>
 
<body class="pdf-body" style="margin-top: 6%; margin-bottom: 10%;">
    
    <?php if(EF::getUrl() != "letterdata"): ?>
         <footer>
               <br>

            <hr align="left" width="25%" class = "hrstyle">
            <div>Authorised Signatory</div>
               <div>Skylite Builders</div>
           <div style="position:absolute;bottom:50px;right: 10px;">Date Printed: <?php echo e(EF::dateFormat(date('d-M-Y'))); ?></div>
        </footer>
    <?php endif; ?>
    <div class="container">
        <?php if(EF::getUrl() == "letterdata"): ?>
            <div class = "card  mb-2"  style = "width:850.92px; height:100%;   float: none;">
            <!-- <?php echo $__env->make('letters.header_letter', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?> -->
        <?php endif; ?>
        <br><br>
        <div class = "row "  style =" text-align: justify;  margin-left: 5%; margin-right: 5%;  ">
            <div class = "col-md-12" >
                <!-- STRT -->
                <div class = "right_div" style="margin-top:30px">
                    <p style="line-height:25pt !important;" class = "date_style"><?php echo e(EF::dateFormat($booking->created_at)); ?></p>
                    <br>
                    <?php if(EF::getUrl() != "letterdata"): ?>
                        <br>
                    <?php endif; ?>
                    <p class=""><b><?php echo e(strtoupper($booking->ref)); ?></b></p>
                    <?php if(!isset($co_owner->id)): ?>
                        <img style = "margin-left:30px; margin-top:0.5px;" class= "letterimage" src="<?php echo e(EF::getFile($user->dp)); ?>" >
                    
                        <p style = "  margin-top:-155px; margin-right:20px;"><b>Reg No: <?php echo e($booking->reference_number); ?></b></p>
                    <?php else: ?>
                        <img  style = "width: 80px; margin-top:1px;" class= "letterimage" src="<?php echo e(EF::getFile($user->dp)); ?>" >
                        <img  style = "width: 80px; margin-top:1px;" class= "letterimage" src="<?php echo e(EF::getFile($co_owner->dp)); ?>" >
                        
                        <p style = "width:120px; margin-top:-155px; "><b style="word-wrap: normal;">Reg No: <?php echo e($booking->reference_number); ?></b></p>
                    <?php endif; ?>
                </div>
                <?php if(!isset($co_owner->id)): ?>
                    <div style=" width: 80%; margin-right: 0px;">
                        <p style="width: 70%;">
                        <?php if($user->relation == "S/O"): ?> <b>MR.</b> <?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"): ?>
                        <b>S / O</b> <?php echo e(strtoupper($user->fname)); ?>  <br>
                        <?php elseif($user->relation == "D/O"): ?>
                        <b>D / O</b> <?php echo e($user->fname); ?>  <br>
                        <?php elseif($user->relation == "W/O"): ?>
                        <b>W / O</b> <?php echo e(strtoupper($user->fname)); ?>  <br>
                        <?php else: ?>
                        <b>S / O</b> <?php echo e(strtoupper($user->fname)); ?>  <br>
                        <?php endif; ?>
                        <b>CNIC NO : </b> <?php echo e($user->cnic); ?>  <br>
                        <b>Address : </b><?php echo e($user->temp_address); ?><br>

                        <b>Mobile:</b> <?php echo e($user->contact); ?> <br>
                        <b>Phone: </b> <?php echo e($user->other_contact); ?> <br>
                        </p>
                    </div>
                <?php else: ?>
                    <div style=" width: 35%;height: 224px; border:1px solid; display: inline-block;">
                        <span style="padding-left: 4px;padding-top: 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> 
                        <br>
                    </div>

                    <div style=" width: 35%;height: 224px; border:1px solid; display: inline-block;">
                        <span style="padding-left: 4px;padding-top: 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="width: 100%;padding-left: 4px;padding-right: 4px;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: 1rem;">
                <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)); ?> We are pleased to inform you that your application has been approved. 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); ?>

                    <br>
                    Size: <?php echo e(strtoupper($plot->size)); ?>, Location:<?php echo e($plot->location); ?>

                </p>
             
            </div>
            <br>
            <div style="padding-left: 2px;">            
                <ul style="list-style-type: none; margin-top:-25px;">
                    <li><b>Total Price:</b> Rs. <?php echo e(EF::numberFormat($plot->rate)); ?> <small>(Rupees <?php echo e(EF::numberToWords($plot->rate)); ?>)</small></li>
                    <li><b>Received Payment:</b> Rs. <?php echo e(EF::numberFormat($balancedetail['debit'])); ?>  <small>(Rupees <?php echo e(EF::numberToWords($balancedetail['debit'])); ?>)</small></li>
                    <li><b>Balance Receivable: </b>Rs. <?php echo e(EF::numberFormat($balancedetail['credit'])); ?>  <small>(Rupees <?php echo e(EF::numberToWords($balancedetail['credit'])); ?>)</small></li>
                    <li><b>Payment Term:</b> <?php echo e($payment_term); ?></small></li>
                </ul>

                <br>

                <div style = "margin-top: -20px;">
                      
                    
                      <?php if(False && $booking->branch->id != 5): ?>
                        <p style = "line-height: 1rem;">
                        The purchaser acknowledges that the Owner has determined the flat price on the bases of current rate of Rs.5,800 Per Sq Ft. Price of the flat will be adjusted at the time of completion on the bases of saleable premises area rate according to variation rise/fall due to the construction input market cost.
                        </p>

                        <?php endif; ?>


                    <p>This allotment is subject to the terms and conditions mentioned in the <b>RESERVATION FORM.</b> </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>The purchaser is responsible for following all the <b>organizational and governmental policies and taxes</b> as applicable from time to time.</p> 
                 
                    <!-- <p>We acknowledge the receipt of payments as mentioned below:</p> -->
                    <p style ="">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>

                <br>
                <!-- <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> -->
                
                

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

                <div class="row clear" style="page-break-before: always;">
                    <div style="margin: 5%;"></div>

                    <?php if(EF::getUrl() != "letterdata"): ?>

                        <div class = "left_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>
                                Father/Husband Name: <?php echo e(strtoupper($user->fname)); ?>  <br>

                        </div>
                    <?php elseif(EF::getUrl() == "letterdata"): ?>
                        <div class = ""  style="margin-top:15px; margin-left:-65px; float:left !important;">
                        
                            <?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>
                            Father/Husband Name: <?php echo e(strtoupper($user->fname)); ?>  <br>

                        </div>
                    <?php endif; ?>

                          
             
                
                    <?php if(EF::getUrl() != "letterdata"): ?>

                        <div style="margin-top:7px" class="subject_div"><br><br>Subject: <b><u>            Installment Schedule</u></b>
                        </div>
                    <?php elseif(EF::getUrl() == "letterdata"): ?>
                        <div style="margin-top:30px; margin-left:-190px; float:left !important;">
                            <br><br>Subject:<b><u>Installment Schedule</u></b>
                        </div>
                    <?php endif; ?>

                    <div style = "line-height: 0.75rem; ">
                        <p style = "line-height: 0.75rem; margin-top:10px; font-family: Calibri Regular !important;"><b>Dear Sir/Madam,</b><br><br> <span style = "line-height: 1rem; ">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.</span></p>
                    </div>

                <div class="" >
                    <h3><u>PAYMENT SCHEDULE</u></h3>
                    <table  border="0" style="border-collapse: collapse;
                    margin-bottom:20%; 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>
                        </thead>

                        <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>
                    </table>
                </div>
                </div>

                <!-- END -->
            </div>
            <?php if(EF::getUrl() == "letterdata"): ?>
                <div class = "row">
                    <div class = "col-md-12" style ="text-align:center; margin-bottom:13%;">
                        <button type = "submit" style ="margin-top: 15%; font-size: 16px; font-weight: bolder; width:100%;" class = "btn btn-primary fa fa-print"> Print</button>
                    </div>
                </div>
            <?php endif; ?>

            

        </div>

      
    </div>  
</body>


</html><?php /**PATH /var/www/skylite/resources/views/letters/pdf_confirmation_of_allotment.blade.php ENDPATH**/ ?>