fix: tambah notifikasi ke ketua saat transaksi butuh persetujuan, dan ke bendahara setelah disetujui/ditolak
This commit is contained in:
@@ -6,6 +6,7 @@ use App\Models\Approval;
|
||||
use App\Models\ApprovalItem;
|
||||
use App\Models\CashCategory;
|
||||
use App\Models\CashRecord;
|
||||
use App\Services\NotificationService;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Actions\BulkActionGroup;
|
||||
use Filament\Actions\DeleteBulkAction;
|
||||
@@ -83,6 +84,14 @@ class CashRecordsTable
|
||||
'notes' => $data['notes'] ?? null,
|
||||
]);
|
||||
$approval->update(['status' => 'approved']);
|
||||
|
||||
NotificationService::send(
|
||||
$record->creator,
|
||||
'Transaksi Kas Disetujui',
|
||||
"Transaksi \"{$record->description}\" senilai Rp " . number_format($record->amount, 0, ',', '.') . " telah disetujui. Silakan lakukan verifikasi.",
|
||||
'success',
|
||||
route('filament.admin.resources.cash-records.index')
|
||||
);
|
||||
}),
|
||||
|
||||
// Ketua: tolak transaksi 500rb–2jt
|
||||
@@ -108,6 +117,14 @@ class CashRecordsTable
|
||||
'notes' => $data['notes'],
|
||||
]);
|
||||
$approval->update(['status' => 'rejected']);
|
||||
|
||||
NotificationService::send(
|
||||
$record->creator,
|
||||
'Transaksi Kas Ditolak',
|
||||
"Transaksi \"{$record->description}\" ditolak: {$data['notes']}",
|
||||
'danger',
|
||||
route('filament.admin.resources.cash-records.index')
|
||||
);
|
||||
}),
|
||||
|
||||
// Bendahara/ketua: verifikasi (hanya jika approval sudah selesai atau tidak diperlukan)
|
||||
|
||||
Reference in New Issue
Block a user