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:
Daeng Deni Mardaeni
2025-11-10 20:47:56 +07:00
parent 42d6e06a48
commit c153990c52
13 changed files with 964 additions and 623 deletions

View File

@@ -26,18 +26,21 @@ use Modules\Lpj\Http\Requests\FormSurveyorRequest;
use Modules\Lpj\Models\Authorization;
use Modules\Lpj\Models\Debiture;
use Modules\Lpj\Services\SaveFormInspesksiService;
use Modules\Lpj\Services\PreviewLaporanService;
class PenilaiController extends Controller
{
public $user;
protected $surveyorController;
protected $inspeksiService;
protected $previewLaporanService;
public function __construct(SurveyorController $surveyorController, SaveFormInspesksiService $inspeksiService)
public function __construct(SurveyorController $surveyorController, SaveFormInspesksiService $inspeksiService, PreviewLaporanService $previewLaporanService)
{
$this->surveyorController = $surveyorController;
$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'));
}
/**
* Remove the specified resource from storage.
*/
public function destroy($id)
{
//
}
public function dataForDatatables(Request $request)
{
@@ -701,15 +698,17 @@ class PenilaiController extends Controller
'lokasi_lengkap' => $data->lokasi_lengkap ?? '',
];
// Extract data pembanding
if (isset($dataPembanding['data_pembanding'])) {
foreach ($dataPembanding['data_pembanding'] as $index => $pembanding) {
if ($index == 0) {
$exportData['pembanding1'] = $pembanding;
} elseif ($index == 1) {
$exportData['pembanding2'] = $pembanding;
} elseif ($index == 2) {
$exportData['pembanding3'] = $pembanding;
if(isset($dataPembanding)){
// Extract data pembanding
if (isset($dataPembanding['data_pembanding'])) {
foreach ($dataPembanding['data_pembanding'] as $index => $pembanding) {
if ($index == 0) {
$exportData['pembanding1'] = $pembanding;
} elseif ($index == 1) {
$exportData['pembanding2'] = $pembanding;
} elseif ($index == 2) {
$exportData['pembanding3'] = $pembanding;
}
}
}
}
@@ -1276,8 +1275,6 @@ class PenilaiController extends Controller
}
}
public function print_out(Request $request)
{
$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)
{
$viewMap = [
@@ -1772,4 +1778,24 @@ class PenilaiController extends Controller
'message' => 'Berhasil Revisi Ke surveyor',
], 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)
{
}
}