
<style type="text/css">
    .bg-color {
    background-color: #1c3752;
}
   
        .page-wrapper{
        font-size: 12px !important;
        font-family: "time-new-roman",Arial,sans-serif !important;
        color: black !important;
        }
        h3{
            line-height: 1px;
        }

          h3 strong{
        text-transform: uppercase;
        color: black !important
    }
    h4 strong{
        text-transform: uppercase;
        color: black !important
    }
    .printFH11 {
    font-size: 13px;
    font-weight: 400;
    background-color: #000000;
    }
    .white-box .box-title {
    margin: 0px 0px 4px 0px;
    font-weight: 400;
    font-size: 14px;
    color: #1c3752;
    background-color: #000000 !important;
    }
    .white-box {
    padding: 0px 0px 2px 0px;
    margin-bottom: 0px;
    margin-bottom: 0;
    border-radius: inherit;
    }
    .table {
    width: 100% !important;
    margin-bottom: 5px;
    margin-top: -2px;
    }
    .table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th {
    vertical-align: top;
    
    }

    .us_table>tbody>tr>td, .us_table>tbody>tr>th, .us_table>tfoot>tr>td, .us_table>tfoot>tr>th {
    
    border :1px solid #e5ebec;
    }
    .page-wrapper {
    padding-top: 0px;
    }
    
</style>

<div class="container-fluid">
    <div class="row printableArea"  id="htmlContent">

        <div class="col-lg-12 text-center">
   
            <!-- <div class="pull-left hidden-lg">-->



        </div><div class="clear"></div>
            <div class="text-center">
                <center><h3><strong><?php echo e(env('APP_NAME')); ?></strong></h3></center>
                 <center><h4>Account Statement</h4></center>
            </div>
        <div class="col-lg-12">
            <div class="white-box1 ">
                <h4 class="box-title " style=" color: white; background-color:#1c3752;line-height: 30px">&nbsp;&nbsp;Member Information</h4>

                <div class="pull-left">
                    <div class="table-responsive">
                        <table class="table bottom-table">
                            <tbody class="printFW">
                                
                                <tr>
                                    <td style=" width: 150px">Ref No:</td>
                                    <td><?php echo e($property->membership_no); ?></td>
                                    <td style="margin-bottom: 5rem; width: 140px"><?= ( $property->customer->type  == 1) ? 'Incorporation no' : 'CNIC No.' ?></td>
                                    <td style="width:240px"> 
                                        <?php $c = str_split($property->customer->cnic, 1);?>
                                    <?php 
                                    for($i =0;$i<count($c) ; $i++) 
                                        {
                                            ?>
                                    <?php if(($i == 5 || $i == 12) &&  $property->customer->type  == 0): ?>
                                    -
                                    <?php endif; ?>
                                      <?= ( $property->customer->type  == 1) ? str_replace('_' , '' , $c[$i] ) : $c[$i] ?> 
                                    <?php 
                                }
                                    ?> 
                                    </td>
                                </tr>
                                <tr>
                                    <td style="margin-bottom: 5rem;"> <?= ( $property->customer->type  == 1) ? 'Company Name:' : 'Member Name:' ?></td>
                                    <td> <?php echo e($property->customer->name); ?> </td>

                                    <td style="margin-bottom: 5rem; width: 140px; display: <?= ( $property->customer->type  == 1) ? 'none' : '' ?>">S/O:</td>
                                    <td style="width:240px;display: <?= ( $property->customer->type  == 1) ? 'none' : '' ?>"> <?php echo e($property->customer->father_name); ?> </td>
                                </tr>
                                <tr>
                                    <td style="margin-bottom: 5rem;">Contact #:</td>
                                    <td> <?php echo e($property->customer ? $property->customer->mobile_number : ''); ?> </td>
                                    <td style="margin-bottom: 5rem;">Address:</td>
                                    <td> <?php echo e($property->customer->mailing_address); ?> </td>
                                </tr>

                            </tbody>
                        </table>
                    </div>
                    <div class="clear"></div>
                </div>
              
            </div>
        </div>






        <div class="col-lg-12">
            <div class="white-box1">
                <h4 class="box-title " style=" color: white; background-color:#1c3752;line-height: 30px">&nbsp;&nbsp;Unit's Details</h4>
               
                    <table class="table bottom-table" >

                        <tbody>
                            <tr>
                                <td style="margin-bottom: 5rem;">Floor / Street:</td>
                                <td ><?php if($property->inventory->floor): ?> <?php echo e($property->inventory->floor->name); ?><?php endif; ?> </td>
                                 <td style="margin-bottom: 5rem;" >Unit No.:</td>
                                <td><?php echo e($property->inventory ? $property->inventory->unit_number : ''); ?></td>
                            </tr>

                            <tr>
                                <td style="margin-bottom: 5rem;">Block:</td>
                                <?php if($property->inventory->floor): ?>
                                 <td > <?php echo e($property->inventory->floor->unitBlock ? $property->inventory->floor->unitBlock->name : ''); ?></td>
<?php else: ?>
<td > </td>
<?php endif; ?>
                                  <td style="margin-bottom: 5rem;">Unit Type:</td>
                                <td><?php echo e($property->inventory->type->name); ?></td>

                            </tr>

                                <tr>
                                <td style="margin-bottom: 5rem;">Category:</td>
                                <td><?php $__currentLoopData = $property->inventory->categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $c): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

                                <?php if($loop->last): ?>
                                <?php echo e($c->category->name); ?> (<?php echo e($c->category->percent); ?> )
                                <?php else: ?>
                                <?php echo e($c->category->name); ?> (<?php echo e($c->category->percent); ?> ),
                                <?php endif; ?>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?></td>


                                <td style="margin-bottom: 5rem;">Area:</td>
                                <td><?php echo e($property->inventory->area); ?></td>
                                </tr>
                            <tr>
                                <td style="margin-bottom: 5rem;">Size:</td>
                                <td>
                                                    <?php echo e($property->inventory->size ? $property->inventory->size->name : ''); ?>  <?php echo e(env('SIZE')); ?>

                                                    </td>

                                                     <td style="margin-bottom: 5rem;">Discount:</td>
                                <td> <?php echo e(number_format($property->discount )); ?> </td>

                            </tr>


                            <tr>
                                <td style="margin-bottom: 5rem;">Total Price:</td>
                                <td> <?php echo e(number_format($property->inventory->total_price - $property->inventory->extra_amount)); ?> </td>
                                  <td style="margin-bottom: 5rem;">Category Cost:</td>
                                <td> <?php echo e(number_format($property->inventory->extra_amount)); ?> </td>
                            </tr>








                            <tr>
                                <td style="margin-bottom: 5rem;">Net Amt.:</td>
                                <td> <?php echo e(number_format($property->net_pay)); ?> </td>

                                 <td style="margin-bottom: 5rem;">Booking Type : </td>
                                <?php if($property->booking_type == \App\CustomerProperty::normal): ?>
                                <td>Installment</td>
                               
                                <?php elseif($property->booking_type == \App\CustomerProperty::full_payment): ?>
                                <td>Full Payment</td>
                                <?php endif; ?>

                            </tr>

                             <?php if($property->down_payment_note): ?>
                            <tr class="no-print">
                                <td style="margin-bottom: 5rem;">Notes:</td>
                                <td><?php echo e($property->down_payment_note); ?></td>

                                 <td  style="margin-bottom: 5rem;">Sale By : </td>
                                <td><?php echo e($property->saleBy ? $property->saleBy->name : ''); ?></td>
                            </tr>
                            <?php else: ?>
                            {
                                 <tr class="no-print">
                                <td style="margin-bottom: 5rem;"></td>
                                <td></td>

                                 <td  style="margin-bottom: 5rem;">Sale By : </td>
                                <td><?php echo e($property->saleBy ? $property->saleBy->name : ''); ?></td>
                            </tr>
                            }
                            <?php endif; ?>
                            <tr class="no-print">
                                <td style="margin-bottom: 5rem;">Automatic Sms Alerts</td>
                                <?php if($property->sms_alert == true): ?>
                                <td>On</td>
                                <?php else: ?>
                                <td>Off</td>
                                <?php endif; ?>

                                 <td style="margin-bottom: 5rem;">Booking Date:</td>
                                
                                <td> <?php echo e(date('d-m-Y', strtotime($property->original_boooking_date))); ?></td>
                                
                                

                            </tr>
                            <tr class="no-print">
                                <td style="margin-bottom: 5rem;">Automatic Email Alerts</td>
                                <?php if($property->email_alert == true): ?>
                                <td>On</td>
                                <?php else: ?>
                                <td>Off</td>
                                <?php endif; ?>

                                 <td style="margin-bottom: 5rem;">Schedule Start Date:</td>
                                <td> <?php if($property->schedule_start_date): ?> <?php echo e(date('d-m-Y', strtotime($property->schedule_start_date))); ?>

                                <?php endif; ?></td>
                            </tr>


                     
                        </tbody>
                    </table>
              

                <div class="clear"></div>
            </div>
        </div>

     


         <div class="col-lg-12">
            <div class="white-box1 ">
                <h4 class="box-title " style=" color: white; background-color:#1c3752; line-height: 30px">&nbsp;&nbsp;Payment Detail</h4>
                 
                <div class="col-md-8 col-xs-10">
                    <div class="table-responsive">
                        <table class="table bottom-table">
                            <tbody class="printFW">
                                
                                <tr style="margin-bottom:2rem">
                                    <td style="margin-bottom: 5rem;">Net Price: </td>
                                    <td style="width: 140px;"> <?php echo e(number_format($property->net_pay)); ?> </td>

                                    <td style="margin-bottom: 5rem;width: 140px;">Received Amount: </td>
                                    <td> <?php echo e(number_format($amount)); ?> </td>

                                   
                                </tr>
                              <tr style="margin-bottom:2rem">
                                    <td style="margin-bottom: 5rem;width: 140px;">Outstanding Amt: </td>
                                    <td> <?php echo e(number_format($property->net_pay - $amount)); ?> </td>

                                    <td style="margin-bottom: 5rem;width: 140px;">Over Due Amt.</td>
                                    <td style="width: 140px;"> <?php echo e(number_format($overDue)); ?></td>
                                </tr>


                                <tr>
                                  

                                    <td style="margin-bottom: 5rem;width: 140px;">Over Due Amt.</td>
                                    <td style="width: 140px;"> <?php echo e(number_format($overDue)); ?></td>
                                </tr>
                                

                            </tbody>
                        </table>
                    </div>
                    <div class="clear"></div>
                </div>
                
            </div>
        </div>

        <div class="col-lg-12">
            <div class="white-box1">
                <div class="table-responsive" style="clear: both;">
                    <table  class="table table-bordered us_table" >
                        <thead style="color: white; background-color:#1c3752;">
                            <tr style="text-align: center">
                                <th style="color: #fff;font-size: 13px;">Payment Head</th>
                                <th style="color: #fff;font-size: 13px;">Due Date</th>
                                <th style="color: #fff;font-size: 13px;">Due Amt.</th>
                                <th style="color: #fff;font-size: 13px;">Received Amt.</th>
                                <th class="no-print" style="color: #fff;font-size: 13px;">Balance</th>
                                <th style="color: #fff;font-size: 13px;">Payment Mode</th>
                                <!-- <th class="no-print">Detail</th> -->
                                <th style="color: #fff;font-size: 13px;">Receipt #</th>
                                <!-- <th>Ref#</th> -->
                                <th style="color: #fff;font-size: 13px;">Receipt Date</th>
                                <th style="color: #fff;font-size: 13px;">Balance Amt.</th>
                                <!-- <th>Surcharge Amt</th>
                                <th>Net Amt</th> -->
                            </tr>
                        </thead>
                        <tbody>
                            <?php $due = 0;
                            $received = 0;
                            $balance = 0;
                            $surcharge = 0;
                            $net_payable = 0;
                            $count = 1;
                            $total = $property->net_pay;
                            ?>
                            <?php $__currentLoopData = $property->statement; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $statement): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

                            <?php if($statement->due > 0): ?>

                            <?php if($statement->balance > 0 && $statement->due_date < Carbon\Carbon::today()): ?>
                                <tr style="background-color: #e8e3c1;">
                            <?php else: ?>
                                <tr>
                            <?php endif; ?>

                            
                                <?php if($statement->payment_head == \App\CustomerStatement::down_payment): ?>
                                <td class="printFV">Down Payment</td>
                                <?php elseif($statement->payment_head == \App\CustomerStatement::possession): ?>
                                <td class="printFV">Possession Fee</td>
                                <?php elseif($statement->payment_head == \App\CustomerStatement::installment): ?>
                                <td class="printFV">Installment - <?php echo e($statement->inst_no); ?></td>
                                <?php elseif($statement->payment_head == \App\CustomerStatement::other): ?>
                                <td class="printFV">Other</td>
                                <?php else: ?>
                                <td class="printFV"></td>
                                <?php endif; ?>

                                <!-- <td class="printFV"><?php echo e($statement->inst_no); ?></td> -->
                                <td class="printFV">
                                    <?php echo e(date('d-m-Y', strtotime($statement->due_date))); ?>


                                    <!-- <?php if($statement->payment_head == \App\CustomerStatement::possession): ?> 
                                    <a href="JavaScript:void(0)" onclick="return changePossessionDate('<?php echo e($statement->id); ?>' , '<?php echo e(date('Y-m-d', strtotime($statement->due_date))); ?>');"><i class="fa fa-pencil" aria-hidden="true"></i></a>
                                     <?php endif; ?> -->
                                     </td>
                                <td class="printFV text-right"><?php echo e(number_format($statement->due)); ?></td><?php $due += $statement->due; ?>
                                <td class="printFV text-right">
                                    <?php if($statement->is_deleted == false): ?><?php echo e(number_format($statement->received)); ?><?php $received += $statement->received; ?>
                                <?php else: ?> 
                                0
                                <?php endif; ?>
                            </td>
                             <td class="printFV no-print text-right">
                                    <?php if($statement->is_deleted == false): ?><?php echo e(number_format($statement->balance)); ?>

                                    <?php else: ?>
                                    <?php echo e(number_format($statement->due)); ?>

                                <?php endif; ?>
                            </td>

                                <?php if($statement->is_deleted == false): ?>

                                <?php if($statement->receipt): ?>

                                <?php if($statement->receipt->payment_method == \App\Receipt::cash): ?>
                                            <td>Cash</td>
                                            <?php elseif($statement->receipt->payment_method == \App\Receipt::bank): ?>
                                            <td>Bank</td>
                                            <?php elseif($statement->receipt->payment_method == \App\Receipt::adjustment): ?>
                                            <td>Adjustment</td>
                                            <?php elseif($statement->receipt->payment_method == \App\Receipt::cheque): ?>
                                            <td>Cheque</td>
                                            <?php else: ?>
                                            <td></td>
                                            <?php endif; ?>
                                <?php else: ?>
                                <td></td>
                                <?php endif; ?>
                                <?php else: ?>
                                <td></td>
                                <?php endif; ?>


                            
                                <td class="printFV"><?php if($statement->is_deleted == false): ?> <?php echo e($statement->rcpt_no); ?> <?php endif; ?></td>
                                <!-- <td class="printFV"> <?php echo e($statement->ref_no); ?> </td> -->
                                <td class="printFV text-right"><?php if($statement->is_deleted == false): ?>  <?php echo e($statement->rcpt_date ? date('d-m-Y', strtotime($statement->rcpt_date)) : ''); ?> <?php endif; ?></td>

                                <?php if($statement->is_deleted == false): ?>
                                <?php if($statement->received): ?>
                                <?php $total -=$statement->received;?>
                                <td class="printFV text-right"> <?php echo e(number_format($total)); ?></td>
                                <?php else: ?>
                                <td class="printFV"></td>
                                <?php endif; ?>
                                <?php else: ?>
                                <td class="printFV"></td>
                                <?php endif; ?>
                                <!-- <?php $balance += $statement->balance; ?>
                                <td class="printFV"><?php echo e($statement->surcharge); ?><?php $surcharge += $statement->surcharge; ?></td>
                                <td class="printFV"><?php echo e(number_format($statement->balance + $statement->surcharge)); ?></td><?php $net_payable += $statement->balance + $statement->surcharge; ?> -->
                            </tr>
                            <?php endif; ?>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            <tr>
                                <td colspan="2" class="printFV text-center"><b>Total</b></td>
                                <td class="printFV text-right"><b><?php echo e(number_format($due)); ?></b></td>
                                <td  class="printFV text-right"><b><?php echo e(number_format($received)); ?></b></td>
                                <!-- <td colspan="3"></td> -->
                                <td colspan="5" class="printFV text-right"><b><?php echo e(number_format($total)); ?></b></td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
            <br>
        
        </div>

    

    </div>
    
</div>
<!-- /.container-fluid -->



</div><?php /**PATH /home/proje372/akram-city.projecterp.net/resources/views/statement/membership-download.blade.php ENDPATH**/ ?>