<div id="invoice-items-details" class="pt-1 col-12 float-left invoice-items-table">
    <div class="row">
        <div class="table-responsive col-sm-12 ">
            <table class="table table-borderless">
                <thead>
                    <tr>
                        <th>ID</th>
                        <th>@lang('admin.products.image')</th>
                        <th width="300">@lang('admin.products.name')</th>
                        <th>@lang('admin.orders.price')</th>
                        <th>@lang('admin.slider.discount')</th>
                        <th>@lang('admin.orders.count')</th>
                    </tr>
                </thead>
                @php
                    $currency = $order->getCurrency?->dollar;
                @endphp
                <tbody>
                    @foreach ($products as $product)
                        <tr>
                            <td>
                                {{ $product->product->id }}
                            </td>
                            <td>
                                <img src="{{ $product->product->getPoster() }}" width="100" alt="">
                            </td>
                            <td>
                                {{ $product->product->getName() }}
                            </td>
                            @php
                                if ($product->discount) {
                                    $dis_persent = 100 - round(($product->discount / $product->price) * 100, 1);
                                } else {
                                    $dis_persent = 0;
                                }
                            @endphp
                            <td>
                                @if ($product->discount)
                                    <strike>
                                        {{ number_format($product->price * $currency, 0, '.', ' ') }}
                                        @lang('admin.ye')
                                    </strike><br>
                                    {{ number_format($product->discount * $currency, 0, '.', ' ') }}
                                @else
                                    {{ number_format($product->price * $currency, 0, '.', ' ') }}
                                @endif
                                @lang('admin.ye')
                            </td>
                            <td>
                                {{ $dis_persent }}%
                            </td>
                            <td>{{ $product->getCount() }}</td>
                        </tr>
                    @endforeach
                </tbody>
            </table>
        </div>
    </div>
</div>

<div id="invoice-total-details" class="invoice-total-table">
    <div class="row">
        <div class="col-7 offset-5">
            <div class="table-responsive">
                <table class="table table-borderless">
                    <tbody>
                        <tr class="text-right">
                            <th>@lang('admin.orders.product')</th>
                            <td width="150">
                                {{ number_format($order->price_products, 0, '', ' ') }}
                                @lang('admin.ye')
                            </td>
                        </tr>

                        <tr class="text-right">
                            <th>@lang('admin.orders.delivery')</th>
                            <td width="150">
                                {{ number_format($order->price_delivery, 0, '', ' ') }}
                                @lang('admin.ye')
                            </td>
                        </tr>

                        <tr class="text-right">
                            <th>@lang('admin.orders.price_master')</th>
                            <td width="150">
                                {{ number_format($order->price_master, 0, '', ' ') }}
                                @lang('admin.ye')
                            </td>
                        </tr>

                        <tr class="text-right">
                            <th>@lang('admin.orders.total')</th>
                            <td width="150">
                                {{ number_format($order->price_total, 0, '', ' ') }}
                                @lang('admin.ye')
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
