@extends('layouts.app') @section('title', __('Sales targets')) @section('content') @if(auth()->user()->isAdmin())

{{ __('Set sales target') }}

@csrf
@endif
@if(auth()->user()->isAdmin())@endif @forelse($targets as $target) @php($progress = min(100, (float) $target->target_amount > 0 ? ($target->achieved_amount / (float) $target->target_amount) * 100 : 0)) @if(auth()->user()->isAdmin())@endif @empty @endforelse
{{ __('Target') }}{{ __('Period') }}{{ __('Achievement') }}{{ __('Progress') }}

{{ $target->user?->name ?? $target->department?->name }}

{{ $target->user?->member_id ?? __('Department target') }}

{{ $target->period_start->format('M d, Y') }} – {{ $target->period_end->format('M d, Y') }} ৳{{ number_format($target->achieved_amount, 2) }} / ৳{{ number_format($target->target_amount, 2) }}

{{ number_format($progress, 1) }}%

@csrf @method('DELETE')
{{ __('No sales targets set for your account.') }}
{{ $targets->links() }}
@endsection