@extends('admin.layouts.app') @section('page_title', __('Edit :x', ['x' => __('Refund')])) @section('css') {{-- Select2 --}} @endsection @section('content')
{{ __('Refunds') }} >> {{ __('Edit :x', ['x' => __('Refund')]) }}

{{ __('Status') }}:

@php $color = ['Opened' => 'text-secondary', 'In progress' => 'text-warning', 'Accepted' => 'text-primary', 'Declined' => 'text-red']; @endphp

{{ $refund->status }}

@csrf
{{ __('Order Id') }}
{{ optional(optional($refund->orderDetail)->order)->reference }}
{{ __('Customer') }}
{{ optional($refund->user)->name }}
{{ __('Email') }}
{{ optional($refund->user)->email }}
{{ __('Shipping Method') }}
{{ $refund->shipping_method }}
{{ __('Refund Reason') }}
{{ optional($refund->refundReason)->name }}
{{ __('Date') }}
{{ timeZoneFormatDate($refund->created_at) }}
{{ __('Amount') }}
{{ formatNumber($refund->orderDetail->price) }}
{{ __('Quantity') }}
x {{ (int) $refund->quantity_sent }}
{{ __('Total') }}
{{ formatNumber($refund->quantity_sent * $refund->orderDetail->price) }}
@if ($refund->status == 'Declined')

{{ __("Declined status can't be changed") }}

@elseif ($refund->status == 'Accepted')

{{ __("Accepted status can't be changed") }}

@else
@endif
@if ($refund->objectFile()->get()->isNotEmpty())
@foreach ($refund->filesUrlold() as $file) @endforeach
@endif
{{ __('Cancel') }} @if (!preg_match('/^Accepted$|^Declined$/', $refund->status)) @endif
@if (count($refundProcesses))
@foreach ($refundProcesses as $process)
@if (auth()->user()->id != $process->user->id)
{{ __('Image') }}
{{ optional($process->user)->name }}
{{ (auth()->user()->role()->name == $process->user->role()->name) ? __('You') : $process->user->role()->name }}

{{ $process->note }}

{{ strtotime($process->created_at) < strtotime('-3 days') ? timeZoneFormatDate($process->created_at) : \Carbon\Carbon::parse($process->created_at)->diffForhumans() }}
@else
{{ optional($process->user)->name }}
{{ (auth()->user()->role()->name == $process->user->role()->name) ? __('You') : $process->user->role()->name }}

{{ $process->note }}

{{ strtotime($process->created_at) < strtotime('-3 days') ? timeZoneFormatDate($process->created_at) : \Carbon\Carbon::parse($process->created_at)->diffForhumans() }}
{{ __('Image') }}
@endif
@endforeach
@endif @if (in_array($refund->status, ['Opened', 'In progress']))
@csrf
@endif
@endsection @section('js') @endsection