@extends('layouts.app', ['class' => 'g-sidenav-show bg-gray-100']) {{-- section content --}} @section('content') @include('layouts.navbars.auth.topnav', ['title' => ''])
Filter {{ $title_menu }}
| No | Action | ID Transaksi | Tanggal | Jenis | No. LPB | Petugas | Shift | Group | Status |
|---|---|---|---|---|---|---|---|---|---|
| {{ $loop->iteration }} |
@php
$userLogin = auth()->user();
$authUsers = DB::table('sys_enum')
->where('idenum', 'posting_penunjang')
->where('isactive', '1')
->pluck('value')
->toArray();
$canPost =
$userLogin &&
in_array($userLogin->username, $authUsers);
$graceDays = max(
0,
(int) (DB::table('sys_enum')
->where('idenum', 'tglpost')
->where('isactive', '1')
->value('name') ?? 0),
);
$isPostablePeriod = false;
if (!empty($detail->tanggal)) {
try {
$transactionDate = \Carbon\Carbon::parse(
$detail->tanggal,
);
$today = \Carbon\Carbon::now();
$lastAllowedPostDate =
$transactionDate->copy()->endOfMonth()->addDays($graceDays)->endOfDay();
$isPostablePeriod = $today->between(
$transactionDate->copy()->startOfMonth(),
$lastAllowedPostDate,
);
} catch (\Exception $e) {
$isPostablePeriod = false;
}
}
$isEntry = ($detail->status ?? '') === 'E';
$isPosted = ($detail->status ?? '') === 'P';
$isActive = (string) ($detail->isactive ?? '0') === '1';
$isCurrentPeriod =
!empty($detail->tanggal) &&
\Carbon\Carbon::parse($detail->tanggal)->isSameMonth(
now(),
);
$canEditTransaction =
$authorize->edit == '1' &&
$isEntry &&
$isActive &&
$isPostablePeriod;
$canPostTransaction =
$authorize->add == '1' &&
$canPost &&
$isEntry &&
$isActive &&
$isPostablePeriod;
$canDeleteTransaction = $isEntry && $isActive;
$canReverseTransaction =
$canPost && $isPosted && $isActive && $isPostablePeriod;
@endphp
|
{{ $detail->id_transaksi }} | {{ $detail->tanggal }} | {{ $detail->jenis_name }} | {{ $detail->no_lpb }} | {{ $detail->petugas }} | {{ $detail->shift }} | {{ $detail->group }} | @if (($detail->isactive ?? '1') == '0') Tidak Aktif @elseif ($detail->status == 'E') Belum Post @elseif($detail->status == 'P') Sudah Post @else {{ $detail->status }} @endif |