fix redirect active tab after submit opname mutations and receive mutations

This commit is contained in:
2025-06-12 18:19:26 +07:00
parent b04b8f88cb
commit 2fa60c583a
2 changed files with 76 additions and 12 deletions

View File

@@ -350,10 +350,11 @@ class OpnamesController extends Controller
DB::commit();
if ($isTransactionForm) {
// Redirect back to transaction page with success message
// Redirect back to transaction page with success message and tab indicator
return redirect()
->route('transaction')
->with('success', "Opname berhasil disimpan dan disetujui. {$processedCount} produk telah diproses.");
->with('success', "Opname berhasil disimpan dan disetujui. {$processedCount} produk telah diproses.")
->with('active_tab', 'opname');
} else {
// Redirect to opname index for regular form
return redirect()
@@ -373,7 +374,8 @@ class OpnamesController extends Controller
->route('transaction')
->withErrors($e->validator)
->withInput()
->with('error', 'Terjadi kesalahan validasi. Periksa kembali data yang dimasukkan.');
->with('error', 'Terjadi kesalahan validasi. Periksa kembali data yang dimasukkan.')
->with('active_tab', 'opname');
} else {
return back()->withErrors($e->validator)->withInput();
}
@@ -389,7 +391,8 @@ class OpnamesController extends Controller
return redirect()
->route('transaction')
->with('error', $errorMessage)
->withInput();
->withInput()
->with('active_tab', 'opname');
} else {
return back()
->with('error', $errorMessage)