From 6d6d497308781a7d160bb670a32ad251e71b80f2 Mon Sep 17 00:00:00 2001 From: BTMS2 Date: Tue, 8 Apr 2025 15:49:19 +0800 Subject: [PATCH] update stockaudit excel --- app/Http/Controllers/AkaunController.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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') {