fix redirect active tab after submit opname mutations and receive mutations
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user