✨ feat(lpj): Perbaiki ekspor, pencarian, validasi tanggal, transaksi, logging, dan UI
- 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`
This commit is contained in:
@@ -306,6 +306,7 @@ class ActivityController extends Controller
|
|||||||
$query = Permohonan::query();
|
$query = Permohonan::query();
|
||||||
|
|
||||||
// Apply search filter if provided
|
// Apply search filter if provided
|
||||||
|
$query = $query->orderBy('nomor_registrasi', 'desc');
|
||||||
if ($request->has('search') && !empty($request->get('search'))) {
|
if ($request->has('search') && !empty($request->get('search'))) {
|
||||||
$search = $request->get('search');
|
$search = $request->get('search');
|
||||||
$query->where(function ($q) use ($search) {
|
$query->where(function ($q) use ($search) {
|
||||||
@@ -324,7 +325,9 @@ class ActivityController extends Controller
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Default sorting if no sort provided
|
|
||||||
|
|
||||||
|
// Apply sorting if provided
|
||||||
if ($request->has('sortOrder') && !empty($request->get('sortOrder'))) {
|
if ($request->has('sortOrder') && !empty($request->get('sortOrder'))) {
|
||||||
$order = $request->get('sortOrder');
|
$order = $request->get('sortOrder');
|
||||||
$column = $request->get('sortField');
|
$column = $request->get('sortField');
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
use Maatwebsite\Excel\Facades\Excel;
|
use Maatwebsite\Excel\Facades\Excel;
|
||||||
use Modules\Lpj\Exports\LaporanHasilPenilaianJaminanInternalExternalExport;
|
use Modules\Lpj\Exports\LaporanHasilPenilaianJaminanInternalExternalExport;
|
||||||
use Modules\Lpj\Models\Permohonan;
|
use Modules\Lpj\Models\Permohonan;
|
||||||
@@ -60,6 +61,7 @@
|
|||||||
$q->orWhereRelation('user', 'name', 'LIKE', '%' . $search->search . '%');
|
$q->orWhereRelation('user', 'name', 'LIKE', '%' . $search->search . '%');
|
||||||
$q->orWhereRelation('tujuanPenilaian', 'name', 'LIKE', '%' . $search->search . '%');
|
$q->orWhereRelation('tujuanPenilaian', 'name', 'LIKE', '%' . $search->search . '%');
|
||||||
$q->orWhereRelation('branch', 'name', 'LIKE', '%' . $search->search . '%');
|
$q->orWhereRelation('branch', 'name', 'LIKE', '%' . $search->search . '%');
|
||||||
|
$q->orWhereRelation('debiture', DB::raw('LOWER(name)'), 'LIKE', '%' . strtolower($search->search) . '%');
|
||||||
$q->orWhereRelation('jenisFasilitasKredit', 'name', 'LIKE', '%' . $search->search . '%');
|
$q->orWhereRelation('jenisFasilitasKredit', 'name', 'LIKE', '%' . $search->search . '%');
|
||||||
$q->orWhereRelation('jenisPenilaian', 'name', 'LIKE', '%' . $search->search . '%');
|
$q->orWhereRelation('jenisPenilaian', 'name', 'LIKE', '%' . $search->search . '%');
|
||||||
$q->orWhere('status', 'LIKE', '%' . $search->search . '%');
|
$q->orWhere('status', 'LIKE', '%' . $search->search . '%');
|
||||||
|
|||||||
@@ -9,6 +9,10 @@ use Modules\Lpj\Models\Permohonan;
|
|||||||
use Modules\Lpj\Models\StatusPermohonan;
|
use Modules\Lpj\Models\StatusPermohonan;
|
||||||
use Modules\Lpj\Exports\LaporanPenilaiJaminanExport;
|
use Modules\Lpj\Exports\LaporanPenilaiJaminanExport;
|
||||||
use Maatwebsite\Excel\Facades\Excel;
|
use Maatwebsite\Excel\Facades\Excel;
|
||||||
|
use Modules\Lpj\Models\Branch;
|
||||||
|
use Modules\Lpj\Services\PreviewLaporanService;
|
||||||
|
use Modules\Lpj\Models\Inspeksi;
|
||||||
|
use Modules\Lpj\Models\Penilai;
|
||||||
|
|
||||||
class LaporanPenilaiJaminanController extends Controller
|
class LaporanPenilaiJaminanController extends Controller
|
||||||
{
|
{
|
||||||
@@ -16,59 +20,31 @@ class LaporanPenilaiJaminanController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Display a listing of the resource.
|
* Display a listing of the resource.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
protected $previewLaporanService;
|
||||||
|
|
||||||
|
public function __construct(PreviewLaporanService $previewLaporanService)
|
||||||
|
{
|
||||||
|
$this->previewLaporanService = $previewLaporanService;
|
||||||
|
}
|
||||||
|
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
$status_permohonan = StatusPermohonan::all();
|
$status_permohonan = StatusPermohonan::all();
|
||||||
return view('lpj::laporan-penilai-jaminan.index', compact('status_permohonan'));
|
return view('lpj::laporan-penilai-jaminan.index', compact('status_permohonan'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Show the form for creating a new resource.
|
|
||||||
*/
|
|
||||||
public function create()
|
|
||||||
{
|
|
||||||
return view('lpj::create');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Store a newly created resource in storage.
|
|
||||||
*/
|
|
||||||
public function store(Request $request)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show the specified resource.
|
* Show the specified resource.
|
||||||
*/
|
*/
|
||||||
public function show($id)
|
public function show($permohonan_id, $dokumen_id, $jaminan_id)
|
||||||
{
|
{
|
||||||
return view('lpj::laporan-penilai-jaminan.show');
|
$back = route('laporan-penilai-jaminan.index');
|
||||||
|
return $this->previewLaporanService->previewLaporan($permohonan_id, $dokumen_id, $jaminan_id, $back);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Show the form for editing the specified resource.
|
|
||||||
*/
|
|
||||||
public function edit($id)
|
|
||||||
{
|
|
||||||
return view('lpj::edit');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Update the specified resource in storage.
|
|
||||||
*/
|
|
||||||
public function update(Request $request, $id)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Remove the specified resource from storage.
|
|
||||||
*/
|
|
||||||
public function destroy($id)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
public function dataForDatatables(Request $request)
|
public function dataForDatatables(Request $request)
|
||||||
{
|
{
|
||||||
@@ -93,91 +69,104 @@ class LaporanPenilaiJaminanController extends Controller
|
|||||||
// dd($startDate);
|
// dd($startDate);
|
||||||
// Retrieve data from the database
|
// Retrieve data from the database
|
||||||
$query = Permohonan::query();
|
$query = Permohonan::query();
|
||||||
|
$query = $query->where('status', 'done')->orderBy('tanggal_permohonan', 'desc');
|
||||||
// Apply search filter if provided
|
// Apply search filter if provided
|
||||||
if ($request->has('search') && !empty($request->get('search'))) {
|
if ($request->has('search') && !empty($request->get('search'))) {
|
||||||
$search = $request->get('search');
|
$search = json_decode($request->get('search'));
|
||||||
$paramsSearch = json_decode($search);
|
|
||||||
|
if (!empty($search->start_date) || !empty($search->end_date)) {
|
||||||
|
$startDate = $search->start_date ?? '1900-01-01';
|
||||||
|
$endDate = $search->end_date ?? now()->toDateString();
|
||||||
|
|
||||||
|
$query->where(function ($q) use ($startDate, $endDate) {
|
||||||
|
|
||||||
|
$q->whereHas('penilaian', function ($q2) use ($startDate, $endDate) {
|
||||||
|
$q2->whereBetween('tanggal_kunjungan', [$startDate, $endDate]);
|
||||||
|
});
|
||||||
|
|
||||||
|
// OR check if has penawaran with date in range
|
||||||
|
$q->orWhereHas('penawaran', function ($q3) use ($startDate, $endDate) {
|
||||||
|
$q3->whereBetween('tanggal_penilaian_sebelumnya', [$startDate, $endDate]);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
$query->where(function ($q) use ($search) {
|
|
||||||
$q->where('nomor_registrasi', 'LIKE', '%' . $search . '%')
|
|
||||||
->orWhere('tanggal_permohonan', 'LIKE', '%' . $search . '%')
|
|
||||||
->orWhereRelation('user', 'name', 'LIKE', '%' . $search . '%')
|
|
||||||
->orWhereRelation('debiture', 'name', 'LIKE', '%' . $search . '%')
|
|
||||||
->orWhereRelation('tujuanPenilaian', 'name', 'LIKE', '%' . $search . '%')
|
|
||||||
->orWhereRelation('branch', 'name', 'LIKE', '%' . $search . '%');
|
|
||||||
|
|
||||||
if (!empty($paramsSearch->tanggal_awal) && !empty($paramsSearch->tanggal_akhir)) {
|
|
||||||
$q->whereBetween('tanggal_permohonan', [$paramsSearch->tanggal_awal, $paramsSearch->tanggal_akhir]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$statusKeywords = explode(',', $search);
|
if (isset($search->branch_id) && !empty($search->branch_id)) {
|
||||||
foreach ($statusKeywords as $keyword) {
|
$query->where('branch_id', $search->branch_id);
|
||||||
$q->orWhereRelation('penilai', 'type_penilai', 'LIKE', '%' . trim($keyword) . '%');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($search->laporan) && is_array($search->laporan) && !empty($search->laporan)) {
|
||||||
|
foreach ($search->laporan as $type) {
|
||||||
|
$query->whereHas('penilai', function ($q) use ($type) {
|
||||||
|
$q->where('type_penilai', 'LIKE', '%' . $type . '%');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
$query->where('status', 'done');
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// dd($search->search);
|
||||||
|
|
||||||
// Default sorting if no sort provided
|
if (isset($search->search)) {
|
||||||
|
|
||||||
|
$query->where(function ($q) use ($search) {
|
||||||
|
$q->where('nomor_registrasi', 'LIKE', '%' . $search->search . '%');
|
||||||
|
$q->orWhere('tanggal_permohonan', 'LIKE', '%' . $search->search . '%');
|
||||||
|
$q->orWhereRelation('user', 'name', 'LIKE', '%' . $search->search . '%');
|
||||||
|
$q->orWhereRelation('tujuanPenilaian', 'name', 'LIKE', '%' . $search->search . '%');
|
||||||
|
$q->orWhereRelation('branch', 'name', 'LIKE', '%' . $search->search . '%');
|
||||||
|
$q->orWhereRelation('debiture', DB::raw('LOWER(name)'), 'LIKE', '%' . strtolower($search->search) . '%');
|
||||||
|
|
||||||
|
$q->orWhereRelation('jenisFasilitasKredit', 'name', 'LIKE', '%' . $search->search . '%');
|
||||||
|
$q->orWhereRelation('jenisPenilaian', 'name', 'LIKE', '%' . $search->search . '%');
|
||||||
|
$q->orWhere('status', 'LIKE', '%' . $search->search . '%');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Apply sorting if provided
|
||||||
if ($request->has('sortOrder') && !empty($request->get('sortOrder'))) {
|
if ($request->has('sortOrder') && !empty($request->get('sortOrder'))) {
|
||||||
$order = $request->get('sortOrder');
|
$order = $request->get('sortOrder');
|
||||||
$column = $request->get('sortField');
|
$column = $request->get('sortField');
|
||||||
$query->orderBy($column, $order);
|
$query->orderBy($column, $order);
|
||||||
} else {
|
|
||||||
$query->orderBy('nomor_registrasi', 'asc');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get total count of records before pagination
|
|
||||||
|
// Get the total count of records
|
||||||
$totalRecords = $query->count();
|
$totalRecords = $query->count();
|
||||||
|
|
||||||
// Pagination
|
// Apply pagination if provided
|
||||||
if ($request->has('page') && $request->has('size')) {
|
if ($request->has('page') && $request->has('size')) {
|
||||||
$page = (int) $request->get('page', 1);
|
$page = $request->get('page');
|
||||||
$size = (int) $request->get('size', 10);
|
$size = $request->get('size');
|
||||||
$offset = ($page - 1) * $size;
|
$offset = ($page - 1) * $size; // Calculate the offset
|
||||||
|
|
||||||
$query->skip($offset)->take($size);
|
$query->skip($offset)->take($size);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get filtered count
|
// Get the filtered count of records
|
||||||
$filteredRecords = $query->count();
|
$filteredRecords = $query->count();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$totalRecords = $query->count();
|
|
||||||
|
|
||||||
// Pagination
|
|
||||||
if ($request->has('page') && $request->has('size')) {
|
|
||||||
$page = (int) $request->get('page', 1);
|
|
||||||
$size = (int) $request->get('size', 10);
|
|
||||||
$offset = ($page - 1) * $size;
|
|
||||||
$query->skip($offset)->take($size);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get filtered count
|
|
||||||
$filteredRecords = $query->count();
|
|
||||||
|
|
||||||
// Get data with necessary relationships
|
// Get data with necessary relationships
|
||||||
$data = $query->with(['user', 'debiture', 'branch', 'tujuanPenilaian', 'penilaian', 'dokumenjaminan.jenisJaminan','nilaiPlafond', 'penilai'])->get();
|
$data = $query->with(['user', 'debiture', 'branch', 'tujuanPenilaian', 'penilaian', 'dokumenjaminan.jenisJaminan','nilaiPlafond', 'penilai', 'dokumenjaminan.inspeksi'])->get();
|
||||||
|
|
||||||
// Calculate total pages
|
// Calculate the page count
|
||||||
$pageCount = ceil($totalRecords / $request->get('size', 10));
|
$pageCount = ceil($totalRecords / $size);
|
||||||
|
|
||||||
|
// Calculate the current page number
|
||||||
|
$currentPage = max(1, $request->get('page', 1));
|
||||||
|
|
||||||
|
// Return the response data as a JSON object
|
||||||
|
|
||||||
// Calculate total pages
|
|
||||||
$pageCount = ceil($totalRecords / $request->get('size', 10));
|
|
||||||
|
|
||||||
return response()->json([
|
return response()->json([
|
||||||
'draw' => $request->get('draw'),
|
'draw' => $request->get('draw'),
|
||||||
'recordsTotal' => $totalRecords,
|
'recordsTotal' => $totalRecords,
|
||||||
'recordsFiltered' => $filteredRecords,
|
'recordsFiltered' => $filteredRecords,
|
||||||
'pageCount' => $pageCount,
|
'pageCount' => $pageCount,
|
||||||
'page' => $request->get('page', 1),
|
'page' => $currentPage,
|
||||||
'totalCount' => $totalRecords,
|
'totalCount' => $totalRecords,
|
||||||
'data' => $data,
|
'data' => $data,
|
||||||
]);
|
]);
|
||||||
@@ -185,15 +174,53 @@ class LaporanPenilaiJaminanController extends Controller
|
|||||||
|
|
||||||
public function export(Request $request)
|
public function export(Request $request)
|
||||||
{
|
{
|
||||||
$tanggalAwal = $request->input('tanggal_awal');
|
$startDate = $request->input('start_date');
|
||||||
$tanggalAkhir = $request->input('tanggal_akhir');
|
$endDate = $request->input('end_date');
|
||||||
$status = $request->input('status');
|
|
||||||
$selectedIds = $request->input('selected_ids');
|
// Validate the date format
|
||||||
|
if (isset($startDate) && isset($endDate)) {
|
||||||
|
$startDate = date('Y-m-d', strtotime($startDate));
|
||||||
|
$endDate = date('Y-m-d', strtotime($endDate));
|
||||||
|
|
||||||
|
if ($startDate > $endDate) {
|
||||||
|
return redirect()->back()->with('error', 'Tanggal awal tidak boleh lebih kecil dari tanggal akhir');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// name the file
|
||||||
|
$filename = $this->createNameLaporan($request);
|
||||||
|
|
||||||
$filename = 'laporan_penilai_jaminan_' . date('YmdHis') . '.xlsx';
|
|
||||||
return Excel::download(
|
return Excel::download(
|
||||||
new LaporanPenilaiJaminanExport($tanggalAwal, $tanggalAkhir, $status, $selectedIds),
|
new LaporanPenilaiJaminanExport($request),
|
||||||
$filename
|
$filename
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function createNameLaporan($request)
|
||||||
|
{
|
||||||
|
$startDate = $request->start_date ?? null;
|
||||||
|
$endDate = $request->end_date ?? null;
|
||||||
|
$branchId = $request->branch_id ?? null;
|
||||||
|
$laporan = $request->laporan ?? null;
|
||||||
|
|
||||||
|
// Initialize filename parts
|
||||||
|
$parts = ['Laporan Penilai Jaminan'];
|
||||||
|
if ($startDate && $endDate) {
|
||||||
|
$parts[] = "{$startDate}_{$endDate}";
|
||||||
|
}
|
||||||
|
if ($laporan) {
|
||||||
|
$parts[] = $laporan;
|
||||||
|
}
|
||||||
|
if ($branchId) {
|
||||||
|
$parts[] = $this->getBranchId($branchId);
|
||||||
|
}
|
||||||
|
// Return concatenated filename with extension
|
||||||
|
return implode('_', $parts) . '.xlsx';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getBranchId($branchId)
|
||||||
|
{
|
||||||
|
$branchesName = Branch::find($branchId)->name ?? null;
|
||||||
|
return $branchesName;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,10 @@
|
|||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Modules\Lpj\Exports\LaporanPenilaianJaminanExport;
|
use Modules\Lpj\Exports\LaporanPenilaianJaminanExport;
|
||||||
use Modules\Lpj\Models\Permohonan;
|
use Modules\Lpj\Models\Permohonan;
|
||||||
|
use Modules\Lpj\Models\Penilaian;
|
||||||
|
use Modules\Lpj\Models\PenawaranTender;
|
||||||
use Maatwebsite\Excel\Facades\Excel;
|
use Maatwebsite\Excel\Facades\Excel;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
class LaporanPenilaianJaminanController extends Controller
|
class LaporanPenilaianJaminanController extends Controller
|
||||||
{
|
{
|
||||||
@@ -34,11 +37,19 @@
|
|||||||
if ($request->has('search') && !empty($request->get('search'))) {
|
if ($request->has('search') && !empty($request->get('search'))) {
|
||||||
$search = json_decode($request->get('search'));
|
$search = json_decode($request->get('search'));
|
||||||
|
|
||||||
if (isset($search->start_date) || isset($search->end_date)) {
|
|
||||||
$query->whereBetween('tanggal_permohonan', [
|
if (!empty($search->start_date) || !empty($search->end_date)) {
|
||||||
$search->start_date ?? '1900-01-01',
|
$startDate = $search->start_date ?? '1900-01-01';
|
||||||
$search->end_date ?? now()->toDateString()
|
$endDate = $search->end_date ?? now()->toDateString();
|
||||||
]);
|
|
||||||
|
$query->where(function ($q) use ($startDate, $endDate) {
|
||||||
|
$q->whereHas('penilaian', function ($q2) use ($startDate, $endDate) {
|
||||||
|
$q2->whereBetween('tanggal_kunjungan', [$startDate, $endDate]);
|
||||||
|
})
|
||||||
|
->orWhereHas('penawaran', function ($q3) use ($startDate, $endDate) {
|
||||||
|
$q3->whereBetween('tanggal_penilaian_sebelumnya', [$startDate, $endDate]);
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Filter by branch if provided
|
// Filter by branch if provided
|
||||||
@@ -60,6 +71,8 @@
|
|||||||
$q->orWhereRelation('user', 'name', 'LIKE', '%' . $search->search . '%');
|
$q->orWhereRelation('user', 'name', 'LIKE', '%' . $search->search . '%');
|
||||||
$q->orWhereRelation('tujuanPenilaian', 'name', 'LIKE', '%' . $search->search . '%');
|
$q->orWhereRelation('tujuanPenilaian', 'name', 'LIKE', '%' . $search->search . '%');
|
||||||
$q->orWhereRelation('branch', 'name', 'LIKE', '%' . $search->search . '%');
|
$q->orWhereRelation('branch', 'name', 'LIKE', '%' . $search->search . '%');
|
||||||
|
$q->orWhereRelation('debiture', DB::raw('LOWER(name)'), 'LIKE', '%' . strtolower($search->search) . '%');
|
||||||
|
|
||||||
$q->orWhereRelation('jenisFasilitasKredit', 'name', 'LIKE', '%' . $search->search . '%');
|
$q->orWhereRelation('jenisFasilitasKredit', 'name', 'LIKE', '%' . $search->search . '%');
|
||||||
$q->orWhereRelation('jenisPenilaian', 'name', 'LIKE', '%' . $search->search . '%');
|
$q->orWhereRelation('jenisPenilaian', 'name', 'LIKE', '%' . $search->search . '%');
|
||||||
$q->orWhere('status', 'LIKE', '%' . $search->search . '%');
|
$q->orWhere('status', 'LIKE', '%' . $search->search . '%');
|
||||||
@@ -156,6 +169,12 @@
|
|||||||
|
|
||||||
public function export(Request $request)
|
public function export(Request $request)
|
||||||
{
|
{
|
||||||
return Excel::download(new LaporanPenilaianJaminanExport($request), 'laporan_penilaian_jaminan.xlsx');
|
$startDate = $request->start_date;
|
||||||
|
$endDate = $request->end_date;
|
||||||
|
// name of the file
|
||||||
|
$fileName = 'laporan_penilaian_jaminan_' . $startDate . '_' . $endDate . '.xlsx';
|
||||||
|
return Excel::download(new LaporanPenilaianJaminanExport($request), $fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,152 +17,160 @@
|
|||||||
public $user;
|
public $user;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tampilkan halaman daftar Nilai Plafond.
|
* Menampilkan halaman daftar Nilai Plafond.
|
||||||
*
|
* Log setiap akses dan sebelum return view.
|
||||||
* @return \Illuminate\Contracts\View\View
|
|
||||||
*/
|
*/
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
Log::info('[NilaiPlafondController@index] Return view index nilai_plafond');
|
Log::info('NilaiPlafondController@index: akses halaman index');
|
||||||
return view('lpj::nilai_plafond.index');
|
return \view('lpj::nilai_plafond.index');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simpan data Nilai Plafond baru ke database.
|
* Menyimpan data Nilai Plafond baru termasuk field biaya.
|
||||||
* Menggunakan transaksi untuk menjamin konsistensi data.
|
* Gunakan validasi dari NilaiPlafondRequest, log proses, dan bungkus dengan transaksi DB.
|
||||||
*
|
|
||||||
* @param NilaiPlafondRequest $request
|
|
||||||
* @return \Illuminate\Http\RedirectResponse
|
|
||||||
*/
|
*/
|
||||||
public function store(NilaiPlafondRequest $request)
|
public function store(NilaiPlafondRequest $request)
|
||||||
{
|
{
|
||||||
|
Log::info('NilaiPlafondController@store: mulai proses simpan');
|
||||||
$validate = $request->validated();
|
$validate = $request->validated();
|
||||||
|
|
||||||
if ($validate) {
|
if ($validate) {
|
||||||
DB::beginTransaction();
|
DB::beginTransaction();
|
||||||
try {
|
try {
|
||||||
// Save to database
|
$record = NilaiPlafond::create($validate);
|
||||||
$created = NilaiPlafond::create($validate);
|
|
||||||
DB::commit();
|
DB::commit();
|
||||||
Log::info('[NilaiPlafondController@store] NilaiPlafond created', ['id' => $created->id, 'payload' => $validate]);
|
|
||||||
return redirect()
|
Log::info('NilaiPlafondController@store: simpan berhasil', ['id' => $record->id]);
|
||||||
|
return \redirect()
|
||||||
->route('basicdata.nilai-plafond.index')
|
->route('basicdata.nilai-plafond.index')
|
||||||
->with('success', 'Nilai Plafond berhasil dibuat');
|
->with('success', 'Nilai Plafond berhasil dibuat');
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
DB::rollBack();
|
DB::rollBack();
|
||||||
Log::error('[NilaiPlafondController@store] Failed to create nilai plafond', ['error' => $e->getMessage(), 'payload' => $validate]);
|
Log::error('NilaiPlafondController@store: simpan gagal', ['error' => $e->getMessage()]);
|
||||||
return redirect()
|
|
||||||
|
return \redirect()
|
||||||
->route('basicdata.nilai-plafond.create')
|
->route('basicdata.nilai-plafond.create')
|
||||||
->with('error', 'Gagal membuat Nilai Plafond');
|
->with('error', 'Gagal membuat Nilai Plafond');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Log::warning('[NilaiPlafondController@store] Validation failed');
|
|
||||||
return redirect()
|
|
||||||
->route('basicdata.nilai-plafond.create')
|
|
||||||
->with('error', 'Validasi gagal');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tampilkan form pembuatan Nilai Plafond.
|
* Menampilkan form pembuatan Nilai Plafond.
|
||||||
*
|
* Log akses sebelum return view.
|
||||||
* @return \Illuminate\Contracts\View\View
|
|
||||||
*/
|
*/
|
||||||
public function create()
|
public function create()
|
||||||
{
|
{
|
||||||
Log::info('[NilaiPlafondController@create] Return view create nilai_plafond');
|
Log::info('NilaiPlafondController@create: akses halaman create');
|
||||||
return view('lpj::nilai_plafond.create');
|
return \view('lpj::nilai_plafond.create');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tampilkan form edit Nilai Plafond berdasarkan ID.
|
* Menampilkan form edit Nilai Plafond berdasarkan ID.
|
||||||
*
|
* Gunakan transaksi untuk pembacaan data dan logging.
|
||||||
* @param int $id
|
|
||||||
* @return \Illuminate\Contracts\View\View
|
|
||||||
*/
|
*/
|
||||||
public function edit($id)
|
public function edit($id)
|
||||||
{
|
{
|
||||||
|
Log::info('NilaiPlafondController@edit: mulai proses edit', ['id' => $id]);
|
||||||
|
|
||||||
|
DB::beginTransaction();
|
||||||
|
try {
|
||||||
$nilaiPlafond = NilaiPlafond::find($id);
|
$nilaiPlafond = NilaiPlafond::find($id);
|
||||||
Log::info('[NilaiPlafondController@edit] Return view edit nilai_plafond', ['id' => $id]);
|
DB::commit();
|
||||||
return view('lpj::nilai_plafond.create', compact('nilaiPlafond'));
|
|
||||||
|
Log::info('NilaiPlafondController@edit: data ditemukan', ['id' => $id]);
|
||||||
|
return \view('lpj::nilai_plafond.create', compact('nilaiPlafond'));
|
||||||
|
} catch (Exception $e) {
|
||||||
|
DB::rollBack();
|
||||||
|
Log::error('NilaiPlafondController@edit: gagal mengambil data', ['id' => $id, 'error' => $e->getMessage()]);
|
||||||
|
return \redirect()
|
||||||
|
->route('basicdata.nilai-plafond.index')
|
||||||
|
->with('error', 'Gagal mengambil data Nilai Plafond');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update data Nilai Plafond pada database.
|
* Memperbarui data Nilai Plafond termasuk field biaya.
|
||||||
* Menggunakan transaksi untuk menjamin konsistensi data.
|
* Validasi input, logging, dan gunakan transaksi DB.
|
||||||
*
|
|
||||||
* @param NilaiPlafondRequest $request
|
|
||||||
* @param int $id
|
|
||||||
* @return \Illuminate\Http\RedirectResponse
|
|
||||||
*/
|
*/
|
||||||
public function update(NilaiPlafondRequest $request, $id)
|
public function update(NilaiPlafondRequest $request, $id)
|
||||||
{
|
{
|
||||||
|
Log::info('NilaiPlafondController@update: mulai proses update', ['id' => $id]);
|
||||||
$validate = $request->validated();
|
$validate = $request->validated();
|
||||||
|
|
||||||
if ($validate) {
|
if ($validate) {
|
||||||
DB::beginTransaction();
|
DB::beginTransaction();
|
||||||
try {
|
try {
|
||||||
// Update in database
|
|
||||||
$nilaiPlafond = NilaiPlafond::find($id);
|
$nilaiPlafond = NilaiPlafond::find($id);
|
||||||
|
if (!$nilaiPlafond) {
|
||||||
|
Log::warning('NilaiPlafondController@update: data tidak ditemukan', ['id' => $id]);
|
||||||
|
DB::rollBack();
|
||||||
|
return \redirect()
|
||||||
|
->route('basicdata.nilai-plafond.index')
|
||||||
|
->with('error', 'Data Nilai Plafond tidak ditemukan');
|
||||||
|
}
|
||||||
|
|
||||||
$nilaiPlafond->update($validate);
|
$nilaiPlafond->update($validate);
|
||||||
DB::commit();
|
DB::commit();
|
||||||
Log::info('[NilaiPlafondController@update] NilaiPlafond updated', ['id' => $id, 'payload' => $validate]);
|
|
||||||
return redirect()
|
Log::info('NilaiPlafondController@update: update berhasil', ['id' => $id]);
|
||||||
|
return \redirect()
|
||||||
->route('basicdata.nilai-plafond.index')
|
->route('basicdata.nilai-plafond.index')
|
||||||
->with('success', 'Nilai Plafond berhasil diperbarui');
|
->with('success', 'Nilai Plafond berhasil diperbarui');
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
DB::rollBack();
|
DB::rollBack();
|
||||||
Log::error('[NilaiPlafondController@update] Failed to update nilai plafond', ['id' => $id, 'error' => $e->getMessage(), 'payload' => $validate]);
|
Log::error('NilaiPlafondController@update: update gagal', ['id' => $id, 'error' => $e->getMessage()]);
|
||||||
return redirect()
|
|
||||||
|
return \redirect()
|
||||||
->route('basicdata.nilai-plafond.edit', $id)
|
->route('basicdata.nilai-plafond.edit', $id)
|
||||||
->with('error', 'Gagal memperbarui Nilai Plafond');
|
->with('error', 'Gagal memperbarui Nilai Plafond');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Log::warning('[NilaiPlafondController@update] Validation failed', ['id' => $id]);
|
|
||||||
return redirect()
|
|
||||||
->route('basicdata.nilai-plafond.edit', $id)
|
|
||||||
->with('error', 'Validasi gagal');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hapus data Nilai Plafond dari database.
|
* Menghapus data Nilai Plafond berdasarkan ID.
|
||||||
* Menggunakan transaksi untuk menjamin konsistensi data.
|
* Logging setiap langkah dan gunakan transaksi DB.
|
||||||
*
|
|
||||||
* @param int $id
|
|
||||||
* @return void
|
|
||||||
*/
|
*/
|
||||||
public function destroy($id)
|
public function destroy($id)
|
||||||
{
|
{
|
||||||
|
Log::info('NilaiPlafondController@destroy: mulai proses hapus', ['id' => $id]);
|
||||||
DB::beginTransaction();
|
DB::beginTransaction();
|
||||||
try {
|
try {
|
||||||
// Delete from database
|
|
||||||
$nilaiPlafond = NilaiPlafond::find($id);
|
$nilaiPlafond = NilaiPlafond::find($id);
|
||||||
|
if (!$nilaiPlafond) {
|
||||||
|
DB::rollBack();
|
||||||
|
Log::warning('NilaiPlafondController@destroy: data tidak ditemukan', ['id' => $id]);
|
||||||
|
return \response()->json(['success' => false, 'message' => 'Data Nilai Plafond tidak ditemukan']);
|
||||||
|
}
|
||||||
|
|
||||||
$nilaiPlafond->delete();
|
$nilaiPlafond->delete();
|
||||||
DB::commit();
|
DB::commit();
|
||||||
Log::info('[NilaiPlafondController@destroy] NilaiPlafond deleted', ['id' => $id]);
|
|
||||||
|
|
||||||
echo json_encode(['success' => true, 'message' => 'Nilai Plafond berhasil dihapus']);
|
Log::info('NilaiPlafondController@destroy: hapus berhasil', ['id' => $id]);
|
||||||
|
return \response()->json(['success' => true, 'message' => 'Nilai Plafond berhasil dihapus']);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
DB::rollBack();
|
DB::rollBack();
|
||||||
Log::error('[NilaiPlafondController@destroy] Failed to delete nilai plafond', ['id' => $id, 'error' => $e->getMessage()]);
|
Log::error('NilaiPlafondController@destroy: hapus gagal', ['id' => $id, 'error' => $e->getMessage()]);
|
||||||
echo json_encode(['success' => false, 'message' => 'Gagal menghapus Nilai Plafond']);
|
return \response()->json(['success' => false, 'message' => 'Gagal menghapus Nilai Plafond']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Endpoint data untuk DataTables custom.
|
* Menyediakan data untuk datatables dengan pencarian, sortir, dan paginasi.
|
||||||
* Menyediakan pencarian, sorting, dan pagination.
|
* Logging proses dan gunakan transaksi DB untuk konsistensi pembacaan.
|
||||||
*
|
|
||||||
* @param Request $request
|
|
||||||
* @return \Illuminate\Http\JsonResponse
|
|
||||||
*/
|
*/
|
||||||
public function dataForDatatables(Request $request)
|
public function dataForDatatables(Request $request)
|
||||||
{
|
{
|
||||||
|
Log::info('NilaiPlafondController@dataForDatatables: mulai proses');
|
||||||
|
|
||||||
if (is_null($this->user) || !$this->user->can('nilai_plafond.view')) {
|
if (is_null($this->user) || !$this->user->can('nilai_plafond.view')) {
|
||||||
//abort(403, 'Sorry! You are not allowed to view users.');
|
//abort(403, 'Sorry! You are not allowed to view users.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DB::beginTransaction();
|
||||||
|
try {
|
||||||
// Retrieve data from the database
|
// Retrieve data from the database
|
||||||
$query = NilaiPlafond::query();
|
$query = NilaiPlafond::query();
|
||||||
|
|
||||||
@@ -172,8 +180,6 @@
|
|||||||
$query->where(function ($q) use ($search) {
|
$query->where(function ($q) use ($search) {
|
||||||
$q->where('code', 'LIKE', "%$search%");
|
$q->where('code', 'LIKE', "%$search%");
|
||||||
$q->orWhere('name', 'LIKE', "%$search%");
|
$q->orWhere('name', 'LIKE', "%$search%");
|
||||||
// CAST ke TEXT agar LIKE bekerja di PostgreSQL
|
|
||||||
$q->orWhereRaw('CAST(biaya AS TEXT) LIKE ?', ["%$search%"]);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -208,15 +214,11 @@
|
|||||||
// Calculate the current page number
|
// Calculate the current page number
|
||||||
$currentPage = 0 + 1;
|
$currentPage = 0 + 1;
|
||||||
|
|
||||||
Log::info('[NilaiPlafondController@dataForDatatables] Return datatables payload', [
|
DB::commit();
|
||||||
'recordsTotal' => $totalRecords,
|
Log::info('NilaiPlafondController@dataForDatatables: proses selesai, mengembalikan data');
|
||||||
'recordsFiltered' => $filteredRecords,
|
|
||||||
'pageCount' => $pageCount,
|
|
||||||
'page' => $currentPage,
|
|
||||||
]);
|
|
||||||
|
|
||||||
// Return the response data as a JSON object
|
// Return the response data as a JSON object
|
||||||
return response()->json([
|
return \response()->json([
|
||||||
'draw' => $request->get('draw'),
|
'draw' => $request->get('draw'),
|
||||||
'recordsTotal' => $totalRecords,
|
'recordsTotal' => $totalRecords,
|
||||||
'recordsFiltered' => $filteredRecords,
|
'recordsFiltered' => $filteredRecords,
|
||||||
@@ -225,16 +227,28 @@
|
|||||||
'totalCount' => $totalRecords,
|
'totalCount' => $totalRecords,
|
||||||
'data' => $data,
|
'data' => $data,
|
||||||
]);
|
]);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
DB::rollBack();
|
||||||
|
Log::error('NilaiPlafondController@dataForDatatables: gagal memproses data', ['error' => $e->getMessage()]);
|
||||||
|
return \response()->json([
|
||||||
|
'draw' => $request->get('draw'),
|
||||||
|
'recordsTotal' => 0,
|
||||||
|
'recordsFiltered' => 0,
|
||||||
|
'pageCount' => 0,
|
||||||
|
'page' => 1,
|
||||||
|
'totalCount' => 0,
|
||||||
|
'data' => [],
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Export data Nilai Plafond ke file Excel.
|
* Mengekspor data Nilai Plafond ke Excel.
|
||||||
*
|
* Log akses sebelum proses download.
|
||||||
* @return \Symfony\Component\HttpFoundation\BinaryFileResponse
|
|
||||||
*/
|
*/
|
||||||
public function export()
|
public function export()
|
||||||
{
|
{
|
||||||
Log::info('[NilaiPlafondController@export] Export nilai_plafond to Excel');
|
Log::info('NilaiPlafondController@export: mulai proses export');
|
||||||
return Excel::download(new NilaiPlafondExport, 'nilai_plafond.xlsx');
|
return Excel::download(new NilaiPlafondExport, 'nilai_plafond.xlsx');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,18 +26,21 @@ use Modules\Lpj\Http\Requests\FormSurveyorRequest;
|
|||||||
use Modules\Lpj\Models\Authorization;
|
use Modules\Lpj\Models\Authorization;
|
||||||
use Modules\Lpj\Models\Debiture;
|
use Modules\Lpj\Models\Debiture;
|
||||||
use Modules\Lpj\Services\SaveFormInspesksiService;
|
use Modules\Lpj\Services\SaveFormInspesksiService;
|
||||||
|
use Modules\Lpj\Services\PreviewLaporanService;
|
||||||
|
|
||||||
class PenilaiController extends Controller
|
class PenilaiController extends Controller
|
||||||
{
|
{
|
||||||
public $user;
|
public $user;
|
||||||
protected $surveyorController;
|
protected $surveyorController;
|
||||||
protected $inspeksiService;
|
protected $inspeksiService;
|
||||||
|
protected $previewLaporanService;
|
||||||
|
|
||||||
|
|
||||||
public function __construct(SurveyorController $surveyorController, SaveFormInspesksiService $inspeksiService)
|
public function __construct(SurveyorController $surveyorController, SaveFormInspesksiService $inspeksiService, PreviewLaporanService $previewLaporanService)
|
||||||
{
|
{
|
||||||
$this->surveyorController = $surveyorController;
|
$this->surveyorController = $surveyorController;
|
||||||
$this->inspeksiService = $inspeksiService;
|
$this->inspeksiService = $inspeksiService;
|
||||||
|
$this->previewLaporanService = $previewLaporanService;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -548,13 +551,7 @@ class PenilaiController extends Controller
|
|||||||
return view('lpj::penilai.components.call-report', compact('permohonan', 'basicData', 'nomorLaporan', 'forminspeksi', 'cities', 'districts', 'villages', 'cekAlamat', 'callReport'));
|
return view('lpj::penilai.components.call-report', compact('permohonan', 'basicData', 'nomorLaporan', 'forminspeksi', 'cities', 'districts', 'villages', 'cekAlamat', 'callReport'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Remove the specified resource from storage.
|
|
||||||
*/
|
|
||||||
public function destroy($id)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
public function dataForDatatables(Request $request)
|
public function dataForDatatables(Request $request)
|
||||||
{
|
{
|
||||||
@@ -701,6 +698,7 @@ class PenilaiController extends Controller
|
|||||||
'lokasi_lengkap' => $data->lokasi_lengkap ?? '',
|
'lokasi_lengkap' => $data->lokasi_lengkap ?? '',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
if(isset($dataPembanding)){
|
||||||
// Extract data pembanding
|
// Extract data pembanding
|
||||||
if (isset($dataPembanding['data_pembanding'])) {
|
if (isset($dataPembanding['data_pembanding'])) {
|
||||||
foreach ($dataPembanding['data_pembanding'] as $index => $pembanding) {
|
foreach ($dataPembanding['data_pembanding'] as $index => $pembanding) {
|
||||||
@@ -713,6 +711,7 @@ class PenilaiController extends Controller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Now create the export
|
// Now create the export
|
||||||
// return response()->json([ 'data' => $fotoForm]);
|
// return response()->json([ 'data' => $fotoForm]);
|
||||||
@@ -1276,8 +1275,6 @@ class PenilaiController extends Controller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function print_out(Request $request)
|
public function print_out(Request $request)
|
||||||
{
|
{
|
||||||
$documentId = $request->query('documentId');
|
$documentId = $request->query('documentId');
|
||||||
@@ -1393,6 +1390,15 @@ class PenilaiController extends Controller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function print_out_laporan($permohonan_id, $document_id, $jaminan_id)
|
||||||
|
{
|
||||||
|
// jika tidak ada id kembalikan ke halaman sebelumnya
|
||||||
|
if (!$permohonan_id || !$document_id || !$jaminan_id) {
|
||||||
|
return redirect()->back()->with('error', 'Laporan tidak valid');
|
||||||
|
}
|
||||||
|
return $this->previewLaporanService->printOutLaporan($permohonan_id, $document_id, $jaminan_id);
|
||||||
|
}
|
||||||
|
|
||||||
private function getViewLaporan($tipe)
|
private function getViewLaporan($tipe)
|
||||||
{
|
{
|
||||||
$viewMap = [
|
$viewMap = [
|
||||||
@@ -1772,4 +1778,24 @@ class PenilaiController extends Controller
|
|||||||
'message' => 'Berhasil Revisi Ke surveyor',
|
'message' => 'Berhasil Revisi Ke surveyor',
|
||||||
], 200);
|
], 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function showLaporanInspeksi(
|
||||||
|
$permohonan_id,
|
||||||
|
$dokumen_id,
|
||||||
|
$jaminan_id,
|
||||||
|
Request $request)
|
||||||
|
{
|
||||||
|
if ($request->type == 'penilai') {
|
||||||
|
$back = route('penilai.show', $permohonan_id);
|
||||||
|
}else{
|
||||||
|
$back = route('surveyor.show', $permohonan_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->previewLaporanService->previewLaporan($permohonan_id, $dokumen_id, $jaminan_id, $back);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function showInspectionReportReview($permohonan_id, $dokumen_id, $jaminan_id)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<form action="{{ isset($debitur->id) ? route('debitur.update', $debitur->id) : route('debitur.store') }}" method="POST"
|
<form action="{{ isset($debitur->id) ? route('debitur.update', $debitur->id) : route('debitur.store') }}" method="POST" id="debitur-form" class="grid gap-5">
|
||||||
id="debitur-form" class="grid gap-5">
|
|
||||||
@if(isset($debitur->id))
|
@if(isset($debitur->id))
|
||||||
<input type="hidden" name="id" value="{{ $debitur->id }}">
|
<input type="hidden" name="id" value="{{ $debitur->id }}">
|
||||||
@method('PUT')
|
@method('PUT')
|
||||||
@@ -11,13 +10,11 @@
|
|||||||
<span class="text-danger">*</span>
|
<span class="text-danger">*</span>
|
||||||
</label>
|
</label>
|
||||||
<div class="flex flex-wrap items-baseline w-full">
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
@if (auth()->user()->hasRole(['administrator']))
|
@if(auth()->user()->hasRole('administrator'))
|
||||||
<select class="input tomselect w-full @error('branch_id') border-danger bg-danger-light @enderror"
|
<select class="input tomselect w-full @error('branch_id') border-danger bg-danger-light @enderror" name="branch_id" id="branch_id">
|
||||||
name="branch_id" id="branch_id">
|
|
||||||
<option value="">Pilih Cabang</option>
|
<option value="">Pilih Cabang</option>
|
||||||
@foreach($branches as $branch)
|
@foreach($branches as $branch)
|
||||||
<option value="{{ $branch->id }}"
|
<option value="{{ $branch->id }}" {{ (isset($debitur) && $branch->id == $debitur->branch_id) || (old('branch_id') == $branch->id) ? 'selected' : '' }}>
|
||||||
{{ (isset($debitur) && $branch->id == $debitur->branch_id) || old('branch_id') == $branch->id ? 'selected' : '' }}>
|
|
||||||
{{ $branch->name }}
|
{{ $branch->name }}
|
||||||
</option>
|
</option>
|
||||||
@endforeach
|
@endforeach
|
||||||
@@ -39,8 +36,7 @@
|
|||||||
</span>
|
</span>
|
||||||
</label>
|
</label>
|
||||||
<div class="flex flex-wrap items-baseline w-full">
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
<input class="input @error('cif') border-danger bg-danger-light @enderror" type="number" id="cif"
|
<input class="input @error('cif') border-danger bg-danger-light @enderror" type="number" id="cif" name="cif" value="{{ $debitur->cif ?? '0000000000' }}">
|
||||||
name="cif" value="{{ $debitur->cif ?? '0000000000' }}">
|
|
||||||
@error('cif')
|
@error('cif')
|
||||||
<em class="text-sm alert text-danger">{{ $message }}</em>
|
<em class="text-sm alert text-danger">{{ $message }}</em>
|
||||||
@enderror
|
@enderror
|
||||||
@@ -51,8 +47,7 @@
|
|||||||
Nomor Rekening
|
Nomor Rekening
|
||||||
</label>
|
</label>
|
||||||
<div class="flex flex-wrap items-baseline w-full">
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
<input class="input @error('nomor_rekening') border-danger bg-danger-light @enderror" type="number"
|
<input class="input @error('nomor_rekening') border-danger bg-danger-light @enderror" type="number" name="nomor_rekening" value="{{ $debitur->nomor_rekening ?? '' }}">
|
||||||
name="nomor_rekening" value="{{ $debitur->nomor_rekening ?? '' }}">
|
|
||||||
@error('nomor_rekening')
|
@error('nomor_rekening')
|
||||||
<em class="text-sm alert text-danger">{{ $message }}</em>
|
<em class="text-sm alert text-danger">{{ $message }}</em>
|
||||||
@enderror
|
@enderror
|
||||||
@@ -66,8 +61,7 @@
|
|||||||
</span>
|
</span>
|
||||||
</label>
|
</label>
|
||||||
<div class="flex flex-wrap items-baseline w-full">
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
<input required class="input @error('name') border-danger bg-danger-light @enderror" type="text"
|
<input required class="input @error('name') border-danger bg-danger-light @enderror" type="text" name="name" value="{{ $debitur->name ?? '' }}">
|
||||||
name="name" value="{{ $debitur->name ?? '' }}">
|
|
||||||
@error('name')
|
@error('name')
|
||||||
<em class="text-sm alert text-danger">{{ $message }}</em>
|
<em class="text-sm alert text-danger">{{ $message }}</em>
|
||||||
@enderror
|
@enderror
|
||||||
@@ -78,20 +72,18 @@
|
|||||||
NPWP
|
NPWP
|
||||||
</label>
|
</label>
|
||||||
<div class="flex flex-wrap items-baseline w-full">
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
<input class="input @error('npwp') border-danger bg-danger-light @enderror" type="number" name="npwp"
|
<input class="input @error('npwp') border-danger bg-danger-light @enderror" type="number" name="npwp" value="{{ $debitur->npwp ?? '' }}">
|
||||||
value="{{ $debitur->npwp ?? '' }}">
|
|
||||||
@error('npwp')
|
@error('npwp')
|
||||||
<em class="text-sm alert text-danger">{{ $message }}</em>
|
<em class="text-sm alert text-danger">{{ $message }}</em>
|
||||||
@enderror
|
@enderror
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex hidden flex-wrap gap-2.5 items-baseline lg:flex-nowrap">
|
<div class="flex flex-wrap gap-2.5 items-baseline lg:flex-nowrap">
|
||||||
<label class="form-label max-w-56">
|
<label class="form-label max-w-56">
|
||||||
Email
|
Email
|
||||||
</label>
|
</label>
|
||||||
<div class="flex flex-wrap items-baseline w-full">
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
<input class="input @error('email') border-danger bg-danger-light @enderror" type="email" name="email"
|
<input class="input @error('email') border-danger bg-danger-light @enderror" type="email" name="email" value="{{ $debitur->email ?? '' }}">
|
||||||
value="{{ $debitur->email ?? '' }}">
|
|
||||||
@error('email')
|
@error('email')
|
||||||
<em class="text-sm alert text-danger">{{ $message }}</em>
|
<em class="text-sm alert text-danger">{{ $message }}</em>
|
||||||
@enderror
|
@enderror
|
||||||
@@ -102,8 +94,7 @@
|
|||||||
No Handphone
|
No Handphone
|
||||||
</label>
|
</label>
|
||||||
<div class="flex flex-wrap items-baseline w-full">
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
<input class="input @error('phone') border-danger bg-danger-light @enderror" type="number" name="phone"
|
<input class="input @error('phone') border-danger bg-danger-light @enderror" type="number" name="phone" value="{{ $debitur->phone ?? '' }}">
|
||||||
value="{{ $debitur->phone ?? '' }}">
|
|
||||||
@error('phone')
|
@error('phone')
|
||||||
<em class="text-sm alert text-danger">{{ $message }}</em>
|
<em class="text-sm alert text-danger">{{ $message }}</em>
|
||||||
@enderror
|
@enderror
|
||||||
@@ -111,7 +102,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="flex flex-wrap gap-2.5 items-baseline lg:flex-nowrap">
|
<div class="flex flex-wrap gap-2.5 items-baseline lg:flex-nowrap">
|
||||||
<label class="gap-1 form-label max-w-56">
|
<label class="gap-1 form-label max-w-56">
|
||||||
Alamat KTP
|
Alamat
|
||||||
<span class="text-danger">
|
<span class="text-danger">
|
||||||
*
|
*
|
||||||
</span>
|
</span>
|
||||||
@@ -119,13 +110,11 @@
|
|||||||
<div class="flex flex-wrap items-baseline w-full">
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
<div class="flex flex-col gap-2 w-full lg:flex-row">
|
<div class="flex flex-col gap-2 w-full lg:flex-row">
|
||||||
<div class="flex flex-wrap items-baseline w-full">
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
<select required id="province_code" name="province_code"
|
<select required id="province_code" name="province_code" class="select w-full @error('province_code') border-danger bg-danger-light @enderror">
|
||||||
class="select w-full @error('province_code') border-danger bg-danger-light @enderror">
|
|
||||||
<option value="">Select Province</option>
|
<option value="">Select Province</option>
|
||||||
@foreach($provinces as $province)
|
@foreach($provinces as $province)
|
||||||
@if(isset($debitur))
|
@if(isset($debitur))
|
||||||
<option value="{{ $province->code }}"
|
<option value="{{ $province->code }}" {{ isset($debitur->province_code) && $debitur->province_code == $province->code?'selected' : '' }}>
|
||||||
{{ isset($debitur->province_code) && $debitur->province_code == $province->code ? 'selected' : '' }}>
|
|
||||||
{{ $province->name }}
|
{{ $province->name }}
|
||||||
</option>
|
</option>
|
||||||
@else
|
@else
|
||||||
@@ -140,14 +129,12 @@
|
|||||||
@enderror
|
@enderror
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-wrap items-baseline w-full">
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
<select required id="city_code" name="city_code"
|
<select required id="city_code" name="city_code" class="select w-full @error('city_code') border-danger bg-danger-light @enderror">
|
||||||
class="select w-full @error('city_code') border-danger bg-danger-light @enderror">
|
|
||||||
<option value="">Select City</option>
|
<option value="">Select City</option>
|
||||||
@if(isset($cities))
|
@if(isset($cities))
|
||||||
@foreach($cities as $city)
|
@foreach($cities as $city)
|
||||||
@if(isset($debitur))
|
@if(isset($debitur))
|
||||||
<option value="{{ $city->code }}"
|
<option value="{{ $city->code }}" {{ isset($debitur->city_code) && $debitur->city_code == $city->code?'selected' : '' }}>
|
||||||
{{ isset($debitur->city_code) && $debitur->city_code == $city->code ? 'selected' : '' }}>
|
|
||||||
{{ $city->name }}
|
{{ $city->name }}
|
||||||
</option>
|
</option>
|
||||||
@else
|
@else
|
||||||
@@ -166,14 +153,12 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col gap-2 mt-2 w-full lg:flex-row lg:mt-5">
|
<div class="flex flex-col gap-2 mt-2 w-full lg:flex-row lg:mt-5">
|
||||||
<div class="flex flex-wrap items-baseline w-full">
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
<select required id="district_code" name="district_code"
|
<select required id="district_code" name="district_code" class="select w-full @error('district_code') border-danger bg-danger-light @enderror">
|
||||||
class="select w-full @error('district_code') border-danger bg-danger-light @enderror">
|
|
||||||
<option value="">Select District</option>
|
<option value="">Select District</option>
|
||||||
@if(isset($districts))
|
@if(isset($districts))
|
||||||
@foreach($districts as $district)
|
@foreach($districts as $district)
|
||||||
@if(isset($debitur))
|
@if(isset($debitur))
|
||||||
<option value="{{ $district->code }}"
|
<option value="{{ $district->code }}" {{ isset($debitur->district_code) && $debitur->district_code == $district->code?'selected' : '' }}>
|
||||||
{{ isset($debitur->district_code) && $debitur->district_code == $district->code ? 'selected' : '' }}>
|
|
||||||
{{ $district->name }}
|
{{ $district->name }}
|
||||||
</option>
|
</option>
|
||||||
@else
|
@else
|
||||||
@@ -190,14 +175,12 @@
|
|||||||
@enderror
|
@enderror
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-wrap items-baseline w-full">
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
<select required id="village_code" name="village_code"
|
<select required id="village_code" name="village_code" class="select w-full @error('district_code') border-danger bg-danger-light @enderror">
|
||||||
class="select w-full @error('district_code') border-danger bg-danger-light @enderror">
|
|
||||||
<option value="">Select Village</option>
|
<option value="">Select Village</option>
|
||||||
@if(isset($villages))
|
@if(isset($villages))
|
||||||
@foreach($villages as $village)
|
@foreach($villages as $village)
|
||||||
@if(isset($debitur))
|
@if(isset($debitur))
|
||||||
<option value="{{ $village->code }}"
|
<option value="{{ $village->code }}" {{ isset($debitur->village_code) && $debitur->village_code == $village->code?'selected' : '' }}>
|
||||||
{{ isset($debitur->village_code) && $debitur->village_code == $village->code ? 'selected' : '' }}>
|
|
||||||
{{ $village->name }}
|
{{ $village->name }}
|
||||||
</option>
|
</option>
|
||||||
@else
|
@else
|
||||||
@@ -214,17 +197,14 @@
|
|||||||
@enderror
|
@enderror
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-wrap items-baseline w-full">
|
<div class="flex flex-wrap items-baseline w-full">
|
||||||
<input required class="input @error('postal_code') border-danger bg-danger-light @enderror"
|
<input required class="input @error('postal_code') border-danger bg-danger-light @enderror" type="number" id="postal_code" name="postal_code" value="{{ $debitur->postal_code ?? '' }}" placeholder="Postal Code">
|
||||||
type="number" id="postal_code" name="postal_code"
|
|
||||||
value="{{ $debitur->postal_code ?? '' }}" placeholder="Postal Code">
|
|
||||||
@error('postal_code')
|
@error('postal_code')
|
||||||
<em class="text-sm alert text-danger">{{ $message }}</em>
|
<em class="text-sm alert text-danger">{{ $message }}</em>
|
||||||
@enderror
|
@enderror
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-row mt-2 w-full lg:mt-5">
|
<div class="flex flex-row mt-2 w-full lg:mt-5">
|
||||||
<textarea required class="textarea @error('address') border-danger bg-danger-light @enderror" rows="3"
|
<textarea required class="textarea @error('address') border-danger bg-danger-light @enderror" rows="3" id="address" name="address" placeholder="Alamat Lengkap">{{ $debitur->address ?? '' }}</textarea>
|
||||||
id="address" name="address" placeholder="Alamat Lengkap">{{ $debitur->address ?? '' }}</textarea>
|
|
||||||
@error('address')
|
@error('address')
|
||||||
<em class="text-sm alert text-danger">{{ $message }}</em>
|
<em class="text-sm alert text-danger">{{ $message }}</em>
|
||||||
@enderror
|
@enderror
|
||||||
|
|||||||
@@ -95,7 +95,7 @@
|
|||||||
@foreach($dokumen_jaminan as $index => $dokumen)
|
@foreach($dokumen_jaminan as $index => $dokumen)
|
||||||
<div class="flex items-center justify-between flex-wrap my-2.5 gap-2">
|
<div class="flex items-center justify-between flex-wrap my-2.5 gap-2">
|
||||||
<span class="text-2xs text-gray-600 uppercase pl-3">
|
<span class="text-2xs text-gray-600 uppercase pl-3">
|
||||||
{{ $loop->index+1 }}. Nomor : {{ $dokumen_nomor[$index] }}
|
{{ $loop->index+1 }}. Nomor : {{ $dokumen_nomor[$index] ?? '' }}
|
||||||
</span>
|
</span>
|
||||||
<div>
|
<div>
|
||||||
@if(in_array(Auth::user()->roles[0]->name,['administrator','pemohon-eo']))
|
@if(in_array(Auth::user()->roles[0]->name,['administrator','pemohon-eo']))
|
||||||
|
|||||||
@@ -6,8 +6,7 @@
|
|||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
<div class="grid">
|
<div class="grid">
|
||||||
<div class="min-w-full border card border-agi-100 card-grid" data-datatable="false" data-datatable-page-size="10"
|
<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="debitur-table" data-api-url="{{ route('debitur.datatables') }}">
|
||||||
data-datatable-state-save="false" id="debitur-table" data-api-url="{{ route('debitur.datatables') }}">
|
|
||||||
<div class="flex-wrap py-5 card-header bg-agi-50">
|
<div class="flex-wrap py-5 card-header bg-agi-50">
|
||||||
<h3 class="card-title">
|
<h3 class="card-title">
|
||||||
Daftar Debitur
|
Daftar Debitur
|
||||||
|
|||||||
@@ -44,111 +44,119 @@
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@endpush
|
@endpush
|
||||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
<div class="grid gap-5 mx-auto w-full lg:gap-7.5">
|
||||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10"
|
|
||||||
data-datatable-state-save="false" id="laporan-penilai-jaminan-table"
|
|
||||||
data-api-url="{{ route('laporan-penilai-jaminan.datatables') }}">
|
<!-- Filter Card -->
|
||||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
<div class="border card border-agi-100">
|
||||||
<h3 class="card-title">
|
<div class="py-5 card-header bg-agi-50">
|
||||||
Daftar Laporan Penilai Jaminan
|
<h3 class="card-title">Filter Laporan</h3>
|
||||||
</h3>
|
</div>
|
||||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
<div class="grid gap-4 card-body">
|
||||||
<div class="flex">
|
<!-- Search field at the top, full width -->
|
||||||
|
<div class="flex flex-col w-full">
|
||||||
|
<label class="mb-1 text-sm font-medium">Pencarian</label>
|
||||||
|
<label class="input input-sm">
|
||||||
|
<i class="ki-filled ki-magnifier"></i>
|
||||||
|
<input placeholder="Search Laporan Penilaian Jaminan" id="search" type="text" value="">
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Other filter fields in grid layout -->
|
||||||
|
<div class="grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-4">
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<label class="mb-1 text-base font-medium">Tanggal Awal</label>
|
||||||
<label class="input">
|
<label class="input">
|
||||||
Start Date
|
<input placeholder="Tanggal Awal" id="start_date" type="date">
|
||||||
<input placeholder="Tanggal Awal" id="tanggal_awal" type="date">
|
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex">
|
<div class="flex flex-col">
|
||||||
|
<label class="mb-1 text-base font-medium">Tanggal Akhir</label>
|
||||||
<label class="input">
|
<label class="input">
|
||||||
End Date
|
<input placeholder="Tanggal Akhir" id="end_date" type="date">
|
||||||
<input placeholder="Tanggal Akhir" id="tanggal_akhir" type="date">
|
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex">
|
<div class="flex flex-col">
|
||||||
<button class="btn btn-primary" id="filter_tanggal">Filter</button>
|
<label class="mb-1 text-base font-medium">Cabang</label>
|
||||||
|
<select class="select tomselect" id="branch_filter">
|
||||||
|
<option value="">Semua Cabang</option>
|
||||||
|
@foreach (\Modules\Basicdata\Models\Branch::where('status', 1)->get() as $branch)
|
||||||
|
<option value="{{ $branch->id }}">{{ $branch->name }}</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex">
|
<div class="flex flex-col">
|
||||||
<label class="input "> <i class="ki-filled ki-magnifier"> </i>
|
|
||||||
<input placeholder="Search Laporan" id="search" type="text" value="">
|
<label class="mb-1 text-base font-medium">Laporan</label>
|
||||||
</label>
|
<select class="select tomselect" name="laporan[]" id="laporan" multiple>
|
||||||
</div>
|
<option value="">Semua Laporan</option>
|
||||||
<div class="flex">
|
|
||||||
<!-- Custom dropdown for status filter -->
|
|
||||||
<div class="dropdown" data-dropdown="true" data-dropdown-trigger="click">
|
|
||||||
<button class="dropdowns-toggle btn btn-light inline-flex justify-between w-full items-center">
|
|
||||||
Pilih Type Laporan
|
|
||||||
<i class="ki-outline ki-down dropdown-open:hidden">
|
|
||||||
</i>
|
|
||||||
<i class="ki-outline ki-up hidden dropdown-open:block">
|
|
||||||
</i>
|
|
||||||
</button>
|
|
||||||
<div
|
|
||||||
class="dropdowns-content w-full max-w-56 py-2 absolute mt-2 origin-top-right z-50 bg-white rounded-md shadow-lg ring-1 ring-black ring-opacity-5">
|
|
||||||
<div class="menu menu-default flex flex-col w-full">
|
|
||||||
<!-- Checkbox untuk All Status -->
|
|
||||||
<div class="menu-item">
|
|
||||||
<label class="menu-link flex items-center px-4 py-2 text-sm text-gray-700">
|
|
||||||
<input id="select-all" type="checkbox"
|
|
||||||
class="form-checkbox h-4 w-4 text-blue-600">
|
|
||||||
<span class="ml-2">All Status</span>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<!-- Dinamis Status dari Backend -->
|
|
||||||
@php
|
@php
|
||||||
$status_laporan = [
|
$status_laporan = ['Standar', 'Sederhana', 'Memo', 'Resume', 'Call Report', 'RAP'];
|
||||||
'Standar',
|
|
||||||
'Sederhana',
|
|
||||||
'Memo',
|
|
||||||
'Resume',
|
|
||||||
'Call Report',
|
|
||||||
'RAP',
|
|
||||||
];
|
|
||||||
@endphp
|
@endphp
|
||||||
@foreach ($status_laporan as $item)
|
@foreach ($status_laporan as $item)
|
||||||
<div class="menu-item">
|
<option value="{{ strtolower($item) }}">{{ $item }}</option>
|
||||||
<label class="menu-link flex items-center px-4 py-2 text-sm text-gray-700">
|
|
||||||
<input type="checkbox"
|
|
||||||
class="form-checkbox status-checkbox h-4 w-4 text-blue-600"
|
|
||||||
value="{{ strtolower($item) }}">
|
|
||||||
<span class="ml-2">{{ $item }}</span>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
@endforeach
|
@endforeach
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
<!-- Buttons row at the bottom -->
|
||||||
<div class="flex flex-wrap gap-2.5">
|
<div class="grid grid-cols-1 gap-4 mt-2 md:grid-cols-2">
|
||||||
<div class="h-[24px] border border-r-gray-200"></div>
|
<button class="btn btn-sm btn-primary" id="filter_tanggal">
|
||||||
<button class="btn btn-light" id="export-button">
|
<i class="ki-outline ki-filter fs-2 me-1"></i>
|
||||||
Export Excel
|
Terapkan Filter
|
||||||
|
</button>
|
||||||
|
<button class="btn btn-sm btn-light" id="export-btn">
|
||||||
|
<i class="ki-outline ki-file-down fs-2 me-1"></i>
|
||||||
|
Export to Excel
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<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="laporan-penilai-jaminan-table"
|
||||||
|
data-api-url="{{ route('laporan-penilai-jaminan.datatables') }}">
|
||||||
|
<div class="flex-wrap py-5 card-header bg-agi-50">
|
||||||
|
<h3 class="card-title">
|
||||||
|
Daftar Laporan Penilai Jaminan
|
||||||
|
</h3>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="scrollable-x-auto">
|
<div class="scrollable-x-auto">
|
||||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm"
|
<table class="table text-sm font-medium text-gray-700 align-middle table-auto table-border"
|
||||||
data-datatable-table="true">
|
data-datatable-table="true">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="w-14">
|
<th class="w-14">
|
||||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox" />
|
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"
|
||||||
|
id="check-all" />
|
||||||
</th>
|
</th>
|
||||||
<th class="min-w-[150px]" data-datatable-column="nomor_registrasi">
|
<th class="min-w-[150px]" data-datatable-column="nomor_registrasi">
|
||||||
<span class="sort"><span class="sort-label">Nomor Registrasi</span>
|
<span class="sort"><span class="sort-label">Nomor Registrasi</span>
|
||||||
<span class="sort-icon"></span>
|
<span class="sort-icon"></span>
|
||||||
</span>
|
</span>
|
||||||
</th>
|
</th>
|
||||||
|
<th class="min-w-[150px]" data-datatable-column="tanggal_permohonan">
|
||||||
|
<span class="sort"> <span class="sort-label"> Tanggal Permohonan </span>
|
||||||
|
<span class="sort-icon"> </span> </span>
|
||||||
|
</th>
|
||||||
|
<th class="min-w-[150px]" data-datatable-column="branch">
|
||||||
|
<span class="sort"> <span class="sort-label"> Cabang </span>
|
||||||
|
<span class="sort-icon"> </span> </span>
|
||||||
|
</th>
|
||||||
<th class="min-w-[150px]" data-datatable-column="user_id">
|
<th class="min-w-[150px]" data-datatable-column="user_id">
|
||||||
<span class="sort"><span class="sort-label">User Pemohon</span>
|
<span class="sort"><span class="sort-label">Pemohon</span>
|
||||||
<span class="sort-icon"></span>
|
<span class="sort-icon"></span>
|
||||||
</span>
|
</span>
|
||||||
</th>
|
</th>
|
||||||
<th class="min-w-[150px]" data-datatable-column="debitur_id">
|
<th class="min-w-[150px]" data-datatable-column="debitur_id">
|
||||||
<span class="sort"><span class="sort-label">Debitur</span>
|
<span class="sort"><span class="sort-label">Nama Debitur</span>
|
||||||
<span class="sort-icon"></span>
|
<span class="sort-icon"></span>
|
||||||
</span>
|
</span>
|
||||||
</th>
|
</th>
|
||||||
@@ -157,29 +165,34 @@
|
|||||||
<span class="sort-icon"></span>
|
<span class="sort-icon"></span>
|
||||||
</span>
|
</span>
|
||||||
</th>
|
</th>
|
||||||
<th class="min-w-[150px]" data-datatable-column="tujuan_penilaian_id">
|
<th class="min-w-[150px]" data-datatable-column="jenis_agunan">
|
||||||
<span class="sort"> <span class="sort-label"> Jenis Jaminan </span>
|
<span class="sort"> <span class="sort-label"> Jenis Jaminan </span>
|
||||||
<span class="sort-icon"></span>
|
<span class="sort-icon"> </span> </span>
|
||||||
</span>
|
|
||||||
</th>
|
</th>
|
||||||
|
|
||||||
<th class="min-w-[150px]" data-datatable-column="laporan">
|
<th class="min-w-[150px]" data-datatable-column="laporan">
|
||||||
<span class="sort"><span class="sort-label">Laporan</span>
|
<span class="sort"><span class="sort-label">Laporan</span>
|
||||||
<span class="sort-icon"></span>
|
<span class="sort-icon"></span>
|
||||||
</span>
|
</span>
|
||||||
</th>
|
</th>
|
||||||
|
|
||||||
|
<th class="" data-datatable-column="actions">
|
||||||
|
<span class="sort"><span class="sort-label">Actions</span>
|
||||||
|
<span class="sort-icon"></span>
|
||||||
|
</span>
|
||||||
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
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 items-center gap-2">
|
<div class="flex gap-2 items-center">
|
||||||
Show
|
Show
|
||||||
<select class="select select-sm w-16" data-datatable-size="true" name="perpage"> </select> per
|
<select class="w-16 select select-sm" data-datatable-size="true" name="perpage"> </select> per
|
||||||
page
|
page
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-center gap-4">
|
<div class="flex gap-4 items-center">
|
||||||
<span data-datatable-info="true"> </span>
|
<span data-datatable-info="true"> </span>
|
||||||
<div class="pagination" data-datatable-pagination="true">
|
<div class="pagination" data-datatable-pagination="true">
|
||||||
</div>
|
</div>
|
||||||
@@ -191,34 +204,49 @@
|
|||||||
|
|
||||||
<!-- Form tersembunyi untuk export -->
|
<!-- Form tersembunyi untuk export -->
|
||||||
<form id="export-form" action="{{ route('laporan-penilai-jaminan.export') }}" method="GET" class="hidden">
|
<form id="export-form" action="{{ route('laporan-penilai-jaminan.export') }}" method="GET" class="hidden">
|
||||||
<input type="hidden" name="tanggal_awal" id="export_tanggal_awal">
|
<input type="hidden" name="start_date" id="export_tanggal_awal">
|
||||||
<input type="hidden" name="tanggal_akhir" id="export_tanggal_akhir">
|
<input type="hidden" name="end_date" id="export_tanggal_akhir">
|
||||||
<input type="hidden" name="status" id="export_status">
|
<input type="hidden" name="status" id="export_status">
|
||||||
|
<input type="hidden" name="branch_id" id="export_branch_id">
|
||||||
|
<input type="hidden" name="laporan" id="export_laporan">
|
||||||
<input type="hidden" name="selected_ids" id="export_selected_ids">
|
<input type="hidden" name="selected_ids" id="export_selected_ids">
|
||||||
<input type="hidden" name="export_type" id="export_type" value="all">
|
<input type="hidden" name="export_type" id="export_type" value="all">
|
||||||
|
<input type="hidden" id="export_search" name="search">
|
||||||
</form>
|
</form>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
|
|
||||||
@push('scripts')
|
@push('scripts')
|
||||||
<script type="module">
|
<script type="module">
|
||||||
const element = document.querySelector('#laporan-penilai-jaminan-table');
|
const element = document.querySelector('#laporan-penilai-jaminan-table');
|
||||||
|
|
||||||
const searchInput = document.getElementById('search');
|
const searchInput = document.getElementById('search');
|
||||||
const tanggalAwalInput = document.getElementById('tanggal_awal');
|
const startDateInput = document.getElementById('start_date');
|
||||||
const tanggalAkhirInput = document.getElementById('tanggal_akhir');
|
const endDateInput = document.getElementById('end_date');
|
||||||
|
const branchFilter = document.getElementById('branch_filter');
|
||||||
|
const laporanFilter = document.getElementById('laporan');
|
||||||
const filterTanggalButton = document.getElementById('filter_tanggal');
|
const filterTanggalButton = document.getElementById('filter_tanggal');
|
||||||
const selectAllCheckbox = document.getElementById('select-all');
|
const exportButton = document.getElementById('export-btn');
|
||||||
|
|
||||||
|
const selectAllCheckbox = document.getElementById('check-all');
|
||||||
const statusCheckboxes = document.querySelectorAll('.status-checkbox');
|
const statusCheckboxes = document.querySelectorAll('.status-checkbox');
|
||||||
|
|
||||||
// Export elements
|
// Export elements
|
||||||
const exportForm = document.getElementById('export-form');
|
const exportForm = document.getElementById('export-form');
|
||||||
const exportButton = document.getElementById('export-button');
|
const exportStartDate = document.getElementById('export_tanggal_awal');
|
||||||
const exportTanggalAwal = document.getElementById('export_tanggal_awal');
|
const exportEndDate = document.getElementById('export_tanggal_akhir');
|
||||||
const exportTanggalAkhir = document.getElementById('export_tanggal_akhir');
|
const exportBranchId = document.getElementById('export_branch_id');
|
||||||
|
const exportLaporan = document.getElementById('export_laporan');
|
||||||
const exportStatus = document.getElementById('export_status');
|
const exportStatus = document.getElementById('export_status');
|
||||||
const exportSelectedIds = document.getElementById('export_selected_ids');
|
const exportSelectedIds = document.getElementById('export_selected_ids');
|
||||||
const exportType = document.getElementById('export_type');
|
const exportType = document.getElementById('export_type');
|
||||||
|
const exportSearch = document.getElementById('export_search');
|
||||||
const apiUrl = element.getAttribute('data-api-url');
|
const apiUrl = element.getAttribute('data-api-url');
|
||||||
|
|
||||||
|
// Simple pagination state management
|
||||||
|
let currentPage = 1;
|
||||||
|
let isReturningFromDetail = false;
|
||||||
|
|
||||||
const dataTableOptions = {
|
const dataTableOptions = {
|
||||||
apiEndpoint: apiUrl,
|
apiEndpoint: apiUrl,
|
||||||
pageSize: 5,
|
pageSize: 5,
|
||||||
@@ -245,12 +273,24 @@
|
|||||||
nomor_registrasi: {
|
nomor_registrasi: {
|
||||||
title: 'Nomor Registrasi',
|
title: 'Nomor Registrasi',
|
||||||
},
|
},
|
||||||
|
tanggal_permohonan: {
|
||||||
|
title: 'Tanggal Permohonan',
|
||||||
|
render: (item, data) => {
|
||||||
|
return data.tanggal_permohonan ? window.formatTanggalIndonesia(data.tanggal_permohonan) :
|
||||||
|
'-';
|
||||||
|
},
|
||||||
|
},
|
||||||
|
branch: {
|
||||||
|
title: 'Cabang',
|
||||||
|
render: (item, data) => {
|
||||||
|
return data.branch && data.branch.name ? `${data.branch.name}` : '-';
|
||||||
|
},
|
||||||
|
},
|
||||||
user_id: {
|
user_id: {
|
||||||
title: 'User Pemohon',
|
title: 'User Pemohon',
|
||||||
render: (item, data) => {
|
render: (item, data) => {
|
||||||
return data.user && data.user.name ? `${data.user.name}` : '-';
|
return data?.user?.name ?? data?.mig_nama_ao ?? '-';
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
debitur_id: {
|
debitur_id: {
|
||||||
title: 'Debitur',
|
title: 'Debitur',
|
||||||
@@ -265,18 +305,18 @@
|
|||||||
`${data.tujuan_penilaian.name}` : '-';
|
`${data.tujuan_penilaian.name}` : '-';
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
jenis_jaminan_id: {
|
jenis_agunan: {
|
||||||
title: 'Jenis Jaminan',
|
title: 'Jenis Jaminan',
|
||||||
render: (item, data) => {
|
render: (item, data) => {
|
||||||
const jenisJaminan = data.dokumenjaminan.map(d => d.jenis_jaminan.name).join(', ');
|
return data.dokumenjaminan.map((item) => {
|
||||||
return jenisJaminan || '-';
|
return item.jenis_jaminan ? item.jenis_jaminan.name : '-';
|
||||||
}
|
}).join(', ');
|
||||||
|
},
|
||||||
},
|
},
|
||||||
laporan: {
|
laporan: {
|
||||||
title: 'Status',
|
title: 'Status',
|
||||||
render: (item, data) => {
|
render: (item, data) => {
|
||||||
let badgeClass = '';
|
let badgeClass = '';
|
||||||
|
|
||||||
const statusLaporan = data.penilai?.type_penilai || '-';
|
const statusLaporan = data.penilai?.type_penilai || '-';
|
||||||
|
|
||||||
switch (statusLaporan.toLowerCase()) {
|
switch (statusLaporan.toLowerCase()) {
|
||||||
@@ -302,17 +342,114 @@
|
|||||||
return `<span class="badge ${badgeClass}">${statusLaporan}</span>`;
|
return `<span class="badge ${badgeClass}">${statusLaporan}</span>`;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
actions: {
|
||||||
|
title: 'Action',
|
||||||
|
render: (item, data) => {
|
||||||
|
const status = data.status;
|
||||||
|
const dokumenjaminan = data.dokumenjaminan || [];
|
||||||
|
|
||||||
|
return `
|
||||||
|
<div class="flex flex-nowrap gap-1 justify-center">
|
||||||
|
${
|
||||||
|
['done'].includes(status) ?
|
||||||
|
dokumenjaminan.map(dokumen => {
|
||||||
|
return `
|
||||||
|
<a class="btn btn-sm btn-primary" href="surveyor/print-out-inspeksi/${data.id}/${dokumen.id}/${dokumen.jenis_jaminan_id}">
|
||||||
|
<i class="ki-outline ki-printer"></i>Inspeksi
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-sm btn-info detail-btn" href="laporan-penilai-jaminan/show/${data.id}/${dokumen.id}/${dokumen.jenis_jaminan_id}">
|
||||||
|
<i class="ki-filled ki-eye"></i>Lihat
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-sm btn-success" href="penilai/print-out-laporan/${data.id}/${dokumen.id}/${dokumen.jenis_jaminan_id}">
|
||||||
|
<i class="ki-filled ki-printer"></i>Laporan
|
||||||
|
</a>
|
||||||
|
`;
|
||||||
|
}).join('') : ''
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||||
|
const fromDetail = true;
|
||||||
|
if (fromDetail) {
|
||||||
|
isReturningFromDetail = true;
|
||||||
|
console.log('Returning from detail page');
|
||||||
|
// Remove the parameter from URL
|
||||||
|
window.history.replaceState({}, document.title, window.location.pathname);
|
||||||
|
setTimeout(() => {
|
||||||
|
restoreCurrentPage();
|
||||||
|
isReturningFromDetail = false;
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
|
|
||||||
|
function getCurrentPageFromDOM() {
|
||||||
|
const activePage = document.querySelector('.pagination .btn.active');
|
||||||
|
if (activePage) {
|
||||||
|
const pageText = activePage.textContent.trim();
|
||||||
|
const pageNum = parseInt(pageText);
|
||||||
|
return isNaN(pageNum) ? 1 : pageNum;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
function saveCurrentPage() {
|
||||||
|
const page = getCurrentPageFromDOM();
|
||||||
|
currentPage = page;
|
||||||
|
sessionStorage.setItem('currentTablePage', currentPage.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
function restoreCurrentPage() {
|
||||||
|
const savedPage = sessionStorage.getItem('currentTablePage');
|
||||||
|
if (savedPage && savedPage !== '1') {
|
||||||
|
currentPage = parseInt(savedPage);
|
||||||
|
console.log('Restoring to page:', currentPage);
|
||||||
|
|
||||||
|
// Use the goPage method to navigate to the saved page
|
||||||
|
dataTable.goPage(currentPage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Listen for pagination events to track current page
|
||||||
|
element.addEventListener('pagination', function(e) {
|
||||||
|
const page = e.detail.page;
|
||||||
|
currentPage = page;
|
||||||
|
console.log('Page changed to:', page);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Alternative: Listen for pagination button clicks
|
||||||
|
document.addEventListener('click', function(e) {
|
||||||
|
if (e.target.matches('.pagination .btn') && !e.target.closest('.detail-btn')) {
|
||||||
|
setTimeout(() => {
|
||||||
|
currentPage = getCurrentPageFromDOM();
|
||||||
|
console.log('Current page updated to:', currentPage);
|
||||||
|
}, 100);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Detail page redirection
|
||||||
|
document.addEventListener('click', function(e) {
|
||||||
|
if (e.target.closest('.detail-btn')) {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
// Save current page before navigating
|
||||||
|
const currentPageNum = getCurrentPageFromDOM();
|
||||||
|
currentPage = currentPageNum;
|
||||||
|
sessionStorage.setItem('currentTablePage', currentPage.toString());
|
||||||
|
console.log('Saving page before detail navigation:', currentPage);
|
||||||
|
|
||||||
|
const link = e.target.closest('.detail-btn');
|
||||||
|
const href = link.getAttribute('href');
|
||||||
|
window.location.href = href;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Search functionality
|
// Search functionality
|
||||||
searchInput.addEventListener('input', function() {
|
searchInput.addEventListener('input', function() {
|
||||||
const searchValue = this.value.trim();
|
applyDateFilter();
|
||||||
dataTable.search(searchValue, true);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Filter by date range
|
// Filter by date range
|
||||||
@@ -321,20 +458,30 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
function applyDateFilter() {
|
function applyDateFilter() {
|
||||||
const tanggalAwal = tanggalAwalInput.value;
|
const startDate = startDateInput.value;
|
||||||
const tanggalAkhir = tanggalAkhirInput.value;
|
const endDate = endDateInput.value;
|
||||||
|
const branch = branchFilter.value;
|
||||||
|
const laporan = Array.from(laporanFilter.selectedOptions).map(option => option.value);
|
||||||
|
|
||||||
let filters = {};
|
let filters = {};
|
||||||
if (searchInput.value) {
|
if (searchInput.value) {
|
||||||
filters.search = searchInput.value;
|
filters.search = searchInput.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tanggalAwal) {
|
if (startDate) {
|
||||||
filters.tanggal_awal = tanggalAwal
|
filters.start_date = startDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tanggalAkhir) {
|
if (endDate) {
|
||||||
filters.tanggal_akhir = tanggalAkhir
|
filters.end_date = endDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (branch) {
|
||||||
|
filters.branch_id = branch;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (laporan.length > 0) {
|
||||||
|
filters.laporan = laporan;
|
||||||
}
|
}
|
||||||
|
|
||||||
dataTable.search(filters);
|
dataTable.search(filters);
|
||||||
@@ -361,10 +508,8 @@
|
|||||||
|
|
||||||
if (selectedStatuses.length === 0) {
|
if (selectedStatuses.length === 0) {
|
||||||
dataTable.search('');
|
dataTable.search('');
|
||||||
console.log(selectedStatuses);
|
|
||||||
} else {
|
} else {
|
||||||
dataTable.search(selectedStatuses.join(','), true);
|
dataTable.search(selectedStatuses.join(','), true);
|
||||||
console.log(selectedStatuses);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dataTable.reload();
|
dataTable.reload();
|
||||||
@@ -374,30 +519,33 @@
|
|||||||
selectAllCheckbox.checked = allChecked;
|
selectAllCheckbox.checked = allChecked;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Single export button functionality
|
// Export functionality
|
||||||
exportButton.addEventListener('click', function(e) {
|
exportButton.addEventListener('click', function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
// Check if any rows are selected
|
|
||||||
const selectedIds = getSelectedRowIds();
|
const selectedIds = getSelectedRowIds();
|
||||||
|
|
||||||
// Determine export type based on context
|
|
||||||
if (selectedIds.length > 0) {
|
if (selectedIds.length > 0) {
|
||||||
// If rows are selected, export those
|
|
||||||
exportData({
|
exportData({
|
||||||
selected_ids: selectedIds,
|
selected_ids: selectedIds,
|
||||||
export_type: 'selected'
|
export_type: 'selected'
|
||||||
});
|
});
|
||||||
} else if (tanggalAwalInput.value && tanggalAkhirInput.value || getSelectedStatuses().length > 0) {
|
} else if (startDateInput.value && endDateInput.value || getSelectedStatuses().length > 0) {
|
||||||
// If filters are applied but no rows selected, export filtered data
|
|
||||||
exportData({
|
exportData({
|
||||||
tanggal_awal: tanggalAwalInput.value,
|
start_date: startDateInput.value,
|
||||||
tanggal_akhir: tanggalAkhirInput.value,
|
end_date: endDateInput.value,
|
||||||
|
branch_id: branchFilter.value,
|
||||||
|
laporan: Array.from(laporanFilter.selectedOptions).map(option => option.value),
|
||||||
status: getSelectedStatuses(),
|
status: getSelectedStatuses(),
|
||||||
|
search: searchInput.value,
|
||||||
|
export_type: 'filtered'
|
||||||
|
});
|
||||||
|
} else if (searchInput.value) {
|
||||||
|
exportData({
|
||||||
|
search: searchInput.value,
|
||||||
export_type: 'filtered'
|
export_type: 'filtered'
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// If no selection and no filters, export all
|
|
||||||
exportData({
|
exportData({
|
||||||
export_type: 'all'
|
export_type: 'all'
|
||||||
});
|
});
|
||||||
@@ -405,14 +553,14 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
function exportData(filters = {}) {
|
function exportData(filters = {}) {
|
||||||
// Set filter values in the hidden form
|
exportStartDate.value = filters.start_date || '';
|
||||||
exportTanggalAwal.value = filters.tanggal_awal || '';
|
exportEndDate.value = filters.end_date || '';
|
||||||
exportTanggalAkhir.value = filters.tanggal_akhir || '';
|
|
||||||
exportStatus.value = filters.status ? filters.status.join(',') : '';
|
exportStatus.value = filters.status ? filters.status.join(',') : '';
|
||||||
|
exportBranchId.value = filters.branch_id || '';
|
||||||
|
exportLaporan.value = filters.laporan ? filters.laporan.join(',') : '';
|
||||||
exportSelectedIds.value = filters.selected_ids ? filters.selected_ids.join(',') : '';
|
exportSelectedIds.value = filters.selected_ids ? filters.selected_ids.join(',') : '';
|
||||||
exportType.value = filters.export_type || 'all';
|
exportType.value = filters.export_type || 'all';
|
||||||
|
exportSearch.value = filters.search || '';
|
||||||
// Submit the form
|
|
||||||
exportForm.submit();
|
exportForm.submit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -426,5 +574,12 @@
|
|||||||
const checkboxes = document.querySelectorAll('[data-datatable-row-check="true"]:checked');
|
const checkboxes = document.querySelectorAll('[data-datatable-row-check="true"]:checked');
|
||||||
return Array.from(checkboxes).map(checkbox => checkbox.value);
|
return Array.from(checkboxes).map(checkbox => checkbox.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Save page before leaving (only when not going to detail)
|
||||||
|
window.addEventListener('beforeunload', function() {
|
||||||
|
if (!isReturningFromDetail) {
|
||||||
|
saveCurrentPage();
|
||||||
|
}
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
@endpush
|
@endpush
|
||||||
|
|||||||
117
resources/views/laporan-penilai-jaminan/show.blade.php
Normal file
117
resources/views/laporan-penilai-jaminan/show.blade.php
Normal file
@@ -0,0 +1,117 @@
|
|||||||
|
@extends('layouts.main')
|
||||||
|
|
||||||
|
@section('breadcrumbs')
|
||||||
|
{{-- {{ Breadcrumbs::render(request()->route()->getName()) }} --}}
|
||||||
|
@endsection
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-header py-5 flex-wrap">
|
||||||
|
<div class="card-title flex flex-row gap-1.5">
|
||||||
|
<button id="tab-laporan" class="btn btn-sm btn-primary">Laporan</button>
|
||||||
|
<button id="tab-hasil" class="btn btn-sm btn-light">Hasil Inspeksi</button>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-wrap gap-2.5">
|
||||||
|
<a href="{{ route('laporan-penilai-jaminan.index') }}" class="btn btn-xs btn-info"><i
|
||||||
|
class="ki-filled ki-exit-left"></i>
|
||||||
|
Back</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
@php
|
||||||
|
$permohonan_id = request()->segment(3);
|
||||||
|
$dokumen_id = request()->segment(4);
|
||||||
|
$jenis_jaminan_id = request()->segment(5);
|
||||||
|
@endphp
|
||||||
|
|
||||||
|
<div id="laporan" class="tab-content">
|
||||||
|
<div class="floating-button">
|
||||||
|
<a href="penilai/print-out-laporan/{{ $permohonan_id }}/{{ $dokumen_id }}/{{ $jenis_jaminan_id }}" class="btn btn-primary">
|
||||||
|
Cetak Laporan
|
||||||
|
<i class="ki-filled ki-printer"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@php
|
||||||
|
$laporan = [
|
||||||
|
'sederhana' => 'lpj::penilai.components.print-out-sederhana',
|
||||||
|
'standar' => 'lpj::penilai.components.print-out-standar',
|
||||||
|
'resume' => 'lpj::penilai.components.print-resume',
|
||||||
|
'memo' => 'lpj::penilai.components.print-memo',
|
||||||
|
'rap' => 'lpj::penilai.components.print-out-rap',
|
||||||
|
'call-report' => 'penilai.components.print-out-call-report',
|
||||||
|
];
|
||||||
|
@endphp
|
||||||
|
@if (array_key_exists($lpj->type_penilai, $laporan))
|
||||||
|
@include($laporan[$lpj->type_penilai])
|
||||||
|
@else
|
||||||
|
<p>Tipe laporan tidak ditemukan.</p>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
<div id="hasil-inspeksi" class="tab-content hidden-tab">
|
||||||
|
<div class="floating-button">
|
||||||
|
<a href="surveyor/print-out-inspeksi/{{ $permohonan_id }}/{{ $dokumen_id }}/{{ $jenis_jaminan_id }}"
|
||||||
|
class="btn btn-primary">
|
||||||
|
Cetak Laporan
|
||||||
|
<i class="ki-filled ki-printer"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
@include('lpj::surveyor.components.print-out.main')
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
|
const tabLaporan = document.getElementById('tab-laporan');
|
||||||
|
const tabHasil = document.getElementById('tab-hasil');
|
||||||
|
const laporanContent = document.getElementById('laporan');
|
||||||
|
const hasilContent = document.getElementById('hasil-inspeksi');
|
||||||
|
|
||||||
|
tabLaporan.addEventListener('click', () => {
|
||||||
|
tabLaporan.classList.add('btn-primary');
|
||||||
|
tabLaporan.classList.remove('btn-light');
|
||||||
|
tabHasil.classList.add('btn-light');
|
||||||
|
tabHasil.classList.remove('btn-primary');
|
||||||
|
laporanContent.classList.remove('hidden-tab');
|
||||||
|
hasilContent.classList.add('hidden-tab');
|
||||||
|
});
|
||||||
|
|
||||||
|
tabHasil.addEventListener('click', () => {
|
||||||
|
tabHasil.classList.add('btn-primary');
|
||||||
|
tabHasil.classList.remove('btn-light');
|
||||||
|
tabLaporan.classList.add('btn-light');
|
||||||
|
tabLaporan.classList.remove('btn-primary');
|
||||||
|
laporanContent.classList.add('hidden-tab');
|
||||||
|
hasilContent.classList.remove('hidden-tab');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.hidden-tab {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.floating-button {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 20px;
|
||||||
|
right: 20px;
|
||||||
|
z-index: 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.floating-button .btn {
|
||||||
|
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
||||||
|
border-radius: 50px;
|
||||||
|
padding: 10px 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.floating-button .btn:hover {
|
||||||
|
transform: scale(1.05);
|
||||||
|
transition: transform 0.2s ease-in-out;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
{{-- @include('lpj::surveyor.js.utils') --}}
|
||||||
|
@endsection
|
||||||
@@ -151,7 +151,7 @@
|
|||||||
user_id: {
|
user_id: {
|
||||||
title: 'User Pemohon',
|
title: 'User Pemohon',
|
||||||
render: (item, data) => {
|
render: (item, data) => {
|
||||||
return `${data.user.name}`;
|
return `${data.user?.name}`;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
tujuan_penilaian_id: {
|
tujuan_penilaian_id: {
|
||||||
@@ -180,16 +180,16 @@
|
|||||||
jenis_fasilitas_kredit_id: {
|
jenis_fasilitas_kredit_id: {
|
||||||
title: 'Fasilitas Kredit',
|
title: 'Fasilitas Kredit',
|
||||||
render: (item, data) => {
|
render: (item, data) => {
|
||||||
return `${data.jenis_fasilitas_kredit.name}`;
|
return `${data.jenis_fasilitas_kredit?.name}`;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
tanggal_survei: {
|
tanggal_survei: {
|
||||||
title: 'Tanggal Survei',
|
title: 'Tanggal Survei',
|
||||||
render: (item, data) => {
|
render: (item, data) => {
|
||||||
if (data.penilaian.waktu_penilaian) {
|
if (data.penilaian?.waktu_penilaian) {
|
||||||
return `${formatDate(new Date(data.penilaian.waktu_penilaian))}`;
|
return `${formatDate(new Date(data.penilaian?.waktu_penilaian))}`;
|
||||||
}
|
}
|
||||||
return `${formatDate(new Date(data.penilaian.created_at))}`;
|
return `${formatDate(new Date(data.penilaian?.created_at))}`;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
due_date_sla: {
|
due_date_sla: {
|
||||||
@@ -197,10 +197,10 @@
|
|||||||
render: (item, data) => {
|
render: (item, data) => {
|
||||||
const tujuan_penilaian = data.tujuan_penilaian.name;
|
const tujuan_penilaian = data.tujuan_penilaian.name;
|
||||||
const tipe_laporan = data.penilai?.type;
|
const tipe_laporan = data.penilai?.type;
|
||||||
const nilai_plafond = data.penilaian.nilaiPlafond?.name;
|
const nilai_plafond = data.penilaian?.nilaiPlafond?.name;
|
||||||
let waktu_penilaian = new Date(data.penilaian.created_at);
|
let waktu_penilaian = new Date(data.penilaian?.created_at);
|
||||||
if (data.penilaian.waktu_penilaian) {
|
if (data.penilaian?.waktu_penilaian) {
|
||||||
waktu_penilaian = new Date(data.penilaian.waktu_penilaian);
|
waktu_penilaian = new Date(data.penilaian?.waktu_penilaian);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tujuan_penilaian.name === "RAP") {
|
if (tujuan_penilaian.name === "RAP") {
|
||||||
|
|||||||
@@ -6,8 +6,7 @@
|
|||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
<div class="grid gap-5 mx-auto w-full lg:gap-7.5">
|
<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"
|
<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') }}">
|
||||||
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">
|
<div class="flex-wrap py-5 card-header bg-agi-50">
|
||||||
<h3 class="card-title">
|
<h3 class="card-title">
|
||||||
Daftar NOC Penyelesaian
|
Daftar NOC Penyelesaian
|
||||||
|
|||||||
Reference in New Issue
Block a user