{{__('Orders')}}

@forelse($orders as $odr) @empty @endforelse
{{__('Order Id')}} {{__('Total')}} {{__("Status")}} {{__("Date")}}
{{ $odr->ref_id }} {{ format_amount($odr->total,$odr->currency())}} {!! $odr->status->badge_label ?? "/" !!} {{ format_date($odr->created_at)}}

{{__("No orders found.")}}

@if($order)
@forelse($order->products as $product) @empty @endforelse @if(!is_null($order->discount_code)) @endif
{{__("Product")}} {{__("Price")}} {{__('Quantity')}} {{__("Total")}}
{{ $product->name }} {{ format_amount($product->price,$order->currency()) }} {{ format_amount($product->pivot->quantity) }} {{ format_amount( $product->pivot->amount,$order->currency()) }}
{{__("Subtotal")}} {{format_amount($order->subtotal,$order->currency()) }}
{{__("Discount")}} ({{ $order->discount_code }}) {{format_amount($order->discount,$order->currency()) }}
{{__("Tax")}} {{format_amount($order->tax,$order->currency()) }}
{{__("Shipping")}} {{format_amount($order->shipping,$order->currency()) }}
{{__("Total")}} {{format_amount($order->total,$order->currency()) }}

{{__('Payments')}}

@forelse($order->paymentUsages as $usage) @empty @endforelse
{{__("Method")}} {{__("Reference")}} {{__("Amount Paid")}} {{__("Amount Used")}} {{__("Paid At")}}
{{ $usage->payment->method->name }} {{ $usage->payment->provider_reference }} {{ format_amount($usage->payment->paid_amount,$order->currency()) }} {{ format_amount($usage->amount_used,$order->currency()) }} {{ format_date($usage->payment->created_at) }}
{{__("No payments in this order.")}}
@if($order->statusChanges)

{{__('Process')}}

@foreach($order->statusChanges as $change) {{-- --}} @endforeach
{{__("Status")}} {{__("At")}}
{!! $change->status->badge_dot ?? "" !!} {{ format_date($change->created_at, __("Y-m-d H:i:s")) }}--}} {{-- @if ($loop->last--}} {{-- && $change->status_code == \App\Models\Statuses\Status::REFUNDED_ORDER)--}} {{-- && now()->addDays(5)->diffInDays(format_date($change->created_at)) != 0)--}} {{--
--}} {{-- {{__("you can return this order in :time days",['time' => 4 - $transaction->created_at->diffInDays()])}}--}} {{-- @endif--}} {{--
@endif
@endif