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

<?php $__env->startPush('css'); ?>

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

<?php $__env->startSection('content'); ?>
    <div class="page-bar">

    </div>

    <div class="row">
        <div class="col-12">
            <div class="white-box">
                <h3><b>PURCAHSE</b> <span class="pull-right">#<?php echo e($invoice->purchase_no); ?></span></h3>
                <hr>
                <div class="row">
                    <div class="col-md-12">
                        <div class="pull-left">
                            <address>
                                <img src="<?php echo e(asset(Config::get('app.company.logo'))); ?>" width="100px" height="auto" style="margin: 0">
                                <p class="text-muted m-l-5">
                                    <?php echo e(Config::get('app.address.house')); ?> , <?php echo e(Config::get('app.address.road')); ?> , <?php echo e(Config::get('app.address.sector')); ?>

                                    <br>
                                    <?php echo e(Config::get('app.address.area')); ?> , <?php echo e(Config::get('app.address.city')); ?>

                                    <br>
                                    <?php echo e(Config::get('app.address.post')); ?>

                                </p>
                            </address>
                        </div>
                        <div class="pull-right text-right">
                            <address>
                                <p class="addr-font-h3">From,</p>
                                <p class="font-bold addr-font-h4"><?php echo e($invoice->company->name); ?></p>
                                <?php if(!empty($invoice->company->address)): ?>
                                    <p class="text-muted m-l-30">
                                        <?php echo e($invoice->company->address ?? 'N/A'); ?>

                                    </p>
                                <?php endif; ?>
                                <p class="m-t-30">
                                    <b>Invoice Date :</b> <i class="fa fa-calendar"></i> <?php echo e(\Carbon\Carbon::parse($invoice->purchase_date)->format('D-M-Y')); ?>

                                </p>
                                <p>
                                    <b>Phone  :</b> <?php echo e($invoice->company->phone1 ?? $invoice->company->phone2); ?>

                                </p>
                            </address>
                        </div>
                    </div>
                    <div class="col-md-12">
                        <div class="table-responsive m-t-40">
                            <table class="table table-hover">
                                <thead> 
                                <tr>
                                    <th class="text-center">#</th>
                                    <th class="text-right">Product Name</th>
                                    <th class="text-right">Price</th>
                                    <th class="text-right">Quantity</th>
                                    <th class="text-right">Discount</th>
                                    <th class="text-right">Amount</th>
                                </tr>
                                </thead>
                                <?php
                                    $i = 1;
                                ?>
                                <tbody>
                                <?php $__currentLoopData = $invoice->purchaseitems; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <tr>
                                        <td class="text-center"><?php echo e($i++); ?></td>
                                        <td class="text-right"><?php echo e($item->product->product_name); ?></td>
                                        <td class="text-right"><?php echo e($item->cost_price); ?></td>
                                        <td class="text-right"><?php echo e($item->quantity); ?></td>
                                        <td class="text-right"><?php echo e($item->discount); ?></td>
                                        <td class="text-right"><?php echo e($item->total_cost); ?></td>
                                    </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div class="col-md-12">
                        <div class="pull-right m-t-30 text-right">
                            <p>Subtotal : <?php echo e($invoice->sub_total); ?> BDT</p>
                            <p>Discount : <?php echo e($invoice->discount); ?> BDT </p>
                            <h3>Total   : <?php echo e($invoice->grand_total); ?> BDT</h3>
                            <h3>Paid    : <?php echo e($invoice->grand_total - $invoice->due); ?> BDT</h3>
                            <h3>Due    : <?php echo e($invoice->due); ?> BDT</h3> 
                        </div>
                        <div class="clearfix"></div>
                        <hr>
                        <div class="text-right">
                            <?php if( $invoice->due > 0 ): ?> 
                                <a href="<?php echo e(route('admin.purchase.partial.payment',[$invoice->id,$invoice->payment_type])); ?>" class="btn btn-danger" type="submit"> Proceed to payment </a>
                            <?php endif; ?> 
                            <button onclick="javascript:window.print();" class="btn btn-default btn-outline" type="button"> <span><i class="fa fa-print"></i> Print</span> </button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php $__env->startPush('js'); ?>


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

<?php echo $__env->make('template.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/forazitradersbd/public_html/resources/views/admin/purchaseinvocie/show.blade.php ENDPATH**/ ?>