<div>

    <template x-if="filled(order) && !$store.invoice.loading && isObject(order)">
        <div class="invoice-box">
            <div class="row m-b-10">
                <div class="col">
                    <div class="float-left">
                        <img src="<?php echo e(url("img/logo-bw.png")); ?>" alt="Owner Logo"
                             style="width: 100%; max-width: 150px; height: 60px" />
                    </div>
                </div>

                <div class="col">
                    <template x-if="order.is_online">
                        <div class="float-right">
                            <div class="fs-13" ><?php echo e(__("Invoice")); ?> :  <strong x-text="'#'+order.ref_id"></strong></div>
                            <div class="m-b-0 fs-12"><?php echo e(__("Created At")); ?> : <span x-text="order.created_at"></span></div>
                            <div class="m-b-0 fs-12"><?php echo e(__('Due At')); ?> : <span x-text="order.updated_at"></span></div>
                            <template x-if="('status' in order)">
                                <div class="m-b-0 fs-12"><?php echo e(__("Status")); ?> : <span x-html="order?.status.badge_dot ?? '---'"></span></div>
                            </template>
                        </div>
                    </template>
                    <template x-if="!order.is_online">
                        <div class="fs-12 float-right">
                            <div class="fs-13" ><strike><?php echo e(__("Invoice")); ?> :  <strong class="text-muted" x-text="'#'+order.reference"></strong></strike></div>
                            <div class="m-b-0"><?php echo e(__("Created At")); ?> : <span x-text="order?.created_at ?? '---'"></span></div>
                        </div>
                    </template>
                </div>
            </div>

            <div class="row m-b-10">
                <div class="col">
                    <div class="float-left">
                        <div class="fs-12 order-head-info"><strong><?php echo e(getSettingsOf("owner_name")); ?></strong></div>
                        <div class="fs-12 order-head-info"><strong><?php echo e(getSettingsOf("phone_number")); ?></strong></div>
                        <div class="fs-12 order-head-info"> <strong><?php echo e(getSettingsOf("address2")); ?></strong></div>
                        <div class="fs-12 order-head-info"><strong><?php echo e(getSettingsOf("site_email")); ?></strong></div>
                    </div>
                </div>

                <div class="col">
                    <template x-if="filled(order.customer)">
                        <div class="float-right">
                            <h6 class="m-b-1 fs-13"><strong><?php echo e(__("Customer Infos")); ?></strong></h6>
                            <div class="fs-12 order-head-infop"><?php echo e(__("Full Name")); ?> : <strong x-text="order.customer.full_name ?? '---'"></strong></div>
                            <div class="fs-12 order-head-infop"><?php echo e(__("Email")); ?> : <strong x-text="order.customer?.email ?? '---'"></strong></div>
                            <div class="fs-12 order-head-infop"><?php echo e(__("Phone")); ?> : <strong x-text="order.customer?.phone ?? '---'"></strong></div>
                        </div>
                    </template>
                </div>
            </div>

            <div class="rows  m-t-10 m-b-10 d-print-none">
                <template  x-if="$.inArray(order.status_code,JSON.parse('<?php echo e(json_encode(\App\Models\OrderManagement\Order::getStatusesRequiredRaesons())); ?>')) !== -1">
                    <div class="col-auto borders p-2 bg-danger tex-left rounded" x-show="filled(order.reason)">
                        <div class="fs-13 font-weight-bold text-white"><?php echo e(__('Reason : ')); ?></div>
                        <span class="fs-12 text-white" x-html="order.reason"></span>
                    </div>
                </template>
                <template  x-if="filled(order.note)">
                    <div class="col-auto border p-2 bg-transparent tex-left rounded">
                        <div class="fs-13 font-weight-bold text-whites"><?php echo e(__('Note : ')); ?></div>
                        <span class="fs-12 text-whites text-muted" x-html="order.note"></span>
                    </div>
                </template>

            </div>


            <div class="row m-b-10">
                <div class="col-lg-12 m-b-0">
                    <table class="details">
                        <thead>
                        <tr class="heading">
                            <td class="left fs-12" width="60%"><?php echo e(__("Product")); ?></td>
                            <td class="right fs-12"><?php echo e(__("Price")); ?></td>
                            <td class="right fs-12"><?php echo e(__("Qty")); ?></td>
                            <td class="right fs-12"><?php echo e(__("Amount")); ?></td>
                        </tr>
                        </thead>
                        <tbody>
                        <template x-for="(item,index) in order.items" :key="index">
                            <tr class="item" :class="(('rejected' in item) && item.rejected) ? 'table-danger':''">
                                <td class="fs-12 text-uppercase" x-text="item.name"></td>
                                <td class="fs-12 right" x-text="formatNumber(item.price)"></td>
                                <td class="fs-12 right" x-text="formatNumber(item.qty)"></td>
                                <td class="fs-12 right" x-text="formatNumber(item.amount)"></td>
                            </tr>
                        </template>
                        </tbody>
                    </table>
                </div>
                <template x-if="filled(order.items)">
                    <div class="col-lg-12">
                        <div class="row">
                            <div class="col-lg-4 col-sm-6"></div>
                            <div class="col-lg-8 col-sm-6">
                               <table>
                                   <tbody>
                                       <tr class="total">
                                           <td class="fs-12 right"><?php echo e(__("Subtotal")); ?></td>
                                           <td class="right fs-12" x-text="formatNumber(order.subtotal,order?.currency ?? '<?php echo e(getSettingsOf("currency")); ?>')"></td>
                                       </tr>
                                       <tr class="total">
                                           <td class="fs-12 right"><?php echo e(__("Discount")); ?></td>
                                           <td class="right fs-12" x-text="formatNumber(order.discount,order?.currency ?? '<?php echo e(getSettingsOf("currency")); ?>')"></td>
                                       </tr>
                                       <tr class="total" >
                                           <td class="fs-12 right"><?php echo e(__("Tax")); ?></td>
                                           <td class="right fs-12" x-text="formatNumber(order.tax,order?.currency ?? '<?php echo e(getSettingsOf("currency")); ?>')"></td>
                                       </tr>
                                       <tr class="total">
                                           <td class="fs-12 right"><?php echo e(__("Shipping")); ?></td>
                                           <td class="right fs-12" x-text="formatNumber(order.shipping,order?.currency ?? '<?php echo e(getSettingsOf("currency")); ?>')"></td>
                                       </tr>
                                       <tr class="total">
                                           <td class="fs-12 right"><?php echo e(__("Total")); ?></td>
                                           <td class="right fs-12" x-text="formatNumber(order.total,order?.currency ?? '<?php echo e(getSettingsOf("currency")); ?>')"></td>
                                       </tr>
                                   </tbody>
                               </table>
                            </div>
                        </div>
                    </div>
                </template>

            </div>

            <div class="rows m-t-10 m-b-10">
                <template x-if="('payment_usages' in order) && filled(order.payment_usages)">
                    <table class="details">
                    <thead>
                        <tr class="heading">
                            <td class="fs-12"><?php echo e(__("Payment Method")); ?></td>
                            <td class="fs-12"><?php echo e(__("Reference")); ?></td>
                            <td class="right fs-12"><?php echo e(__("Paid")); ?></td>
                            <td class="right fs-12"><?php echo e(__("Used")); ?></td>
                        </tr>
                    </thead>
                    <tbody>
                    <template x-for="(usage,i) in order.payment_usages" :key="i">

                        <tr class="item" :class="(('deleted' in usage) && usage.deleted) ? 'table-danger':''">
                            <td class="fs-12" x-text="usage?.method?.name ?? '---'"></td>
                            <td class="fs-12" x-text="usage?.payment?.provider_reference ?? '---'"></td>
                            <td class="right fs-12" x-text="formatNumber(usage?.payment?.paid_amount,order?.currency ?? currency)"></td>
                            <td class="right fs-12" x-text="formatNumber(usage?.amount_used,order?.currency ?? currency)"></td>
                        </tr>
                    </template>
                    <tr>
                        <th colspan="3" class="right fs-12"><?php echo e(__("Total")); ?></th>
                        <th class="right fs-12" x-text="formatNumber(getSum(order.payment_usages, 'amount_used'), order?.currency ?? currency)"></th>
                    </tr>
                    </tbody>
                </table>
                </template>
            </div>

            <div class="rows m-t-10 m-b-10 d-print-none">
                <h5 class="fs-13"><?php echo e(__("History")); ?></h5>
                <template x-if="('status_changes' in order) && filled(order.status_changes)">
                    <table class="details">
                        <thead>
                            <tr class="heading">
                                <td class="fs-12"><?php echo e(__("Status")); ?></td>
                                <td class="fs-12"><?php echo e(__("At")); ?></td>
                                <td class="fs-12"><?php echo e(__("By")); ?></td>
                            </tr>
                        </thead>
                        <tbody>
                        <template x-for="(change,i) in order.status_changes" :key="i">
                            <tr class="item">
                                <td class="fs-12" x-html="change?.status?.badge_dot ?? '---'"></td>
                                <td class="fs-12" x-text="change?.created_at ?? '---'"></td>
                                <td class="fs-12" x-text="change?.createdBy?.full_name ?? '---'"></td>
                            </tr>
                        </template>
                        </tbody>
                    </table>
                </template>
            </div>
        </div>
    </template>

    <div class="row">
        <div class="col-lg-12 bg-gray-200"
             x-transition.scale.20
             x-show="$store.invoice.loading">
            <div class="d-flex justify-content-center align-items-center"  style="height: 500px;">
                <div class="loader"></div>
            </div>
        </div>
        <template x-if="blank(order) && !$store.invoice.loading">
            <div class="col-lg-12 d-flex justify-content-center align-items-center"
                 x-show="blank(order)" x-transition.scale.30 style="height: 400px">
                <?php if (isset($component)) { $__componentOriginal13e1f50f0bc62a8194c32460ab51a9dc01c30e0e = $component; } ?>
<?php $component = App\View\Components\NotFound::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('not-found'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(App\View\Components\NotFound::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
                     <?php $__env->slot('title', null, []); ?>  <?php echo e(__("No Order Found.")); ?> <?php $__env->endSlot(); ?>
                     <?php $__env->slot('desc', null, []); ?>  <?php $__env->endSlot(); ?>
                 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal13e1f50f0bc62a8194c32460ab51a9dc01c30e0e)): ?>
<?php $component = $__componentOriginal13e1f50f0bc62a8194c32460ab51a9dc01c30e0e; ?>
<?php unset($__componentOriginal13e1f50f0bc62a8194c32460ab51a9dc01c30e0e); ?>
<?php endif; ?>
            </div>
        </template>
    </div>

</div>
<?php /**PATH /home2/lekruu/public_html/resources/views/components/invoice.blade.php ENDPATH**/ ?>