- ActivityController: tambah default order `nomor_registrasi` desc; rapikan komentar & alur sorting - LaporanHasilPenilaianJaminanInternalExternalController: pencarian debitur case-insensitive via `LOWER(name)`; normalisasi angka LPJ (luas_tanah, nilai_bangunan, likuidasi, NPW); perapihan spacing - LaporanPenilaiJaminanController: validasi `start_date`/`end_date` dan buat nama file ekspor dinamis via `createNameLaporan`; gunakan `LaporanPenilaiJaminanExport($request)`; helper `getBranchId` - LaporanPenilaianJaminanController: standarisasi respons JSON datatables; tambah `export(Request)` dengan nama `laporan_penilaian_jaminan_<start>_<end>.xlsx` - NilaiPlafondController: bungkus proses datatables dalam transaksi DB (commit/rollback) dengan try/catch; tambah logging info/error; rapikan dan standarisasi respons JSON - PenilaiController: map data pembanding ke `pembanding1/2/3`; tambah `print_out_laporan` dan `showLaporanInspeksi` (penentuan route back); stub `showInspectionReportReview`; perapihan minor - Views debitur/components/debitur: perbaiki closing textarea, konsistensi event listener `function ()`, rapikan markup error - Views debitur/components/jaminan: fallback `dokumen_nomor[$index] ?? ''` untuk hindari undefined index - Views laporan/index: akses aman dengan optional chaining `?.`, fallback tanggal pada `formatDate`, akses `nilaiPlafond` aman - Views laporan-penilai-jaminan/index + show: JS toggle tab (Laporan vs Hasil Inspeksi), CSS `hidden-tab`, gaya floating button, perapihan - Views debitur/index: rapikan directive `@if` spacing pada tombol tambah - Views noc/penyelesaian: perbaiki route key ke `noc.datatables.penyelesaian`
315 lines
16 KiB
PHP
315 lines
16 KiB
PHP
@extends('layouts.main')
|
|
|
|
@section('breadcrumbs')
|
|
{{ Breadcrumbs::render('noc.penyelesaian') }}
|
|
@endsection
|
|
|
|
@section('content')
|
|
<div class="grid gap-5 mx-auto w-full lg:gap-7.5">
|
|
<div class="min-w-full border card border-agi-100 card-grid" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false" id="noc-table" data-api-url="{{ route('noc.datatables.penyelesaian') }}">
|
|
<div class="flex-wrap py-5 card-header bg-agi-50">
|
|
<h3 class="card-title">
|
|
Daftar NOC Penyelesaian
|
|
</h3>
|
|
<div class="flex flex-wrap gap-2 lg:gap-5">
|
|
<div class="flex">
|
|
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
|
|
<input placeholder="Search NOC Penyelesaian" id="search" type="text" value="">
|
|
</label>
|
|
</div>
|
|
<div class="flex flex-wrap gap-2.5">
|
|
<div class="flex">
|
|
<select id="jenis_penilaian_filter" class="select select-sm">
|
|
<option value="">Semua Jenis Penilaian</option>
|
|
@foreach ($jenisPenilaians as $jenisPenilaian)
|
|
<option value="{{ $jenisPenilaian->name }}">{{ $jenisPenilaian->name }}</option>
|
|
@endforeach
|
|
</select>
|
|
</div>
|
|
<div class="h-[24px] border border-r-gray-200"></div>
|
|
<a class="btn btn-sm btn-light" href="#"> Export to Excel </a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="card-body">
|
|
<div class="scrollable-x-auto">
|
|
<table class="table text-sm font-medium text-gray-700 align-middle table-auto table-border"
|
|
data-datatable-table="true">
|
|
<thead>
|
|
<tr>
|
|
<th class="w-14">
|
|
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox" />
|
|
</th>
|
|
<th class="min-w-[150px]" data-datatable-column="nomor_registrasi">
|
|
<span class="sort"> <span class="sort-label"> Nomor Registrasi </span>
|
|
<span class="sort-icon"> </span> </span>
|
|
</th>
|
|
<th class="min-w-[150px]" data-datatable-column="nomor_tiket">
|
|
<span class="sort"> <span class="sort-label"> Nomor Tiket </span>
|
|
<span class="sort-icon"> </span> </span>
|
|
</th>
|
|
<th class="min-w-[150px]" data-datatable-column="nama_debitur">
|
|
<span class="sort"> <span class="sort-label"> Nama Debitur </span>
|
|
<span class="sort-icon"> </span> </span>
|
|
</th>
|
|
<th class="min-w-[150px]" data-datatable-column="cabang">
|
|
<span class="sort"> <span class="sort-label"> Cabang </span>
|
|
<span class="sort-icon"> </span> </span>
|
|
</th>
|
|
<th class="min-w-[150px]" data-datatable-column="jenis_penilaian">
|
|
<span class="sort"> <span class="sort-label"> Jenis Penilaian </span>
|
|
<span class="sort-icon"> </span> </span>
|
|
</th>
|
|
<th class="min-w-[150px]" data-datatable-column="tanggal_setor">
|
|
<span class="sort"> <span class="sort-label"> Tanggal KSL </span>
|
|
<span class="sort-icon"> </span> </span>
|
|
</th>
|
|
<th class="min-w-[150px]" data-datatable-column="nominal_bayar">
|
|
<span class="sort"> <span class="sort-label"> Nominal bayar </span>
|
|
<span class="sort-icon"> </span> </span>
|
|
</th>
|
|
<th class="min-w-[150px]" data-datatable-column="bukti_bayar">
|
|
<span class="sort"> <span class="sort-label"> Bukti Bayar </span>
|
|
<span class="sort-icon"> </span> </span>
|
|
</th>
|
|
<th class="min-w-[150px]" data-datatable-column="nominal_diterima">
|
|
<span class="sort"> <span class="sort-label"> Nominal Diterima </span>
|
|
<span class="sort-icon"> </span> </span>
|
|
</th>
|
|
<th class="min-w-[150px]" data-datatable-column="bukti_ksl">
|
|
<span class="sort"> <span class="sort-label"> Bukti KSL </span>
|
|
<span class="sort-icon"> </span> </span>
|
|
</th>
|
|
<th class="min-w-[150px]" data-datatable-column="tanggal_pembayaran">
|
|
<span class="sort"> <span class="sort-label"> Tanggal Pembayaran </span>
|
|
<span class="sort-icon"> </span> </span>
|
|
</th>
|
|
<th class="min-w-[150px]" data-datatable-column="memo_penyelesaian">
|
|
<span class="sort"> <span class="sort-label"> Memo Penyelesaian </span>
|
|
<span class="sort-icon"> </span> </span>
|
|
</th>
|
|
<th class="min-w-[150px]" data-datatable-column="bukti_penyelesaian">
|
|
<span class="sort"> <span class="sort-label"> Bukti Penyelesaian </span>
|
|
<span class="sort-icon"> </span> </span>
|
|
</th>
|
|
<th class="min-w-[150px]" data-datatable-column="nominal_penyelesaian">
|
|
<span class="sort"> <span class="sort-label"> Nominal Penyelesaian </span>
|
|
<span class="sort-icon"> </span> </span>
|
|
</th>
|
|
<th class="min-w-[150px]" data-datatable-column="tanggal_penyelesaian">
|
|
<span class="sort"> <span class="sort-label"> Tanggal Penyelesaian </span>
|
|
<span class="sort-icon"> </span> </span>
|
|
</th>
|
|
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
|
|
</tr>
|
|
</thead>
|
|
</table>
|
|
</div>
|
|
<!-- Table Footer untuk Total -->
|
|
<div class="px-5 py-3 bg-gray-50 border-t border-gray-200">
|
|
<div class="flex justify-end items-center">
|
|
<div class="text-sm font-semibold text-gray-700">
|
|
Total Nominal Diterima: <span id="total-nominal-diterima"
|
|
class="text-lg font-bold text-green-600">Rp 0</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div
|
|
class="flex-col gap-3 justify-center font-medium text-gray-600 card-footer md:justify-between md:flex-row text-2sm">
|
|
<div class="flex gap-2 items-center">
|
|
Show
|
|
<select class="w-16 select select-sm" data-datatable-size="true" name="perpage"> </select> per
|
|
page
|
|
</div>
|
|
<div class="flex gap-4 items-center">
|
|
<span data-datatable-info="true"> </span>
|
|
<div class="pagination" data-datatable-pagination="true">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endsection
|
|
|
|
@push('scripts')
|
|
<script type="text/javascript">
|
|
function prosesData(data) {
|
|
Swal.fire({
|
|
title: 'NOC Penyelesaian',
|
|
text: "Apakah Anda yakin ingin menyetujui penyelesaian ini?",
|
|
icon: 'info',
|
|
showCancelButton: true,
|
|
confirmButtonColor: '#3085d6',
|
|
cancelButtonColor: '#d33',
|
|
confirmButtonText: 'Ya',
|
|
cancelButtonText: 'Tidak'
|
|
}).then((result) => {
|
|
if (result.isConfirmed) {
|
|
window.location.href = `noc/${data}/edit`;
|
|
}
|
|
})
|
|
}
|
|
</script>
|
|
|
|
<script type="module">
|
|
const element = document.querySelector('#noc-table');
|
|
const searchInput = document.getElementById('search');
|
|
const jenisPenilaianFilter = document.getElementById('jenis_penilaian_filter');
|
|
|
|
const apiUrl = element.getAttribute('data-api-url');
|
|
const dataTableOptions = {
|
|
apiEndpoint: apiUrl,
|
|
pageSize: 5,
|
|
columns: {
|
|
select: {
|
|
render: (item, data, context) => {
|
|
const checkbox = document.createElement('input');
|
|
checkbox.className = 'checkbox checkbox-sm';
|
|
checkbox.type = 'checkbox';
|
|
checkbox.value = data.id.toString();
|
|
checkbox.setAttribute('data-datatable-row-check', 'true');
|
|
return checkbox.outerHTML.trim();
|
|
},
|
|
},
|
|
nomor_registrasi: {
|
|
title: 'Nomor Registrasi'
|
|
},
|
|
nomor_tiket: {
|
|
title: 'Nomor Tiket',
|
|
},
|
|
nama_debitur: {
|
|
title: 'Nama Debitur',
|
|
},
|
|
cabang: {
|
|
title: 'Cabang',
|
|
render: (item, data) => {
|
|
return data.kode_cabang + ' - ' + data.cabang;
|
|
}
|
|
},
|
|
jenis_penilaian: {
|
|
title: 'Jenis Penilaian'
|
|
},
|
|
tanggal_setor: {
|
|
title: 'Tanggal Setor',
|
|
},
|
|
nominal_bayar: {
|
|
title: 'Nominal Bayar',
|
|
},
|
|
bukti_bayar: {
|
|
title: 'Bukti KSL',
|
|
render: (item, data) => {
|
|
if (data.bukti_bayar) {
|
|
return `<a href="storage/${data.bukti_bayar}" download="storage/${data.bukti_bayar}" target="_blank" class="badge badge-sm badge-outline">
|
|
Download <i class="ki-filled ki-cloud-download"></i>
|
|
</a>`;
|
|
} else {
|
|
return '-';
|
|
}
|
|
},
|
|
},
|
|
nominal_diterima: {
|
|
title: 'Nominal Diterima',
|
|
},
|
|
bukti_ksl: {
|
|
title: 'Bukti KSL',
|
|
render: (item, data) => {
|
|
if (data.bukti_ksl) {
|
|
return `<a href="storage/${data.bukti_ksl}" download="storage/${data.bukti_ksl}" target="_blank" class="badge badge-sm badge-outline">
|
|
Download <i class="ki-filled ki-cloud-download"></i>
|
|
</a>`;
|
|
} else {
|
|
return '-';
|
|
}
|
|
},
|
|
},
|
|
tanggal_pembayaran: {
|
|
title: 'Tanggal Pembayaran',
|
|
},
|
|
memo_penyelesaian: {
|
|
title: 'Memo Penyelesaian',
|
|
render: (item, data) => {
|
|
if (data.memo_penyelesaian) {
|
|
return `<a href="storage/${data.memo_penyelesaian}" download="storage/${data.memo_penyelesaian}" target="_blank" class="badge badge-sm badge-outline">
|
|
Download <i class="ki-filled ki-cloud-download"></i>
|
|
</a>`;
|
|
} else {
|
|
return '-';
|
|
}
|
|
},
|
|
},
|
|
bukti_penyelesaian: {
|
|
title: 'Bukti Penyelesaian',
|
|
render: (item, data) => {
|
|
if (data.bukti_penyelesaian) {
|
|
return `<a href="storage/${data.bukti_penyelesaian}" download="storage/${data.bukti_penyelesaian}" target="_blank" class="badge badge-sm badge-outline">
|
|
Download <i class="ki-filled ki-cloud-download"></i>
|
|
</a>`;
|
|
} else {
|
|
return '-';
|
|
}
|
|
},
|
|
},
|
|
nominal_penyelesaian: {
|
|
title: 'Nominal Penyelesaian',
|
|
},
|
|
tanggal_penyelesaian: {
|
|
title: 'Tanggal Penyelesaian',
|
|
},
|
|
actions: {
|
|
title: 'Action',
|
|
render: (item, data) => {
|
|
return `<div class="flex flex-nowrap justify-center">
|
|
<a class="btn btn-sm btn-outline btn-info" onclick="prosesData(${data.id})">
|
|
<i class="ki-filled ki-double-check"></i>
|
|
</a>
|
|
</div>`;
|
|
},
|
|
}
|
|
},
|
|
};
|
|
|
|
let dataTable = new KTDataTable(element, dataTableOptions);
|
|
// Custom search functionality
|
|
searchInput.addEventListener('input', function() {
|
|
const searchValue = this.value.trim();
|
|
dataTable.search(searchValue, true);
|
|
});
|
|
|
|
// Filter berdasarkan jenis penilaian
|
|
jenisPenilaianFilter.addEventListener('change', function() {
|
|
const filterValue = this.value.trim();
|
|
if (filterValue === '') {
|
|
dataTable.search('', true); // Reset filter
|
|
} else {
|
|
dataTable.search(filterValue, true);
|
|
}
|
|
});
|
|
|
|
/**
|
|
* Update total nominal diterima dari response backend
|
|
* @param {number} total - Total nominal diterima dari backend
|
|
*/
|
|
function updateTotalNominalDiterima(total) {
|
|
// Format dan tampilkan total
|
|
const formattedTotal = new Intl.NumberFormat('id-ID', {
|
|
style: 'currency',
|
|
currency: 'IDR',
|
|
minimumFractionDigits: 0
|
|
}).format(total || 0);
|
|
|
|
document.getElementById('total-nominal-diterima').textContent = formattedTotal;
|
|
}
|
|
|
|
// Event listener untuk update total saat data berubah
|
|
dataTable.on('fetched', function(e, response) {
|
|
// Ambil total dari response backend
|
|
console.log(e.response);
|
|
if (e.response && e.response.totalNominalDiterima !== undefined) {
|
|
updateTotalNominalDiterima(e.response.totalNominalDiterima);
|
|
}
|
|
});
|
|
</script>
|
|
@endpush
|