
    <!DOCTYPE html>
<html>
<head>
    <title>
        <?php if(!empty($quotation->outer_client_id)): ?>
            <?php echo $quotation->OuterClient->client_name . " - عرض سعر رقم " . $quotation->quotation_number;  ?>
        <?php else: ?>
            <?php echo "عرض سعر بيع نقدى" . " - عرض سعر رقم " . $quotation->quotation_number;  ?>
        <?php endif; ?>
    </title>
    <meta charset="utf-8"/>
    <link href="<?php echo e(asset('/assets/css/bootstrap.min.css')); ?>" rel="stylesheet"/>
    <style type="text/css" media="screen">
        @font-face {
            font-family: 'Cairo';
            src: url(<?php echo e(asset('fonts/Cairo.ttf')); ?>);
        }

        body, html {
            font-family: 'Cairo' !important;
        }

        .table-container {
            width: 50%;
            margin: 10px auto;
        }

        .no-print {
            position: fixed;
            bottom: 0;
            right: 30px;
            border-radius: 0;
            z-index: 9999;
        }
    </style>
    <style type="text/css" media="print">
            @font-face {
            font-family: 'Cairo';
            src: url(<?php echo e(asset('fonts/Cairo.ttf')); ?>);
        }
        
        body, html {
            font-family: 'Cairo' !important;
        }

        .no-print {
            display: none;
        }
    </style>
</head>
<body style="background: #fff">
<table class="table table-bordered table-container">
    <thead>
        <?php if(!empty($company->basic_settings->header)): ?>
    <tr>
        <td>
            <img class="img-footer" style="width: 700px; height:150px" src="<?php echo e(asset($company->basic_settings->header)); ?>"/>
        </td>
    </tr>
    <?php endif; ?>
    </thead>
    <tbody>
    <tr>
        <td class="thisTD">
            <center style="margin:20px auto;">
                <?php if(!empty($quotation->outer_client_id)): ?>
                    <span style="font-size:18px;font-weight:bold;border:1px dashed #333; padding: 5px 30px;"> عرض سعر مبيعات ضريبية </span>
                <?php else: ?>
                    <span style="font-size:18px;font-weight:bold;border:1px dashed #333; padding: 5px 30px;"> عرض سعر مبيعات ضريبية نقدية </span>
                <?php endif; ?>
            </center>

            <hr style="border-bottom:1px solid #000;margin:5px auto; width: 90%;"/>
            <div class="row" dir="rtl">
                <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" style="margin:10px auto;">

                    <table class="table  table-bordered text-right" dir="rtl" style="font-size:12px;">
                        <tr>
                            <td style="width:40%;"> تاريخ العرض سعر</td>
                            <td><?php echo e($quotation->date); ?></td>
                            <td style="width:40%;"> الرقم الضريبى</td>
                            <td><?php echo e($company->tax_number); ?></td>
                        </tr>
                        <tr>
                            <td style="width:40%;">رقم العرض سعر</td>
                            <td><?php echo e($quotation->quotation_number); ?></td>
                            <td style="width:40%;">السجل التجارى</td>
                            <td><?php echo e($company->commercial_registration_number); ?></td>
                        </tr>
                        <tr>
                            <td style="width:15%;">اسم المؤسسة</td>
                            <td style="width:35%;"><?php echo e($company->company_name); ?></td>
                            <td colspan="2" style="width:15%;text-align: center;">عنوان المؤسسة</td>
                        </tr>
                        <tr>
                            <td style="width:15%;">رقم التليفون</td>
                            <td style="width:35%;"><?php echo e($company->phone_number); ?></td>
                            <td colspan="2" style="width:35%;text-align: center;"><?php echo e($company->company_address); ?></td>
                        </tr>
                    </table>
                </div>
                <?php if(!empty($quotation->outer_client_id)): ?>
                    <div class="col-lg-12">
                        <table class="table table-bordered text-right" dir="rtl" style="font-size:12px;">
                            <tr class="text-center">
                                <td colspan="4">بيانات العميل</td>
                            </tr>
                            <tr>
                                <td style="width:15%;">اسم العميل</td>
                                <td style="width:35%;"><?php echo e($quotation->OuterClient->client_name); ?></td>
                                <td style="width:15%;">فئة التعامل</td>
                                <td style="width:35%;"><?php echo e($quotation->OuterClient->client_category); ?></td>
                            </tr>
                            <tr>
                                <td style="width:15%;">رقم التليفون</td>
                                <td style="width:35%;direction:ltr;"><?php echo e($quotation->OuterClient->phones[0]->client_phone); ?></td>
                                <td style="width:15%;">الرقم الضريبى</td>
                                <td style="width:35%;"><?php echo e($quotation->OuterClient->tax_number); ?></td>
                            </tr>
                        </table>
                    </div>
                <?php endif; ?>
            </div>
            
                
                <?php 
                $sum = array();
                $i = 0;
                 ?>
            
            <?php if(!$quotation->elements->isEmpty()): ?> 
               <h6 class="alert alert-sm alert-info text-center">
                        <i class="fa fa-info-circle"></i>
                    بيانات عناصر العرض سعر  رقم
                    <?php echo e($quotation->quotation_number); ?> 
                </h6>
                
                <div class='table-responsive'>
               <table style='width:100%;text-align:center' dir='rtl' class='table table-bordered text-right'>
               <thead dir='rtl' class='text-center bg-primary' style='text-align:center;'>
               <td style='border:1px solid #ddd;font-family:Cairo !important;'>م</td>
               <td style='border:1px solid #ddd;font-family:Cairo !important;'>الكود</td>
               <td style='border:1px solid #ddd;font-family:Cairo !important;'>الموديل</td>
               <td style='border:1px solid #ddd;font-family:Cairo !important;'>بيانات المنتج</td>
               <td style='border:1px solid #ddd;font-family:Cairo !important;'>العدد</td>
               <td style='border:1px solid #ddd;font-family:Cairo !important;'> سعر الوحدة </td>
               <td style='border:1px solid #ddd;font-family:Cairo !important;'> سعر الاجمالى</td>
               </thead>
               <tbody>
                <?php $__currentLoopData = $quotation->elements; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $element): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> 
                   <?php array_push($sum, $element->quantity_price); ?>
                    <tr>
                    <td><?php echo e(++$i); ?></td>
                    <td><?php echo e($element->product->code_universal); ?> </td>
                    <td><?php echo e($element->product->product_model); ?></td>
                    <td><?php echo e($element->product->product_name); ?></td>
                    <td><?php echo e($element->quantity); ?>  <?php echo e($element->unit->unit_name); ?> </td>
                    <td><?php echo e(number_format($element->product_price)); ?></td>
                    <td><?php echo e(number_format($element->quantity_price)); ?></td>
                    </tr>
                    
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </tbody>
                </table>
                </div>
               <?php $total = array_sum($sum);
                $percentage = ($tax_value_added / 100) * $total;
                $after_total = $total + $percentage;
                ?>
            <?php endif; ?>
            <table class='table table-bordered text-right' dir='rtl' style='font-size:12px;'>
                <tr>
                    <td>الاجمالى قبل الخصم والضريبة <?php echo e(number_format($total)); ?>  <?php echo e($currency); ?> </td>
            <td>
               
            <?php $__currentLoopData = $quotation->extras; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> 
                <?php if($key->action == "discount"): ?> 
                    <?php if($key->action_type == "pound"): ?> 
                         خصم  <?php echo e($key->value); ?>  <?php echo e($currency); ?>;
                        <?php $discount = $key->value; ?>
                     <?php else: ?> 
                         خصم <?php echo e($key->value); ?>  % ;
                         <?php $discount = ($key->value / 100) * $quotation->final_total; ?>

                    <?php endif; ?>

                <?php else: ?> 
                    <span style='margin-right:30px;'>
                    <?php if($key->action_type == "pound"): ?> 
                        مصاريف شحن  <?php echo e($key->value); ?>  <?php echo e($currency); ?>;
                        <?php $extra = $key->value; ?>

                    <?php else: ?>
                         مصاريف شحن  <?php echo e($key->value); ?>  % 
                            <?php $extra = ($key->value / 100) * $quotation->final_total; ?>
                    <?php endif; ?>
                    </span>
                <?php endif; ?>

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

            </td></tr>

            
            <tr>
                <td>ضريبة القيمة المضافة : (  <?php echo e($tax_value_added); ?> % ) </td>
                 <td>قيمة ضريبة القيمة المضافة    :  <?php echo e(number_format($quotation->final_total*$quotation->tax/100)); ?>  <?php echo e($currency); ?> </td>
            </tr>
            <tr>
                <td>اجمالى  العرض  بعد الخصم والضريبة : <?php echo e(number_format($quotation->final_total)); ?>  <?php echo e($currency); ?> </td>
 
            </tr>
            </table>
            
        </td>
    </tr>
    </tbody>
    <?php if(!empty($company->basic_settings->footer) &&!empty($company->basic_settings->electronic_stamp)): ?>
    <tfoot>
    <tr>
        <td>
                <?php if(!empty($company->basic_settings->footer)): ?>
            <img style="width: 90%; display: inline;float: left;" class="img-footer"
                 src="<?php echo e(asset($company->basic_settings->footer)); ?>"/>
                 <?php endif; ?>
                 <?php if(!empty($company->basic_settings->electronic_stamp)): ?>
            <img style="width: 10%;display: inline;float: right; max-height: 60px;" class="img-footer"
                 src="<?php echo e(asset($company->basic_settings->electronic_stamp)); ?>"/>
                 <?php endif; ?>
        </td>
    </tr>
    </tfoot>
    <?php endif; ?>
</table>
<button onclick="window.print();" class="no-print btn btn-md btn-success">اضغط للطباعة</button>
<script src="<?php echo e(asset('app-assets/js/jquery.min.js')); ?>"></script>
<script type="text/javascript">
    // $(window).on('load',function(){
    // 	var cashid = $('#cashid').val();
    // 	window.open('./print_supplier_receipt.php?cashid='+cashid+'','_blank');
    // });
</script>
</body>
</html>
<?php /**PATH E:\xampp\htdocs\sales\resources\views/client/quotations/print.blade.php ENDPATH**/ ?>