DONE: request online modal from pc to operasi, operasi can edit amount; WIP: customer detail confirmation form, retest pembiayaan online, notification if required
This commit is contained in:
@@ -3,3 +3,25 @@
|
||||
- MOHAMAD KHAIRULNIZAN BIN JUSOF - TELLER
|
||||
- MOHAMAD AZUHAIDIE BIN AHMAD - PPC
|
||||
- WAN NURUL AMIRA BINTI WAN HARON - PC
|
||||
|
||||
## Akaun
|
||||
- admin@test.com
|
||||
- admin2@test.com
|
||||
|
||||
Module Gadai Online:
|
||||
- Langkah 1
|
||||
- Langkah 2
|
||||
[x] PC akan tekan submit, then customer akan masuk ke senarai online mengikut batch
|
||||
[x] PC boleh semak list customer yang pilih gadai online
|
||||
- Langkah 3 (Operasi)
|
||||
[x] dapat dalam bentuk list
|
||||
[x] Apa jadi kalau operasi reject? - patah balik ke pc, untuk pc buat semakan balik
|
||||
- Langkah 4
|
||||
- Langkah 5
|
||||
- Langkah 6
|
||||
- Langkah 7
|
||||
[x] Macam mana PC nak tahu pembayaran berjaya (Tally PAID page)
|
||||
[x] Kalau online, dia kena upload kat mana (Operasi: PAID + bukti)
|
||||
- Langkah 8
|
||||
[x] PC semak senarai pelanggan gadai tu tally atau tak
|
||||
[ ] PC tekan butang blast ke (tanda selesai ada; WhatsApp/SMS belum wire)
|
||||
@@ -211,13 +211,50 @@ class GadaianController extends Controller
|
||||
'teller' => $auth_user['name']
|
||||
]);
|
||||
|
||||
$this->AliranTunaiController->alirantunaiGadai($request, $auth_user['name']);
|
||||
$caraTerima = strtoupper((string) $request->input('cara_terima', 'TUNAI'));
|
||||
$pinjamanAmt = round((float) $request->pinjaman, 2);
|
||||
|
||||
// Online only for RM5k–50k; otherwise force cash path.
|
||||
if ($caraTerima === 'ONLINE' && ($pinjamanAmt < 5000 || $pinjamanAmt > 50000)) {
|
||||
$caraTerima = 'TUNAI';
|
||||
}
|
||||
|
||||
if ($caraTerima === 'ONLINE') {
|
||||
$online = Http::withOptions(['verify' => config('app.api_verify')])
|
||||
->asForm()
|
||||
->post(config('api.url') . '/api/pembiayaan-online/' . $auth_user['cawangan'], [
|
||||
'norujukan' => $request->norujukan_gadai,
|
||||
'nokp' => $request->nokp,
|
||||
'pinjaman' => $pinjamanAmt,
|
||||
'kodbank' => $request->kodbank,
|
||||
'noakaun' => $request->noakaun,
|
||||
'nama_bank' => $request->nama_bank,
|
||||
'nama_akaun' => $request->nama_akaun ?: $request->nama_pelanggan,
|
||||
'nama_pelanggan' => $request->nama_pelanggan,
|
||||
'nopelanggan' => $request->nopelanggan,
|
||||
'created_by' => $auth_user['name'],
|
||||
'update_customer_bank' => true,
|
||||
]);
|
||||
|
||||
if (!$online->successful()) {
|
||||
$body = $online->json();
|
||||
$msg = is_array($body) && isset($body['message'])
|
||||
? $body['message']
|
||||
: 'Gagal daftar pembiayaan online. Sila cuba lagi.';
|
||||
return redirect()->back()->with('error', $msg);
|
||||
}
|
||||
} else {
|
||||
$this->AliranTunaiController->alirantunaiGadai($request, $auth_user['name']);
|
||||
}
|
||||
|
||||
event(new GadaiNotify('lulus', $auth_user['cawangan']));
|
||||
|
||||
$request->session()->forget('page_reload');
|
||||
$request->session()->forget('norujukan');
|
||||
$request->session()->flash('activate_tab', 'SAG_baru');
|
||||
if ($caraTerima === 'ONLINE') {
|
||||
$request->session()->flash('message', 'Gadai berjaya. Pembiayaan online menunggu semakan PC.');
|
||||
}
|
||||
|
||||
return redirect()->route('customer_info');
|
||||
}
|
||||
|
||||
@@ -0,0 +1,744 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
|
||||
class PembiayaanOnlineController extends Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
}
|
||||
|
||||
protected function api()
|
||||
{
|
||||
return Http::withOptions(['verify' => config('app.api_verify')]);
|
||||
}
|
||||
|
||||
protected function kodcaw()
|
||||
{
|
||||
return Auth::user()->cawangan;
|
||||
}
|
||||
|
||||
/**
|
||||
* PC senarai queue + batch history.
|
||||
*/
|
||||
public function index(Request $request)
|
||||
{
|
||||
$auth_user = Auth::user();
|
||||
$kodcaw = $this->kodcaw();
|
||||
$api_url = config('api.url');
|
||||
|
||||
$cawangan_info = $this->api()
|
||||
->get($api_url . '/api/cawangan/' . $kodcaw)
|
||||
->json();
|
||||
|
||||
$queue = $this->api()
|
||||
->get($api_url . '/api/pembiayaan-online/' . $kodcaw . '/queue')
|
||||
->json();
|
||||
|
||||
$batches = $this->api()
|
||||
->get($api_url . '/api/pembiayaan-online/' . $kodcaw . '/batches')
|
||||
->json();
|
||||
|
||||
$banks = $this->api()->get($api_url . '/api/bank')->json();
|
||||
if (!is_array($banks)) {
|
||||
$banks = [];
|
||||
}
|
||||
|
||||
$modal = $this->api()
|
||||
->get($api_url . '/api/modal-online/' . $kodcaw)
|
||||
->json();
|
||||
|
||||
$lines = $queue['data'] ?? [];
|
||||
$slot = $queue['slot_cadangan'] ?? null;
|
||||
if (!is_array($batches)) {
|
||||
$batches = [];
|
||||
}
|
||||
|
||||
return view('pembiayaan_online.pc.senarai', compact(
|
||||
'auth_user',
|
||||
'kodcaw',
|
||||
'api_url',
|
||||
'cawangan_info',
|
||||
'lines',
|
||||
'batches',
|
||||
'banks',
|
||||
'modal',
|
||||
'slot',
|
||||
'queue'
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update bank/docs for a queue line.
|
||||
*/
|
||||
public function updateLine(Request $request, $id)
|
||||
{
|
||||
$kodcaw = $this->kodcaw();
|
||||
$api_url = config('api.url');
|
||||
|
||||
$payload = [
|
||||
'kodbank' => $request->input('kodbank'),
|
||||
'noakaun' => $request->input('noakaun'),
|
||||
'nama_bank' => $request->input('nama_bank'),
|
||||
'nama_akaun' => $request->input('nama_akaun'),
|
||||
'nota' => $request->input('nota'),
|
||||
'update_customer_bank' => true,
|
||||
];
|
||||
|
||||
$res = $this->api()
|
||||
->asForm()
|
||||
->put($api_url . '/api/pembiayaan-online/' . $kodcaw . '/lines/' . $id, $payload);
|
||||
|
||||
if (!$res->successful()) {
|
||||
$body = $res->json();
|
||||
$msg = is_array($body) && isset($body['message']) ? $body['message'] : 'Gagal kemaskini rekod.';
|
||||
return redirect()->back()->with('error', $msg);
|
||||
}
|
||||
|
||||
return redirect()->route('pembiayaan.online.pc')->with('message', 'Rekod dikemaskini.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Submit selected lines as a batch to Operasi.
|
||||
*/
|
||||
public function submitBatch(Request $request)
|
||||
{
|
||||
$kodcaw = $this->kodcaw();
|
||||
$api_url = config('api.url');
|
||||
$auth_user = Auth::user();
|
||||
|
||||
$ids = $request->input('ids', []);
|
||||
if (!is_array($ids)) {
|
||||
$ids = array_filter(explode(',', (string) $ids));
|
||||
}
|
||||
|
||||
$res = $this->api()
|
||||
->asForm()
|
||||
->post($api_url . '/api/pembiayaan-online/' . $kodcaw . '/batches/submit', [
|
||||
'ids' => $ids,
|
||||
'pc_submitted_by' => $auth_user['name'],
|
||||
'slot' => $request->input('slot'),
|
||||
]);
|
||||
|
||||
if (!$res->successful()) {
|
||||
$body = $res->json();
|
||||
$msg = is_array($body) && isset($body['message']) ? $body['message'] : 'Gagal hantar batch.';
|
||||
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 : '.'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Batch detail.
|
||||
*/
|
||||
public function showBatch($batchId)
|
||||
{
|
||||
$kodcaw = $this->kodcaw();
|
||||
$api_url = config('api.url');
|
||||
|
||||
$cawangan_info = $this->api()
|
||||
->get($api_url . '/api/cawangan/' . $kodcaw)
|
||||
->json();
|
||||
|
||||
$detail = $this->api()
|
||||
->get($api_url . '/api/pembiayaan-online/' . $kodcaw . '/batches/' . $batchId)
|
||||
->json();
|
||||
|
||||
if (!is_array($detail) || empty($detail['batch'])) {
|
||||
return redirect()->route('pembiayaan.online.pc')->with('error', 'Batch tidak dijumpai.');
|
||||
}
|
||||
|
||||
return view('pembiayaan_online.pc.batch', [
|
||||
'batch' => $detail['batch'],
|
||||
'lines' => $detail['lines'] ?? [],
|
||||
'kodcaw' => $kodcaw,
|
||||
'api_url' => $api_url,
|
||||
'cawangan_info' => $cawangan_info,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* PC: senarai PAID untuk tally + blast.
|
||||
*/
|
||||
public function paidIndex(Request $request)
|
||||
{
|
||||
$auth_user = Auth::user();
|
||||
$kodcaw = $this->kodcaw();
|
||||
$api_url = config('api.url');
|
||||
$blastFilter = $request->input('blast_sent', '0');
|
||||
|
||||
$cawangan_info = $this->api()
|
||||
->get($api_url . '/api/cawangan/' . $kodcaw)
|
||||
->json();
|
||||
|
||||
$query = [];
|
||||
if ($blastFilter !== 'all' && $blastFilter !== '') {
|
||||
$query['blast_sent'] = $blastFilter;
|
||||
}
|
||||
|
||||
$paid = $this->api()
|
||||
->get($api_url . '/api/pembiayaan-online/' . $kodcaw . '/paid', $query)
|
||||
->json();
|
||||
|
||||
$lines = $paid['data'] ?? [];
|
||||
if (!is_array($lines)) {
|
||||
$lines = [];
|
||||
}
|
||||
|
||||
$bilangan = $paid['bilangan'] ?? count($lines);
|
||||
$jumlah = $paid['jumlah'] ?? 0;
|
||||
|
||||
return view('pembiayaan_online.pc.paid', compact(
|
||||
'auth_user',
|
||||
'kodcaw',
|
||||
'api_url',
|
||||
'cawangan_info',
|
||||
'lines',
|
||||
'bilangan',
|
||||
'jumlah',
|
||||
'blastFilter'
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* PC: view/download bukti bayaran inline.
|
||||
*/
|
||||
public function viewBukti($id)
|
||||
{
|
||||
$kodcaw = $this->kodcaw();
|
||||
$res = $this->api()
|
||||
->get(config('api.url') . '/api/pembiayaan-online/' . $kodcaw . '/lines/' . $id . '/bukti');
|
||||
|
||||
if (!$res->successful()) {
|
||||
$body = $res->json();
|
||||
$msg = is_array($body) && isset($body['message']) ? $body['message'] : 'Bukti tidak dijumpai.';
|
||||
return redirect()->back()->with('error', $msg);
|
||||
}
|
||||
|
||||
$payload = $res->json();
|
||||
$bukti = $payload['bukti'] ?? null;
|
||||
if (!$bukti || empty($bukti['data'])) {
|
||||
return redirect()->back()->with('error', 'Fail bukti kosong.');
|
||||
}
|
||||
|
||||
$raw = $bukti['data'];
|
||||
if (strpos($raw, 'base64,') !== false) {
|
||||
$raw = substr($raw, strpos($raw, 'base64,') + 7);
|
||||
}
|
||||
$binary = base64_decode($raw, true);
|
||||
if ($binary === false) {
|
||||
$binary = base64_decode($bukti['data']);
|
||||
}
|
||||
|
||||
$type = $bukti['type'] ?? 'application/octet-stream';
|
||||
$filename = $bukti['filename'] ?? ('bukti-' . $id);
|
||||
|
||||
return response($binary, 200, [
|
||||
'Content-Type' => $type,
|
||||
'Content-Disposition' => 'inline; filename="' . $filename . '"',
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* PC: tanda rekod PAID sebagai selesai semak / blast.
|
||||
*/
|
||||
public function markBlast(Request $request)
|
||||
{
|
||||
$kodcaw = $this->kodcaw();
|
||||
$ids = $request->input('ids', []);
|
||||
if (!is_array($ids)) {
|
||||
$ids = array_filter(explode(',', (string) $ids));
|
||||
}
|
||||
|
||||
if (count($ids) === 0) {
|
||||
return redirect()->back()->with('error', 'Sila pilih sekurang-kurangnya satu rekod.');
|
||||
}
|
||||
|
||||
$res = $this->api()
|
||||
->asForm()
|
||||
->post(config('api.url') . '/api/pembiayaan-online/' . $kodcaw . '/paid/blast', [
|
||||
'ids' => $ids,
|
||||
'blast_by' => Auth::user()['name'],
|
||||
]);
|
||||
|
||||
if (!$res->successful()) {
|
||||
$body = $res->json();
|
||||
$msg = is_array($body) && isset($body['message']) ? $body['message'] : 'Gagal tanda selesai.';
|
||||
return redirect()->back()->with('error', $msg);
|
||||
}
|
||||
|
||||
$n = $res->json()['dikemaskini'] ?? count($ids);
|
||||
return redirect()
|
||||
->route('pembiayaan.online.pc.paid')
|
||||
->with('message', $n . ' rekod ditanda selesai semak/blast.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Operasi: senarai batch semua cawangan.
|
||||
*/
|
||||
public function operasiIndex(Request $request)
|
||||
{
|
||||
$auth_user = Auth::user();
|
||||
$api_url = config('api.url');
|
||||
$status = $request->input('status', 'SUBMITTED');
|
||||
$tarikh = $request->input('tarikh');
|
||||
|
||||
$query = ['status' => $status];
|
||||
if ($tarikh) {
|
||||
$query['tarikh'] = $tarikh;
|
||||
}
|
||||
|
||||
$res = $this->api()
|
||||
->get($api_url . '/api/pembiayaan-online/operasi/batches', $query)
|
||||
->json();
|
||||
|
||||
$batches = $res['data'] ?? [];
|
||||
if (!is_array($batches)) {
|
||||
$batches = [];
|
||||
}
|
||||
|
||||
return view('pembiayaan_online.operasi.senarai', compact(
|
||||
'auth_user',
|
||||
'api_url',
|
||||
'batches',
|
||||
'status',
|
||||
'tarikh'
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Operasi: detail batch + lines.
|
||||
*/
|
||||
public function operasiShowBatch($kodcaw, $batchId)
|
||||
{
|
||||
$auth_user = Auth::user();
|
||||
$api_url = config('api.url');
|
||||
|
||||
$cawangan_info = $this->api()
|
||||
->get($api_url . '/api/cawangan/' . $kodcaw)
|
||||
->json();
|
||||
|
||||
$detail = $this->api()
|
||||
->get($api_url . '/api/pembiayaan-online/operasi/' . $kodcaw . '/batches/' . $batchId)
|
||||
->json();
|
||||
|
||||
if (!is_array($detail) || empty($detail['batch'])) {
|
||||
return redirect()
|
||||
->route('pembiayaan.online.operasi')
|
||||
->with('error', 'Batch tidak dijumpai.');
|
||||
}
|
||||
|
||||
return view('pembiayaan_online.operasi.batch', [
|
||||
'auth_user' => $auth_user,
|
||||
'batch' => $detail['batch'],
|
||||
'lines' => $detail['lines'] ?? [],
|
||||
'kodcaw' => $kodcaw,
|
||||
'api_url' => $api_url,
|
||||
'cawangan_info' => $cawangan_info,
|
||||
]);
|
||||
}
|
||||
|
||||
public function operasiApproveLine(Request $request, $kodcaw, $id)
|
||||
{
|
||||
$res = $this->api()
|
||||
->asForm()
|
||||
->post(config('api.url') . '/api/pembiayaan-online/operasi/' . $kodcaw . '/lines/' . $id . '/approve', [
|
||||
'ops_by' => Auth::user()['name'],
|
||||
]);
|
||||
|
||||
return $this->opsRedirect($res, $kodcaw, $request->input('batch_id'), 'Rekod diluluskan.');
|
||||
}
|
||||
|
||||
public function operasiRejectLine(Request $request, $kodcaw, $id)
|
||||
{
|
||||
$reason = trim((string) $request->input('reject_reason', ''));
|
||||
if ($reason === '') {
|
||||
return redirect()->back()->with('error', 'Sebab tolak diperlukan.');
|
||||
}
|
||||
|
||||
$res = $this->api()
|
||||
->asForm()
|
||||
->post(config('api.url') . '/api/pembiayaan-online/operasi/' . $kodcaw . '/lines/' . $id . '/reject', [
|
||||
'ops_by' => Auth::user()['name'],
|
||||
'reject_reason' => $reason,
|
||||
]);
|
||||
|
||||
return $this->opsRedirect($res, $kodcaw, $request->input('batch_id'), 'Rekod ditolak. Dikembalikan ke PC.');
|
||||
}
|
||||
|
||||
public function operasiApproveBatch(Request $request, $kodcaw, $batchId)
|
||||
{
|
||||
$res = $this->api()
|
||||
->asForm()
|
||||
->post(config('api.url') . '/api/pembiayaan-online/operasi/' . $kodcaw . '/batches/' . $batchId . '/approve', [
|
||||
'ops_by' => Auth::user()['name'],
|
||||
]);
|
||||
|
||||
return $this->opsRedirect($res, $kodcaw, $batchId, 'Semua rekod menunggu dalam batch diluluskan.');
|
||||
}
|
||||
|
||||
public function operasiMarkPaid(Request $request, $kodcaw, $id)
|
||||
{
|
||||
$payload = $this->buildPaidPayload($request);
|
||||
if (isset($payload['error'])) {
|
||||
return redirect()->back()->with('error', $payload['error']);
|
||||
}
|
||||
|
||||
$res = $this->api()
|
||||
->asForm()
|
||||
->post(config('api.url') . '/api/pembiayaan-online/operasi/' . $kodcaw . '/lines/' . $id . '/paid', $payload);
|
||||
|
||||
return $this->opsRedirect($res, $kodcaw, $request->input('batch_id'), 'Rekod ditanda PAID.');
|
||||
}
|
||||
|
||||
public function operasiMarkPaidBatch(Request $request, $kodcaw, $batchId)
|
||||
{
|
||||
$payload = $this->buildPaidPayload($request);
|
||||
if (isset($payload['error'])) {
|
||||
return redirect()->back()->with('error', $payload['error']);
|
||||
}
|
||||
|
||||
$res = $this->api()
|
||||
->asForm()
|
||||
->post(config('api.url') . '/api/pembiayaan-online/operasi/' . $kodcaw . '/batches/' . $batchId . '/paid', $payload);
|
||||
|
||||
return $this->opsRedirect($res, $kodcaw, $batchId, 'Rekod APPROVED dalam batch ditanda PAID.');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function buildPaidPayload(Request $request)
|
||||
{
|
||||
$noRujukan = trim((string) $request->input('no_rujukan_bayaran', ''));
|
||||
if ($noRujukan === '') {
|
||||
return ['error' => 'No. rujukan bayaran diperlukan.'];
|
||||
}
|
||||
|
||||
if (!$request->hasFile('bukti')) {
|
||||
return ['error' => 'Fail bukti bayaran diperlukan.'];
|
||||
}
|
||||
|
||||
$file = $request->file('bukti');
|
||||
if (!$file->isValid()) {
|
||||
return ['error' => 'Fail bukti tidak sah.'];
|
||||
}
|
||||
|
||||
$raw = base64_encode(file_get_contents($file->getRealPath()));
|
||||
$mime = $file->getMimeType() ?: 'application/octet-stream';
|
||||
|
||||
return [
|
||||
'ops_by' => Auth::user()['name'],
|
||||
'no_rujukan_bayaran' => $noRujukan,
|
||||
'tarikh_bayaran' => $request->input('tarikh_bayaran') ?: date('Y-m-d'),
|
||||
'bukti_data' => $raw,
|
||||
'bukti_filename' => $file->getClientOriginalName(),
|
||||
'bukti_type' => $mime,
|
||||
];
|
||||
}
|
||||
|
||||
protected function opsRedirect($res, $kodcaw, $batchId, $successMsg)
|
||||
{
|
||||
$batchId = $batchId ?: null;
|
||||
|
||||
if (!$res->successful()) {
|
||||
$body = $res->json();
|
||||
$msg = is_array($body) && isset($body['message']) ? $body['message'] : 'Tindakan gagal.';
|
||||
return redirect()->back()->with('error', $msg);
|
||||
}
|
||||
|
||||
if ($batchId) {
|
||||
return redirect()
|
||||
->route('pembiayaan.online.operasi.batch', ['kodcaw' => $kodcaw, 'batchId' => $batchId])
|
||||
->with('message', $successMsg);
|
||||
}
|
||||
|
||||
return redirect()->route('pembiayaan.online.operasi')->with('message', $successMsg);
|
||||
}
|
||||
|
||||
/**
|
||||
* PC: modal online float + top-up request form/history.
|
||||
*/
|
||||
public function topupIndex(Request $request)
|
||||
{
|
||||
$auth_user = Auth::user();
|
||||
$kodcaw = $this->kodcaw();
|
||||
$api_url = config('api.url');
|
||||
$status = $request->input('status', '');
|
||||
|
||||
$cawangan_info = $this->api()
|
||||
->get($api_url . '/api/cawangan/' . $kodcaw)
|
||||
->json();
|
||||
|
||||
$modal = $this->api()
|
||||
->get($api_url . '/api/modal-online/' . $kodcaw)
|
||||
->json();
|
||||
|
||||
$query = [];
|
||||
if ($status !== '' && $status !== 'all') {
|
||||
$query['status'] = $status;
|
||||
}
|
||||
|
||||
$reqRes = $this->api()
|
||||
->get($api_url . '/api/modal-online/' . $kodcaw . '/topup/requests', $query)
|
||||
->json();
|
||||
|
||||
$requests = $reqRes['data'] ?? [];
|
||||
if (!is_array($requests)) {
|
||||
$requests = [];
|
||||
}
|
||||
|
||||
$pendingRes = $this->api()
|
||||
->get($api_url . '/api/modal-online/' . $kodcaw . '/topup/requests', ['status' => 'PENDING'])
|
||||
->json();
|
||||
$pendingList = $pendingRes['data'] ?? [];
|
||||
$hasPending = is_array($pendingList) && count($pendingList) > 0;
|
||||
$isMissing = !empty($modal['missing']);
|
||||
$pendingRequest = $modal['pending_request'] ?? null;
|
||||
if (!$pendingRequest && $hasPending) {
|
||||
$pendingRequest = $pendingList[0];
|
||||
}
|
||||
|
||||
return view('pembiayaan_online.pc.topup', compact(
|
||||
'auth_user',
|
||||
'kodcaw',
|
||||
'api_url',
|
||||
'cawangan_info',
|
||||
'modal',
|
||||
'requests',
|
||||
'status',
|
||||
'hasPending',
|
||||
'isMissing',
|
||||
'pendingRequest'
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* PC: submit top-up request.
|
||||
*/
|
||||
public function topupRequest(Request $request)
|
||||
{
|
||||
$kodcaw = $this->kodcaw();
|
||||
$amaun = (float) $request->input('amaun', 0);
|
||||
|
||||
if ($amaun <= 0) {
|
||||
return redirect()->back()->with('error', 'Amaun mesti lebih daripada 0.');
|
||||
}
|
||||
|
||||
$res = $this->api()
|
||||
->asForm()
|
||||
->post(config('api.url') . '/api/modal-online/' . $kodcaw . '/topup/request', [
|
||||
'amaun' => $amaun,
|
||||
'dimohon_oleh' => Auth::user()['name'],
|
||||
'nota' => $request->input('nota'),
|
||||
]);
|
||||
|
||||
if (!$res->successful()) {
|
||||
$body = $res->json();
|
||||
$msg = is_array($body) && isset($body['message']) ? $body['message'] : 'Gagal hantar permohonan.';
|
||||
return redirect()->back()->with('error', $msg)->withInput();
|
||||
}
|
||||
|
||||
return redirect()
|
||||
->route('pembiayaan.online.pc.topup')
|
||||
->with('message', 'Permohonan modal online dihantar. Menunggu kelulusan Operasi.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Operasi: senarai permohonan tambah modal online.
|
||||
*/
|
||||
public function operasiTopupIndex(Request $request)
|
||||
{
|
||||
$auth_user = Auth::user();
|
||||
$api_url = config('api.url');
|
||||
$status = $request->input('status', 'PENDING');
|
||||
$tarikh = $request->input('tarikh');
|
||||
|
||||
$query = [];
|
||||
if ($status === 'all') {
|
||||
$query['status'] = 'all';
|
||||
} elseif ($status !== '' && $status !== null) {
|
||||
$query['status'] = $status;
|
||||
} else {
|
||||
$query['status'] = 'PENDING';
|
||||
}
|
||||
if ($tarikh) {
|
||||
$query['tarikh'] = $tarikh;
|
||||
}
|
||||
|
||||
$res = $this->api()
|
||||
->get($api_url . '/api/modal-online/operasi/topup/requests', $query)
|
||||
->json();
|
||||
|
||||
$requests = $res['data'] ?? [];
|
||||
if (!is_array($requests)) {
|
||||
$requests = [];
|
||||
}
|
||||
|
||||
return view('pembiayaan_online.operasi.topup', compact(
|
||||
'auth_user',
|
||||
'api_url',
|
||||
'requests',
|
||||
'status',
|
||||
'tarikh'
|
||||
));
|
||||
}
|
||||
|
||||
public function operasiTopupApprove(Request $request, $id)
|
||||
{
|
||||
$amaun = $request->input('amaun');
|
||||
if ($amaun !== null && $amaun !== '' && (float) $amaun <= 0) {
|
||||
return redirect()->back()->with('error', 'Amaun diluluskan mesti lebih daripada 0.');
|
||||
}
|
||||
|
||||
$res = $this->api()
|
||||
->asForm()
|
||||
->post(config('api.url') . '/api/modal-online/operasi/topup/' . $id . '/approve', [
|
||||
'diluluskan_oleh' => Auth::user()['name'],
|
||||
'nota' => $request->input('nota'),
|
||||
'amaun' => $amaun,
|
||||
]);
|
||||
|
||||
if (!$res->successful()) {
|
||||
$body = $res->json();
|
||||
$msg = is_array($body) && isset($body['message']) ? $body['message'] : 'Gagal lulus permohonan.';
|
||||
return redirect()->back()->with('error', $msg);
|
||||
}
|
||||
|
||||
$amaunLulus = $res->json()['request']['amaun'] ?? $amaun;
|
||||
return redirect()
|
||||
->route('pembiayaan.online.operasi.topup')
|
||||
->with('message', 'Permohonan diluluskan RM ' . number_format((float) $amaunLulus, 2) . '. Modal online cawangan dikemas kini.');
|
||||
}
|
||||
|
||||
public function operasiTopupReject(Request $request, $id)
|
||||
{
|
||||
$res = $this->api()
|
||||
->asForm()
|
||||
->post(config('api.url') . '/api/modal-online/operasi/topup/' . $id . '/reject', [
|
||||
'diluluskan_oleh' => Auth::user()['name'],
|
||||
'nota' => $request->input('nota'),
|
||||
]);
|
||||
|
||||
if (!$res->successful()) {
|
||||
$body = $res->json();
|
||||
$msg = is_array($body) && isset($body['message']) ? $body['message'] : 'Gagal tolak permohonan.';
|
||||
return redirect()->back()->with('error', $msg);
|
||||
}
|
||||
|
||||
return redirect()
|
||||
->route('pembiayaan.online.operasi.topup')
|
||||
->with('message', 'Permohonan ditolak.');
|
||||
}
|
||||
|
||||
/**
|
||||
* PC: EOD close branch modal online.
|
||||
*/
|
||||
public function closeModal(Request $request)
|
||||
{
|
||||
$kodcaw = $this->kodcaw();
|
||||
|
||||
$res = $this->api()
|
||||
->asForm()
|
||||
->post(config('api.url') . '/api/modal-online/' . $kodcaw . '/close', [
|
||||
'ditutup_oleh' => Auth::user()['name'],
|
||||
]);
|
||||
|
||||
if (!$res->successful()) {
|
||||
$body = $res->json();
|
||||
$msg = is_array($body) && isset($body['message']) ? $body['message'] : 'Gagal tutup modal online.';
|
||||
return redirect()->back()->with('error', $msg);
|
||||
}
|
||||
|
||||
$dikembalikan = $res->json()['dikembalikan'] ?? 0;
|
||||
return redirect()
|
||||
->route('pembiayaan.online.pc.topup')
|
||||
->with('message', 'Modal online ditutup. Baki dikembalikan RM ' . number_format((float) $dikembalikan, 2) . '.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Operasi: EOD dashboard semua cawangan.
|
||||
*/
|
||||
public function operasiEodIndex(Request $request)
|
||||
{
|
||||
$auth_user = Auth::user();
|
||||
$api_url = config('api.url');
|
||||
$tarikh = $request->input('tarikh') ?: date('Y-m-d');
|
||||
|
||||
$res = $this->api()
|
||||
->get($api_url . '/api/modal-online/operasi/eod', [
|
||||
'zone' => 'all',
|
||||
'tarikh' => $tarikh,
|
||||
])
|
||||
->json();
|
||||
|
||||
$rows = $res['data'] ?? [];
|
||||
if (!is_array($rows)) {
|
||||
$rows = [];
|
||||
}
|
||||
|
||||
$summary = [
|
||||
'open' => $res['open'] ?? 0,
|
||||
'closed' => $res['closed'] ?? 0,
|
||||
'missing' => $res['missing'] ?? 0,
|
||||
'bilangan' => $res['bilangan'] ?? count($rows),
|
||||
];
|
||||
|
||||
return view('pembiayaan_online.operasi.eod', compact(
|
||||
'auth_user',
|
||||
'api_url',
|
||||
'rows',
|
||||
'tarikh',
|
||||
'summary'
|
||||
));
|
||||
}
|
||||
|
||||
public function operasiCloseModal(Request $request, $kodcaw)
|
||||
{
|
||||
$res = $this->api()
|
||||
->asForm()
|
||||
->post(config('api.url') . '/api/modal-online/' . $kodcaw . '/close', [
|
||||
'ditutup_oleh' => Auth::user()['name'],
|
||||
]);
|
||||
|
||||
if (!$res->successful()) {
|
||||
$body = $res->json();
|
||||
$msg = is_array($body) && isset($body['message']) ? $body['message'] : 'Gagal tutup modal online.';
|
||||
return redirect()->back()->with('error', $msg);
|
||||
}
|
||||
|
||||
return redirect()
|
||||
->route('pembiayaan.online.operasi.eod')
|
||||
->with('message', 'Modal online ' . $kodcaw . ' ditutup.');
|
||||
}
|
||||
|
||||
public function operasiCloseAllModal(Request $request)
|
||||
{
|
||||
$res = $this->api()
|
||||
->asForm()
|
||||
->post(config('api.url') . '/api/modal-online/operasi/eod/close-all', [
|
||||
'ditutup_oleh' => Auth::user()['name'],
|
||||
'zone' => 'all',
|
||||
]);
|
||||
|
||||
if (!$res->successful()) {
|
||||
$body = $res->json();
|
||||
$msg = is_array($body) && isset($body['message']) ? $body['message'] : 'Gagal tutup semua modal online.';
|
||||
return redirect()->back()->with('error', $msg);
|
||||
}
|
||||
|
||||
$closed = $res->json()['closed'] ?? 0;
|
||||
$skipped = $res->json()['skipped'] ?? 0;
|
||||
return redirect()
|
||||
->route('pembiayaan.online.operasi.eod')
|
||||
->with('message', 'EOD selesai: ' . $closed . ' ditutup, ' . $skipped . ' sudah ditutup.');
|
||||
}
|
||||
}
|
||||
@@ -230,7 +230,6 @@
|
||||
|
||||
// 4️⃣ Hantar permohonan ke backend (Laravel)
|
||||
const response = await fetch("{{ route('operasi.createkelulusan-anggota') }}", {
|
||||
|
||||
method: 'POST',
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
@@ -238,15 +237,14 @@
|
||||
},
|
||||
body: JSON.stringify({
|
||||
mohon: "Assign Anggota",
|
||||
noic: noic,
|
||||
nokp: noic,
|
||||
norujukan: norujukan,
|
||||
komen: komen,
|
||||
teller: "{{ Auth::user()->name }}",
|
||||
tagoperasi: 1 // 1 = tunggu kelulusan operasi
|
||||
})
|
||||
|
||||
console.log(`Response: ${response}`);
|
||||
});
|
||||
console.log(`Response: ${response}`);
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
|
||||
@@ -217,6 +217,68 @@
|
||||
</div>
|
||||
</diV>
|
||||
</div>
|
||||
<div class="col-12" id="cara_terima_section" style="display:none;">
|
||||
<hr>
|
||||
<div class="form-group row">
|
||||
<div class="col-md-3">
|
||||
Cara Terima Pembiayaan
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<div class="form-check form-check-inline">
|
||||
<input class="form-check-input" type="radio" name="cara_terima" id="cara_terima_tunai" value="TUNAI" checked>
|
||||
<label class="form-check-label" for="cara_terima_tunai">Tunai</label>
|
||||
</div>
|
||||
<div class="form-check form-check-inline">
|
||||
<input class="form-check-input" type="radio" name="cara_terima" id="cara_terima_online" value="ONLINE">
|
||||
<label class="form-check-label" for="cara_terima_online">Online (Akaun Bank)</label>
|
||||
</div>
|
||||
<small class="form-text text-muted">Pilihan Online untuk pembiayaan RM5,000 – RM50,000 sahaja.</small>
|
||||
</div>
|
||||
</div>
|
||||
<div id="bank_online_section" style="display:none;">
|
||||
<div class="form-group row">
|
||||
<div class="col-md-3">Modal Online</div>
|
||||
<div class="col-md-9">
|
||||
<div id="modal_online_status" class="mb-1">Memeriksa baki...</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-md-3">Bank</div>
|
||||
<div class="col-md-4">
|
||||
@php
|
||||
$banks_list = Http::withOptions(['verify' => config('app.api_verify')])
|
||||
->get($api_url . '/api/bank')
|
||||
->json();
|
||||
@endphp
|
||||
<select class="form-control" name="kodbank" id="gadai_kodbank">
|
||||
<option value="">-- Pilih Bank --</option>
|
||||
@foreach ($banks_list as $banks)
|
||||
<option value="{{ $banks['abbreviation'] }}"
|
||||
{{ ($customer_info['kodbank'] ?? '') == $banks['abbreviation'] ? 'selected' : '' }}
|
||||
data-nama="{{ $banks['name'] }}">
|
||||
{{ $banks['name'] }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-2">No. Akaun</div>
|
||||
<div class="col-md-3">
|
||||
<input type="text" class="form-control" name="noakaun" id="gadai_noakaun"
|
||||
value="{{ $customer_info['noakaun'] ?? '' }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-md-3">Nama Akaun</div>
|
||||
<div class="col-md-9">
|
||||
<input type="text" class="form-control" name="nama_akaun" id="gadai_nama_akaun"
|
||||
value="{{ $customer_info['nama'] ?? '' }}">
|
||||
<input type="hidden" name="nama_bank" id="gadai_nama_bank" value="">
|
||||
<input type="hidden" name="nama_pelanggan" value="{{ $customer_info['nama'] ?? '' }}">
|
||||
<input type="hidden" name="nopelanggan" id="nopelanggan" value="{{ $customer_info['nopelanggan'] ?? '' }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<input type="text" name="norujukan_gadai" id="norujukan_gadai" value="{{ $norujukan }}" hidden>
|
||||
<input type="text" name="marhun_detail" id="marhun_detail" value="" hidden>
|
||||
@@ -684,6 +746,7 @@
|
||||
var nokp = $('#nokp').val();
|
||||
//console.log('DEBUG NOKP:', nokp, kadarupah);
|
||||
|
||||
toggleCaraTerima(pinjaman);
|
||||
|
||||
// var keuntungan_sebulan = pinjaman * kadarupah;
|
||||
// var keuntungan_6bln = keuntungan_sebulan * 6;
|
||||
@@ -1195,9 +1258,170 @@
|
||||
.then(response => response.json());
|
||||
}
|
||||
|
||||
function toggleCaraTerima(pinjaman) {
|
||||
if (pinjaman >= 5000 && pinjaman <= 50000) {
|
||||
$('#cara_terima_section').show();
|
||||
toggleBankOnlineSection();
|
||||
} else {
|
||||
$('#cara_terima_section').hide();
|
||||
$('#bank_online_section').hide();
|
||||
$('#cara_terima_tunai').prop('checked', true);
|
||||
}
|
||||
}
|
||||
|
||||
function toggleBankOnlineSection() {
|
||||
if ($('input[name="cara_terima"]:checked').val() === 'ONLINE') {
|
||||
$('#bank_online_section').show();
|
||||
var nama = $('#gadai_kodbank option:selected').data('nama') || '';
|
||||
$('#gadai_nama_bank').val(nama);
|
||||
refreshModalOnlineStatus();
|
||||
} else {
|
||||
$('#bank_online_section').hide();
|
||||
}
|
||||
}
|
||||
|
||||
$(document).on('change', 'input[name="cara_terima"]', function () {
|
||||
toggleBankOnlineSection();
|
||||
});
|
||||
|
||||
$(document).on('change', '#gadai_kodbank', function () {
|
||||
$('#gadai_nama_bank').val($('#gadai_kodbank option:selected').data('nama') || '');
|
||||
});
|
||||
|
||||
async function getModalOnline() {
|
||||
let kodcaw = $('#kodcaw').val();
|
||||
let apiUrl = api_url + '/api/modal-online/' + kodcaw;
|
||||
return $.ajax({
|
||||
method: 'GET',
|
||||
url: apiUrl,
|
||||
dataType: 'json',
|
||||
});
|
||||
}
|
||||
|
||||
async function refreshModalOnlineStatus() {
|
||||
var $el = $('#modal_online_status');
|
||||
$el.removeClass('text-success text-danger text-warning text-muted').addClass('text-muted').text('Memeriksa baki...');
|
||||
try {
|
||||
var modal = await getModalOnline();
|
||||
var pending = modal.pending_request || null;
|
||||
var closed = Number(modal.ditutup || 0) === 1;
|
||||
var missing = !!modal.missing;
|
||||
var baki = Number(modal.baki || 0);
|
||||
var had = Number(modal.had || 0) + Number(modal.tambah || 0);
|
||||
|
||||
if (closed) {
|
||||
$el.removeClass('text-muted').addClass('text-danger')
|
||||
.text('Modal online hari ini sudah ditutup (EOD). Gadai online tidak dibenarkan.');
|
||||
return modal;
|
||||
}
|
||||
|
||||
if (pending) {
|
||||
$el.removeClass('text-muted').addClass('text-warning')
|
||||
.text('Menunggu kelulusan Operasi: RM ' + formatter.format(Number(pending.amaun || 0)) +
|
||||
' (' + (pending.dimohon_oleh || '-') + ').');
|
||||
} else if (missing) {
|
||||
$el.removeClass('text-muted').addClass('text-danger')
|
||||
.text('Belum ada had hari ini. Sila hubungi PC.');
|
||||
} else {
|
||||
$el.removeClass('text-muted').addClass('text-success')
|
||||
.text('Baki RM ' + formatter.format(baki) + ' / Had RM ' + formatter.format(had));
|
||||
}
|
||||
return modal;
|
||||
} catch (e) {
|
||||
$el.removeClass('text-muted').addClass('text-danger').text('Gagal semak modal online.');
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
async function checkDisbursementFloat(pinjaman) {
|
||||
var cara = $('input[name="cara_terima"]:checked').val() || 'TUNAI';
|
||||
if (!(pinjaman >= 5000 && pinjaman <= 50000)) {
|
||||
cara = 'TUNAI';
|
||||
}
|
||||
|
||||
if (cara === 'ONLINE') {
|
||||
var kodbank = $('#gadai_kodbank').val();
|
||||
var noakaun = ($('#gadai_noakaun').val() || '').trim();
|
||||
$('#gadai_nama_bank').val($('#gadai_kodbank option:selected').data('nama') || '');
|
||||
if (!kodbank || !noakaun) {
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran!',
|
||||
text: 'Sila lengkapkan maklumat bank untuk pembayaran online.'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
var modal;
|
||||
try {
|
||||
modal = await getModalOnline();
|
||||
} catch (e) {
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran!',
|
||||
text: 'Gagal semak modal online. Sila cuba lagi.'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Number(modal.ditutup || 0) === 1) {
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran!',
|
||||
text: 'Modal online hari ini sudah ditutup (EOD). Sila pilih Tunai.'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
if (modal.pending_request) {
|
||||
Swal.fire({
|
||||
icon: 'info',
|
||||
title: 'Menunggu Operasi',
|
||||
text: 'Permohonan RM ' + formatter.format(Number(modal.pending_request.amaun || 0)) +
|
||||
' masih PENDING. Sila tunggu kelulusan Operasi atau pilih Tunai.'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
if (modal.missing) {
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran!',
|
||||
text: 'Belum ada had modal online hari ini. Sila hubungi PC.'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Number(modal.baki || 0) < pinjaman) {
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran!',
|
||||
text: 'Baki modal online tidak mencukupi. Sila hubungi PC untuk mohon tambah modal, atau pilih Tunai.'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
let dataCawangan = await getDataCawangan();
|
||||
let bakiAkhir = dataCawangan.baki;
|
||||
if (bakiAkhir < pinjaman) {
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran!',
|
||||
text: 'Baki Akhir Tunai Lebih Rendah Daripada Nilai Marhun Yang Ingin Digadaikan. Sila Tambah Pendahuluan di Laman Aliran Tunai Segera. '
|
||||
});
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
async function verifyGadai(func){
|
||||
$("#terima_gadai").prop('disabled', true);
|
||||
event.preventDefault();
|
||||
if (typeof event !== 'undefined' && event && event.preventDefault) {
|
||||
event.preventDefault();
|
||||
}
|
||||
var kodcaw = $('#kodcaw').val();
|
||||
var nokp = $('#nokp').val();
|
||||
var nopelanggan = $('#nopelanggan').val();
|
||||
@@ -1224,23 +1448,16 @@
|
||||
title: 'Amaran!',
|
||||
text: 'Pembiayaan Tidak Lengkap'
|
||||
});
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
|
||||
let dataCawangan = await getDataCawangan();
|
||||
let bakiAkhir = dataCawangan.baki;
|
||||
|
||||
if(bakiAkhir < pinjaman){
|
||||
let floatOk = await checkDisbursementFloat(pinjaman);
|
||||
if (!floatOk) {
|
||||
$("#terima_gadai").prop('disabled', false);
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran!',
|
||||
text: 'Baki Akhir Tunai Lebih Rendah Daripada Nilai Marhun Yang Ingin Digadaikan. Sila Tambah Pendahuluan di Laman Aliran Tunai Segera. '
|
||||
});
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}else{
|
||||
}
|
||||
|
||||
if(true){
|
||||
|
||||
if($.isNumeric(pinjaman) == false){
|
||||
$("#terima_gadai").prop('disabled', false);
|
||||
|
||||
@@ -262,6 +262,10 @@
|
||||
<a href="{{ url('pendahuluanserahan') }}"
|
||||
class="btn btn-info btn-lg btn-block mb-3">Pendahuluan - Serahan</a>
|
||||
</div>
|
||||
<div class="row">
|
||||
<a href="{{ route('pembiayaan.online.pc') }}"
|
||||
class="btn btn-info btn-lg btn-block mb-3">Pembiayaan Online</a>
|
||||
</div>
|
||||
<div class="row">
|
||||
<a href="{{ route('khazanah.indexwakil') }}"
|
||||
class="btn btn-info btn-lg btn-block mb-3">Surat Wakil</a>
|
||||
|
||||
@@ -14,13 +14,16 @@
|
||||
</nav>
|
||||
|
||||
<div class="card-body text-center">
|
||||
<a href="{{ route('operasi.kelulusananggota') }}" class="btn btn-info btn-lg">Kelulusan Anggota</a>
|
||||
<a href="{{ route('operasi.kelulusan') }}" class="btn btn-info btn-lg">Kelulusan</a>
|
||||
<a href="{{ route('daftar.kakitangan') }}" class="btn btn-info btn-lg">Kakitangan</a>
|
||||
<a href="{{ route('parameter') }}" class="btn btn-info btn-lg">Parameter</a>
|
||||
<a href="{{ route('komuditi') }}" class="btn btn-info btn-lg">Komoditi</a>
|
||||
<a href="{{ route('perubatan') }}" class="btn btn-info btn-lg">Perubatan</a>
|
||||
<a href="{{ route('operasi.laporan.audit') }}" class="btn btn-info btn-lg">Laporan Audit</a>
|
||||
<a href="{{ route('operasi.kelulusananggota') }}" class="btn btn-info btn-lg d-inline-block m-1">Kelulusan Anggota</a>
|
||||
<a href="{{ route('operasi.kelulusan') }}" class="btn btn-info btn-lg d-inline-block m-1">Kelulusan</a>
|
||||
<a href="{{ route('pembiayaan.online.operasi') }}" class="btn btn-info btn-lg d-inline-block m-1">Pembiayaan Online</a>
|
||||
<a href="{{ route('pembiayaan.online.operasi.topup') }}" class="btn btn-info btn-lg d-inline-block m-1">Modal Online</a>
|
||||
<a href="{{ route('pembiayaan.online.operasi.eod') }}" class="btn btn-info btn-lg d-inline-block m-1">EOD Modal Online</a>
|
||||
<a href="{{ route('daftar.kakitangan') }}" class="btn btn-info btn-lg d-inline-block m-1">Kakitangan</a>
|
||||
<a href="{{ route('parameter') }}" class="btn btn-info btn-lg d-inline-block m-1">Parameter</a>
|
||||
<a href="{{ route('komuditi') }}" class="btn btn-info btn-lg d-inline-block m-1">Komoditi</a>
|
||||
<a href="{{ route('perubatan') }}" class="btn btn-info btn-lg d-inline-block m-1">Perubatan</a>
|
||||
<a href="{{ route('operasi.laporan.audit') }}" class="btn btn-info btn-lg d-inline-block m-1">Laporan Audit</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,271 @@
|
||||
@extends('layouts.app_operasi')
|
||||
@section('content')
|
||||
@php
|
||||
$pendingCount = collect($lines)->whereIn('status', ['IN_BATCH', 'OPS_REVIEW'])->count();
|
||||
$approvedCount = collect($lines)->where('status', 'APPROVED')->count();
|
||||
$cawName = $cawangan_info['nama'] ?? $cawangan_info['namacaw'] ?? $kodcaw;
|
||||
@endphp
|
||||
<div class="container-fluid">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-12">
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb pb-3">
|
||||
<li class="breadcrumb-item"><a href="{{ route('home') }}">Home</a></li>
|
||||
<li class="breadcrumb-item"><a href="{{ route('pembiayaan.online.operasi') }}">Pembiayaan Online</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">Batch</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
@if(session()->has('message'))
|
||||
<div class="alert alert-success">{{ session('message') }}</div>
|
||||
@endif
|
||||
@if(session()->has('error'))
|
||||
<div class="alert alert-danger">{{ session('error') }}</div>
|
||||
@endif
|
||||
|
||||
<div class="card mb-3">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-md-3"><b>Batch No</b><br>{{ $batch['batch_no'] ?? '-' }}</div>
|
||||
<div class="col-md-3"><b>Cawangan</b><br>{{ $cawName }} <small class="text-muted">({{ $kodcaw }})</small></div>
|
||||
<div class="col-md-2"><b>Tarikh</b><br>{{ $batch['tarikh'] ?? '-' }}</div>
|
||||
<div class="col-md-2"><b>Slot</b><br>{{ $batch['slot'] ?? '-' }}</div>
|
||||
<div class="col-md-2"><b>Status</b><br>{{ $batch['status'] ?? '-' }}</div>
|
||||
</div>
|
||||
<div class="row mt-3">
|
||||
<div class="col-md-3"><b>Bilangan</b><br>{{ $batch['bilangan'] ?? count($lines) }}</div>
|
||||
<div class="col-md-3"><b>Jumlah</b><br>RM {{ number_format((float)($batch['jumlah_keseluruhan'] ?? 0), 2) }}</div>
|
||||
<div class="col-md-3"><b>Dihantar Oleh</b><br>{{ $batch['pc_submitted_by'] ?? '-' }}</div>
|
||||
<div class="col-md-3"><b>Dihantar Pada</b><br>{{ $batch['submitted_at'] ?? '-' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mb-3">
|
||||
<div class="card-header d-flex justify-content-between align-items-center flex-wrap">
|
||||
<h5 class="mb-0">Senarai Dalam Batch</h5>
|
||||
<div class="mt-2 mt-md-0">
|
||||
<a href="{{ route('pembiayaan.online.operasi') }}" class="btn btn-secondary btn-sm">Kembali</a>
|
||||
@if($pendingCount > 0)
|
||||
<form method="post"
|
||||
action="{{ route('pembiayaan.online.operasi.approve.batch', ['kodcaw' => $kodcaw, 'batchId' => $batch['id']]) }}"
|
||||
class="d-inline"
|
||||
onsubmit="return confirm('Luluskan semua {{ $pendingCount }} rekod menunggu dalam batch ini?');">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-success btn-sm">Lulus Semua Menunggu ({{ $pendingCount }})</button>
|
||||
</form>
|
||||
@endif
|
||||
@if($approvedCount > 0)
|
||||
<button type="button" class="btn btn-dark btn-sm" data-toggle="modal" data-target="#paidBatchModal">
|
||||
Tanda PAID Batch ({{ $approvedCount }})
|
||||
</button>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body table-responsive">
|
||||
<table class="table table-striped table-sm text-center">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th>Status</th>
|
||||
<th>SAG</th>
|
||||
<th>Pelanggan</th>
|
||||
<th>No KP</th>
|
||||
<th>Bank</th>
|
||||
<th>No Akaun</th>
|
||||
<th>Nama Akaun</th>
|
||||
<th>Pinjaman (RM)</th>
|
||||
<th>Rujukan Bayaran</th>
|
||||
<th>Tindakan</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse($lines as $line)
|
||||
@php
|
||||
$st = $line['status'] ?? '';
|
||||
$badge = 'badge-secondary';
|
||||
if ($st === 'APPROVED') $badge = 'badge-success';
|
||||
elseif ($st === 'PAID') $badge = 'badge-dark';
|
||||
elseif ($st === 'REJECTED_PC') $badge = 'badge-danger';
|
||||
elseif (in_array($st, ['IN_BATCH', 'OPS_REVIEW'], true)) $badge = 'badge-primary';
|
||||
@endphp
|
||||
<tr>
|
||||
<td><span class="badge {{ $badge }}">{{ $st ?: '-' }}</span></td>
|
||||
<td>{{ $line['norujukan'] ?? '-' }}</td>
|
||||
<td class="text-left">{{ $line['nama_pelanggan'] ?? '-' }}</td>
|
||||
<td>{{ $line['nokp'] ?? '-' }}</td>
|
||||
<td>{{ $line['nama_bank'] ?? $line['kodbank'] ?? '-' }}</td>
|
||||
<td>{{ $line['noakaun'] ?? '-' }}</td>
|
||||
<td class="text-left">{{ $line['nama_akaun'] ?? '-' }}</td>
|
||||
<td class="text-right">{{ number_format((float)($line['pinjaman'] ?? 0), 2) }}</td>
|
||||
<td>{{ $line['no_rujukan_bayaran'] ?? '-' }}</td>
|
||||
<td class="text-nowrap">
|
||||
@if(in_array($st, ['IN_BATCH', 'OPS_REVIEW'], true))
|
||||
<form method="post"
|
||||
action="{{ route('pembiayaan.online.operasi.approve', ['kodcaw' => $kodcaw, 'id' => $line['id']]) }}"
|
||||
class="d-inline"
|
||||
onsubmit="return confirm('Luluskan rekod {{ $line['norujukan'] ?? '' }}?');">
|
||||
@csrf
|
||||
<input type="hidden" name="batch_id" value="{{ $batch['id'] }}">
|
||||
<button type="submit" class="btn btn-success btn-sm">Lulus</button>
|
||||
</form>
|
||||
<button type="button"
|
||||
class="btn btn-danger btn-sm btn-reject"
|
||||
data-id="{{ $line['id'] }}"
|
||||
data-norujukan="{{ $line['norujukan'] ?? '' }}">
|
||||
Tolak
|
||||
</button>
|
||||
@elseif($st === 'APPROVED')
|
||||
<button type="button"
|
||||
class="btn btn-dark btn-sm btn-paid"
|
||||
data-id="{{ $line['id'] }}"
|
||||
data-norujukan="{{ $line['norujukan'] ?? '' }}">
|
||||
PAID + Bukti
|
||||
</button>
|
||||
<button type="button"
|
||||
class="btn btn-outline-danger btn-sm btn-reject"
|
||||
data-id="{{ $line['id'] }}"
|
||||
data-norujukan="{{ $line['norujukan'] ?? '' }}">
|
||||
Tolak
|
||||
</button>
|
||||
@elseif($st === 'PAID')
|
||||
<span class="text-muted small">Selesai</span>
|
||||
@else
|
||||
<span class="text-muted small">-</span>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="10">Tiada rekod dalam batch.</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Reject modal --}}
|
||||
<div class="modal fade" id="rejectModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<form method="post" id="rejectForm" action="">
|
||||
@csrf
|
||||
<input type="hidden" name="batch_id" value="{{ $batch['id'] }}">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Tolak Rekod — <span id="rejectNorujukan"></span></h5>
|
||||
<button type="button" class="close" data-dismiss="modal"><span>×</span></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<label>Sebab Tolak <span class="text-danger">*</span></label>
|
||||
<textarea name="reject_reason" id="rejectReason" class="form-control" rows="3" required
|
||||
placeholder="Contoh: No akaun tidak sepadan / dokumen tidak lengkap"></textarea>
|
||||
</div>
|
||||
<p class="small text-muted mb-0">Rekod akan dikembalikan ke queue PC untuk semakan semula.</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Batal</button>
|
||||
<button type="submit" class="btn btn-danger">Tolak</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Paid line modal --}}
|
||||
<div class="modal fade" id="paidModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<form method="post" id="paidForm" action="" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<input type="hidden" name="batch_id" value="{{ $batch['id'] }}">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Tanda PAID — <span id="paidNorujukan"></span></h5>
|
||||
<button type="button" class="close" data-dismiss="modal"><span>×</span></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<label>No. Rujukan Bayaran <span class="text-danger">*</span></label>
|
||||
<input type="text" name="no_rujukan_bayaran" class="form-control" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Tarikh Bayaran</label>
|
||||
<input type="date" name="tarikh_bayaran" class="form-control" value="{{ date('Y-m-d') }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Bukti Bayaran <span class="text-danger">*</span></label>
|
||||
<input type="file" name="bukti" class="form-control-file" accept=".pdf,.jpg,.jpeg,.png,.gif" required>
|
||||
<small class="text-muted">PDF / imej slip pindahan bank</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Batal</button>
|
||||
<button type="submit" class="btn btn-dark">Simpan PAID</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Paid batch modal --}}
|
||||
<div class="modal fade" id="paidBatchModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<form method="post"
|
||||
action="{{ route('pembiayaan.online.operasi.paid.batch', ['kodcaw' => $kodcaw, 'batchId' => $batch['id']]) }}"
|
||||
enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Tanda PAID Semua APPROVED ({{ $approvedCount }})</h5>
|
||||
<button type="button" class="close" data-dismiss="modal"><span>×</span></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p class="small text-muted">Satu no. rujukan + bukti akan diguna untuk semua rekod APPROVED dalam batch ini.</p>
|
||||
<div class="form-group">
|
||||
<label>No. Rujukan Bayaran <span class="text-danger">*</span></label>
|
||||
<input type="text" name="no_rujukan_bayaran" class="form-control" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Tarikh Bayaran</label>
|
||||
<input type="date" name="tarikh_bayaran" class="form-control" value="{{ date('Y-m-d') }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Bukti Bayaran <span class="text-danger">*</span></label>
|
||||
<input type="file" name="bukti" class="form-control-file" accept=".pdf,.jpg,.jpeg,.png,.gif" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Batal</button>
|
||||
<button type="submit" class="btn btn-dark">Simpan PAID Batch</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$('.btn-reject').on('click', function () {
|
||||
var id = $(this).data('id');
|
||||
$('#rejectForm').attr(
|
||||
'action',
|
||||
"{{ url('/pembiayaan-online/operasi/' . $kodcaw . '/lines') }}/" + id + "/reject"
|
||||
);
|
||||
$('#rejectNorujukan').text($(this).data('norujukan'));
|
||||
$('#rejectReason').val('');
|
||||
$('#rejectModal').modal('show');
|
||||
});
|
||||
|
||||
$('.btn-paid').on('click', function () {
|
||||
var id = $(this).data('id');
|
||||
$('#paidForm').attr(
|
||||
'action',
|
||||
"{{ url('/pembiayaan-online/operasi/' . $kodcaw . '/lines') }}/" + id + "/paid"
|
||||
);
|
||||
$('#paidNorujukan').text($(this).data('norujukan'));
|
||||
$('#paidModal').modal('show');
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,152 @@
|
||||
@extends('layouts.app_operasi')
|
||||
@section('content')
|
||||
<div class="container-fluid">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-12">
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb pb-3">
|
||||
<li class="breadcrumb-item"><a href="{{ route('home') }}">Home</a></li>
|
||||
<li class="breadcrumb-item"><a href="{{ route('pembiayaan.online.operasi') }}">Pembiayaan Online</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">EOD Modal Online</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
@if(session()->has('message'))
|
||||
<div class="alert alert-success">{{ session('message') }}</div>
|
||||
@endif
|
||||
@if(session()->has('error'))
|
||||
<div class="alert alert-danger">{{ session('error') }}</div>
|
||||
@endif
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-3">
|
||||
<div class="card"><div class="card-body text-center">
|
||||
<div class="text-muted">Tarikh</div>
|
||||
<h4 class="mb-0">{{ $tarikh }}</h4>
|
||||
</div></div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="card"><div class="card-body text-center">
|
||||
<div class="text-muted">Masih Dibuka</div>
|
||||
<h4 class="mb-0 text-warning">{{ $summary['open'] ?? 0 }}</h4>
|
||||
</div></div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="card"><div class="card-body text-center">
|
||||
<div class="text-muted">Sudah Ditutup</div>
|
||||
<h4 class="mb-0 text-success">{{ $summary['closed'] ?? 0 }}</h4>
|
||||
</div></div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="card"><div class="card-body text-center">
|
||||
<div class="text-muted">Belum Ada Rekod</div>
|
||||
<h4 class="mb-0 text-muted">{{ $summary['missing'] ?? 0 }}</h4>
|
||||
</div></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mb-3">
|
||||
<div class="card-body d-flex flex-wrap justify-content-between align-items-center">
|
||||
<form method="get" action="{{ route('pembiayaan.online.operasi.eod') }}" class="form-inline mb-2 mb-md-0">
|
||||
<label class="mr-2">Tarikh</label>
|
||||
<input type="date" name="tarikh" class="form-control mr-2" value="{{ $tarikh }}">
|
||||
<button type="submit" class="btn btn-primary">Tapis</button>
|
||||
<a href="{{ route('pembiayaan.online.operasi.topup') }}" class="btn btn-outline-secondary ml-2">Top-up</a>
|
||||
</form>
|
||||
@if(($summary['open'] ?? 0) > 0)
|
||||
<form method="post" action="{{ route('pembiayaan.online.operasi.eod.closeall') }}"
|
||||
onsubmit="return confirm('Tutup SEMUA modal online yang masih dibuka untuk {{ $tarikh }}?');">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-dark">Tutup Semua (EOD)</button>
|
||||
</form>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0">Status Modal Online Mengikut Cawangan</h5>
|
||||
</div>
|
||||
<div class="card-body table-responsive">
|
||||
<table class="table table-striped table-hover table-sm text-center">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th>Cawangan</th>
|
||||
<th>Had</th>
|
||||
<th>Tambah</th>
|
||||
<th>Digunakan</th>
|
||||
<th>Kurang (EOD)</th>
|
||||
<th>Baki</th>
|
||||
<th>Status</th>
|
||||
<th>Ditutup Oleh</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse($rows as $row)
|
||||
@php
|
||||
$closed = (int)($row['ditutup'] ?? 0) === 1;
|
||||
$missing = !empty($row['missing']);
|
||||
@endphp
|
||||
<tr class="{{ $closed ? '' : ($missing ? 'table-secondary' : 'table-warning') }}">
|
||||
<td class="text-left">
|
||||
<div>{{ $row['cawangan_nama'] ?? '-' }}</div>
|
||||
<small class="text-muted">{{ $row['kodcaw'] ?? '' }}</small>
|
||||
</td>
|
||||
<td class="text-right">{{ number_format((float)($row['had'] ?? 0), 2) }}</td>
|
||||
<td class="text-right">{{ number_format((float)($row['tambah'] ?? 0), 2) }}</td>
|
||||
<td class="text-right">{{ number_format((float)($row['digunakan'] ?? 0), 2) }}</td>
|
||||
<td class="text-right">{{ number_format((float)($row['kurang'] ?? 0), 2) }}</td>
|
||||
<td class="text-right">
|
||||
@if($missing)
|
||||
—
|
||||
@else
|
||||
{{ number_format((float)($row['baki'] ?? 0), 2) }}
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if($closed)
|
||||
<span class="badge badge-success">DITUTUP</span>
|
||||
@elseif($missing)
|
||||
<span class="badge badge-secondary">TIADA</span>
|
||||
@else
|
||||
<span class="badge badge-warning">DIBUKA</span>
|
||||
@endif
|
||||
</td>
|
||||
<td class="small">
|
||||
@if($closed)
|
||||
{{ $row['ditutup_oleh'] ?? '-' }}<br>
|
||||
{{ $row['ditutup_at'] ?? '' }}
|
||||
@else
|
||||
—
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if($closed)
|
||||
<span class="text-muted small">OK</span>
|
||||
@elseif($missing)
|
||||
<span class="text-muted small">Tiada had</span>
|
||||
@else
|
||||
<form method="post"
|
||||
action="{{ route('pembiayaan.online.operasi.eod.close', ['kodcaw' => $row['kodcaw']]) }}"
|
||||
class="d-inline"
|
||||
onsubmit="return confirm('Tutup modal online {{ $row['kodcaw'] }}?');">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-sm btn-dark">Tutup</button>
|
||||
</form>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="9">Tiada data cawangan.</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,102 @@
|
||||
@extends('layouts.app_operasi')
|
||||
@section('content')
|
||||
<div class="container-fluid">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-12">
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb pb-3">
|
||||
<li class="breadcrumb-item"><a href="{{ route('home') }}">Home</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">Pembiayaan Online — Operasi</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
@if(session()->has('message'))
|
||||
<div class="alert alert-success">{{ session('message') }}</div>
|
||||
@endif
|
||||
@if(session()->has('error'))
|
||||
<div class="alert alert-danger">{{ session('error') }}</div>
|
||||
@endif
|
||||
|
||||
<div class="card mb-3">
|
||||
<div class="card-body">
|
||||
<form method="get" action="{{ route('pembiayaan.online.operasi') }}" class="form-inline">
|
||||
<label class="mr-2">Status</label>
|
||||
<select name="status" class="form-control mr-3">
|
||||
@foreach(['SUBMITTED' => 'Menunggu (SUBMITTED)', 'PARTIAL' => 'Separa (PARTIAL)', 'OPS_DONE' => 'Selesai Lulus (OPS_DONE)', 'PAID' => 'Dibayar (PAID)', 'all' => 'Semua'] as $val => $label)
|
||||
<option value="{{ $val }}" {{ ($status ?? 'SUBMITTED') === $val ? 'selected' : '' }}>{{ $label }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<label class="mr-2">Tarikh</label>
|
||||
<input type="date" name="tarikh" class="form-control mr-3" value="{{ $tarikh ?? '' }}">
|
||||
<button type="submit" class="btn btn-primary">Tapis</button>
|
||||
<a href="{{ route('pembiayaan.online.operasi') }}" class="btn btn-secondary ml-2">Reset</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h5 class="mb-0">Senarai Batch Pembiayaan Online</h5>
|
||||
<div>
|
||||
<a href="{{ route('pembiayaan.online.operasi.topup') }}" class="btn btn-sm btn-warning">Modal Online</a>
|
||||
<a href="{{ route('pembiayaan.online.operasi.eod') }}" class="btn btn-sm btn-dark">EOD</a>
|
||||
<span class="text-muted ml-2">{{ count($batches) }} batch</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body table-responsive">
|
||||
<table class="table table-striped table-hover table-sm text-center">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th>Batch No</th>
|
||||
<th>Cawangan</th>
|
||||
<th>Tarikh</th>
|
||||
<th>Slot</th>
|
||||
<th>Bil</th>
|
||||
<th>Jumlah (RM)</th>
|
||||
<th>Status</th>
|
||||
<th>Dihantar Oleh</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse($batches as $batch)
|
||||
@php
|
||||
$st = $batch['status'] ?? '';
|
||||
$badge = 'badge-secondary';
|
||||
if ($st === 'SUBMITTED') $badge = 'badge-primary';
|
||||
elseif ($st === 'PARTIAL') $badge = 'badge-warning';
|
||||
elseif ($st === 'OPS_DONE') $badge = 'badge-success';
|
||||
elseif ($st === 'PAID') $badge = 'badge-dark';
|
||||
@endphp
|
||||
<tr>
|
||||
<td>{{ $batch['batch_no'] ?? '-' }}</td>
|
||||
<td class="text-left">
|
||||
<div>{{ $batch['cawangan_nama'] ?? '-' }}</div>
|
||||
<small class="text-muted">{{ $batch['kodcaw'] ?? '' }}</small>
|
||||
</td>
|
||||
<td>{{ $batch['tarikh'] ?? '-' }}</td>
|
||||
<td>{{ $batch['slot'] ?? '-' }}</td>
|
||||
<td>{{ $batch['bilangan'] ?? 0 }}</td>
|
||||
<td class="text-right">{{ number_format((float)($batch['jumlah_keseluruhan'] ?? 0), 2) }}</td>
|
||||
<td><span class="badge {{ $badge }}">{{ $st ?: '-' }}</span></td>
|
||||
<td>{{ $batch['pc_submitted_by'] ?? '-' }}</td>
|
||||
<td>
|
||||
<a class="btn btn-sm btn-info"
|
||||
href="{{ route('pembiayaan.online.operasi.batch', ['kodcaw' => $batch['kodcaw'], 'batchId' => $batch['id']]) }}">
|
||||
Semak
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="9">Tiada batch untuk tapisan ini.</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,198 @@
|
||||
@extends('layouts.app_operasi')
|
||||
@section('content')
|
||||
<div class="container-fluid">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-12">
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb pb-3">
|
||||
<li class="breadcrumb-item"><a href="{{ route('home') }}">Home</a></li>
|
||||
<li class="breadcrumb-item"><a href="{{ route('pembiayaan.online.operasi') }}">Pembiayaan Online</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">Tambah Modal Online</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
@if(session()->has('message'))
|
||||
<div class="alert alert-success">{{ session('message') }}</div>
|
||||
@endif
|
||||
@if(session()->has('error'))
|
||||
<div class="alert alert-danger">{{ session('error') }}</div>
|
||||
@endif
|
||||
|
||||
<div class="card mb-3">
|
||||
<div class="card-body">
|
||||
<form method="get" action="{{ route('pembiayaan.online.operasi.topup') }}" class="form-inline">
|
||||
<label class="mr-2">Status</label>
|
||||
<select name="status" class="form-control mr-3">
|
||||
<option value="PENDING" {{ ($status ?? 'PENDING') === 'PENDING' ? 'selected' : '' }}>PENDING</option>
|
||||
<option value="APPROVED" {{ ($status ?? '') === 'APPROVED' ? 'selected' : '' }}>APPROVED</option>
|
||||
<option value="REJECTED" {{ ($status ?? '') === 'REJECTED' ? 'selected' : '' }}>REJECTED</option>
|
||||
<option value="all" {{ ($status ?? '') === 'all' ? 'selected' : '' }}>Semua</option>
|
||||
</select>
|
||||
<label class="mr-2">Tarikh</label>
|
||||
<input type="date" name="tarikh" class="form-control mr-3" value="{{ $tarikh ?? '' }}">
|
||||
<button type="submit" class="btn btn-primary">Tapis</button>
|
||||
<a href="{{ route('pembiayaan.online.operasi.topup') }}" class="btn btn-secondary ml-2">Reset</a>
|
||||
<a href="{{ route('pembiayaan.online.operasi') }}" class="btn btn-outline-secondary ml-2">Batch Online</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h5 class="mb-0">Permohonan Had / Tambah Modal Online</h5>
|
||||
<span class="text-muted">{{ count($requests) }} rekod</span>
|
||||
</div>
|
||||
<div class="card-body table-responsive">
|
||||
<table class="table table-striped table-hover table-sm text-center">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Cawangan</th>
|
||||
<th>Tarikh</th>
|
||||
<th>Amaun (RM)</th>
|
||||
<th>Dimohon Oleh</th>
|
||||
<th>Status</th>
|
||||
<th>Nota</th>
|
||||
<th>Tindakan</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse($requests as $req)
|
||||
@php
|
||||
$st = $req['status'] ?? '';
|
||||
$badge = 'badge-secondary';
|
||||
if ($st === 'PENDING') $badge = 'badge-warning';
|
||||
elseif ($st === 'APPROVED') $badge = 'badge-success';
|
||||
elseif ($st === 'REJECTED') $badge = 'badge-danger';
|
||||
@endphp
|
||||
<tr>
|
||||
<td>{{ $req['id'] ?? '-' }}</td>
|
||||
<td class="text-left">
|
||||
<div>{{ $req['cawangan_nama'] ?? '-' }}</div>
|
||||
<small class="text-muted">{{ $req['kodcaw'] ?? '' }}</small>
|
||||
</td>
|
||||
<td>{{ $req['tarikh'] ?? '-' }}</td>
|
||||
<td class="text-right">{{ number_format((float)($req['amaun'] ?? 0), 2) }}</td>
|
||||
<td>{{ $req['dimohon_oleh'] ?? '-' }}</td>
|
||||
<td><span class="badge {{ $badge }}">{{ $st ?: '-' }}</span></td>
|
||||
<td class="text-left small">{{ $req['nota'] ?? '-' }}</td>
|
||||
<td class="text-nowrap">
|
||||
@if($st === 'PENDING')
|
||||
<button type="button"
|
||||
class="btn btn-success btn-sm btn-approve-topup"
|
||||
data-id="{{ $req['id'] }}"
|
||||
data-kodcaw="{{ $req['kodcaw'] ?? '' }}"
|
||||
data-cawangan="{{ $req['cawangan_nama'] ?? ($req['kodcaw'] ?? '') }}"
|
||||
data-amaun="{{ number_format((float)($req['amaun'] ?? 0), 2, '.', '') }}">
|
||||
Lulus
|
||||
</button>
|
||||
<button type="button"
|
||||
class="btn btn-danger btn-sm btn-reject-topup"
|
||||
data-id="{{ $req['id'] }}"
|
||||
data-kodcaw="{{ $req['kodcaw'] ?? '' }}"
|
||||
data-amaun="{{ number_format((float)($req['amaun'] ?? 0), 2) }}">
|
||||
Tolak
|
||||
</button>
|
||||
@else
|
||||
<small class="text-muted">{{ $req['diluluskan_oleh'] ?? '-' }}</small>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="8">Tiada permohonan untuk tapisan ini.</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="approveTopupModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<form method="post" id="approveTopupForm" action="">
|
||||
@csrf
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Lulus Permohonan Modal</h5>
|
||||
<button type="button" class="close" data-dismiss="modal"><span>×</span></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p class="mb-3">
|
||||
Cawangan: <b id="approveCawangan"></b>
|
||||
(<span id="approveKodcaw"></span>)<br>
|
||||
Amaun dimohon: RM <b id="approveAmaunDimohon"></b>
|
||||
</p>
|
||||
<div class="form-group">
|
||||
<label>Amaun diluluskan (RM) <span class="text-danger">*</span></label>
|
||||
<input type="number" name="amaun" id="approveAmaun" class="form-control"
|
||||
min="0.01" step="0.01" required>
|
||||
<small class="form-text text-muted">Boleh tukar amaun sebelum lulus.</small>
|
||||
</div>
|
||||
<div class="form-group mb-0">
|
||||
<label>Nota (pilihan)</label>
|
||||
<textarea name="nota" class="form-control" rows="3" placeholder="Catatan kelulusan"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Batal</button>
|
||||
<button type="submit" class="btn btn-success">Lulus</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="rejectTopupModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<form method="post" id="rejectTopupForm" action="">
|
||||
@csrf
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Tolak Permohonan Modal</h5>
|
||||
<button type="button" class="close" data-dismiss="modal"><span>×</span></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p class="mb-2">
|
||||
Cawangan: <b id="rejectKodcaw"></b><br>
|
||||
Amaun: RM <b id="rejectAmaun"></b>
|
||||
</p>
|
||||
<div class="form-group">
|
||||
<label>Nota (pilihan)</label>
|
||||
<textarea name="nota" class="form-control" rows="3" placeholder="Sebab tolak"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Batal</button>
|
||||
<button type="submit" class="btn btn-danger">Tolak</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$('.btn-approve-topup').on('click', function () {
|
||||
var id = $(this).data('id');
|
||||
var amaun = $(this).data('amaun');
|
||||
$('#approveTopupForm').attr('action', "{{ url('/pembiayaan-online/operasi/topup') }}/" + id + "/approve");
|
||||
$('#approveCawangan').text($(this).data('cawangan'));
|
||||
$('#approveKodcaw').text($(this).data('kodcaw'));
|
||||
$('#approveAmaunDimohon').text(Number(amaun).toLocaleString('en-MY', { minimumFractionDigits: 2, maximumFractionDigits: 2 }));
|
||||
$('#approveAmaun').val(amaun);
|
||||
$('#approveTopupForm textarea[name="nota"]').val('');
|
||||
$('#approveTopupModal').modal('show');
|
||||
});
|
||||
|
||||
$('.btn-reject-topup').on('click', function () {
|
||||
var id = $(this).data('id');
|
||||
$('#rejectTopupForm').attr('action', "{{ url('/pembiayaan-online/operasi/topup') }}/" + id + "/reject");
|
||||
$('#rejectKodcaw').text($(this).data('kodcaw'));
|
||||
$('#rejectAmaun').text($(this).data('amaun'));
|
||||
$('#rejectTopupModal').modal('show');
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,65 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="container-fluid">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-12">
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb pb-3">
|
||||
<li class="breadcrumb-item"><a href="{{ route('home') }}">Home</a></li>
|
||||
<li class="breadcrumb-item"><a href="{{ route('pembiayaan.online.pc') }}">Pembiayaan Online</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">Batch</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
<div class="card mb-3">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-md-3"><b>Batch No</b><br>{{ $batch['batch_no'] ?? '-' }}</div>
|
||||
<div class="col-md-2"><b>Tarikh</b><br>{{ $batch['tarikh'] ?? '-' }}</div>
|
||||
<div class="col-md-2"><b>Slot</b><br>{{ $batch['slot'] ?? '-' }}</div>
|
||||
<div class="col-md-2"><b>Status</b><br>{{ $batch['status'] ?? '-' }}</div>
|
||||
<div class="col-md-3"><b>Jumlah</b><br>RM {{ number_format((float)($batch['jumlah_keseluruhan'] ?? 0), 2) }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between">
|
||||
<h5 class="mb-0">Senarai Dalam Batch</h5>
|
||||
<a href="{{ route('pembiayaan.online.pc') }}" class="btn btn-secondary btn-sm">Kembali</a>
|
||||
</div>
|
||||
<div class="card-body table-responsive">
|
||||
<table class="table table-striped table-sm text-center">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th>Status</th>
|
||||
<th>SAG</th>
|
||||
<th>Pelanggan</th>
|
||||
<th>No KP</th>
|
||||
<th>Bank</th>
|
||||
<th>No Akaun</th>
|
||||
<th>Pinjaman (RM)</th>
|
||||
<th>Rujukan Bayaran</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($lines as $line)
|
||||
<tr>
|
||||
<td>{{ $line['status'] ?? '-' }}</td>
|
||||
<td>{{ $line['norujukan'] ?? '-' }}</td>
|
||||
<td class="text-left">{{ $line['nama_pelanggan'] ?? '-' }}</td>
|
||||
<td>{{ $line['nokp'] ?? '-' }}</td>
|
||||
<td>{{ $line['nama_bank'] ?? $line['kodbank'] ?? '-' }}</td>
|
||||
<td>{{ $line['noakaun'] ?? '-' }}</td>
|
||||
<td class="text-right">{{ number_format((float)($line['pinjaman'] ?? 0), 2) }}</td>
|
||||
<td>{{ $line['no_rujukan_bayaran'] ?? '-' }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,187 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="container-fluid">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-12">
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb pb-3">
|
||||
<li class="breadcrumb-item"><a href="{{ route('home') }}">Home</a></li>
|
||||
<li class="breadcrumb-item"><a href="{{ route('pembiayaan.online.pc') }}">Pembiayaan Online</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">Tally PAID</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
@if(session()->has('message'))
|
||||
<div class="alert alert-success">{{ session('message') }}</div>
|
||||
@endif
|
||||
@if(session()->has('error'))
|
||||
<div class="alert alert-danger">{{ session('error') }}</div>
|
||||
@endif
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-body text-center">
|
||||
<div class="text-muted">Bilangan PAID</div>
|
||||
<h4 class="mb-0">{{ $bilangan }} rekod</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-body text-center">
|
||||
<div class="text-muted">Jumlah Pinjaman</div>
|
||||
<h4 class="mb-0">RM {{ number_format((float) $jumlah, 2) }}</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-body text-center">
|
||||
<div class="text-muted">Tapisan</div>
|
||||
<h4 class="mb-0">
|
||||
@if(($blastFilter ?? '0') === '0') Belum Blast
|
||||
@elseif(($blastFilter ?? '') === '1') Sudah Blast
|
||||
@else Semua
|
||||
@endif
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mb-3">
|
||||
<div class="card-body">
|
||||
<form method="get" action="{{ route('pembiayaan.online.pc.paid') }}" class="form-inline">
|
||||
<label class="mr-2">Status Blast</label>
|
||||
<select name="blast_sent" class="form-control mr-3">
|
||||
<option value="0" {{ ($blastFilter ?? '0') === '0' ? 'selected' : '' }}>Belum blast / belum selesai semak</option>
|
||||
<option value="1" {{ ($blastFilter ?? '') === '1' ? 'selected' : '' }}>Sudah selesai</option>
|
||||
<option value="all" {{ ($blastFilter ?? '') === 'all' ? 'selected' : '' }}>Semua PAID</option>
|
||||
</select>
|
||||
<button type="submit" class="btn btn-primary">Tapis</button>
|
||||
<a href="{{ route('pembiayaan.online.pc') }}" class="btn btn-secondary ml-2">Kembali Queue</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center flex-wrap">
|
||||
<h5 class="mb-0">Senarai Pembiayaan Online — PAID</h5>
|
||||
<button type="button" class="btn btn-success btn-sm mt-2 mt-md-0" id="btnMarkBlast" disabled>
|
||||
Sahkan Tally / Selesai
|
||||
</button>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p class="small text-muted">
|
||||
Semak jumlah & bukti bayaran sepadan dengan pelanggan. Setelah semak, tanda selesai.
|
||||
(WhatsApp/SMS blast boleh disambung kemudian — butang ini menanda rekod sebagai selesai semak.)
|
||||
</p>
|
||||
<form id="formMarkBlast" method="post" action="{{ route('pembiayaan.online.pc.blast') }}">
|
||||
@csrf
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-hover table-sm text-center" id="paidTable">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th>
|
||||
@if(($blastFilter ?? '0') !== '1')
|
||||
<input type="checkbox" id="checkAll">
|
||||
@endif
|
||||
</th>
|
||||
<th>Blast</th>
|
||||
<th>SAG</th>
|
||||
<th>Pelanggan</th>
|
||||
<th>No KP</th>
|
||||
<th>Bank</th>
|
||||
<th>No Akaun</th>
|
||||
<th>Pinjaman (RM)</th>
|
||||
<th>Rujukan Bayaran</th>
|
||||
<th>Tarikh Bayaran</th>
|
||||
<th>Paid At</th>
|
||||
<th>Bukti</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse($lines as $line)
|
||||
@php $blasted = (int)($line['blast_sent'] ?? 0) === 1; @endphp
|
||||
<tr class="{{ $blasted ? '' : 'table-warning' }}">
|
||||
<td>
|
||||
@if(!$blasted)
|
||||
<input type="checkbox" class="row-check" name="ids[]" value="{{ $line['id'] }}">
|
||||
@else
|
||||
—
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if($blasted)
|
||||
<span class="badge badge-success">SELESAI</span>
|
||||
@else
|
||||
<span class="badge badge-warning">BELUM</span>
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $line['norujukan'] ?? '-' }}</td>
|
||||
<td class="text-left">{{ $line['nama_pelanggan'] ?? '-' }}</td>
|
||||
<td>{{ $line['nokp'] ?? '-' }}</td>
|
||||
<td>{{ $line['nama_bank'] ?? $line['kodbank'] ?? '-' }}</td>
|
||||
<td>{{ $line['noakaun'] ?? '-' }}</td>
|
||||
<td class="text-right">{{ number_format((float)($line['pinjaman'] ?? 0), 2) }}</td>
|
||||
<td>{{ $line['no_rujukan_bayaran'] ?? '-' }}</td>
|
||||
<td>{{ $line['tarikh_bayaran'] ?? '-' }}</td>
|
||||
<td class="small">{{ $line['paid_at'] ?? '-' }}</td>
|
||||
<td>
|
||||
@if(!empty($line['bukti_file_id']))
|
||||
<a class="btn btn-sm btn-info"
|
||||
href="{{ route('pembiayaan.online.pc.bukti', ['id' => $line['id']]) }}"
|
||||
target="_blank" rel="noopener">
|
||||
Lihat
|
||||
</a>
|
||||
@else
|
||||
<span class="text-muted small">Tiada</span>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="12">Tiada rekod PAID untuk tapisan ini.</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
@if(count($lines) > 0)
|
||||
<tfoot>
|
||||
<tr class="font-weight-bold">
|
||||
<td colspan="7" class="text-right">Jumlah dipaparkan</td>
|
||||
<td class="text-right">{{ number_format((float) $jumlah, 2) }}</td>
|
||||
<td colspan="4"></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
@endif
|
||||
</table>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function syncBlastButton() {
|
||||
var n = $('.row-check:checked').length;
|
||||
$('#btnMarkBlast').prop('disabled', n === 0);
|
||||
$('#btnMarkBlast').text(n ? ('Sahkan Tally / Selesai (' + n + ')') : 'Sahkan Tally / Selesai');
|
||||
}
|
||||
|
||||
$('#checkAll').on('change', function () {
|
||||
$('.row-check').prop('checked', this.checked);
|
||||
syncBlastButton();
|
||||
});
|
||||
|
||||
$(document).on('change', '.row-check', syncBlastButton);
|
||||
|
||||
$('#btnMarkBlast').on('click', function () {
|
||||
if ($('.row-check:checked').length === 0) return;
|
||||
if (!confirm('Sahkan tally untuk rekod dipilih? Rekod akan ditanda selesai semak/blast.')) return;
|
||||
$('#formMarkBlast').submit();
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,304 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="container-fluid">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-12">
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb pb-3">
|
||||
<li class="breadcrumb-item"><a href="{{ route('home') }}">Home</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">Pembiayaan Online</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
<div class="mb-3">
|
||||
<a href="{{ route('pembiayaan.online.pc.paid') }}" class="btn btn-success">
|
||||
Tally PAID / Blast
|
||||
</a>
|
||||
<a href="{{ route('pembiayaan.online.pc.topup') }}" class="btn btn-warning">
|
||||
Had / Modal Online
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@if(session()->has('message'))
|
||||
<div class="alert alert-success">{{ session('message') }}</div>
|
||||
@endif
|
||||
@if(session()->has('error'))
|
||||
<div class="alert alert-danger">{{ session('error') }}</div>
|
||||
@endif
|
||||
|
||||
@php
|
||||
$isMissing = !empty($modal['missing']);
|
||||
$isClosed = (int)($modal['ditutup'] ?? 0) === 1;
|
||||
$pendingReq = $modal['pending_request'] ?? null;
|
||||
if (is_object($pendingReq)) {
|
||||
$pendingReq = json_decode(json_encode($pendingReq), true);
|
||||
}
|
||||
@endphp
|
||||
|
||||
@if($isClosed)
|
||||
<div class="alert alert-dark">Modal online hari ini sudah ditutup (EOD).</div>
|
||||
@elseif($isMissing)
|
||||
<div class="alert alert-warning mb-3">
|
||||
Belum ada had modal online hari ini.
|
||||
@if($pendingReq)
|
||||
Permohonan RM {{ number_format((float)($pendingReq['amaun'] ?? 0), 2) }}
|
||||
daripada {{ $pendingReq['dimohon_oleh'] ?? '-' }} masih <b>PENDING</b>.
|
||||
@else
|
||||
Mohon had di
|
||||
<a href="{{ route('pembiayaan.online.pc.topup') }}">Had Modal Online</a>.
|
||||
@endif
|
||||
</div>
|
||||
@elseif($pendingReq)
|
||||
<div class="alert alert-info mb-3">
|
||||
Permohonan tambah RM {{ number_format((float)($pendingReq['amaun'] ?? 0), 2) }}
|
||||
daripada {{ $pendingReq['dimohon_oleh'] ?? '-' }} menunggu kelulusan Operasi.
|
||||
<a href="{{ route('pembiayaan.online.pc.topup') }}">Semak</a>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-body text-center">
|
||||
<div class="text-muted">Modal Online Hari Ini</div>
|
||||
<h4 class="mb-0">
|
||||
@if(!empty($modal['missing']))
|
||||
Belum ada had
|
||||
@else
|
||||
Baki RM {{ number_format((float)($modal['baki'] ?? 0), 2) }}
|
||||
@endif
|
||||
</h4>
|
||||
<small>
|
||||
@if(!empty($modal['missing']))
|
||||
Tunggu kelulusan Operasi
|
||||
@else
|
||||
Digunakan RM {{ number_format((float)($modal['digunakan'] ?? 0), 2) }}
|
||||
/ Had RM {{ number_format((float)($modal['had'] ?? 0) + (float)($modal['tambah'] ?? 0), 2) }}
|
||||
@endif
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-body text-center">
|
||||
<div class="text-muted">Queue PC</div>
|
||||
<h4 class="mb-0">{{ count($lines) }} rekod</h4>
|
||||
<small>Jumlah RM {{ number_format((float)($queue['jumlah'] ?? 0), 2) }}</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-body text-center">
|
||||
<div class="text-muted">Slot Cadangan</div>
|
||||
<h4 class="mb-0">{{ $slot['slot'] ?? '-' }}</h4>
|
||||
<small>{{ $slot['nota'] ?? '' }}</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mb-4">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h5 class="mb-0">Senarai Menunggu (PENDING / REJECTED)</h5>
|
||||
<button type="button" class="btn btn-primary" id="btnSubmitBatch" disabled>Hantar Batch ke Operasi</button>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form id="formSubmitBatch" method="post" action="{{ route('pembiayaan.online.pc.submit') }}">
|
||||
@csrf
|
||||
<input type="hidden" name="slot" value="{{ $slot['slot'] ?? 'BATCH1' }}">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-hover table-sm text-center" id="queueTable">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th><input type="checkbox" id="checkAll"></th>
|
||||
<th>Status</th>
|
||||
<th>SAG</th>
|
||||
<th>Pelanggan</th>
|
||||
<th>No KP</th>
|
||||
<th>Bank</th>
|
||||
<th>No Akaun</th>
|
||||
<th>Pinjaman (RM)</th>
|
||||
<th>Sebab Tolak</th>
|
||||
<th>Tindakan</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse($lines as $line)
|
||||
<tr class="{{ ($line['status'] ?? '') === 'REJECTED_PC' ? 'table-warning' : '' }}">
|
||||
<td>
|
||||
<input type="checkbox" class="row-check" name="ids[]" value="{{ $line['id'] }}">
|
||||
</td>
|
||||
<td>
|
||||
@if(($line['status'] ?? '') === 'REJECTED_PC')
|
||||
<span class="badge badge-danger">REJECTED</span>
|
||||
@else
|
||||
<span class="badge badge-secondary">PENDING</span>
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $line['norujukan'] ?? '-' }}</td>
|
||||
<td class="text-left">{{ $line['nama_pelanggan'] ?? '-' }}</td>
|
||||
<td>{{ $line['nokp'] ?? '-' }}</td>
|
||||
<td>{{ $line['nama_bank'] ?? $line['kodbank'] ?? '-' }}</td>
|
||||
<td>{{ $line['noakaun'] ?? '-' }}</td>
|
||||
<td class="text-right">{{ number_format((float)($line['pinjaman'] ?? 0), 2) }}</td>
|
||||
<td class="text-left small">{{ $line['reject_reason'] ?? '-' }}</td>
|
||||
<td>
|
||||
<button type="button" class="btn btn-sm btn-info btn-edit"
|
||||
data-id="{{ $line['id'] }}"
|
||||
data-kodbank="{{ $line['kodbank'] ?? '' }}"
|
||||
data-noakaun="{{ $line['noakaun'] ?? '' }}"
|
||||
data-namaakaun="{{ $line['nama_akaun'] ?? '' }}"
|
||||
data-namabank="{{ $line['nama_bank'] ?? '' }}"
|
||||
data-nota="{{ $line['nota'] ?? '' }}"
|
||||
data-norujukan="{{ $line['norujukan'] ?? '' }}">
|
||||
Edit
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="10">Tiada rekod dalam queue.</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0">Sejarah Batch</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-hover table-sm text-center">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th>Batch No</th>
|
||||
<th>Tarikh</th>
|
||||
<th>Slot</th>
|
||||
<th>Bil</th>
|
||||
<th>Jumlah (RM)</th>
|
||||
<th>Status</th>
|
||||
<th>Dihantar Oleh</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse($batches as $batch)
|
||||
<tr>
|
||||
<td>{{ $batch['batch_no'] ?? '-' }}</td>
|
||||
<td>{{ $batch['tarikh'] ?? '-' }}</td>
|
||||
<td>{{ $batch['slot'] ?? '-' }}</td>
|
||||
<td>{{ $batch['bilangan'] ?? 0 }}</td>
|
||||
<td class="text-right">{{ number_format((float)($batch['jumlah_keseluruhan'] ?? 0), 2) }}</td>
|
||||
<td><span class="badge badge-info">{{ $batch['status'] ?? '-' }}</span></td>
|
||||
<td>{{ $batch['pc_submitted_by'] ?? '-' }}</td>
|
||||
<td>
|
||||
<a class="btn btn-sm btn-secondary"
|
||||
href="{{ route('pembiayaan.online.pc.batch', ['batchId' => $batch['id']]) }}">
|
||||
Lihat
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="8">Belum ada batch.</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Edit modal --}}
|
||||
<div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<form method="post" id="editForm" action="">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Kemaskini Bank — <span id="editNorujukan"></span></h5>
|
||||
<button type="button" class="close" data-dismiss="modal"><span>×</span></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<label>Bank</label>
|
||||
<select name="kodbank" id="editKodbank" class="form-control" required>
|
||||
<option value="">-- Pilih Bank --</option>
|
||||
@foreach($banks as $bank)
|
||||
<option value="{{ $bank['abbreviation'] }}" data-nama="{{ $bank['name'] }}">
|
||||
{{ $bank['name'] }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<input type="hidden" name="nama_bank" id="editNamabank">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>No. Akaun</label>
|
||||
<input type="text" name="noakaun" id="editNoakaun" class="form-control" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Nama Akaun</label>
|
||||
<input type="text" name="nama_akaun" id="editNamaakaun" class="form-control">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Nota</label>
|
||||
<textarea name="nota" id="editNota" class="form-control" rows="2"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button>
|
||||
<button type="submit" class="btn btn-primary">Simpan</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function syncSubmitButton() {
|
||||
var n = $('.row-check:checked').length;
|
||||
$('#btnSubmitBatch').prop('disabled', n === 0);
|
||||
$('#btnSubmitBatch').text(n ? ('Hantar Batch ke Operasi (' + n + ')') : 'Hantar Batch ke Operasi');
|
||||
}
|
||||
|
||||
$('#checkAll').on('change', function () {
|
||||
$('.row-check').prop('checked', this.checked);
|
||||
syncSubmitButton();
|
||||
});
|
||||
|
||||
$(document).on('change', '.row-check', syncSubmitButton);
|
||||
|
||||
$('#btnSubmitBatch').on('click', function () {
|
||||
if ($('.row-check:checked').length === 0) return;
|
||||
if (!confirm('Hantar rekod dipilih ke Operasi?')) return;
|
||||
$('#formSubmitBatch').submit();
|
||||
});
|
||||
|
||||
$('.btn-edit').on('click', function () {
|
||||
var id = $(this).data('id');
|
||||
$('#editForm').attr('action', "{{ url('/pembiayaan-online/pc/lines') }}/" + id);
|
||||
$('#editNorujukan').text($(this).data('norujukan'));
|
||||
$('#editKodbank').val($(this).data('kodbank'));
|
||||
$('#editNoakaun').val($(this).data('noakaun'));
|
||||
$('#editNamaakaun').val($(this).data('namaakaun'));
|
||||
$('#editNamabank').val($(this).data('namabank'));
|
||||
$('#editNota').val($(this).data('nota'));
|
||||
$('#editModal').modal('show');
|
||||
});
|
||||
|
||||
$('#editKodbank').on('change', function () {
|
||||
$('#editNamabank').val($('#editKodbank option:selected').data('nama') || '');
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,215 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
@php
|
||||
$isClosed = (int)($modal['ditutup'] ?? 0) === 1;
|
||||
$isMissing = !empty($isMissing) || !empty($modal['missing']);
|
||||
$pendingRequest = $pendingRequest ?? ($modal['pending_request'] ?? null);
|
||||
@endphp
|
||||
<div class="container-fluid">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-12">
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb pb-3">
|
||||
<li class="breadcrumb-item"><a href="{{ route('home') }}">Home</a></li>
|
||||
<li class="breadcrumb-item"><a href="{{ route('pembiayaan.online.pc') }}">Pembiayaan Online</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">Had Modal Online</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
@if(session()->has('message'))
|
||||
<div class="alert alert-success">{{ session('message') }}</div>
|
||||
@endif
|
||||
@if(session()->has('error'))
|
||||
<div class="alert alert-danger">{{ session('error') }}</div>
|
||||
@endif
|
||||
|
||||
@if($isClosed)
|
||||
<div class="alert alert-dark">
|
||||
Modal online hari ini <b>sudah ditutup (EOD)</b>
|
||||
oleh {{ $modal['ditutup_oleh'] ?? '-' }}
|
||||
pada {{ $modal['ditutup_at'] ?? '-' }}.
|
||||
Esok PC perlu mohon had baru daripada Operasi.
|
||||
</div>
|
||||
@elseif($isMissing)
|
||||
<div class="alert alert-warning">
|
||||
Belum ada had modal online hari ini.
|
||||
Mohon amaun di bawah. Operasi akan luluskan permohonan.
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if($hasPending && $pendingRequest)
|
||||
<div class="alert alert-info">
|
||||
Permohonan PENDING RM {{ number_format((float)($pendingRequest['amaun'] ?? 0), 2) }}
|
||||
daripada {{ $pendingRequest['dimohon_oleh'] ?? '-' }}.
|
||||
Menunggu kelulusan Operasi.
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-3">
|
||||
<div class="card">
|
||||
<div class="card-body text-center">
|
||||
<div class="text-muted">Baki Hari Ini</div>
|
||||
<h4 class="mb-0">
|
||||
@if($isMissing)
|
||||
—
|
||||
@else
|
||||
RM {{ number_format((float)($modal['baki'] ?? 0), 2) }}
|
||||
@endif
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="card">
|
||||
<div class="card-body text-center">
|
||||
<div class="text-muted">Had Asas</div>
|
||||
<h4 class="mb-0">
|
||||
@if($isMissing)
|
||||
—
|
||||
@else
|
||||
RM {{ number_format((float)($modal['had'] ?? 0), 2) }}
|
||||
@endif
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="card">
|
||||
<div class="card-body text-center">
|
||||
<div class="text-muted">Tambah Diluluskan</div>
|
||||
<h4 class="mb-0">RM {{ number_format((float)($modal['tambah'] ?? 0), 2) }}</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="card">
|
||||
<div class="card-body text-center">
|
||||
<div class="text-muted">Digunakan</div>
|
||||
<h4 class="mb-0">RM {{ number_format((float)($modal['digunakan'] ?? 0), 2) }}</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-5 mb-3">
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0">{{ $isMissing ? 'Mohon Had Modal Online' : 'Mohon Tambah Modal Online' }}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@if($isClosed)
|
||||
<div class="alert alert-secondary mb-0">
|
||||
Tidak boleh mohon selepas EOD.
|
||||
</div>
|
||||
@else
|
||||
@if($hasPending)
|
||||
<div class="alert alert-warning">
|
||||
Masih ada permohonan <b>PENDING</b>. Tunggu kelulusan Operasi sebelum mohon lagi.
|
||||
</div>
|
||||
@endif
|
||||
<form method="post" action="{{ route('pembiayaan.online.pc.topup.request') }}">
|
||||
@csrf
|
||||
<div class="form-group">
|
||||
<label>Amaun (RM) <span class="text-danger">*</span></label>
|
||||
<input type="number" name="amaun" class="form-control" min="1" step="0.01"
|
||||
value="{{ old('amaun') }}" required {{ $hasPending ? 'disabled' : '' }}>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Nota</label>
|
||||
<textarea name="nota" class="form-control" rows="3"
|
||||
placeholder="{{ $isMissing ? 'Contoh: Had awal hari ini' : 'Contoh: Modal online hampir habis' }}"
|
||||
{{ $hasPending ? 'disabled' : '' }}>{{ old('nota') }}</textarea>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary" {{ $hasPending ? 'disabled' : '' }}>
|
||||
Hantar Permohonan
|
||||
</button>
|
||||
<a href="{{ route('pembiayaan.online.pc') }}" class="btn btn-secondary">Kembali</a>
|
||||
</form>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0">Tutup Modal Online (EOD)</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p class="small text-muted">
|
||||
Tutup hari ini: baki yang tidak digunakan akan dikembalikan,
|
||||
dan tiada lagi gadai online / permohonan untuk hari ini.
|
||||
Esok mohon had baru daripada Operasi.
|
||||
</p>
|
||||
@if($isClosed)
|
||||
<button type="button" class="btn btn-dark" disabled>Sudah Ditutup</button>
|
||||
@elseif($isMissing)
|
||||
<button type="button" class="btn btn-dark" disabled>Tiada rekod untuk ditutup</button>
|
||||
@else
|
||||
<form method="post" action="{{ route('pembiayaan.online.pc.topup.close') }}"
|
||||
onsubmit="return confirm('Tutup modal online hari ini? Baki RM {{ number_format((float)($modal['baki'] ?? 0), 2) }} akan dikembalikan.');">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-dark">Tutup Modal Online Hari Ini</button>
|
||||
</form>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-7 mb-3">
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center flex-wrap">
|
||||
<h5 class="mb-0">Permohonan PC</h5>
|
||||
<form method="get" class="form-inline mt-2 mt-md-0">
|
||||
<select name="status" class="form-control form-control-sm mr-2" onchange="this.form.submit()">
|
||||
<option value="all" {{ ($status ?? '') === 'all' || ($status ?? '') === '' ? 'selected' : '' }}>Semua</option>
|
||||
<option value="PENDING" {{ ($status ?? '') === 'PENDING' ? 'selected' : '' }}>PENDING</option>
|
||||
<option value="APPROVED" {{ ($status ?? '') === 'APPROVED' ? 'selected' : '' }}>APPROVED</option>
|
||||
<option value="REJECTED" {{ ($status ?? '') === 'REJECTED' ? 'selected' : '' }}>REJECTED</option>
|
||||
</select>
|
||||
</form>
|
||||
</div>
|
||||
<div class="card-body table-responsive">
|
||||
<table class="table table-striped table-sm text-center">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th>Tarikh</th>
|
||||
<th>Amaun (RM)</th>
|
||||
<th>Status</th>
|
||||
<th>Dimohon Oleh</th>
|
||||
<th>Diluluskan Oleh</th>
|
||||
<th>Nota</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse($requests as $req)
|
||||
@php
|
||||
$st = $req['status'] ?? '';
|
||||
$badge = 'badge-secondary';
|
||||
if ($st === 'PENDING') $badge = 'badge-warning';
|
||||
elseif ($st === 'APPROVED') $badge = 'badge-success';
|
||||
elseif ($st === 'REJECTED') $badge = 'badge-danger';
|
||||
@endphp
|
||||
<tr>
|
||||
<td>{{ $req['tarikh'] ?? '-' }}</td>
|
||||
<td class="text-right">{{ number_format((float)($req['amaun'] ?? 0), 2) }}</td>
|
||||
<td><span class="badge {{ $badge }}">{{ $st ?: '-' }}</span></td>
|
||||
<td>{{ $req['dimohon_oleh'] ?? '-' }}</td>
|
||||
<td>{{ $req['diluluskan_oleh'] ?? '-' }}</td>
|
||||
<td class="text-left small">{{ $req['nota'] ?? '-' }}</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="6">Belum ada permohonan.</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -634,7 +634,7 @@
|
||||
<tr>
|
||||
<td style="width:10px">(-) Rebat Untung</td>
|
||||
<td style="width:10px">: RM
|
||||
{{ number_format($keuntungan_rebate,2) }}
|
||||
{{ number_format($totalrebate['onepercent'], 2) }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -644,7 +644,7 @@
|
||||
<tr>
|
||||
<td style="width:10px">(-) Rebat Lain-Lain Caj</td>
|
||||
<td style="width:10px">: RM
|
||||
{{ number_format($ujrah_rebate, 2) }} </td>
|
||||
{{ number_format($totalrebate['ujrah'], 2) }} </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:10px">Jumlah Keuntungan + Lain-Lain Caj</td>
|
||||
@@ -867,7 +867,7 @@
|
||||
<tr>
|
||||
<td style="width:10px">(-) Rebat Untung</td>
|
||||
<td style="width:10px">: RM
|
||||
{{ number_format($keuntungan_rebate, 2) }}
|
||||
{{ number_format($totalrebate['onepercent'], 2) }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -877,7 +877,7 @@
|
||||
<tr>
|
||||
<td style="width:10px">(-) Rebat Lain-Lain Caj</td>
|
||||
<td style="width:10px">: RM
|
||||
{{ number_format($ujrah_rebate, 2) }} </td>
|
||||
{{ number_format($totalrebate['ujrah'], 2) }} </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:10px">Jumlah Keuntungan + Lain-Lain Caj</td>
|
||||
|
||||
@@ -172,6 +172,33 @@ Route::post('/khazanah/pendahuluanserahanHQ',['as'=>'khazanah.pendahuluanserahan
|
||||
Route::get('/penebusankhazanah/{norujukan}',['as'=>'penebusan.khazanah','uses' => 'PenebusanController@PenebusanKhazanah'])->middleware('auth','khazanah');
|
||||
Route::get('/lelongankhazanah/{norujukan}',['as'=>'lelongan.khazanah','uses' => 'KhazanahController@lelongan'])->middleware('auth','khazanah');
|
||||
Route::get('/permohonan',['as'=>'permohonan.index','uses' => 'KhazanahController@PaparanPermohonan'])->middleware('auth','khazanah');
|
||||
|
||||
// Pembiayaan Online — PC
|
||||
Route::get('/pembiayaan-online/pc',['as'=>'pembiayaan.online.pc','uses'=>'PembiayaanOnlineController@index'])->middleware('auth','khazanah');
|
||||
Route::put('/pembiayaan-online/pc/lines/{id}',['as'=>'pembiayaan.online.pc.update','uses'=>'PembiayaanOnlineController@updateLine'])->middleware('auth','khazanah');
|
||||
Route::post('/pembiayaan-online/pc/batches/submit',['as'=>'pembiayaan.online.pc.submit','uses'=>'PembiayaanOnlineController@submitBatch'])->middleware('auth','khazanah');
|
||||
Route::get('/pembiayaan-online/pc/batches/{batchId}',['as'=>'pembiayaan.online.pc.batch','uses'=>'PembiayaanOnlineController@showBatch'])->middleware('auth','khazanah');
|
||||
Route::get('/pembiayaan-online/pc/paid',['as'=>'pembiayaan.online.pc.paid','uses'=>'PembiayaanOnlineController@paidIndex'])->middleware('auth','khazanah');
|
||||
Route::get('/pembiayaan-online/pc/lines/{id}/bukti',['as'=>'pembiayaan.online.pc.bukti','uses'=>'PembiayaanOnlineController@viewBukti'])->middleware('auth','khazanah');
|
||||
Route::post('/pembiayaan-online/pc/paid/blast',['as'=>'pembiayaan.online.pc.blast','uses'=>'PembiayaanOnlineController@markBlast'])->middleware('auth','khazanah');
|
||||
Route::get('/pembiayaan-online/pc/topup',['as'=>'pembiayaan.online.pc.topup','uses'=>'PembiayaanOnlineController@topupIndex'])->middleware('auth','khazanah');
|
||||
Route::post('/pembiayaan-online/pc/topup',['as'=>'pembiayaan.online.pc.topup.request','uses'=>'PembiayaanOnlineController@topupRequest'])->middleware('auth','khazanah');
|
||||
Route::post('/pembiayaan-online/pc/topup/close',['as'=>'pembiayaan.online.pc.topup.close','uses'=>'PembiayaanOnlineController@closeModal'])->middleware('auth','khazanah');
|
||||
|
||||
// Pembiayaan Online — Operasi
|
||||
Route::get('/pembiayaan-online/operasi',['as'=>'pembiayaan.online.operasi','uses'=>'PembiayaanOnlineController@operasiIndex'])->middleware('auth','operasi');
|
||||
Route::get('/pembiayaan-online/operasi/topup',['as'=>'pembiayaan.online.operasi.topup','uses'=>'PembiayaanOnlineController@operasiTopupIndex'])->middleware('auth','operasi');
|
||||
Route::post('/pembiayaan-online/operasi/topup/{id}/approve',['as'=>'pembiayaan.online.operasi.topup.approve','uses'=>'PembiayaanOnlineController@operasiTopupApprove'])->middleware('auth','operasi');
|
||||
Route::post('/pembiayaan-online/operasi/topup/{id}/reject',['as'=>'pembiayaan.online.operasi.topup.reject','uses'=>'PembiayaanOnlineController@operasiTopupReject'])->middleware('auth','operasi');
|
||||
Route::get('/pembiayaan-online/operasi/eod',['as'=>'pembiayaan.online.operasi.eod','uses'=>'PembiayaanOnlineController@operasiEodIndex'])->middleware('auth','operasi');
|
||||
Route::post('/pembiayaan-online/operasi/eod/close-all',['as'=>'pembiayaan.online.operasi.eod.closeall','uses'=>'PembiayaanOnlineController@operasiCloseAllModal'])->middleware('auth','operasi');
|
||||
Route::post('/pembiayaan-online/operasi/eod/{kodcaw}/close',['as'=>'pembiayaan.online.operasi.eod.close','uses'=>'PembiayaanOnlineController@operasiCloseModal'])->middleware('auth','operasi');
|
||||
Route::get('/pembiayaan-online/operasi/{kodcaw}/batches/{batchId}',['as'=>'pembiayaan.online.operasi.batch','uses'=>'PembiayaanOnlineController@operasiShowBatch'])->middleware('auth','operasi');
|
||||
Route::post('/pembiayaan-online/operasi/{kodcaw}/lines/{id}/approve',['as'=>'pembiayaan.online.operasi.approve','uses'=>'PembiayaanOnlineController@operasiApproveLine'])->middleware('auth','operasi');
|
||||
Route::post('/pembiayaan-online/operasi/{kodcaw}/lines/{id}/reject',['as'=>'pembiayaan.online.operasi.reject','uses'=>'PembiayaanOnlineController@operasiRejectLine'])->middleware('auth','operasi');
|
||||
Route::post('/pembiayaan-online/operasi/{kodcaw}/batches/{batchId}/approve',['as'=>'pembiayaan.online.operasi.approve.batch','uses'=>'PembiayaanOnlineController@operasiApproveBatch'])->middleware('auth','operasi');
|
||||
Route::post('/pembiayaan-online/operasi/{kodcaw}/lines/{id}/paid',['as'=>'pembiayaan.online.operasi.paid','uses'=>'PembiayaanOnlineController@operasiMarkPaid'])->middleware('auth','operasi');
|
||||
Route::post('/pembiayaan-online/operasi/{kodcaw}/batches/{batchId}/paid',['as'=>'pembiayaan.online.operasi.paid.batch','uses'=>'PembiayaanOnlineController@operasiMarkPaidBatch'])->middleware('auth','operasi');
|
||||
Route::get('/permohonan/rekod',['as'=>'permohonan.rekod','uses' => 'KhazanahController@RekodPermohonan'])->middleware('auth','khazanah');
|
||||
Route::post('/permohonan/simpan',['as'=>'permohonan.simpan','uses' => 'KhazanahController@SimpanPermohonan'])->middleware('auth','khazanah');
|
||||
Route::get('/permohonan/status/{mohonid}',['as'=>'permohonan.status','uses' => 'KhazanahController@StatusPermohonan'])->middleware('auth','khazanah');
|
||||
@@ -356,6 +383,8 @@ Route::post('/barcodescanned',['as'=>'barcode.scanned','uses'=>'KhazanahControll
|
||||
Route::get('/operasi/kelulusan','OperasiController@kelulusan')->name('operasi.kelulusan')->middleware('auth','operasi');
|
||||
Route::get('/operasi/kelulusan/anggota','OperasiController@kelulusanAnggota')->name('operasi.kelulusananggota')->middleware('auth','operasi');
|
||||
Route::post('/operasi/createkelulusan',['as'=>'operasi.createkelulusan','uses'=>'OperasiController@createkelulusan'])->middleware('auth','teller');
|
||||
Route::post('/operasi/createkelulusan-by-khazanah',['as'=>'operasi.createkelulusan-by-khazanah','uses'=>'OperasiController@createkelulusanByKhazanah'])->middleware('auth','khazanah');
|
||||
Route::post('/operasi/createkelulusan-anggota',['as'=>'operasi.createkelulusan-anggota','uses'=>'OperasiController@createkelulusanAnggota'])->middleware('auth','teller');
|
||||
Route::get('/operasi/getkelulusan',['as'=>'operasi.getkelulusan','uses'=>'OperasiController@getkelulusan'])->middleware('auth','teller');
|
||||
Route::put('/operasi/updatekelulusan',['as'=>'operasi.updatekelulusan','uses'=>'OperasiController@updatekelulusan'])->middleware('auth','operasi');
|
||||
Route::put('/operasi/updatekelulusananggota',['as'=>'operasi.updatekelulusananggota','uses'=>'OperasiController@updatekelulusananggota'])->middleware('auth','operasi');
|
||||
|
||||
Reference in New Issue
Block a user