diff --git a/app/Services/Manage/PurchaseService.php b/app/Services/Manage/PurchaseService.php index a0172a3..0f0d0c5 100644 --- a/app/Services/Manage/PurchaseService.php +++ b/app/Services/Manage/PurchaseService.php @@ -302,7 +302,6 @@ public function update(Purchase $purchase, array $validated): void public function delete(Purchase $purchase): void { $supplierName = $purchase->supplier->name; - $total = $purchase->total; DB::transaction(function () use ($purchase): void { $purchase->load('items'); @@ -318,7 +317,7 @@ public function delete(Purchase $purchase): void $this->pushNotificationService->sendToRoles( '🗑️ Belanja Dihapus', - "Pembelian dari supplier {$supplierName} senilai {$total_formatted} telah dihapus.", + "Pembelian dari supplier {$supplierName} senilai {$purchase->total_formatted} telah dihapus.", ['owner', 'developer'], '/admin/manage/purchases', ); diff --git a/app/Services/Master/RawMaterialService.php b/app/Services/Master/RawMaterialService.php index ca219dd..2a9d413 100644 --- a/app/Services/Master/RawMaterialService.php +++ b/app/Services/Master/RawMaterialService.php @@ -85,6 +85,7 @@ public function stockWarningGroups(): array private function inventoryAlertGroups(callable $filter): array { return RawMaterialPrice::query() + ->whereHas('rawMaterial', fn (Builder $query) => $query->where('is_active', true)) ->with(['rawMaterial', 'media']) ->get() ->filter($filter)