


<?php $__env->startSection('title'); ?>
    Transfer Detail
<?php $__env->stopSection(); ?>

<?php $__env->startSection('breadcrumb'); ?>
    <ol class="breadcrumb pull-right">
        <li><a href="<?php echo e(route('home')); ?>"><i class="fa fa-dashboard"></i> Home</a></li>
        <li><a href="<?php echo e(route('transfer.all')); ?>">Transfers</a></li>
        <li class="active">Transfer Detail</li>
    </ol>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
    <div class="container-fluid">
        <div class="row colorbox-group-widget">
            <div class="col-md-3 col-sm-6 info-color-box">
                <div class="white-box">
                    <div class="profile-widget">
                        <div class="profile-img">
                            <img src="<?php echo e(asset('plugins/images/big/logo.png')); ?>" height="70px" width="auto"
                                alt="user-img" class="img-circle">
                            <p class="m-t-10 m-b-5"><a href="javascript:void(0);"
                                    class="profile-text font-22 font-semibold">
                                    <?php if($transfer->property->inventory): ?>
                                        <?php if($transfer->property->inventory->registration): ?>
                                            <?php echo e($transfer->property->inventory->registration->registrationNo->number); ?>

                                        <?php endif; ?>
                                    <?php endif; ?>
                                </a></p>
                            <p class="info-ot font-20">
                                <?php if($transfer->property->inventory): ?>
                                    <?php echo e($transfer->property->inventory->unit_number); ?>

                                <?php endif; ?>
                            </p>

                        </div>
                    </div>
                </div>
            </div>
            <div class="col-md-3 col-sm-6 info-color-box">

            </div>
            <div class="col-md-3 col-sm-6 info-color-box">
                <div class="white-box">
                    <div class="media bg-info">
                        <div class="media-body">
                            <h3 class="info-count"><?php echo e(number_format($transfer->property->net_pay)); ?> <span
                                    class="pull-right"><i class="mdi mdi-coin"></i></span></h3>
                            <p class="info-text font-12">PKR</p>
                            <p class="info-ot font-20">Cost Amount</p>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-md-3 col-sm-6 info-color-box">
                <div class="white-box">
                    <div class="media bg-success">
                        <div class="media-body">
                            <h3 class="info-count"><?php echo e(number_format($transfer->amount_paid)); ?><span class="pull-right"><i
                                        class="mdi mdi-checkbox-marked-circle-outline"></i></span></h3>
                            <p class="info-text font-12">PKR </p>
                            <p class="info-ot font-20"> Paid Amount</p>
                        </div>
                    </div>
                </div>
            </div>

        </div>
        <!-- /row -->
        <div class="row">
            <div class="col-sm-12">
                <div class="white-box">
                    <h3 class="box-title">Other Information</h3>
                    <hr>
                    <div class="table-responsive">
                        <table class="table">
                            <tbody>
                                <tr>
                                    <td>Previous Owner Name</td>
                                    <td> <?php echo e($transfer->owner->name); ?> </td>
                                </tr>
                                <tr>
                                    <td>Transfer to</td>
                                    <td> <?php echo e($transfer->transfer->name); ?> </td>
                                </tr>
                                <tr>
                                    <td>Old Client ID</td>
                                    <td> <?php echo e($transfer->old_client_id); ?> </td>
                                </tr>
                                <tr>
                                    <td>New Client ID</td>
                                    <td> <?php echo e($transfer->new_client_id); ?> </td>
                                </tr>
                                <tr>
                                    <td>Transfer Note</td>
                                    <td> <?php echo e($transfer->transfer_note); ?> </td>
                                </tr>
                                <tr>
                                    <td>Transfer Date</td>
                                    <td> <?php echo e(date('d-m-Y', strtotime($transfer->transfer_date))); ?> </td>
                                </tr>
                                <tr>
                                    <td>Transfer Charges</td>
                                    <td> <?php echo e($transfer->transfer_charges); ?> </td>
                                </tr>
                                <!--
                                                    <tr>
                                                        <td>Updated at</td>
                                                        <td> <?php echo e($transfer->updated_at); ?></td>
                                                    </tr>-->
                                <tr>
                                    <td>Created at</td>
                                    <td> <?php echo e(date('d-m-Y h i', strtotime($transfer->created_at))); ?></td>
                                </tr>

                            </tbody>
                        </table>
                    </div>

                </div>
            </div>
        </div>
        <!-- /.row -->
        <!-- /.row -->


        <div class="row">
            <div class="col-sm-12">
                <div class="white-box">
                    <h3 class="box-title">unit History</h3>
                    <hr>
                    <div class="table-responsive">
                        <table class="table">
                            <thead>
                                <tr>
                                    <th>#</th>
                                    <th>Unit #</th>
                                    <th>Owner Name</th>
                                    <th>Duration</th>
                                    <th>Paid Amount</th>
                                    <th>Transfer Date</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php $count = 1; ?>
                                <?php $__currentLoopData = $allTransfers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $t): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <?php if($count == 1): ?>
                                        <tr>
                                            <td><?php echo e($count++); ?></td>

                                            <td><b><?php echo e($t->property->inventory->unit_number); ?></b></td>

                                            <td><?php echo e($t->owner ? $t->owner->name : ''); ?></td>



                                            <td><?php echo e(date('d-m-Y', strtotime($t->property->booking_date)) . '  :  ' . date('d-m-Y', strtotime($t->transfer_date))); ?>

                                            </td>





                                            <td><?php echo e(number_format($t->amount_paid)); ?> PKR</td>




                                            <td><?php echo e(date('d-m-Y', strtotime($t->transfer_date))); ?></td>


                                        </tr>

                                        <tr>
                                            <td><?php echo e($count++); ?></td>

                                            <td><b><?php echo e($t->property->inventory->unit_number); ?></b></td>

                                            <td><?php echo e($t->transfer ? $t->transfer->name : ''); ?></td>


                                            <?php if($loop->last): ?>
                                                <td><b>Current Owner</b>
                                                <?php else: ?>
                                                <td><?php echo e($duration[$t->id]); ?></td>
                                            <?php endif; ?>




                                            <td>

                                                <?php
                                           $amount=     \App\Receipt::where('customer_id',$t->transfer->id )->where('customer_property_id',$t->property->id)->where('is_approved',1)->where('payment_head','!=', \App\Receipt::transfer_fee)->sum('amount');    

                                                ?>
                                               
                                                
                                                <?php echo e(number_format($amount)); ?>

                                                
                                                PKR</td>




                                            <td><?php echo e(date('d-m-Y', strtotime($t->transfer_date))); ?></td>


                                        </tr>
                                    <?php else: ?>
                                        <tr>
                                            <td><?php echo e($count++); ?></td>

                                            <td><b><?php echo e($t->property->inventory->unit_number); ?></b></td>

                                            <td><?php echo e($t->transfer ? $t->transfer->name : ''); ?></td>


                                            <?php if($loop->last): ?>
                                                <td><b>Current Owner</b>
                                                <?php else: ?>
                                                <td><?php echo e($duration[$t->id]); ?></td>
                                            <?php endif; ?>


                                            <?php
                                            $amount=     \App\Receipt::where('customer_id',$t->transfer->id )->where('customer_property_id',$t->property->id)->where('is_approved',1)->where('payment_head','!=', \App\Receipt::transfer_fee)->sum('amount');    
 
                                                 ?>
                                               
                                            <td><?php echo e(number_format($amount)); ?> PKR</td>




                                            <td><?php echo e(date('d-m-Y', strtotime($t->transfer_date))); ?></td>


                                        </tr>
                                    <?php endif; ?>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                            </tbody>
                        </table>
                    </div>

                </div>
            </div>
        </div>



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

<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/proje372/akram-city.projecterp.net/resources/views/statement/transfer/detail-transfer.blade.php ENDPATH**/ ?>