diff --git a/app/Http/Controllers/AkaunController.php b/app/Http/Controllers/AkaunController.php index eb99340..7946316 100644 --- a/app/Http/Controllers/AkaunController.php +++ b/app/Http/Controllers/AkaunController.php @@ -752,7 +752,13 @@ class AkaunController extends Controller if (empty($stokauditRecords)) { return back()->with('error', 'No records found to export.'); } - return Excel::download(new SAExport($stokauditRecords, 'Laporan Stok Audit'), 'laporan_stokaudit_' . $request->kodcaw . '_' . $tebus_date . '.xlsx'); + //return Excel::download(new SAExport($stokauditRecords, 'Laporan Stok Audit'), 'laporan_stokaudit_' . $request->kodcaw . '_' . $tebus_date . '.xlsx'); + return Excel::download(new SAExport( + $stokauditRecords, + 'Laporan Stok Audit', + $tebus_date, + $cawangan_detail['namacaw']// ✅ Use the correct branch name from API + ), 'laporan_stokaudit_' . $request->kodcaw . '_' . $tebus_date . '.xlsx'); } else { if ($request->radaktif === 'aktif') {