<?php $__env->startSection('content'); ?>
<div class="col-md-12 content-header" >
    <h1><i class="fa fa-quote-left"></i> <?php echo e(trans('application.estimates')); ?></h1>
</div>

<section class="content">
    <div class="row">
        <div class="col-md-12">
            <div class="panel panel-default">
                <div class="row">
                    <div class="col-md-6" style="width:1035px;margin-left:20px"><br/>
                        <?php if(Session::has('flash_notification.message')): ?>
                            <?php echo message(); ?>
                        <?php endif; ?>
                        <a href="<?php echo e(route('estimates.index')); ?>" class="btn btn-info btn-sm"> <i class="fa fa-chevron-left"></i> <?php echo e(trans('application.back')); ?></a>
                        <a href="<?php echo e(url('estimates/send',$estimate->uuid)); ?>" class="btn btn-success btn-sm pull-right" style="margin-left: 5px"> <i class="fa fa-share"></i> <?php echo e(trans('application.send')); ?></a>
                        <a href="<?php echo e(url('estimates/pdf', $estimate->uuid)); ?>" class="btn btn-primary btn-sm pull-right" style="margin-left: 5px"> <i class="fa fa-download"></i> <?php echo e(trans('application.download')); ?></a>
                        <a href="<?php echo e(route('estimates.edit', $estimate->uuid)); ?>" class="btn btn-warning btn-sm pull-right" > <i class="fa fa-pencil"></i> <?php echo e(trans('application.edit')); ?></a>
                    </div>
                </div>
                <div class="panel-body">
                    <div class="row">
                        <div class="invoice">
                            <div class="row">
                                <div class="col-md-3">
                                    <div class="panel-body">
                                        <?php if($settings && $settings->logo != ''): ?>
                                            <img src="<?php echo e(asset('assets/img/'.$settings->logo)); ?>" alt="logo" width="100%"/>
                                        <?php endif; ?>
                                     </div>
                                </div>
                                <div class="col-md-9 text-right">
                                    <div class="panel-body">
                                        <div class="col-xs-12 text-right"> <h1><?php echo e(trans('application.estimate')); ?></h1></div>
                                        <div class="col-xs-9 text-right invoice_title"><?php echo e(trans('application.reference')); ?></div>
                                        <div class="col-xs-3 text-right"><?php echo e($estimate->estimate_no); ?></div>
                                        <div class="col-xs-9 text-right invoice_title"><?php echo e(trans('application.date')); ?></div>
                                        <div class="col-xs-3 text-right"><?php echo e($estimate->estimate_date); ?></div>
                                    </div>
                                </div>
                            </div>


                            <div class="row">
                                <div class="col-md-6">
                                        <div class="panel-body">
                                            <h4 class="invoice_title"><?php echo e(trans('application.our_information')); ?></h4><hr class="separator"/>
                                            <?php if($settings): ?>
                                                <h4><?php echo e($settings->name); ?></h4>
                                                <?php echo e($settings->address1 ? $settings->address1.',' : ''); ?> <?php echo e($settings->state ? $settings->state : ''); ?><br/>
                                                <?php echo e($settings->city ? $settings->city.',' : ''); ?> <?php echo e($settings->postal_code ? $settings->postal_code.','  : ''); ?><br/>
                                                <?php echo e($settings->country); ?><br/>
                                                Phone: <?php echo e($settings->phone); ?><br/>
                                                Email: <?php echo e($settings->email); ?>.
                                            <?php endif; ?>
                                        </div>
                                </div>
                                <div class="col-xs-6">
                                        <div class="panel-body">
                                            <h4 class="invoice_title"><?php echo e(trans('application.billing_to')); ?> </h4><hr class="separator"/>
                                            <h4><?php echo e($estimate->client->name); ?></h4>
                                            <?php echo e($estimate->client->address1 ? $estimate->client->address1.',' : ''); ?> <?php echo e($estimate->client->state ? $estimate->client->state : ''); ?><br/>
                                            <?php echo e($estimate->client->city ? $estimate->client->city.',' : ''); ?> <?php echo e($estimate->client->postal_code ? $estimate->client->postal_code.','  : ''); ?><br/>
                                            <?php echo e($estimate->client->country); ?><br/>
                                            Phone: <?php echo e($estimate->client->phone); ?><br/>
                                            Email: <?php echo e($estimate->client->email); ?>.
                                        </div>
                                </div>
                            </div>
                            <div class="col-md-12">
                            <table class="table">
                                <thead style="margin-bottom:30px;background: #2e3e4e;color: #fff;">
                                <tr>
                                    <th style="width:50%"><?php echo e(trans('application.product')); ?></th>
                                    <th style="width:10%" class="text-center"><?php echo e(trans('application.quantity')); ?></th>
                                    <th style="width:15%" class="text-right"><?php echo e(trans('application.price')); ?></th>
                                    <th style="width:10%" class="text-center"><?php echo e(trans('application.tax')); ?></th>
                                    <th style="width:15%" class="text-right"><?php echo e(trans('application.total')); ?></th>
                                </tr>
                                </thead>
                                <tbody id="items">
                                <?php foreach($estimate->items as $item): ?>
                                <tr>
                                    <td><b><?php echo $item->item_name; ?></b><br/><?php echo $item->item_description; ?></td>
                                    <td class="text-center"><?php echo e($item->quantity); ?></td>
                                    <td class="text-right"><?php echo e($item->price); ?></td>
                                    <td class="text-center"><?php echo e($item->tax ? $item->tax->value.'%' : ''); ?></td>
                                    <td class="text-right"><?php echo e($estimate->totals[$item->uuid]['itemTotal']); ?></td>
                                </tr>
                                <?php endforeach; ?>
                                </tbody>
                            </table>
                            </div><!-- /.col -->


                            <div class="col-md-6"></div><!-- /.col -->
                            <div class="col-md-6">
                                <div class="table-responsive">
                                    <table class="table">
                                        <tbody>
                                        <tr>
                                            <th style="width:50%"><?php echo e(trans('application.subtotal')); ?></th>
                                            <td class="text-right">
                                                <span id="subTotal"><?php echo e($estimate->currency.' '.$estimate->totals['subTotal']); ?></span>
                                            </td>
                                        </tr>
                                        <tr>
                                            <th><?php echo e(trans('application.tax')); ?></th>
                                            <td class="text-right">
                                                <span id="taxTotal"><?php echo e($estimate->currency.' '.$estimate->totals['taxTotal']); ?></span>
                                            </td>
                                        </tr>

                                        <tr class="amount_due">
                                            <th><?php echo e(trans('application.total')); ?></th>
                                            <td class="text-right">
                                                <span id="grandTotal"><?php echo e($estimate->currency.' '.$estimate->totals['grandTotal']); ?></span>
                                            </td>
                                        </tr>
                                        </tbody></table>
                                </div>
                            </div><!-- /.col -->



                            <div class="col-md-12">
                                <?php if($estimate->notes): ?>
                                <h4 class="invoice_title"><?php echo e(trans('application.notes')); ?></h4><hr class="separator"/>
                                <?php echo e($estimate->notes); ?>  <br/><br/>
                                <?php endif; ?>
                                <?php if($estimate->terms): ?>
                                <h4 class="invoice_title"><?php echo e(trans('application.terms')); ?></h4><hr class="separator"/>
                                <?php echo $estimate->terms; ?>
                                <?php endif; ?>
                            </div>
                        </div>
                    </div>
                </div>
            </div>


        </div>
        <div class="cleafix"></div>
    </div>
</section>

<style>
    .invoice_title{
        color: #2e3e4e;
        font-weight: bold;
    }
    hr.separator{
        border-color:  #2e3e4e;
        margin-top: 10px;
        margin-bottom: 10px;
    }

    tbody#items > tr > td{
        border: 3px solid #fff !important;
        vertical-align: middle;
    }

    #items{
        background-color: #f1f1f1;
    }
</style>
<?php $__env->stopSection(); ?>






<?php echo $__env->make('app', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>