188 lines
10 KiB
PHP
188 lines
10 KiB
PHP
@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
|