Muhasebe Notları
{{-- Sayfa adı kabuğun üst çubuğunda zaten yazıyor; burada mor gradyanlı emoji karesiyle ikinci kez yazılıyordu. Dört doygun (mor/sarı/mavi/yeşil) özet şeridine geçti: renk yalnız ANLAM taşır. --}}
@php // Modal payload — hem kanban kartı hem liste satırı aynı JSON'u kullanır $notePayload = function ($note) use ($currentUserId) { $noteAuthor = $note->user?->hasRole('Admin') ? 'Admin' : ($note->user?->name ?? '—'); $commentsArr = []; foreach ($note->comments as $cm) { $cUser = \App\Models\User::find($cm->user_id); $cName = $cUser?->hasRole('Admin') ? 'Admin' : ($cUser?->name ?? '—'); $commentsArr[] = ['id'=>$cm->id, 'user_id'=>$cm->user_id, 'user_name'=>$cName, 'comment'=>$cm->comment, 'date'=>$cm->created_at?->format('d.m.Y H:i')]; } return [ 'id'=>$note->id, 'user_id'=>$note->user_id, 'user_name'=>$noteAuthor, 'type'=>$note->type, 'title'=>$note->title, 'content'=>$note->content, 'color'=>$note->color, 'status'=>$note->status, 'note_date'=>optional($note->note_date)->toDateString(), 'show_in_calendar'=>(bool) $note->show_in_calendar, 'updated_at'=>$note->updated_at?->format('d.m.Y H:i'), 'can_edit'=>$note->user_id === $currentUserId || auth()->user()?->hasRole('Admin'), 'comments'=>$commentsArr, ]; }; // URL üretici — mevcut görünüm/filtre/sıralamayı koru, override uygula, boşları at $q = fn ($over = []) => route('accounting.notes.index', array_filter(array_merge([ 'view'=>$view, 'type'=>$filterType, 'q'=>$search, 'status'=>$status, 'author'=>$author, 'sort'=>$sort==='recent' ? null : $sort, ], $over), fn ($v) => $v !== null && $v !== '')); $statusLabels = ['todo'=>'⏳ Yapılacak', 'inprogress'=>'🔄 Devam Ediyor', 'done'=>'✓ Tamamlandı']; $activeFilters = ($filterType ? 1 : 0) + ($status ? 1 : 0) + ($author ? 1 : 0) + ($search !== '' ? 1 : 0); @endphp @php $siralaSecenekleri = collect([ 'recent' => 'Son güncellenen', 'oldest' => 'En eski', 'date_desc' => 'Tarih (yeni → eski)', 'date_asc' => 'Tarih (eski → yeni)', 'title' => 'Başlık (A → Z)', ])->map(fn ($ad, $k) => ['etiket' => $ad, 'href' => $q(['sort' => $k])])->all(); /* Süzgeç alanları — denetleyicinin okuduğu parametreler. Durum yalnız liste görünümünde anlamlı (kanbanda kolonlar zaten durum). */ $notSuzgecAlanlari = [ 'type' => ['type' => 'select', 'label' => 'Tür', 'options' => ['general' => 'Genel', 'private' => 'Özel']], 'author' => ['type' => 'select', 'label' => 'Yazan', 'options' => $authorOptions], ]; if ($view === 'list') { $notSuzgecAlanlari['status'] = ['type' => 'select', 'label' => 'Durum', 'options' => [ 'todo' => 'Yapılacak', 'inprogress' => 'Devam Ediyor', 'done' => 'Tamamlandı', ]]; } @endphp {{-- Araç çubuğu — STANDART kontroller: `.ks-ara-kutu` + `` + ``. Sayfa kendi `nt-*` araç çubuğunu (mor gradyan düğme, çıplak ` @if($sort !== 'recent')@endif @if($view !== 'list' && $status)@endif @php /* Durum -> ANLAM varyantı. Kanban kolon başlıkları amber/mavi/yeşil gradyandı, rozetler de ayrı bir hex paletindeydi; ikisi de tema tokenına bağlandı. Emoji simge yerine geçmez: kaldırıldı. */ $notDurumTon = ['todo' => 'uyari', 'inprogress' => 'accent', 'done' => 'ok']; $notRozetTon = ['todo' => 'uyari', 'inprogress' => 'bilgi', 'done' => 'ok']; @endphp {{-- Tablo OLMAYAN görünümlerde araç çubuğu kendi `.ks-liste` kabında durur: `.ks-arac-cubugu` kabın iç şeridi olarak tasarlandı, tek başına bırakılınca sayfada zeminsiz bir bant gibi yüzüyordu. --}} @if($stats['total'] === 0 || $view === 'kanban')
@include('muhasebe.notlar._arac-cubugu')
@endif @if($stats['total'] === 0)
Henüz not yok — yukarıdaki "Yeni Not" düğmesiyle ekleyebilirsin.
@elseif($view === 'kanban')
@foreach(['todo', 'inprogress', 'done'] as $col) @php $defaultOpen = ($col !== 'done'); @endphp
@php $colItems = $col === 'done' ? $byStatus['done']->take(25) : $byStatus[$col]; @endphp @foreach($colItems as $note) @php $noteAuthor = $note->user?->hasRole('Admin') ? 'Admin' : ($note->user?->name ?? '—'); @endphp
{{-- Kullanıcının seçtiği renk NOKTA olarak: sol şerit temada 8 ayrı anlama ayrılmıştır, süs değildir. --}} {{ $note->title }} {{ $note->type === 'private' ? 'Özel' : 'Genel' }}
@if($note->content)
{{ $note->content }}
@endif
{{ $noteAuthor }}@if($note->note_date) · {{ $note->note_date->format('d.m.Y') }}@endif @if($note->show_in_calendar) · takvimde @endif @if($note->comments->count() > 0) · {{ $note->comments->count() }} yorum @endif
{{-- Hızlı durum değiştirme — görebilen herkes değiştirebilir. --}}
@foreach(['todo' => 'Yapılacak', 'inprogress' => 'Devam Ediyor', 'done' => 'Tamamlandı'] as $sk => $sl) @if($note->status !== $sk)
@csrf
@endif @endforeach
@endforeach @if($byStatus[$col]->isEmpty())
Bu durumda not yok.
@endif @if($col === 'done' && $byStatus['done']->count() > 25) @endif
@endforeach
@else {{-- Liste görünümü — araç çubuğu, tablo ve alt şerit TEK kart (). Üçü ayrı blok durduğunda araç çubuğu kendi bandına düşüyor, üstünde ve altında fazladan boşluk kalıyordu (kullanıcı bildirdi; hakediş listesi zaten böyleydi). --}} @include('muhasebe.notlar._arac-cubugu') Not Tür Durum Yazan Tarih Yorum @foreach($listNotes as $note) @php $noteAuthor = $note->user?->hasRole('Admin') ? 'Admin' : ($note->user?->name ?? '—'); @endphp
{{ $note->title }}
@if($note->content)
{{ Str::limit($note->content, 90) }}
@endif {{ $note->type === 'private' ? 'Özel' : 'Genel' }} {{ \App\Models\MuhasebeNote::STATUSES[$note->status] ?? $note->status }} {{ $noteAuthor }} {{ $note->note_date ? $note->note_date->format('d.m.Y') : '—' }} {{ $note->comments->count() ?: '—' }}
{{-- `@json` BİLEŞEN özniteliğinde derlenmez (defter); yük PHP'de kurulup `Js::from` ile basılır. --}} @php $notYuk = $notePayload($note); @endphp
@endforeach
@endif
{{-- ── Not Modal (Yeni / Düzenle / Görüntüle) ─────────────────── --}} {{-- Not penceresi — mor gradyan başlık ve kendi `nt-modal*` sözlüğü silindi; ortak `.ks-modal`. Pencere JS ile açılır (Alpine değil), `.ks-modal-ort` varsayılanı display:none olduğu için `ks-acik` sınıfı eklenip çıkarılır. --}}
@csrf
Yeni Not
Takvim
Renk
@foreach($colors as $c) @endforeach
{{-- Yorumlar --}}
{{-- Sessiz silme formu --}}