feat: tambah role editor, workflow post, leaderboard, rekap kehadiran, kategori kas dengan type, seeder lengkap

This commit is contained in:
2026-04-05 06:21:16 +07:00
parent cde63da358
commit 6c23cc8660
40 changed files with 2432 additions and 129 deletions
+3 -3
View File
@@ -21,7 +21,7 @@ class CashStatsWidget extends StatsOverviewWidget
$saldo = fn ($query) => $query
->whereNotNull('verified_at')
->join('cash_categories', 'cash_records.category_id', '=', 'cash_categories.id')
->selectRaw("SUM(CASE WHEN cash_categories.name = 'pemasukan' THEN amount ELSE -amount END) as saldo")
->selectRaw("SUM(CASE WHEN cash_categories.type = 'pemasukan' THEN amount ELSE -amount END) as saldo")
->value('saldo') ?? 0;
$bulanIni = now()->startOfMonth();
@@ -30,12 +30,12 @@ class CashStatsWidget extends StatsOverviewWidget
$totalSaldo = $saldo(CashRecord::query());
$pemasukanBulanIni = CashRecord::whereNotNull('verified_at')
->join('cash_categories', 'cash_records.category_id', '=', 'cash_categories.id')
->where('cash_categories.name', 'pemasukan')
->where('cash_categories.type', 'pemasukan')
->whereMonth('date', $bulanIni->month)->whereYear('date', $bulanIni->year)
->sum('amount');
$pengeluaranBulanIni = CashRecord::whereNotNull('verified_at')
->join('cash_categories', 'cash_records.category_id', '=', 'cash_categories.id')
->where('cash_categories.name', 'pengeluaran')
->where('cash_categories.type', 'pengeluaran')
->whereMonth('date', $bulanIni->month)->whereYear('date', $bulanIni->year)
->sum('amount');
$saldoBulanLalu = $saldo(CashRecord::query()->where('date', '<', $bulanIni));