
<?php $__env->startSection('title', $title); ?>
<?php $__env->startSection('content'); ?>

<!-- Start Content-->
<div class="container-fluid">
    
    <!-- start page title -->
    <!-- Include page breadcrumb -->
    <?php echo $__env->make('admin.inc.breadcrumb', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
    <!-- end page title --> 


    <div class="row">
        <div class="col-12">
            <a href="<?php echo e(route($route.'.index')); ?>" class="btn btn-info"><?php echo e(__('dashboard.back')); ?></a>
            <?php if(isset($row->quote_id)): ?>
            <a href="<?php echo e(route('admin.get-quote.show', [$row->quote_id])); ?>" class="btn btn-primary"><?php echo e(__('dashboard.quote')); ?></a>
            <?php endif; ?>
        </div>
    </div>

    <div class="row mt-3 mb-3">
        <div class="col-12">
            <!-- Logo & title -->
            <div class="clearfix">
                <div class="float-right">
                    <h4 class="m-0 d-print-none"><?php echo e(__('dashboard.invoice')); ?> #<?php echo e($row->id); ?></h4>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-6">
                    <div class="pull-left mt-3">
                        <p><b><?php echo e(__('dashboard.hello')); ?>, <?php echo e($row->name); ?></b></p>
                    </div>

                </div><!-- end col -->
                <div class="col-sm-4 offset-sm-2">
                    <div class="mt-3 float-right">
                        <p class="m-b-10"><strong><?php echo e(__('dashboard.invoice_date')); ?> : </strong> <span class="float-right"> <?php echo e(date('d-M-y', strtotime($row->invoice_date))); ?></span></p>
                        <?php if(isset($row->due_date)): ?>
                        <p class="m-b-10"><strong><?php echo e(__('dashboard.due_date')); ?> : </strong> <span class="float-right"> <?php echo e(date('d-M-y', strtotime($row->due_date))); ?></span></p>
                        <?php endif; ?>
                        <p class="m-b-10"><strong><?php echo e(__('dashboard.invoice_type')); ?> : </strong> <span class="float-right">
                            <?php if( $row->invoice_type == 0 ): ?>
                                <?php echo e(__('dashboard.estimate')); ?>

                            <?php elseif( $row->invoice_type == 1 ): ?>
                                <?php echo e(__('dashboard.advance')); ?>

                            <?php elseif( $row->invoice_type == 2 ): ?>
                                <?php echo e(__('dashboard.interval')); ?>

                            <?php elseif( $row->invoice_type == 3 ): ?>
                                <?php echo e(__('dashboard.milestone')); ?>

                            <?php elseif( $row->invoice_type == 4 ): ?>
                                <?php echo e(__('dashboard.final')); ?>

                            <?php elseif( $row->invoice_type == 5 ): ?>
                                <?php echo e(__('dashboard.full')); ?>

                            <?php endif; ?>
                        </span></p>
                        <p class="m-b-10"><strong><?php echo e(__('dashboard.invoice_status')); ?> : </strong> <span class="float-right">
                            <?php if( $row->status == 1 ): ?>
                            <span class="badge badge-primary badge-pill"><?php echo e(__('dashboard.pending')); ?></span>
                            <?php elseif( $row->status == 2 ): ?>
                            <span class="badge badge-success badge-pill"><?php echo e(__('dashboard.paid')); ?></span>
                            <?php elseif( $row->status == 0 ): ?>
                            <span class="badge badge-danger badge-pill"><?php echo e(__('dashboard.canceled')); ?></span>
                            <?php endif; ?>
                        </span></p>
                        <?php if(isset($row->quote_id)): ?>
                        <p class="m-b-10"><strong><?php echo e(__('dashboard.quote_no')); ?> : </strong> <span class="float-right">#<?php echo e($row->quote_id); ?> </span></p>
                        <?php endif; ?>
                    </div>
                </div><!-- end col -->
            </div>
            <!-- end row -->

            <div class="row mt-3">
                <div class="col-sm-6">
                    <h6><?php echo e(__('dashboard.billing_address')); ?></h6>
                    <address class="line-h-24">
                        <abbr title="<?php echo e(__('dashboard.name')); ?>"><?php echo e(__('dashboard.name')); ?>:</abbr> <?php echo e($row->name); ?><br>
                        <abbr title="<?php echo e(__('dashboard.email')); ?>"><?php echo e(__('dashboard.email')); ?>:</abbr> <?php echo e($row->email); ?><br>
                        <?php if(isset($row->phone)): ?>
                        <abbr title="<?php echo e(__('dashboard.phone')); ?>"><?php echo e(__('dashboard.phone')); ?>:</abbr> <?php echo e($row->phone); ?><br>
                        <?php endif; ?>
                        <?php if(isset($row->company)): ?>
                        <abbr title="<?php echo e(__('dashboard.company')); ?>"><?php echo e(__('dashboard.company')); ?>:</abbr> <?php echo e($row->company); ?><br>
                        <?php endif; ?>
                        <abbr title="<?php echo e(__('dashboard.address')); ?>"><?php echo e(__('dashboard.address')); ?>:</abbr> <?php echo e($row->address); ?><br>
                        <?php if(isset($row->city)): ?>
                        <abbr title="<?php echo e(__('dashboard.city')); ?>"><?php echo e(__('dashboard.city')); ?>:</abbr> <?php echo e($row->city); ?><br>
                        <?php endif; ?>
                        <?php if(isset($row->reference)): ?>
                        <abbr title="<?php echo e(__('dashboard.reference')); ?>"><?php echo e(__('dashboard.reference')); ?>:</abbr> <?php echo e($row->reference); ?><br>
                        <?php endif; ?>
                    </address>
                </div> <!-- end col -->
            </div> 
            <!-- end row -->

            <div class="row">
                <div class="col-12">
                    <?php if(count($row->services) > 0): ?>
                    <span><?php echo e(__('dashboard.services')); ?>: </span>
                    <?php $__currentLoopData = $row->services; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $service): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <span class="badge badge-primary"><?php echo e($service->title); ?></span> 
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    <br/><br/>
                    <?php endif; ?>
                    <div>
                    <p><?php echo e(__('dashboard.note')); ?>: </p>
                      <?php echo $row->message; ?>

                    </div>
                </div> <!-- end col -->
            </div>
            <!-- end row -->

            <div class="row">
                <div class="col-sm-6">
                    <div class="clearfix pt-5">
                    </div>
                </div> <!-- end col -->
                <div class="col-sm-6">
                    <div class="float-right">
                        <?php if(isset($row->service_charge)): ?>
                        <p><b><?php echo e(__('dashboard.service_bill')); ?>:</b> <span class="float-right"><?php echo e($row->service_charge); ?> <?php echo e(__('common.currency')); ?></span></p>
                        <?php endif; ?>
                        <?php if(isset($row->tax)): ?>
                        <p><b><?php echo e(__('dashboard.tax_charge')); ?>:</b> <span class="float-right"><?php echo e($row->tax); ?> <?php echo e(__('common.currency')); ?></span></p>
                        <?php endif; ?>
                        <?php if(isset($row->shipping)): ?>
                        <p><b><?php echo e(__('dashboard.shipping_charge')); ?>:</b> <span class="float-right"><?php echo e($row->shipping); ?> <?php echo e(__('common.currency')); ?></span></p>
                        <?php endif; ?>
                        <p><b><?php echo e(__('dashboard.total')); ?>:</b> <span class="float-right"><?php echo e($row->total_amount); ?> <?php echo e(__('common.currency')); ?></span></p>
                        <?php if(isset($row->discount_amount)): ?>
                        <p><b><?php echo e(__('dashboard.discount')); ?>:</b> <span class="float-right"><?php echo e($row->discount_amount); ?> <?php echo e(__('common.currency')); ?></span></p>
                        <?php endif; ?>
                        <h3><b><?php echo e(__('dashboard.payable')); ?>:</b> <?php echo e($row->invoice_amount); ?> <?php echo e(__('common.currency')); ?></h3>
                    </div>
                    <div class="clearfix"></div>
                </div> <!-- end col -->
            </div>
            <!-- end row -->

            <div class="mt-4 mb-1">
                <div class="text-right d-print-none">
                    <button type="button" class="btn btn-primary btn-sm" data-toggle="modal" data-target="#editModal-<?php echo e($row->id); ?>">
                        <i class="far fa-edit"></i>
                    </button>
                    <!-- Include Edit modal -->
                    <?php echo $__env->make($view.'.edit', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

                    <button type="button" class="btn btn-danger btn-sm" data-toggle="modal" data-target="#deleteModal-<?php echo e($row->id); ?>">
                        <i class="fas fa-trash-alt"></i>
                    </button>
                    <!-- Include Delete modal -->
                    <?php echo $__env->make('admin.inc.delete', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

                    <?php if(is_file('uploads/invoice/'.$row->attach)): ?>
                    <a href="<?php echo e(asset('uploads/invoice/'.$row->attach)); ?>" class="btn btn-sm btn-warning waves-effect waves-light" download><?php echo e(__('dashboard.attach')); ?></a>
                    <?php endif; ?>

                    <a href="javascript:window.print()" class="btn btn-sm btn-info waves-effect waves-light"><i class="mdi mdi-printer mr-1"></i> <?php echo e(__('dashboard.print')); ?></a>
                </div>
            </div>
        </div> <!-- end col -->
    </div>
    <!-- end row --> 

    
</div> <!-- container -->
<!-- End Content-->

<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp8\htdocs\multipurpose_business\resources\views/admin/invoice/show.blade.php ENDPATH**/ ?>