Current File : /home/tradevaly/public_html/storage/framework/views/286d8c3282a07c1b70ea32ef2420a77345f47312.php
<?php $__env->startPush('title',' Invoice Details || Product'); ?>
<?php $__env->startSection('css'); ?>
    <style>
        #invoice {
            margin-left: auto;
            margin-right: auto;
            background: #d0d0d044;
            position: relative;
            top: 0;
        }

        #invoice .table-bordered td, .table-bordered th {
            border: 1px solid #444 !important;
        }

        .card-title {
            font-size: 15px;
            margin: 0 0 7px;
            font-weight: 600;
            padding: 15px;
            background: #cdd7ef;
        }
    </style>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
    <?php $__env->startComponent('components.breadcrumb'); ?>
        <?php $__env->slot('li_1'); ?> Dashboard <?php $__env->endSlot(); ?>
        <?php $__env->slot('title'); ?> Invoice Details <?php $__env->endSlot(); ?>
    <?php echo $__env->renderComponent(); ?>
    <div class="row justify-content-center">
        <div class="col-11">
            <div class="card" id="invoice">
                <div class="card-body p-5">
                    <table style="width: 100%;">
                        <tr>
                            <td>
                                <?php
                                    $settings = \Illuminate\Support\Facades\DB::table('logo')->first();
                                ?>
                                <?php if(!empty($settings)): ?>
                                    <img
                                        src="<?php echo e(asset('storage/images/admin/logo/'.$settings->image)); ?>"
                                        height="60" width="200" alt="">
                                <?php else: ?>
                                    <img
                                        src="<?php echo e(asset('fav-icon.png')); ?>" height="60" width="200" alt="">
                                <?php endif; ?>
                            </td>
                            <td style="text-align: right">
                                <h3 class="text-uppercase text-dark fw-bold">
                                    Tradevaly
                                </h3>
                                <p><?php echo e(settings()->address); ?></p>
                            </td>
                        </tr>
                    </table>
                    <div class="card-title mb-4 d-flex align-items-center justify-content-between">
                        <h5 class="m-0">Invoice ID: <?php echo e($invoice->order_id); ?></h5>
                        <h5 class="m-0">Invoice Date: <?php echo e(date('F m Y', strtotime($invoice->created_at))); ?></h5>
                        <h5 class="m-0">
                            Payment Status:
                            <span
                                class="text-uppercase badge bg-<?php echo e($invoice->payment_status == 'paid' ? 'success':'danger'); ?>"><?php echo e($invoice->transaction->payment_status); ?></span>
                        </h5>
                    </div>
                    <div class="col-lg-4 col-12">
                        <h5>Invoiced To</h5>
                        <h6 class="mb-2"><b><?php echo e($invoice->user->company->name); ?></b></h6>
                        <p class="mb-2"><b>Member ID:</b> <?php echo e($invoice->user->id); ?></p>
                        <p class="mb-2"><?php echo e($invoice->user->name); ?></p>
                        <p class="mb-2"><?php echo e($invoice->user->address); ?></p>
                        <p class="mb-2"><?php echo e($invoice->user->phone ?? ''); ?></p>
                        <p class="mb-2"><?php echo e($invoice->user->email); ?></p>
                    </div>
                    <table class="table table-bordered mt-4">
                        <thead>
                        <tr>
                            <th>Product Title</th>
                            <th>Product Price</th>
                            <th>Quantity</th>
                            <th>Discount</th>
                            <th>Total Amount</th>
                        </tr>
                        </thead>
                        <tbody>
                            <?php
                             $discount = 0;
                             $total = 0;
                            ?>
                        <?php $__currentLoopData = $orders; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $order): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <tr>
                            <td>
                                <span
                                    class="text-capitalize"><?php echo e($order->product_title); ?>

                                </span>
                            </td>
                            <td>
                                <span
                                    class="text-capitalize">
                                        <?php echo e($order->product_price); ?>

                                </span>
                            </td>
                            <td>
                                <span
                                    class="text-capitalize">
                                    <?php echo e($order->quantity); ?>

                                </span>
                            </td>
                            <td>
                                <span
                                    class="text-uppercase"><?php echo e($order->order->total_discount); ?>

                                </span> 
                            </td>
                            <td><?php echo e($order->product_price * $order->quantity); ?></td>
                        </tr>
                        <?php 
                            $discount = $discount + $order->order->total_discount;
                            $total = $total + $order->product_price * $order->quantity;
                        ?>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        <tr>
                            <td colspan="4" class="text-end">Discount :</td>
                            <td><?php echo e($discount); ?></td>
                        </tr>
                        <tr>
                            <td colspan="4" class="text-end">Total :</td>
                            <td><?php echo e($total - $discount); ?></td>
                        </tr>
                        </tbody>
                    </table>
                <div class="col-lg-12 py-5 text-center">
                    <p><a href="">www.tradevaly.com.bd</a></p>
                </div>
            </div>
            <div class="col-lg-12 text-center my-5">
                <a class="btn btn-info my-2" href="<?php echo e(route('admin.subscriber.index')); ?>">
                    <i class="fa fa-arrow-left"></i> Back to list
                </a>
                <a href="javascript:" class="btn btn-success" id="downloadInvoice">
                    <i class="fa fa-download"></i> Download PDF
                </a>
                <a href="javascript:" class="btn btn-warning" onclick="printHandler()">
                    <i class="fa fa-print"></i> Print
                </a>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/html2pdf.js/0.10.1/html2pdf.bundle.min.js"
            integrity="sha512-GsLlZN/3F2ErC5ifS5QtgpiJtWd43JWSuIgh7mbzZ8zBps+dvLusV+eNQATqgA/HdeKFVgA5v3S/cIrLF7QnIg=="
            crossorigin="anonymous" referrerpolicy="no-referrer"></script>
    <script type="text/javascript">
        $(document).ready(function ($) {
            $('#downloadInvoice').on('click', function (event) {
                event.preventDefault();
                const element = document.getElementById("invoice");

                var options = {
                    margin: [0, 0, 0, 0],
                    filename: "invoice.pdf",
                    image: {type: "jpeg", quality: 0.98},
                    html2canvas: {scale: 3, y: 0, scrollY: 0},
                    jsPDF: {unit: "px", format: [800, 800], orientation: "portrait"},
                };
                html2pdf().set(options).from(element).save();
            })
        })

        function printHandler() {
            var printableContent = document.getElementById('invoice')
            var printContents = printableContent.innerHTML;
            var originalContents = document.body.innerHTML;
            document.body.innerHTML = printContents;
            window.setTimeout(function () {
                document.title = "Invoice"
                window.print();
                document.body.innerHTML = originalContents;
                window.location.reload()
            }, 1000);
        }
    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('user.ayaan.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/tradevaly/public_html/resources/views/user/pages/invoice/product_invoice.blade.php ENDPATH**/ ?>