DONE: optimize loading page on employee, append the online payment under same batch

This commit is contained in:
ISMAIL MASSERAN
2026-09-06 10:21:04 +08:00
parent effe268e3b
commit 9fbcf86325
4 changed files with 117 additions and 87 deletions
@@ -132,9 +132,14 @@ class PembiayaanOnlineController extends Controller
return redirect()->back()->with('error', $msg);
}
$batchNo = $res->json()['batch']['batch_no'] ?? '';
return redirect()->route('pembiayaan.online.pc')
->with('message', 'Batch dihantar ke Operasi' . ($batchNo ? ': ' . $batchNo : '.'));
$payload = $res->json();
$batchNo = is_array($payload) ? ($payload['batch']['batch_no'] ?? '') : '';
$appended = is_array($payload) && !empty($payload['appended']);
$message = $appended
? ('Rekod ditambah ke batch' . ($batchNo ? ' ' . $batchNo : '') . '.')
: ('Batch dihantar ke Operasi' . ($batchNo ? ': ' . $batchNo : '.'));
return redirect()->route('pembiayaan.online.pc')->with('message', $message);
}
/**