@extends('admin.layouts.master') @section('content')

{{ trans('app.merchant') }}

@if (Gate::allows('view', $dispute->shop)) {{ $dispute->shop->name }} @else {{ $dispute->shop->name }} @endif {{ trans('app.logo') }}

{{ trans('app.total_disputes') }}: {{ \App\Helpers\Statistics::dispute_count($dispute->shop_id) }}

{{ trans('app.latest_days', ['days' => 30]) }}: {{ \App\Helpers\Statistics::dispute_count($dispute->shop_id, 30) }}

@if ($dispute->shop->owner)

{{ trans('app.avatar') }}   @if (Gate::allows('view', $dispute->shop->owner)) {{ $dispute->shop->owner->getName() }} @else {{ $dispute->shop->owner->getName() }} @endif

@endif

{{ trans('app.dispute') }} {!! $dispute->statusName() !!}

@can('view', $dispute->order) {{ trans('app.order_details') }} @endcan @unless ($dispute->order->refunds->count()) @can('initiate', \App\Models\Refund::class) {{ trans('app.initiate_refund') }} @endcan @endunless @can('response', $dispute) {{ trans('app.response') }} @endcan
@can('view', $dispute->order) {{ trans('app.order_number') . ': ' }}{{ $dispute->order->order_number }} @else {{ trans('app.order_number') . ': ' }}{{ $dispute->order->order_number }} @endcan

{{ $dispute->dispute_type->detail }}

@if (count($dispute->attachments)) {{ trans('app.attachments') . ': ' }} @foreach ($dispute->attachments as $attachment) @endforeach @endif @if ($dispute->description)
{!! $dispute->description !!}
@endif @if ($dispute->replies->count() > 0)
{{ strtoupper(trans('app.conversations')) }}
@foreach ($dispute->replies as $reply) @include('admin.partials._reply_conversations') @endforeach @endif
@if ($dispute->order->refunds->count())

{{ trans('app.refunds') }}

@foreach ($dispute->order->refunds as $refund) @endforeach
{{ trans('app.refund_amount') }} {{ trans('app.status') }} {{ trans('app.created_at') }} {{ trans('app.updated_at') }}  
{{ get_formated_currency($refund->amount, 2, $dispute->order->currency_id) }} {!! $refund->statusName() !!} {{ $refund->created_at->diffForHumans() }} {{ $refund->updated_at->diffForHumans() }} @if ($refund->isOpen()) @can('approve', $refund)   @endcan @endif
@endif @include('admin.partials._activity_logs', ['logger' => $dispute])
@if ($dispute->product_id)

{{ trans('app.product') }}

{{ trans('app.image') }} @if (Gate::allows('view', $dispute->product)) {{ $dispute->product->name }} @else {{ $dispute->product->name }} @endif
@endif @if ($dispute->refund_amount)

{{ trans('app.refund_requested') }}

{{ trans('app.amount') }}: {{ get_formated_currency($dispute->refund_amount, 2, $dispute->order->currency_id) }}

@endif

{{ trans('app.customer') }}

{{ trans('app.avatar') }} @if (Gate::allows('view', $dispute->customer)) {{ $dispute->customer->getName() }} @else {{ $dispute->customer->getName() }} @endif

{{ trans('app.total_disputes') }}: {{ \App\Helpers\Statistics::disputes_by_customer_count($dispute->customer_id) }}

{{ trans('app.latest_days', ['days' => 30]) }}: {{ \App\Helpers\Statistics::disputes_by_customer_count($dispute->customer_id, 30) }}


{{ $dispute->created_at->diffForHumans() }}

{{ $dispute->updated_at->diffForHumans() }}

@endsection