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

{{ __('inventory.inventory') ?? 'انبار' }}

{{ __('inventory.items') }}

{{ persian_num($totalItems) }}

{{ __('inventory.active_items') ?? 'اقلام فعال' }}

{{ persian_num($activeItems) }}

{{ __('inventory.warehouses') }}

{{ persian_num($totalWarehouses) }}

{{ __('inventory.low_stock_items') ?? 'موجودی کم' }}

{{ persian_num($lowStockItems->count()) }}

{{ __('inventory.create_item') ?? 'افزودن قلم' }} {{ __('inventory.create_warehouse') ?? 'افزودن انبار' }} {{ __('inventory.transactions') ?? 'رسید و حواله' }}

{{ __('inventory.recent_transactions') ?? 'آخرین تراکنش‌ها' }}

{{ __('common.view_all') ?? 'مشاهده همه' }}
@if($recentTransactions->count() > 0)
@foreach($recentTransactions as $txn)
{{ __('inventory.type_' . $txn->type) }}

{{ $txn->item?->name ?? '-' }}

{{ $txn->warehouse?->name ?? '-' }}

{{ $txn->type === 'out' ? '-' : '+' }}{{ persian_num(number_format($txn->quantity, 2)) }}

{{ $txn->created_at ? calendar_date($txn->created_at) : '' }}

@endforeach
@else
{{ __('inventory.no_transactions') ?? 'تراکنشی ثبت نشده است' }}
@endif

{{ __('inventory.low_stock_alert') ?? 'هشدار موجودی' }}

{{ __('common.view_all') ?? 'مشاهده همه' }}
@if($lowStockItems->count() > 0)
@foreach($lowStockItems as $item)

{{ $item->name }}

{{ $item->code ?? '-' }} · {{ $item->unit ?? '-' }}

{{ persian_num(number_format($item->current_stock, 2)) }}

{{ __('inventory.min_stock') ?? 'حداقل' }}: {{ persian_num(number_format($item->min_stock ?? 0, 2)) }}

@endforeach
@else

{{ __('inventory.all_stock_ok') ?? 'همه اقلام موجودی کافی دارند' }}

@endif
@endsection