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

{{ $pageTitle }}

@foreach($discounts as $discount) @endforeach
{{ trans('admin/main.title') }} {{ trans('admin/main.type') }} {{ trans('admin/main.code') }} {{ trans('admin/main.user') }} {{ trans('admin/main.created_date') }} {{ trans('admin/main.ext_date') }} {{ trans('admin/main.usable_times') }} {{ trans('admin/main.percentage') }} {{ trans('admin/main.max_amount') }} {{ trans('admin/main.amount') }} {{ trans('update.minimum_order') }} {{ trans('admin/main.status') }} {{ trans('admin/main.actions') }}
{{ $discount->title }} @if($discount->discount_type == \App\Models\Discount::$discountTypeFixedAmount) {{ trans('update.fixed_amount') }} @else {{ trans('admin/main.percentage') }} @endif {{ $discount->code }} @if($discount->user_type == 'all_users') {{ trans('admin/main.all_users') }} @elseif(!empty($discount->discountUsers) and !empty($discount->discountUsers->user)) {{ $discount->discountUsers->user->full_name }} @endif {{ dateTimeFormat($discount->created_at, 'Y M d') }} {{ dateTimeFormat($discount->expired_at, 'Y M d - H:i') }}
{{ $discount->count }}
{{ trans('admin/main.remain') }} : {{ $discount->discountRemain() }}
{{ $discount->percent ? $discount->percent . '%' : '-' }} {{ $discount->max_amount ? handlePrice($discount->max_amount) : '-' }} {{ $discount->amount ? handlePrice($discount->amount) : '-' }} {{ $discount->minimum_order ? handlePrice($discount->minimum_order) : '-' }} @if($discount->expired_at < time()) {{ trans('panel.expired') }} @else {{ trans('admin/main.active') }} @endif @can('admin_discount_codes_edit') @endcan @can('admin_discount_codes_delete') @include('admin.includes.delete_button',['url' => getAdminPanelUrl().'/financial/discounts/'. $discount->id.'/delete','btnClass' => '']) @endcan
@endsection