Compare commits
42 Commits
d068593177
...
e55184591c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e55184591c | ||
|
|
f928cf1d76 | ||
|
|
bfc515f3ed | ||
|
|
e968cefe0d | ||
|
|
8c08b46c8f | ||
|
|
f65b9bec23 | ||
|
|
d51f9f902c | ||
|
|
9a6223ac26 | ||
|
|
2efcf7d85c | ||
|
|
025cb3d5b8 | ||
|
|
85644362a9 | ||
|
|
33162704e8 | ||
|
|
25735d205f | ||
|
|
5389cd1d3a | ||
|
|
2793e397b0 | ||
|
|
476106a58c | ||
|
|
f253d0c14c | ||
|
|
cc500bfcac | ||
|
|
03b0ba4ac0 | ||
|
|
f6bae680af | ||
|
|
2759fdc8d9 | ||
|
|
e08130132f | ||
|
|
222ada0f0c | ||
|
|
e6b6ad6e2c | ||
|
|
7fd77dde57 | ||
|
|
b8a492e842 | ||
|
|
fbabb2efaa | ||
|
|
2a475a9ea7 | ||
|
|
ecbeb15d2f | ||
|
|
6102205900 | ||
|
|
a8be1591c3 | ||
|
|
94fc66a48f | ||
|
|
88bd409d42 | ||
|
|
222cbd8df8 | ||
|
|
77189701d6 | ||
|
|
3d7da22ac0 | ||
|
|
18ec35f272 | ||
|
|
7766d127e0 | ||
|
|
9d29cb3540 | ||
|
|
009cdf2955 | ||
|
|
2045da36d8 | ||
|
|
dfa364cdd8 |
@@ -392,7 +392,7 @@ class ActivityController extends Controller
|
||||
$q->where('user_id', $id);
|
||||
})
|
||||
->whereHas('permohonan', function ($q) {
|
||||
$q->whereIn('status', ['assign', 'proses-laporan', 'done', 'proses-survey', 'request-reschedule', 'reschedule', 'rejected-reschedule', 'approved-reschedule', 'revisi-laporan', 'survey']);
|
||||
$q->whereNotIn('status', ['done']);
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ class LaporanController extends Controller
|
||||
'penilai',
|
||||
'dokumenjaminan',
|
||||
])->find($id);
|
||||
|
||||
|
||||
if ($permohonan->penilai->type_penilai == 'memo') {
|
||||
return $this->penilaiController->print_out($request = new Request(['documentId' => $permohonan->penilai->dokument_id, 'jaminanId' => $permohonan->dokumenjaminan[0]->jenis_jaminan_id, 'permohonanId' => $permohonan->id, 'statusLpj' => 1, 'type' => 'memo']));
|
||||
}
|
||||
@@ -75,7 +75,7 @@ class LaporanController extends Controller
|
||||
}
|
||||
|
||||
// Retrieve data from the database
|
||||
$query = Permohonan::query()->whereIn('status',['proses-laporan','done'])->whereNotNull('approval_so_at')->whereNotNull('approval_eo_at')->where(function ($q) {
|
||||
$query = Permohonan::query()->whereIn('status',['proses-laporan','done', 'paparan', 'proses-paparan'])->whereNotNull('approval_so_at')->whereNotNull('approval_eo_at')->where(function ($q) {
|
||||
$q->whereIn('nilai_plafond_id', [1,4])
|
||||
->whereNotNull('approval_dd_at')
|
||||
->orWhereIn('nilai_plafond_id', [2,3]);
|
||||
|
||||
@@ -1,282 +1,304 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Controllers;
|
||||
namespace Modules\Lpj\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Exception;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
use Modules\Lpj\Http\Requests\PersetujuanPenawaranRequest;
|
||||
use Modules\Lpj\Models\PenawaranTender;
|
||||
use Modules\Lpj\Models\Permohonan;
|
||||
use Modules\Lpj\Models\PersetujuanPenawaran;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Exception;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
use Modules\Lpj\Http\Requests\PersetujuanPenawaranRequest;
|
||||
use Modules\Lpj\Models\PenawaranTender;
|
||||
use Modules\Lpj\Models\Permohonan;
|
||||
use Modules\Lpj\Models\PersetujuanPenawaran;
|
||||
|
||||
// use Modules\Lpj\Models\JenisPenilaian;
|
||||
// use Modules\Lpj\Models\JenisPenilaian;
|
||||
|
||||
// use Modules\Lpj\Models\Regions;
|
||||
// use Modules\Lpj\Models\Regions;
|
||||
|
||||
class PembayaranController extends Controller
|
||||
class PembayaranController extends Controller
|
||||
{
|
||||
public $user;
|
||||
|
||||
public function index()
|
||||
{
|
||||
public $user;
|
||||
|
||||
public function index()
|
||||
{
|
||||
return view('lpj::pembayaran.index');
|
||||
}
|
||||
|
||||
public function approval() {
|
||||
return view('lpj::pembayaran.approval');
|
||||
}
|
||||
|
||||
public function dataApprovalForDatatables(Request $request) {
|
||||
if (is_null($this->user) || !$this->user->can('noc.view')) {
|
||||
//abort(403, 'Sorry! You are not allowed to view persetujuan penawaran.');
|
||||
}
|
||||
|
||||
// Retrieve data from the database
|
||||
$query = PersetujuanPenawaran::query();
|
||||
|
||||
// Apply search filter if provided
|
||||
if ($request->has('search') && !empty($request->get('search'))) {
|
||||
$search = $request->get('search');
|
||||
$query->where(function ($q) use ($search) {
|
||||
$q->orWhereRelation('penawaran', 'nomor_registrasi', 'LIKE', '%' . $search . '%');
|
||||
});
|
||||
}
|
||||
|
||||
// Apply sorting if provided
|
||||
if ($request->has('sortOrder') && !empty($request->get('sortOrder'))) {
|
||||
$order = $request->get('sortOrder');
|
||||
$column = $request->get('sortField');
|
||||
$query->orderBy($column, $order);
|
||||
}
|
||||
|
||||
// Get the total count of records
|
||||
$totalRecords = $query->count();
|
||||
|
||||
// Apply pagination if provided
|
||||
if ($request->has('page') && $request->has('size')) {
|
||||
$page = $request->get('page');
|
||||
$size = $request->get('size');
|
||||
$offset = ($page - 1) * $size; // Calculate the offset
|
||||
|
||||
$query->skip($offset)->take($size);
|
||||
}
|
||||
|
||||
// Get the filtered count of records
|
||||
$filteredRecords = $query->count();
|
||||
|
||||
// Get the data for the current page
|
||||
$data = $query
|
||||
->with(
|
||||
[
|
||||
'penawaran.permohonan.user',
|
||||
'penawaran.permohonan.debiture',
|
||||
'penawaran.permohonan.branch',
|
||||
'permohonan.debiture',
|
||||
'permohonan.branch',
|
||||
'permohonan.user',
|
||||
'permohonan.approveBayar',
|
||||
'penawaran.permohonan.approveBayar',
|
||||
'penawaran.detail',
|
||||
'penawaran.persetujuan',
|
||||
],
|
||||
)->get();
|
||||
|
||||
|
||||
// Calculate the page count
|
||||
$pageCount = ceil($totalRecords / $request->get('size'));
|
||||
|
||||
// Calculate the current page number
|
||||
$currentPage = $request->get('page', 1);
|
||||
|
||||
// Return the response data as a JSON object
|
||||
return response()->json([
|
||||
'draw' => $request->get('draw'),
|
||||
'recordsTotal' => $totalRecords,
|
||||
'recordsFiltered' => $filteredRecords,
|
||||
'pageCount' => $pageCount,
|
||||
'page' => $currentPage,
|
||||
'totalCount' => $totalRecords,
|
||||
'data' => $data,
|
||||
]);
|
||||
}
|
||||
|
||||
function edit($id)
|
||||
{
|
||||
$permohonan = Permohonan::find($id);
|
||||
return view('lpj::pembayaran.form', compact('permohonan'));
|
||||
}
|
||||
|
||||
public function store(PersetujuanPenawaranRequest $request)
|
||||
{
|
||||
$validated = $request->validated();
|
||||
$validated['created_by'] = Auth::id();
|
||||
$validated['status'] = '0';
|
||||
|
||||
if (isset($validated['penawaran_id'])) {
|
||||
$persetujuanPenawaran = PersetujuanPenawaran::create(
|
||||
['penawaran_id' => $validated['penawaran_id']],
|
||||
$validated,
|
||||
);
|
||||
} else {
|
||||
$persetujuanPenawaran = PersetujuanPenawaran::create(
|
||||
$validated
|
||||
);
|
||||
}
|
||||
|
||||
$folderPath = 'persetujuan_penawaran/' . $validated['penawaran_id'];
|
||||
|
||||
if ($request->hasFile('bukti_bayar')) {
|
||||
$persetujuanPenawaran->bukti_bayar = $request->file('bukti_bayar')->store($folderPath, 'public');
|
||||
}
|
||||
|
||||
$persetujuanPenawaran->save();
|
||||
|
||||
// Update the status of the related permohonan to 'spk'
|
||||
$permohonan = Permohonan::find(request()->get('permohonan_id'));
|
||||
if ($permohonan) {
|
||||
$permohonan->status_bayar = request()->get('status_bayar');
|
||||
$permohonan->save();
|
||||
|
||||
// andy add, update status penawaran.status='spk'
|
||||
// $penawaran = PenawaranTender::where('nomor_registrasi',$permohonan->nomor_registrasi)->first();
|
||||
PenawaranTender::where('nomor_registrasi', $permohonan->nomor_registrasi)->update([
|
||||
'status' => 'noc',
|
||||
'updated_by' => Auth::id(),
|
||||
'updated_at' => now(),
|
||||
]);
|
||||
// andy add, update status penawaran.status='spk'
|
||||
|
||||
}
|
||||
|
||||
return redirect()
|
||||
->route('pembayaran.index')->with('success', 'Pembayaran berhasil disimpan.');
|
||||
}
|
||||
|
||||
public function update(Request $request, $id)
|
||||
: JsonResponse {
|
||||
// init
|
||||
$data = [];
|
||||
$output = [];
|
||||
$tindakan = null;
|
||||
if (request()->ajax()) {
|
||||
try {
|
||||
$data = [
|
||||
'approve_bayar_by' => Auth::id(),
|
||||
'approve_bayar_at' => now(),
|
||||
];
|
||||
|
||||
if ($request->keterangan) {
|
||||
$data['approve_keterangan_bayar'] = $request->keterangan;
|
||||
}
|
||||
$output['data'] = $data;
|
||||
|
||||
// Update the status of the related permohonan to 'spk'
|
||||
$permohonan = Permohonan::find($id);
|
||||
|
||||
if ($permohonan) {
|
||||
$data['status_bayar'] = 'sudah_bayar';
|
||||
if($permohonan->jenis_penilaian_id == 2) {
|
||||
$data['status'] = 'spk';
|
||||
}
|
||||
|
||||
$permohonan->update($data);
|
||||
|
||||
if($permohonan->jenis_penilaian_id == 2) {
|
||||
PenawaranTender::where('nomor_registrasi', $permohonan->nomor_registrasi)->update([
|
||||
'status' => 'spk',
|
||||
'updated_by' => Auth::id(),
|
||||
'updated_at' => now(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
$output['status'] = 'success';
|
||||
$output['message'] = ['Otorisasi' . $permohonan->nomor_registrasi . 'berhasil di lakukan'];
|
||||
} catch (Exception $e) {
|
||||
$output['status'] = 'error';
|
||||
$output['message'] = ['Otorisasi gagal di lakukan.'];
|
||||
}
|
||||
}
|
||||
return response()->json($output);
|
||||
}
|
||||
|
||||
public function dataForDatatables(Request $request)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('debitur.view')) {
|
||||
// abort(403, 'Sorry! You are not allowed to view users.');
|
||||
}
|
||||
|
||||
$query = Permohonan::query()->where(['status_bayar' => 'belum_bayar', 'jenis_penilaian_id' => 1])
|
||||
->whereNotIn('id', function($subquery) {
|
||||
$subquery->select('permohonan_id')
|
||||
->from('persetujuan_penawaran')
|
||||
->whereNotNull('permohonan_id');
|
||||
});
|
||||
|
||||
// Pencarian berdasarkan parameter search
|
||||
if ($request->has('search') && !empty($request->get('search'))) {
|
||||
$search = $request->get('search');
|
||||
$query->where(function ($q) use ($search) {
|
||||
$q->where('nomor_registrasi', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhere('tanggal_permohonan', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhereRelation('user', 'name', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhereRelation('debiture', 'name', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhereRelation('jenisPenilaian', 'name', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhereRelation('branch', 'name', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhere('status', 'LIKE', '%' . $search . '%');
|
||||
});
|
||||
}
|
||||
|
||||
// Sorting berdasarkan sortField dan sortOrder
|
||||
if ($request->has('sortOrder') && !empty($request->get('sortOrder'))) {
|
||||
$order = $request->get('sortOrder');
|
||||
$column = $request->get('sortField');
|
||||
$query->orderBy($column, $order);
|
||||
}
|
||||
|
||||
// Hitung total records
|
||||
$totalRecords = $query->count();
|
||||
|
||||
// Pagination (default page size 10)
|
||||
$size = $request->get('size', 10);
|
||||
if ($size == 0) {
|
||||
$size = 10;
|
||||
}
|
||||
|
||||
if ($request->has('page') && $request->has('size')) {
|
||||
$page = $request->get('page', 1);
|
||||
$offset = ($page - 1) * $size;
|
||||
|
||||
$query->skip($offset)->take($size);
|
||||
}
|
||||
|
||||
// Filtered records
|
||||
$filteredRecords = $query->count();
|
||||
|
||||
// Ambil data dengan relasi
|
||||
$data = $query->with(['user', 'debiture', 'branch', 'jenisPenilaian'])->get();
|
||||
|
||||
|
||||
// Hitung jumlah halaman
|
||||
$pageCount = ceil($totalRecords / $size);
|
||||
|
||||
// Ambil current page
|
||||
$currentPage = max(1, $request->get('page', 1));
|
||||
|
||||
// Return JSON response
|
||||
return response()->json([
|
||||
'draw' => $request->get('draw'),
|
||||
'recordsTotal' => $totalRecords,
|
||||
'recordsFiltered' => $filteredRecords,
|
||||
'pageCount' => $pageCount,
|
||||
'page' => $currentPage,
|
||||
'totalCount' => $totalRecords,
|
||||
'data' => $data,
|
||||
]);
|
||||
}
|
||||
return view('lpj::pembayaran.index');
|
||||
}
|
||||
|
||||
public function approval()
|
||||
{
|
||||
return view('lpj::pembayaran.approval');
|
||||
}
|
||||
|
||||
public function dataApprovalForDatatables(Request $request)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('noc.view')) {
|
||||
//abort(403, 'Sorry! You are not allowed to view persetujuan penawaran.');
|
||||
}
|
||||
|
||||
// Retrieve data from the database
|
||||
$query = PersetujuanPenawaran::query();
|
||||
|
||||
// Apply search filter if provided
|
||||
if ($request->has('search') && !empty($request->get('search'))) {
|
||||
$search = $request->get('search');
|
||||
$query->where(function ($q) use ($search) {
|
||||
$q->orWhereRelation('penawaran', 'nomor_registrasi', 'LIKE', '%' . $search . '%');
|
||||
});
|
||||
}
|
||||
|
||||
// Apply sorting if provided
|
||||
if ($request->has('sortOrder') && !empty($request->get('sortOrder'))) {
|
||||
$order = $request->get('sortOrder');
|
||||
$column = $request->get('sortField');
|
||||
$query->orderBy($column, $order);
|
||||
}
|
||||
|
||||
// Get the total count of records
|
||||
$totalRecords = $query->count();
|
||||
|
||||
// Apply pagination if provided
|
||||
if ($request->has('page') && $request->has('size')) {
|
||||
$page = $request->get('page');
|
||||
$size = $request->get('size');
|
||||
$offset = ($page - 1) * $size; // Calculate the offset
|
||||
|
||||
$query->skip($offset)->take($size);
|
||||
}
|
||||
|
||||
// Get the filtered count of records
|
||||
$filteredRecords = $query->count();
|
||||
|
||||
// Get the data for the current page
|
||||
$data = $query
|
||||
->with(
|
||||
[
|
||||
'penawaran.permohonan.user',
|
||||
'penawaran.permohonan.debiture',
|
||||
'penawaran.permohonan.branch',
|
||||
'permohonan.debiture',
|
||||
'permohonan.branch',
|
||||
'permohonan.user',
|
||||
'permohonan.approveBayar',
|
||||
'penawaran.permohonan.approveBayar',
|
||||
'penawaran.detail',
|
||||
'penawaran.persetujuan',
|
||||
],
|
||||
)->get();
|
||||
|
||||
|
||||
// Calculate the page count
|
||||
$pageCount = ceil($totalRecords / $request->get('size'));
|
||||
|
||||
// Calculate the current page number
|
||||
$currentPage = $request->get('page', 1);
|
||||
|
||||
// Return the response data as a JSON object
|
||||
return response()->json([
|
||||
'draw' => $request->get('draw'),
|
||||
'recordsTotal' => $totalRecords,
|
||||
'recordsFiltered' => $filteredRecords,
|
||||
'pageCount' => $pageCount,
|
||||
'page' => $currentPage,
|
||||
'totalCount' => $totalRecords,
|
||||
'data' => $data,
|
||||
]);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$permohonan = Permohonan::find($id);
|
||||
return view('lpj::pembayaran.form', compact('permohonan'));
|
||||
}
|
||||
|
||||
public function store(PersetujuanPenawaranRequest $request)
|
||||
{
|
||||
$validated = $request->validated();
|
||||
$validated['created_by'] = Auth::id();
|
||||
$validated['status'] = '0';
|
||||
|
||||
if (isset($validated['penawaran_id'])) {
|
||||
$persetujuanPenawaran = PersetujuanPenawaran::create(
|
||||
['penawaran_id' => $validated['penawaran_id']],
|
||||
$validated,
|
||||
);
|
||||
} else {
|
||||
$persetujuanPenawaran = PersetujuanPenawaran::create(
|
||||
$validated
|
||||
);
|
||||
}
|
||||
|
||||
$folderPath = 'persetujuan_penawaran/' . $validated['penawaran_id'];
|
||||
|
||||
if ($request->hasFile('bukti_bayar')) {
|
||||
$persetujuanPenawaran->bukti_bayar = $request->file('bukti_bayar')->store($folderPath, 'public');
|
||||
}
|
||||
|
||||
$persetujuanPenawaran->save();
|
||||
|
||||
// Update the status of the related permohonan to 'spk'
|
||||
$permohonan = Permohonan::find(request()->get('permohonan_id'));
|
||||
if ($permohonan) {
|
||||
$permohonan->status_bayar = request()->get('status_bayar');
|
||||
$permohonan->save();
|
||||
|
||||
// andy add, update status penawaran.status='spk'
|
||||
// $penawaran = PenawaranTender::where('nomor_registrasi',$permohonan->nomor_registrasi)->first();
|
||||
PenawaranTender::where('nomor_registrasi', $permohonan->nomor_registrasi)->update([
|
||||
'status' => 'noc',
|
||||
'updated_by' => Auth::id(),
|
||||
'updated_at' => now(),
|
||||
]);
|
||||
// andy add, update status penawaran.status='spk'
|
||||
|
||||
}
|
||||
|
||||
return redirect()
|
||||
->route('pembayaran.index')->with('success', 'Pembayaran berhasil disimpan.');
|
||||
}
|
||||
|
||||
public function update(Request $request, $id): JsonResponse
|
||||
{
|
||||
// init
|
||||
$data = [];
|
||||
$output = [];
|
||||
$tindakan = null;
|
||||
if (request()->ajax()) {
|
||||
try {
|
||||
$data = [
|
||||
'approve_bayar_by' => Auth::id(),
|
||||
'approve_bayar_at' => now(),
|
||||
];
|
||||
|
||||
if ($request->keterangan) {
|
||||
$data['approve_keterangan_bayar'] = $request->keterangan;
|
||||
}
|
||||
$output['data'] = $data;
|
||||
|
||||
// Update the status of the related permohonan to 'spk'
|
||||
$permohonan = Permohonan::find($id);
|
||||
|
||||
if ($permohonan) {
|
||||
|
||||
if ($request->type === 'revisi') {
|
||||
$data['status_bayar'] = 'belum_bayar';
|
||||
} else {
|
||||
$data['status_bayar'] = 'sudah_bayar';
|
||||
}
|
||||
|
||||
if ($permohonan->jenis_penilaian_id == 2) {
|
||||
$data['status'] = 'spk';
|
||||
}
|
||||
|
||||
if ($permohonan->jenis_penilaian_id == 1) {
|
||||
unset(
|
||||
$data['approval_so'],
|
||||
$data['approval_so_at'],
|
||||
$data['approval_eo'],
|
||||
$data['approval_eo_at'],
|
||||
$data['approval_dd'],
|
||||
$data['approval_dd_at'],
|
||||
$data['keterangan']
|
||||
);
|
||||
|
||||
$data['status'] = 'proses-laporan';
|
||||
}
|
||||
|
||||
$permohonan->update($data);
|
||||
|
||||
if ($permohonan->jenis_penilaian_id == 2) {
|
||||
PenawaranTender::where('nomor_registrasi', $permohonan->nomor_registrasi)->update([
|
||||
'status' => 'spk',
|
||||
'updated_by' => Auth::id(),
|
||||
'updated_at' => now(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
$output['status'] = 'success';
|
||||
$output['message'] = ['Otorisasi' . $permohonan->nomor_registrasi . 'berhasil di lakukan'];
|
||||
} catch (Exception $e) {
|
||||
$output['status'] = 'error';
|
||||
$output['message'] = ['Otorisasi gagal di lakukan.'];
|
||||
}
|
||||
}
|
||||
return response()->json($output);
|
||||
}
|
||||
|
||||
public function dataForDatatables(Request $request)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('debitur.view')) {
|
||||
// abort(403, 'Sorry! You are not allowed to view users.');
|
||||
}
|
||||
|
||||
$query = Permohonan::query()->where(['status_bayar' => 'belum_bayar', 'jenis_penilaian_id' => 1])
|
||||
->whereNotIn('id', function ($subquery) {
|
||||
$subquery->select('permohonan_id')
|
||||
->from('persetujuan_penawaran')
|
||||
->whereNotNull('permohonan_id');
|
||||
});
|
||||
|
||||
// Pencarian berdasarkan parameter search
|
||||
if ($request->has('search') && !empty($request->get('search'))) {
|
||||
$search = $request->get('search');
|
||||
$query->where(function ($q) use ($search) {
|
||||
$q->where('nomor_registrasi', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhere('tanggal_permohonan', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhereRelation('user', 'name', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhereRelation('debiture', 'name', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhereRelation('jenisPenilaian', 'name', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhereRelation('branch', 'name', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhere('status', 'LIKE', '%' . $search . '%');
|
||||
});
|
||||
}
|
||||
|
||||
// Sorting berdasarkan sortField dan sortOrder
|
||||
if ($request->has('sortOrder') && !empty($request->get('sortOrder'))) {
|
||||
$order = $request->get('sortOrder');
|
||||
$column = $request->get('sortField');
|
||||
$query->orderBy($column, $order);
|
||||
}
|
||||
|
||||
// Hitung total records
|
||||
$totalRecords = $query->count();
|
||||
|
||||
// Pagination (default page size 10)
|
||||
$size = $request->get('size', 10);
|
||||
if ($size == 0) {
|
||||
$size = 10;
|
||||
}
|
||||
|
||||
if ($request->has('page') && $request->has('size')) {
|
||||
$page = $request->get('page', 1);
|
||||
$offset = ($page - 1) * $size;
|
||||
|
||||
$query->skip($offset)->take($size);
|
||||
}
|
||||
|
||||
// Filtered records
|
||||
$filteredRecords = $query->count();
|
||||
|
||||
// Ambil data dengan relasi
|
||||
$data = $query->with(['user', 'debiture', 'branch', 'jenisPenilaian'])->get();
|
||||
|
||||
|
||||
// Hitung jumlah halaman
|
||||
$pageCount = ceil($totalRecords / $size);
|
||||
|
||||
// Ambil current page
|
||||
$currentPage = max(1, $request->get('page', 1));
|
||||
|
||||
// Return JSON response
|
||||
return response()->json([
|
||||
'draw' => $request->get('draw'),
|
||||
'recordsTotal' => $totalRecords,
|
||||
'recordsFiltered' => $filteredRecords,
|
||||
'pageCount' => $pageCount,
|
||||
'page' => $currentPage,
|
||||
'totalCount' => $totalRecords,
|
||||
'data' => $data,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,6 +82,7 @@ class PenilaiController extends Controller
|
||||
$inspeksiId = $request->query('inspeksiId');
|
||||
$permohonan = $this->surveyorController->getPermohonanJaminanId($id, $documentId, $jaminanId);
|
||||
$basicData = $this->surveyorController->getCommonData();
|
||||
$provinces = Province::all();
|
||||
|
||||
$noLpSederhana = $this->generateNoLaporan($permohonan, $documentId, 'lpj');
|
||||
|
||||
@@ -107,7 +108,7 @@ class PenilaiController extends Controller
|
||||
$lpjData = json_decode($lpj->lpj, true);
|
||||
}
|
||||
|
||||
return view('lpj::penilai.components.lpj-sederhana-standard', compact('permohonan', 'forminspeksi', 'basicData', 'inspeksi', 'lpjData'));
|
||||
return view('lpj::penilai.components.lpj-sederhana-standard', compact('permohonan', 'forminspeksi', 'basicData', 'inspeksi', 'lpjData', 'provinces'));
|
||||
}
|
||||
|
||||
public function standard(Request $request, $id)
|
||||
@@ -121,7 +122,7 @@ class PenilaiController extends Controller
|
||||
$basicData = $this->surveyorController->getCommonData();
|
||||
$noLpSederhana = $this->generateNoLaporan($permohonan, $documentId, 'lpj');
|
||||
|
||||
|
||||
$provinces = Province::all();
|
||||
$inspeksi = Inspeksi::where('permohonan_id', $id)->where('dokument_id', $documentId)->first();
|
||||
$lpj = Penilai::updateOrCreate(
|
||||
[
|
||||
@@ -144,7 +145,7 @@ class PenilaiController extends Controller
|
||||
$lpjData = json_decode($lpj->lpj, true);
|
||||
}
|
||||
|
||||
return view('lpj::penilai.components.lpj-sederhana-standard', compact('permohonan', 'forminspeksi', 'basicData', 'inspeksi', 'lpjData'));
|
||||
return view('lpj::penilai.components.lpj-sederhana-standard', compact('permohonan', 'forminspeksi', 'basicData', 'inspeksi', 'lpjData', 'provinces'));
|
||||
}
|
||||
|
||||
public function resume(Request $request)
|
||||
@@ -274,18 +275,28 @@ class PenilaiController extends Controller
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
if ($request->hasFile('file_paparan')) {
|
||||
// Menyimpan atau memperbarui data Penilai
|
||||
$penilai = Penilai::updateOrCreate(
|
||||
[
|
||||
'permohonan_id' => $request->permohonan_id,
|
||||
'dokument_id' => $request->documentId,
|
||||
'inspeksi_id' => $request->inspeksiId,
|
||||
]
|
||||
);
|
||||
|
||||
// Menyimpan fil
|
||||
$file = $request->file('file_paparan');
|
||||
$path = $file->store('public/file_paparan');
|
||||
|
||||
$penilai = Penilai::where('permohonan_id', $id)->first();
|
||||
$penilai->file_paparan = $path;
|
||||
$penilai->save();
|
||||
}
|
||||
|
||||
|
||||
return redirect()
|
||||
->route('penilai.show', ['id' => $id])->with('success', 'diperbarui ke status paparan dan dikirim ke So untuk proses lebih lanjut.');
|
||||
|
||||
} catch (\Exception $e) {
|
||||
return redirect()->route('penilai.show', ['id' => $id])->with('error', 'Terjadi kesalahan saat memproses permohonan.');
|
||||
}
|
||||
@@ -424,11 +435,8 @@ class PenilaiController extends Controller
|
||||
if ($call && isset($call->call_report)) {
|
||||
$callReport = json_decode($call->call_report, true);
|
||||
}
|
||||
$forminspeksi = null;
|
||||
if ($forminspeksi) {
|
||||
|
||||
$forminspeksi = json_decode($inspeksi->data_form, true);
|
||||
}
|
||||
$forminspeksi = json_decode($inspeksi->data_form, true);
|
||||
// Default: gunakan data dari debitur
|
||||
$debitur = Debiture::find($permohonan->debiture_id);
|
||||
|
||||
@@ -449,6 +457,7 @@ class PenilaiController extends Controller
|
||||
$villages = Village::where('district_code', $districtCode)->get();
|
||||
|
||||
if ($forminspeksi) {
|
||||
|
||||
if (isset($forminspeksi['alamat']['sesuai']['province_code'])) {
|
||||
$cities = City::where('province_code', $forminspeksi['alamat']['sesuai']['province_code'])->get();
|
||||
}
|
||||
@@ -462,7 +471,6 @@ class PenilaiController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return view('lpj::penilai.components.call-report', compact('permohonan', 'basicData', 'nomorLaporan', 'forminspeksi', 'cities', 'districts', 'villages', 'cekAlamat', 'callReport'));
|
||||
}
|
||||
|
||||
@@ -496,7 +504,7 @@ class PenilaiController extends Controller
|
||||
});
|
||||
}
|
||||
|
||||
$query->whereRaw('LOWER(status) IN (?, ?, ?, ?, ?, ?)', ['assign','survey-completed', 'proses-laporan', 'paparan', 'proses-paparan','paparan']);
|
||||
$query->whereRaw('LOWER(status) IN (?, ?, ?, ?, ?, ?,?, ?)', ['assign', 'survey-completed', 'proses-laporan', 'paparan', 'proses-paparan', 'paparan', 'revisi-laporan', 'revisi-paparan']);
|
||||
|
||||
if (!Auth::user()->hasRole('administrator')) {
|
||||
$query->whereHas('penilaian.userPenilai', function ($q) {
|
||||
@@ -565,8 +573,8 @@ class PenilaiController extends Controller
|
||||
$jaminanId = $request->query('jaminanId');
|
||||
// Fetch the data from the database
|
||||
$data = Inspeksi::where('permohonan_id', $permohonanId)
|
||||
->where('dokument_id', $documentId)
|
||||
->first();
|
||||
->where('dokument_id', $documentId)
|
||||
->first();
|
||||
|
||||
$permohonan = $this->surveyorController->getPermohonanJaminanId(
|
||||
$permohonanId,
|
||||
@@ -740,7 +748,8 @@ class PenilaiController extends Controller
|
||||
!empty($item->memo) ||
|
||||
!empty($item->resume) ||
|
||||
!empty($item->lpj) ||
|
||||
!empty($item->rap)
|
||||
!empty($item->rap) ||
|
||||
!empty($item->call_report)
|
||||
) && !empty($item->kertas_kerja);
|
||||
});
|
||||
|
||||
@@ -762,7 +771,6 @@ class PenilaiController extends Controller
|
||||
'success' => true,
|
||||
'message' => 'Berhasil Megirim reported ke so'
|
||||
], 200);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
@@ -775,20 +783,23 @@ class PenilaiController extends Controller
|
||||
public function storeResume(Request $request)
|
||||
{
|
||||
try {
|
||||
|
||||
// dd($request->all());
|
||||
$validatedData = $request->validate([
|
||||
'permohonan_id' => 'required',
|
||||
'document_id' => 'required',
|
||||
'dokument_id' => 'required',
|
||||
'inspeksi_id' => 'required',
|
||||
'resume' => 'required|array',
|
||||
'fakta_positif' => 'nullable|array',
|
||||
'fakta_negatif' => 'nullable|array',
|
||||
'type' => 'required',
|
||||
'action' => 'required',
|
||||
'keterangan' => 'nullable|array'
|
||||
]);
|
||||
|
||||
// Simpan atau update data
|
||||
|
||||
Penilai::updateOrCreate(
|
||||
[
|
||||
'permohonan_id' => $validatedData['permohonan_id'],
|
||||
'dokument_id' => $validatedData['document_id'],
|
||||
'dokument_id' => $validatedData['dokument_id'],
|
||||
'inspeksi_id' => $validatedData['inspeksi_id'],
|
||||
],
|
||||
[
|
||||
@@ -796,10 +807,51 @@ class PenilaiController extends Controller
|
||||
]
|
||||
);
|
||||
|
||||
$inspeksi = Inspeksi::where('permohonan_id', $validatedData['permohonan_id'])
|
||||
->where('dokument_id', $validatedData['dokument_id'])
|
||||
->first();
|
||||
if ($inspeksi) {
|
||||
// Get existing data_form
|
||||
$existingData = json_decode($inspeksi->data_form, true) ?: [];
|
||||
|
||||
// Structure the fakta data correctly
|
||||
$existingFaktaData = $existingData['fakta'] ?? [];
|
||||
|
||||
// Gabungkan data baru dengan data yang sudah ada
|
||||
$updatedFaktaData = array_merge($existingFaktaData, [
|
||||
'fakta_positif' => $validatedData['fakta_positif'] ?? $existingFaktaData['fakta_positif'] ?? null,
|
||||
'fakta_negatif' => $validatedData['fakta_negatif'] ?? $existingFaktaData['fakta_negatif'] ?? null,
|
||||
'keterangan' => $validatedData['keterangan'] ?? $existingFaktaData['keterangan'] ?? null,
|
||||
]);
|
||||
$existingData['fakta'] = $updatedFaktaData;
|
||||
|
||||
$inspeksi->update([
|
||||
'data_form' => json_encode($existingData),
|
||||
]);
|
||||
} else {
|
||||
// If inspeksi
|
||||
$newData = [
|
||||
'fakta' => [
|
||||
'fakta_positif' => $validatedData['fakta_positif'] ?? null,
|
||||
'fakta_negatif' => $validatedData['fakta_negatif'] ?? null,
|
||||
'keterangan' => $validatedData['keterangan'] ?? null,
|
||||
],
|
||||
];
|
||||
|
||||
|
||||
|
||||
Inspeksi::create([
|
||||
'permohonan_id' => $validatedData['permohonan_id'],
|
||||
'dokument_id' => $validatedData['dokument_id'],
|
||||
'data_form' => json_encode($newData),
|
||||
'name' => $validatedData['type']
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
return response()->json([
|
||||
'success' => true,
|
||||
'message' => 'Berhasil saved resume'
|
||||
'message' => 'Berhasil saved resume',
|
||||
], 200);
|
||||
} catch (\Exception $e) {
|
||||
return response()->json([
|
||||
@@ -985,7 +1037,6 @@ class PenilaiController extends Controller
|
||||
'trace' => $e->getTraceAsString()
|
||||
], 500);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function storeCallReport(Request $request)
|
||||
@@ -997,10 +1048,15 @@ class PenilaiController extends Controller
|
||||
'permohonan_id' => 'required|exists:permohonan,id',
|
||||
'dokument_id' => 'required',
|
||||
'inspeksi_id' => 'required',
|
||||
'data' => 'required'
|
||||
'data' => 'required',
|
||||
'fakta_positif' => 'nullable|array',
|
||||
'fakta_negatif' => 'nullable|array',
|
||||
'type' => 'required',
|
||||
'action' => 'required',
|
||||
'keterangan' => 'nullable|array',
|
||||
|
||||
]);
|
||||
|
||||
$data = $request->input('data');
|
||||
|
||||
Penilai::updateOrCreate(
|
||||
[
|
||||
@@ -1012,11 +1068,51 @@ class PenilaiController extends Controller
|
||||
'call_report' => json_encode($validated['data']),
|
||||
]
|
||||
);
|
||||
|
||||
$inspeksi = Inspeksi::where('permohonan_id', $validated['permohonan_id'])
|
||||
->where('dokument_id', $validated['dokument_id'])
|
||||
->first();
|
||||
if ($inspeksi) {
|
||||
// Get existing data_form
|
||||
$existingData = json_decode($inspeksi->data_form, true) ?: [];
|
||||
|
||||
// Structure the fakta data correctly
|
||||
$existingFaktaData = $existingData['fakta'] ?? [];
|
||||
|
||||
// Gabungkan data baru dengan data yang sudah ada
|
||||
$updatedFaktaData = array_merge($existingFaktaData, [
|
||||
'fakta_positif' => $validated['fakta_positif'] ?? $existingFaktaData['fakta_positif'] ?? null,
|
||||
'fakta_negatif' => $validated['fakta_negatif'] ?? $existingFaktaData['fakta_negatif'] ?? null,
|
||||
'keterangan' => $validated['keterangan'] ?? $existingFaktaData['keterangan'] ?? null,
|
||||
]);
|
||||
$existingData['fakta'] = $updatedFaktaData;
|
||||
|
||||
$inspeksi->update([
|
||||
'data_form' => json_encode($existingData),
|
||||
]);
|
||||
} else {
|
||||
// If inspeksi
|
||||
$newData = [
|
||||
'fakta' => [
|
||||
'fakta_positif' => $validated['fakta_positif'] ?? null,
|
||||
'fakta_negatif' => $validated['fakta_negatif'] ?? null,
|
||||
'keterangan' => $validated['keterangan'] ?? null,
|
||||
],
|
||||
];
|
||||
|
||||
|
||||
|
||||
Inspeksi::create([
|
||||
'permohonan_id' => $validated['permohonan_id'],
|
||||
'dokument_id' => $validated['dokument_id'],
|
||||
'data_form' => json_encode($newData),
|
||||
'name' => $validated['type']
|
||||
]);
|
||||
}
|
||||
// DB::commit();
|
||||
return response()->json([
|
||||
'success' => true,
|
||||
'message' => 'Berhasil menyimpan data',
|
||||
'data' => $data
|
||||
], 200);
|
||||
} catch (\Throwable $e) {
|
||||
// DB::rollBack();
|
||||
@@ -1108,8 +1204,8 @@ class PenilaiController extends Controller
|
||||
$cleanNomorLaporan = str_replace(['/', '\\'], '-', $nomorLaporan);
|
||||
$pdf->setPaper('A4', 'portrait');
|
||||
return response($pdf->output(), 200)
|
||||
->header('Content-Type', 'application/pdf')
|
||||
->header('Content-Disposition', 'inline; filename="Laporan_' . $tipeLaporan . '_' .$permohonan->debiture->name . '_' . $cleanNomorLaporan .'.pdf"');
|
||||
->header('Content-Type', 'application/pdf')
|
||||
->header('Content-Disposition', 'inline; filename="Laporan_' . $tipeLaporan . '_' . $permohonan->debiture->name . '_' . $cleanNomorLaporan . '.pdf"');
|
||||
// return $pdf->stream();
|
||||
} else {
|
||||
// $pdf = view('lpj::' . $viewLaporan, compact(
|
||||
@@ -1134,14 +1230,12 @@ class PenilaiController extends Controller
|
||||
// return $pdf;
|
||||
$cleanNomorLaporan = str_replace(['/', '\\'], '-', $nomorLaporan);
|
||||
$pdf->setPaper('A4', 'portrait');
|
||||
return $pdf->download('Laporan_'. $tipeLaporan . '_' .$permohonan->debiture->name . '_' . $cleanNomorLaporan .'_data.pdf');
|
||||
return $pdf->download('Laporan_' . $tipeLaporan . '_' . $permohonan->debiture->name . '_' . $cleanNomorLaporan . '_data.pdf');
|
||||
}
|
||||
|
||||
} catch (\Exception $e) {
|
||||
Log::error('PDF generation failed: ' . $e->getMessage());
|
||||
return response()->json(['error' => 'Failed to generate PDF. Please check the log for details.'. $e->getMessage()], 500);
|
||||
return response()->json(['error' => 'Failed to generate PDF. Please check the log for details.' . $e->getMessage()], 500);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private function getViewLaporan($tipe)
|
||||
@@ -1164,10 +1258,10 @@ class PenilaiController extends Controller
|
||||
private function getDataPermohonanWithPenilaiAndInspeksi($permohonanId, $documentId, $jaminanId)
|
||||
{
|
||||
return [
|
||||
'permohonan' => $this->surveyorController->getPermohonanJaminanId($permohonanId, $documentId, $jaminanId),
|
||||
'penilai' => Penilai::where('permohonan_id', $permohonanId)->where('dokument_id', $documentId)->first(),
|
||||
'inspeksi' => Inspeksi::where('permohonan_id', $permohonanId)->where('dokument_id', $documentId)->first()
|
||||
];
|
||||
'permohonan' => $this->surveyorController->getPermohonanJaminanId($permohonanId, $documentId, $jaminanId),
|
||||
'penilai' => Penilai::where('permohonan_id', $permohonanId)->where('dokument_id', $documentId)->first(),
|
||||
'inspeksi' => Inspeksi::where('permohonan_id', $permohonanId)->where('dokument_id', $documentId)->first()
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -1332,8 +1426,6 @@ class PenilaiController extends Controller
|
||||
|
||||
$validationRules = [
|
||||
'resume' => [
|
||||
'fakta.fakta_positif',
|
||||
'fakta.fakta_negatif',
|
||||
'fisik'
|
||||
],
|
||||
];
|
||||
@@ -1363,7 +1455,7 @@ class PenilaiController extends Controller
|
||||
|
||||
// Validasi struktur data di dalam array
|
||||
foreach ($value as $item) {
|
||||
$requiredKeys = ['sertifikat', 'luas_tanah', 'luas_bangunan', 'nilai'];
|
||||
$requiredKeys = ['sertifikat', 'luas_tanah', 'nilai'];
|
||||
foreach ($requiredKeys as $requiredKey) {
|
||||
if (!isset($item[$requiredKey])) {
|
||||
$missingFields[] = $field . '.' . $requiredKey;
|
||||
@@ -1498,5 +1590,18 @@ class PenilaiController extends Controller
|
||||
}
|
||||
|
||||
|
||||
public function revisiSurveyor(Request $request, $id)
|
||||
{
|
||||
$permohonan = Permohonan::findOrFail($id);
|
||||
$permohonan->update([
|
||||
'status' => 'revisi-survey',
|
||||
'keterangan' => $request->message,
|
||||
'submitted_at' => now()
|
||||
]);
|
||||
|
||||
return response()->json([
|
||||
'success' => true,
|
||||
'message' => 'Berhasil Revisi Ke surveyor',
|
||||
], 200);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ use Modules\Lpj\Models\StatusPermohonan;
|
||||
use Modules\Lpj\Models\Teams;
|
||||
use Modules\Lpj\Models\Inspeksi;
|
||||
use Modules\Lpj\Models\Penilai;
|
||||
use Modules\Lpj\Models\Regions;
|
||||
use Modules\Location\Models\Province;
|
||||
use Modules\Location\Models\City;
|
||||
use Modules\Location\Models\District;
|
||||
@@ -96,6 +97,7 @@ class PenilaianController extends Controller
|
||||
}
|
||||
|
||||
} else {
|
||||
$teams_ids[] = $validatedData['teams_id'];
|
||||
$user_ids[] = $validatedData['surveyor_id'];
|
||||
|
||||
}
|
||||
@@ -136,13 +138,14 @@ class PenilaianController extends Controller
|
||||
$user_ids[] = $validatedData['penilai_surveyor_id'];
|
||||
}
|
||||
} else {
|
||||
$teams_ids[] = $validatedData['teams_id'];
|
||||
$user_ids[] = $validatedData['penilai_id'];
|
||||
}
|
||||
|
||||
$roles[] = 'penilai';
|
||||
}
|
||||
|
||||
// dd($teams_ids, $user_ids);
|
||||
// dd($validatedData['penilai_region_id'],$validatedData['teams_id']);
|
||||
foreach ($teams_ids as $key => $teams_id) {
|
||||
PenilaianTeam::create([
|
||||
'penilaian_id' => $validatedData['penilaian_id'],
|
||||
@@ -153,13 +156,11 @@ class PenilaianController extends Controller
|
||||
}
|
||||
|
||||
if ($validatedData['surveyor_id'] === 'pilih_dari_region' || $validatedData['penilai_id'] === 'pilih_dari_region' || $validatedData['penilai_surveyor_id'] === 'pilih_dari_region') {
|
||||
$status = $permohonan->status;
|
||||
}else {
|
||||
$status = 'reassign';
|
||||
} else {
|
||||
$status = 'assign';
|
||||
}
|
||||
|
||||
|
||||
|
||||
$permohonan->update([
|
||||
'status' => $status,
|
||||
]);
|
||||
@@ -344,7 +345,7 @@ class PenilaianController extends Controller
|
||||
});
|
||||
}
|
||||
|
||||
$query->whereIn('status', ['registered', 'registrasi-final']);
|
||||
$query->whereIn('status', ['registered', 'registrasi-final', 'reassign']);
|
||||
|
||||
// Filter berdasarkan role
|
||||
if (Auth::user()->roles[0]->name !== 'administrator') {
|
||||
@@ -404,6 +405,8 @@ class PenilaianController extends Controller
|
||||
'paparan' => 'Paparan'
|
||||
];
|
||||
|
||||
$regions = Regions::all();
|
||||
|
||||
$header = $headers[$type] ?? 'Pelaporan';
|
||||
|
||||
switch ($header) {
|
||||
@@ -412,7 +415,7 @@ class PenilaianController extends Controller
|
||||
case 'Paparan':
|
||||
return view('lpj::penilaian.paparan-so', compact('header'));
|
||||
default:
|
||||
return view('lpj::penilaian.otorisator.index', compact('header'));
|
||||
return view('lpj::penilaian.otorisator.index', compact('header', 'regions'));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -491,27 +494,22 @@ class PenilaianController extends Controller
|
||||
break;
|
||||
|
||||
case 'pelaporan':
|
||||
if (Auth::user()->roles[0]->name === 'senior-officer') {
|
||||
$permohonan->update([
|
||||
'status' => 'proses-laporan',
|
||||
'approval_so' => Auth::user()->id,
|
||||
'approval_so_at' => now(),
|
||||
'keterangan' => $request->message,
|
||||
]);
|
||||
} elseif (Auth::user()->roles[0]->name === 'EO Appraisal') {
|
||||
$permohonan->update([
|
||||
'status' => 'proses-laporan',
|
||||
'approval_eo' => Auth::user()->id,
|
||||
'approval_eo_at' => now(),
|
||||
'keterangan' => $request->message,
|
||||
]);
|
||||
} elseif (Auth::user()->roles[0]->name === 'DD Appraisal') {
|
||||
$permohonan->update([
|
||||
'status' => 'done',
|
||||
'approval_dd' => Auth::user()->id,
|
||||
'approval_dd_at' => now(),
|
||||
'keterangan' => $request->message,
|
||||
]);
|
||||
$role = Auth::user()->roles[0]->name;
|
||||
$status = 'done';
|
||||
$approvalField = null;
|
||||
if ($role === 'senior-officer') {
|
||||
$approvalField = 'approval_so';
|
||||
$status = in_array($permohonan->nilai_plafond_id, [3]) ? 'done' : 'proses-laporan';
|
||||
} elseif ($role === 'EO Appraisal') {
|
||||
$approvalField = 'approval_eo';
|
||||
$status = in_array($permohonan->nilai_plafond_id, [2, 1]) ? 'done' : 'proses-laporan';
|
||||
} elseif ($role === 'DD Appraisal') {
|
||||
$approvalField = 'approval_dd';
|
||||
$status = 'done';
|
||||
}
|
||||
|
||||
if ($approvalField) {
|
||||
$this->updatePermohonan($permohonan, $status, $approvalField, $request->message);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -569,7 +567,7 @@ class PenilaianController extends Controller
|
||||
]);
|
||||
} elseif (Auth::user()->roles[0]->name === 'EO Appraisal') {
|
||||
$status = '2';
|
||||
if (!in_array($permohonan->nilai_plafond_id, [1, 4])) {
|
||||
if (!in_array($permohonan->nilai_plafond_id, [1,4])) {
|
||||
$status = '1';
|
||||
$permohonan->update([
|
||||
'status' => $authorization->request
|
||||
@@ -610,6 +608,15 @@ class PenilaianController extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
public function updatePermohonan($permohonan, $status, $approvalField, $message)
|
||||
{
|
||||
$permohonan->update([
|
||||
'status' => $status,
|
||||
$approvalField => Auth::user()->id,
|
||||
"{$approvalField}_at" => now(),
|
||||
'keterangan' => $message,
|
||||
]);
|
||||
}
|
||||
|
||||
public function dataForAuthorization(Request $request, $otorisator)
|
||||
{
|
||||
@@ -634,6 +641,7 @@ class PenilaianController extends Controller
|
||||
// Pencarian berdasarkan parameter search
|
||||
if ($request->has('search') && !empty($request->get('search'))) {
|
||||
$search = $request->get('search');
|
||||
|
||||
$query->where(function ($q) use ($search) {
|
||||
$q->where('nomor_registrasi', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhere('tanggal_permohonan', 'LIKE', '%' . $search . '%');
|
||||
@@ -641,6 +649,7 @@ class PenilaianController extends Controller
|
||||
$q->orWhereRelation('debiture', 'name', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhereRelation('tujuanPenilaian', 'name', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhereRelation('branch', 'name', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhereRelation('region', 'name', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhere('status', 'LIKE', '%' . $search . '%');
|
||||
});
|
||||
}
|
||||
@@ -661,11 +670,27 @@ class PenilaianController extends Controller
|
||||
}
|
||||
|
||||
// Filter berdasarkan region user yang login
|
||||
// if ($status == 'proses-laporan') {
|
||||
// $requestedRegion = $request->get('search');
|
||||
|
||||
// if ($requestedRegion) {
|
||||
// $query->whereHas('region', function ($q) use ($requestedRegion) {
|
||||
// $q->where('name', $requestedRegion);
|
||||
// });
|
||||
// } else {
|
||||
// $query->whereHas('region.teams.teamsUsers', function ($q) {
|
||||
// $q->where('user_id', Auth::id());
|
||||
// });
|
||||
// }
|
||||
// } else {
|
||||
if (Auth::user()->hasRole('senior-officer')) {
|
||||
$query->whereHas('region.teams.teamsUsers', function ($q) {
|
||||
$q->where('user_id', Auth::id());
|
||||
});
|
||||
}
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
// Sorting berdasarkan sortField dan sortOrder
|
||||
@@ -763,6 +788,7 @@ class PenilaianController extends Controller
|
||||
if ($lpj) {
|
||||
$lpjData = json_decode($lpj->lpj, true);
|
||||
$resumeData = json_decode($lpj->resume, true);
|
||||
$callReport = json_decode($lpj->call_report, true);
|
||||
if (isset($lpj->memo)) {
|
||||
$memo = json_decode($lpj->memo);
|
||||
}
|
||||
@@ -790,7 +816,7 @@ class PenilaianController extends Controller
|
||||
return redirect()->back()->with('error', 'Laporan belum dibuat');
|
||||
}
|
||||
|
||||
return view('lpj::' . $viewLaporan, compact('permohonan', 'forminspeksi', 'basicData', 'inspeksi', 'lpjData', 'provinces', 'resumeData', 'rap', 'memo', 'cities', 'districts', 'villages', 'formFoto', 'formPeta', 'nomorLaporan', 'penilai'));
|
||||
return view('lpj::' . $viewLaporan, compact('permohonan', 'forminspeksi', 'basicData', 'inspeksi', 'lpjData', 'provinces', 'resumeData', 'rap', 'memo', 'cities', 'districts', 'villages', 'formFoto', 'formPeta', 'nomorLaporan', 'penilai', 'callReport'));
|
||||
}
|
||||
|
||||
private function getViewLaporan($tipe)
|
||||
@@ -800,7 +826,8 @@ class PenilaianController extends Controller
|
||||
'standard' => 'penilai.components.lpj-sederhana-standard',
|
||||
'resume' => 'penilai.components.resume',
|
||||
'memo' => 'penilai.components.memo',
|
||||
'rap' => 'penilai.components.rap-penilai'
|
||||
'rap' => 'penilai.components.rap-penilai',
|
||||
'call-report' => 'penilai.components.call-report',
|
||||
];
|
||||
return $viewMap[$tipe] ?? '';
|
||||
}
|
||||
@@ -862,15 +889,48 @@ class PenilaianController extends Controller
|
||||
public function revisiLaporan(Request $request, $id)
|
||||
{
|
||||
$permohonan = Permohonan::findOrFail($id);
|
||||
$userRole = Auth::user()->roles[0]->name;
|
||||
|
||||
if ($permohonan->status === 'proses-paparan' && in_array($userRole, ['EO Appraisal', 'DD Appraisal'])) {
|
||||
Authorization::delete([
|
||||
'permohonan_id' => $permohonan->id,
|
||||
'jenis' => 'paparan',
|
||||
'request' => 'paparan',
|
||||
]);
|
||||
$status = 'revisi-paparan';
|
||||
} elseif ($permohonan->status === 'proses-laporan' && $userRole === 'EO Appraisal') {
|
||||
$permohonan->update([
|
||||
'approve_so' => null,
|
||||
'approve_so_at' => null,
|
||||
]);
|
||||
$status = 'revisi-laporan';
|
||||
} elseif ($permohonan->status === 'proses-laporan' && $userRole === 'DD Appraisal') {
|
||||
$permohonan->update([
|
||||
'approve_so' => null,
|
||||
'approve_so_at' => null,
|
||||
'approve_eo' => null,
|
||||
'approve_eo_at' => null,
|
||||
|
||||
]);
|
||||
$status = 'revisi-laporan';
|
||||
} else {
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => 'Tidak ada tindakan yang dapat dilakukan untuk status saat ini.',
|
||||
], 400);
|
||||
}
|
||||
|
||||
// Perbarui status dan informasi lainnya
|
||||
$permohonan->update([
|
||||
'status' => 'revisi-laporan',
|
||||
'status' => $status,
|
||||
'keterangan' => $request->message,
|
||||
'submitted_at' => now()
|
||||
'submitted_at' => now(),
|
||||
]);
|
||||
|
||||
return response()->json([
|
||||
'success' => true,
|
||||
'message' => 'Berhasil Revisi Laporan penilai',
|
||||
'message' => 'Berhasil Revisi Laporan penilai.',
|
||||
], 200);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ use Illuminate\Support\Facades\Auth;
|
||||
->select('permohonan.*', 'jenis_jaminan.name as jenis_jaminan_name',
|
||||
'dokumen_jaminan.address as dokumen_jaminan_address');
|
||||
|
||||
$data = $permohonan->with(['user', 'debiture', 'branch', 'tujuanPenilaian','dokumenjaminan'])->first();
|
||||
$data = $permohonan->with(['user', 'debiture', 'branch', 'tujuanPenilaian','dokumenjaminan.detail'])->first();
|
||||
|
||||
if($penawaran->detail_penawaran_tgl_proposal)
|
||||
$penawaran->detail_penawaran_tgl_proposal = Carbon::parse($penawaran->detail_penawaran_tgl_proposal)->format('d F Y');
|
||||
|
||||
@@ -79,16 +79,20 @@ use Modules\Lpj\Models\LaluLintasLokasi;
|
||||
use Modules\Lpj\Models\SpekBagunanAnalisaDetail;
|
||||
use Modules\Lpj\Http\Requests\SurveyorRequest;
|
||||
use Modules\Lpj\Http\Requests\FormSurveyorRequest;
|
||||
use Modules\Lpj\Emails\SendJadwalKunjunganEmail;
|
||||
use Modules\Lpj\Jobs\SendJadwalKunjunganEmailJob;
|
||||
use App\Helpers\Lpj;
|
||||
use Modules\Lpj\Models\Authorization;
|
||||
use Modules\Lpj\Services\SurveyorValidateService;
|
||||
|
||||
class SurveyorController extends Controller
|
||||
{
|
||||
public $user;
|
||||
public $validateService;
|
||||
|
||||
|
||||
|
||||
public function __construct(SurveyorValidateService $validateService)
|
||||
{
|
||||
$this->validateService = $validateService;
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
@@ -156,11 +160,12 @@ class SurveyorController extends Controller
|
||||
/**
|
||||
* Store form inspeksi.
|
||||
*/
|
||||
public function store(FormSurveyorRequest $request)
|
||||
public function store(Request $request)
|
||||
{
|
||||
try {
|
||||
// Validate request data
|
||||
$validatedData = $request->validated();
|
||||
$validatedData = $request->all();
|
||||
|
||||
|
||||
// Get action specific rules and process data
|
||||
$processedData = $this->getActionSpecificRules(
|
||||
@@ -237,6 +242,9 @@ class SurveyorController extends Controller
|
||||
$rules = [];
|
||||
$hasAssetDescriptionRules = false;
|
||||
$hasFactaData = false;
|
||||
|
||||
|
||||
|
||||
$pisah = array_filter(
|
||||
explode(',', $action),
|
||||
function ($act) use ($allowedActions) {
|
||||
@@ -244,20 +252,27 @@ class SurveyorController extends Controller
|
||||
}
|
||||
);
|
||||
|
||||
// dd($pisah);
|
||||
|
||||
foreach ($pisah as $act) {
|
||||
$act = trim($act);
|
||||
$method = $allowedActions[$act];
|
||||
$act = trim($act); // Bersihkan spasi
|
||||
if (isset($allowedActions[$act])) {
|
||||
$method = $allowedActions[$act];
|
||||
|
||||
$actionRules = $this->$method($data, $request);
|
||||
$rules = array_merge($rules, $actionRules);
|
||||
$actionRules = $this->$method($data, $request);
|
||||
$rules = array_merge($rules, $actionRules);
|
||||
|
||||
if (in_array($act, ['apartemen-kantor', 'tanah', 'bangunan', 'rap'])) {
|
||||
$hasAssetDescriptionRules = true;
|
||||
// Cek apakah act memerlukan asset description rules
|
||||
if (in_array($act, ['apartemen-kantor', 'tanah', 'bangunan', 'rap'])) {
|
||||
$hasAssetDescriptionRules = true;
|
||||
}
|
||||
|
||||
// Cek apakah act memerlukan fakta data
|
||||
if (in_array($act, ['rap'])) {
|
||||
$hasFactaData = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (in_array($act, ['rap'])) {
|
||||
$hasFactaData = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ($hasAssetDescriptionRules) {
|
||||
@@ -492,7 +507,6 @@ class SurveyorController extends Controller
|
||||
if ($request->hasFile($paramName)) {
|
||||
$files = $request->file($paramName);
|
||||
|
||||
// Pastikan $files adalah array
|
||||
if (!is_array($files)) {
|
||||
$files = [$files];
|
||||
}
|
||||
@@ -500,23 +514,49 @@ class SurveyorController extends Controller
|
||||
$formatFotoData = [];
|
||||
$nomor_registrasi = $request->nomor_registrasi;
|
||||
|
||||
|
||||
$batchTimestamp = time();
|
||||
|
||||
$existingFilePaths = [];
|
||||
if (isset($formatFotojson[$paramName]) && is_array($formatFotojson[$paramName])) {
|
||||
foreach ($formatFotojson[$paramName] as $existingFile) {
|
||||
if (isset($existingFile['path'])) {
|
||||
$existingFilePaths[] = $existingFile['path'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($files as $index => $file) {
|
||||
$timestamp = time();
|
||||
$originalName = $file->getClientOriginalName();
|
||||
$extension = $file->getClientOriginalExtension();
|
||||
// Validasi nama file
|
||||
if (empty($originalName)) {
|
||||
$originalName = "file_{$timestamp}";
|
||||
$fileNameWithoutExt = pathinfo($originalName, PATHINFO_FILENAME);
|
||||
|
||||
if (empty($fileNameWithoutExt)) {
|
||||
$fileNameWithoutExt = "file_{$batchTimestamp}_{$index}";
|
||||
}
|
||||
$uniqueFileName = "{$timestamp}.{$extension}";
|
||||
|
||||
// Simpan file
|
||||
$nomor_registrasi = $request->nomor_registrasi;
|
||||
$path = $file->storeAs("surveyor/{$paramName}/{$nomor_registrasi}", $uniqueFileName, 'public');
|
||||
$safeFileName = preg_replace('/[^a-zA-Z0-9_-]/', '_', $fileNameWithoutExt);
|
||||
$uniqueFileName = "{$batchTimestamp}_{$index}_{$safeFileName}.{$extension}";
|
||||
$path = "surveyor/{$paramName}/{$nomor_registrasi}/{$uniqueFileName}";
|
||||
|
||||
if (in_array($path, $existingFilePaths)) {
|
||||
$counter = 1;
|
||||
do {
|
||||
$uniquePath = "surveyor/{$paramName}/{$nomor_registrasi}/{$batchTimestamp}_{$index}_{$safeFileName}_{$counter}.{$extension}";
|
||||
$counter++;
|
||||
} while (in_array($uniquePath, $existingFilePaths));
|
||||
|
||||
$path = $uniquePath;
|
||||
}
|
||||
|
||||
$savedPath = $file->storeAs('', $path, 'public');
|
||||
|
||||
$existingFilePaths[] = $path;
|
||||
|
||||
// Add file data
|
||||
$fotoData = [
|
||||
'name' => pathinfo($originalName, PATHINFO_FILENAME),
|
||||
'path' => $path,
|
||||
'name' => $fileNameWithoutExt,
|
||||
'path' => $savedPath,
|
||||
'category' => 'lainnya',
|
||||
'sub' => null,
|
||||
'description' => null,
|
||||
@@ -527,18 +567,20 @@ class SurveyorController extends Controller
|
||||
$formatFotoData[] = $fotoData;
|
||||
}
|
||||
|
||||
// Struktur JSON yang konsisten
|
||||
if (!isset($formatFotojson[$paramName])) {
|
||||
$formatFotojson[$paramName] = $formatFotoData;
|
||||
} else {
|
||||
$formatFotojson[$paramName] = array_merge(
|
||||
$formatFotojson[$paramName] ?? [],
|
||||
$formatFotoData
|
||||
);
|
||||
// Only update if we have new photos to add
|
||||
if (!empty($formatFotoData)) {
|
||||
// Struktur JSON yang konsisten
|
||||
if (!isset($formatFotojson[$paramName])) {
|
||||
$formatFotojson[$paramName] = $formatFotoData;
|
||||
} else {
|
||||
$formatFotojson[$paramName] = array_merge(
|
||||
$formatFotojson[$paramName] ?? [],
|
||||
$formatFotoData
|
||||
);
|
||||
}
|
||||
|
||||
return $formatFotoData;
|
||||
}
|
||||
|
||||
|
||||
return $formatFotoData;
|
||||
}
|
||||
|
||||
return [];
|
||||
@@ -632,6 +674,52 @@ class SurveyorController extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
public function saveEditedImage(Request $request)
|
||||
{
|
||||
try {
|
||||
|
||||
$request->validate([
|
||||
'edited_image' => 'required|string',
|
||||
'original_path' => 'required|string',
|
||||
'nomor_registrasi' => 'required',
|
||||
]);
|
||||
|
||||
// Decode base64 image
|
||||
$base64Image = $request->input('edited_image');
|
||||
if (str_contains($base64Image, ';base64,')) {
|
||||
[$metadata, $base64Image] = explode(';base64,', $base64Image);
|
||||
}
|
||||
|
||||
$decodedImage = base64_decode($base64Image);
|
||||
if (!$decodedImage) {
|
||||
return response()->json([
|
||||
'status' => 'error',
|
||||
'message' => 'Gambar tidak valid',
|
||||
], 400);
|
||||
}
|
||||
|
||||
// Path asli
|
||||
$originalPath = $request->input('original_path');
|
||||
$fileName = basename($originalPath);
|
||||
$newFilePath = 'surveyor/upload_foto/'. $request->input('nomor_registrasi') . '/' . $fileName;
|
||||
|
||||
// Simpan file ke storage
|
||||
Storage::disk('public')->put($newFilePath, $decodedImage);
|
||||
|
||||
return response()->json([
|
||||
'status' => 'success',
|
||||
'message' => 'Gambar berhasil disimpan',
|
||||
'file_path' => $newFilePath,
|
||||
], 200);
|
||||
} catch (\Exception $e) {
|
||||
return response()->json([
|
||||
'status' => 'error',
|
||||
'message' => 'Terjadi kesalahan: ' . $e->getMessage(),
|
||||
], 500);
|
||||
}
|
||||
}
|
||||
|
||||
private function findFotoByParamName($fotoForm, $paramName)
|
||||
{
|
||||
// Mapping parameter name ke struktur JSON
|
||||
@@ -699,80 +787,6 @@ class SurveyorController extends Controller
|
||||
return false;
|
||||
}
|
||||
|
||||
public function hapusLantai(Request $request)
|
||||
{
|
||||
$permohonanId = $request->permohonan_id;
|
||||
$dokumentId = $request->dokument_id;
|
||||
|
||||
// Normalisasi path foto
|
||||
$cleanRequestPath = str_replace(['storage/', 'surveyor/'], '', $request->foto_path);
|
||||
|
||||
$inspeksi = Inspeksi::firstOrNew(
|
||||
['permohonan_id' => $permohonanId, 'dokument_id' => $dokumentId]
|
||||
);
|
||||
$fotoLantaiUnit = json_decode($inspeksi->foto_form, true);
|
||||
|
||||
// Konversi lantai ke string untuk konsistensi
|
||||
$lantai = (string)$request->lantai;
|
||||
|
||||
// Cek apakah lantai ada di array
|
||||
$pat = null;
|
||||
if (isset($fotoLantaiUnit['foto_lantai_unit'][$lantai])) {
|
||||
// Filter foto, hapus foto yang sesuai
|
||||
$fotoLantaiUnit['foto_lantai_unit'][$lantai] = array_filter(
|
||||
$fotoLantaiUnit['foto_lantai_unit'][$lantai],
|
||||
function ($foto) use ($cleanRequestPath) {
|
||||
// Normalisasi path foto yang tersimpan
|
||||
$storedPath = str_replace(['storage/', 'surveyor/'], '', $foto['path']);
|
||||
|
||||
// Jika path cocok, hapus file dari storage
|
||||
if ($storedPath === $cleanRequestPath) {
|
||||
// Hapus file dari storage dengan berbagai kemungkinan path
|
||||
$possiblePaths = [
|
||||
'storage/surveyor/lantai_unit/' . $cleanRequestPath,
|
||||
'storage/surveyor/' . $cleanRequestPath,
|
||||
'storage/' . $cleanRequestPath,
|
||||
$cleanRequestPath
|
||||
];
|
||||
|
||||
foreach ($possiblePaths as $path) {
|
||||
if (Storage::disk('public')->exists($path)) {
|
||||
Storage::disk('public')->delete($path);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return false; // Hapus dari array
|
||||
}
|
||||
return true;
|
||||
}
|
||||
);
|
||||
|
||||
// Reset index array
|
||||
$fotoLantaiUnit['foto_lantai_unit'][$lantai] = array_values($fotoLantaiUnit['foto_lantai_unit'][$lantai]);
|
||||
|
||||
// Hapus lantai jika tidak ada foto
|
||||
if (empty($fotoLantaiUnit['foto_lantai_unit'][$lantai])) {
|
||||
unset($fotoLantaiUnit['foto_lantai_unit'][$lantai]);
|
||||
}
|
||||
|
||||
// Update inspeksi
|
||||
$inspeksi->foto_form = json_encode($fotoLantaiUnit);
|
||||
$inspeksi->save();
|
||||
|
||||
return response()->json([
|
||||
'success' => true,
|
||||
'foto_lantai_unit' => $pat
|
||||
]);
|
||||
}
|
||||
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => 'gagal menghapus'
|
||||
], 404);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private function generateUniqueFileName($file, $prefix = '')
|
||||
{
|
||||
@@ -797,7 +811,7 @@ class SurveyorController extends Controller
|
||||
'permohonan_id' => 'required',
|
||||
'dokument_id' => 'required',
|
||||
'nomor_registrasi' => 'required',
|
||||
'foto_rute.*' => 'required|image|mimes:jpeg,png,jpg,gif,svg,webp,bmp,tiff,heic,heif|max:'. $maxSize,
|
||||
'upload_foto.*' => 'required|image|mimes:jpeg,png,jpg,gif,svg,webp,bmp,tiff,heic,heif|max:'. $maxSize,
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -808,6 +822,7 @@ class SurveyorController extends Controller
|
||||
$buttonStatusCheck = $this->checkButtonStatus($id);
|
||||
$buttonStatus = json_decode($buttonStatusCheck->getContent(), true);
|
||||
|
||||
|
||||
// Check if button should be disabled
|
||||
if ($buttonStatus['buttonDisable']) {
|
||||
return response()->json([
|
||||
@@ -816,19 +831,57 @@ class SurveyorController extends Controller
|
||||
], 422);
|
||||
}
|
||||
|
||||
$inspeksiRecords = Inspeksi::with(['dokument.jenisJaminan'])
|
||||
->where('permohonan_id', $id)
|
||||
->get();
|
||||
|
||||
|
||||
$validateConfig = [
|
||||
'tanah' => 'validateTanah',
|
||||
'bangunan' => 'validateBangunan',
|
||||
'lingkungan' => 'validateLingkungan',
|
||||
'fakta' => 'validateFactData',
|
||||
'rap' => 'validateRapData',
|
||||
];
|
||||
|
||||
// Ambil data inspeksi
|
||||
$inspeksiRecords = Inspeksi::with(['dokument.jenisJaminan'])
|
||||
->where('permohonan_id', $id)
|
||||
->get();
|
||||
|
||||
foreach ($inspeksiRecords as $inspeksi) {
|
||||
$cekname = $inspeksi->name;
|
||||
|
||||
// Pecah nama menjadi array
|
||||
$names = array_map('trim', explode(',', $cekname));
|
||||
$dataForm = json_decode($inspeksi->data_form, true);
|
||||
|
||||
foreach ($names as $name) {
|
||||
// Validasi hanya untuk nama yang ada dalam konfigurasi
|
||||
if (array_key_exists($name, $validateConfig)) {
|
||||
$validateMethod = $validateConfig[$name];
|
||||
$invalidFields = $this->validateService->{$validateMethod}($dataForm);
|
||||
|
||||
// Jika validasi gagal, kembalikan respons error
|
||||
if ($invalidFields) {
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => ucfirst($name) . ' tidak valid: ' . implode(', ', $invalidFields),
|
||||
], 422);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If validation passes, update permohonan status
|
||||
$permohonan = Permohonan::findOrFail($id);
|
||||
|
||||
|
||||
|
||||
$permohonan->update([
|
||||
'status' => 'survey-completed',
|
||||
'submitted_at' => now()
|
||||
]);
|
||||
|
||||
|
||||
|
||||
|
||||
return response()->json([
|
||||
'success' => true,
|
||||
'message' => 'Form surveyor berhasil disubmit'
|
||||
@@ -903,7 +956,7 @@ class SurveyorController extends Controller
|
||||
}
|
||||
|
||||
|
||||
public function storeJadwal(Request $request)
|
||||
public function storeJadwal(Request $request, $id)
|
||||
{
|
||||
try {
|
||||
$validate = $request->validate([
|
||||
@@ -912,7 +965,15 @@ class SurveyorController extends Controller
|
||||
'deskripsi_penilaian' => 'required'
|
||||
]);
|
||||
|
||||
$penilaian = Penilaian::findOrFail($validate['id']);
|
||||
$penilaian = Penilaian::findOrFail($id);
|
||||
|
||||
if (Carbon::parse($validate['waktu_penilaian']) <= Carbon::parse($penilaian->tanggal_kunjungan)) {
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => 'Waktu penilaian harus lebih besar dari tanggal assign.'
|
||||
], 422);
|
||||
}
|
||||
|
||||
|
||||
$emailData = [
|
||||
'email' => $penilaian->permohonan->user->email,
|
||||
@@ -921,28 +982,26 @@ class SurveyorController extends Controller
|
||||
|
||||
];
|
||||
|
||||
Mail::to($emailData['email'])->send(new SendJadwalKunjunganEmail($emailData, $penilaian->permohonan->nomor_resitrasi, $penilaian->permohonan->debiture));
|
||||
SendJadwalKunjunganEmailJob::dispatch($emailData);
|
||||
|
||||
|
||||
|
||||
if (Carbon::parse($validate['waktu_penilaian']) <= Carbon::parse($penilaian->tanggal_kunjungan)) {
|
||||
return redirect()
|
||||
->route('surveyor.index')
|
||||
->with('error', 'Waktu penilaian harus lebih besar dari tanggal assign.');
|
||||
}
|
||||
|
||||
$penilaian->update([
|
||||
'waktu_penilaian' => $validate['waktu_penilaian'],
|
||||
'deskripsi_penilaian' => $validate['deskripsi_penilaian'],
|
||||
]);
|
||||
|
||||
return redirect()
|
||||
->route('surveyor.index')
|
||||
->with('success', 'Jadwal berhasil dibuat.');
|
||||
return response()->json([
|
||||
'success' => true,
|
||||
'message' => 'Berhasil kirim jadwal kunjungan'
|
||||
], 200);
|
||||
} catch (\Exception $e) {
|
||||
\Log::error('Error sending email: ' . $e->getMessage());
|
||||
return redirect()
|
||||
->route('surveyor.index')
|
||||
->with('error', 'Internal Server Error: ' . $e->getMessage());
|
||||
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => 'Terjadi kesalahan',
|
||||
'error' => $e->getMessage()
|
||||
], 500);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1031,7 +1090,7 @@ class SurveyorController extends Controller
|
||||
'address', 'village_code', 'district_code', 'city_code', 'province_code',
|
||||
'nama', 'type','warna','lokasi', 'total', 'diskon', 'harga_diskon',
|
||||
'sumber_data', 'harga', 'tahun','transmisi','telepon',
|
||||
'kordinat_lat', 'kordinat_lng', 'tahun_pembuatan','merek_buatan','kapasitas','power','kondisi'
|
||||
'kordinat_lat', 'kordinat_lng', 'tahun_pembuatan','merek_buatan','kapasitas','power','kondisi','tanggal'
|
||||
];
|
||||
|
||||
|
||||
@@ -1041,7 +1100,7 @@ class SurveyorController extends Controller
|
||||
'tahun', 'luas_tanah', 'luas_bangunan', 'tahun_bangunan',
|
||||
'status_nara_sumber', 'harga', 'harga_diskon', 'diskon', 'total', 'nama_nara_sumber',
|
||||
'peruntukan', 'penawaran', 'telepon','hak_properti',
|
||||
'kordinat_lat', 'kordinat_lng', 'jenis_aset','foto_objek'
|
||||
'kordinat_lat', 'kordinat_lng', 'jenis_aset','foto_objek','tanggal'
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1096,7 +1155,7 @@ class SurveyorController extends Controller
|
||||
'address', 'village_code', 'district_code', 'city_code', 'province_code',
|
||||
'luas_tanah', 'luas_tanah_bagunan', 'total', 'diskon', 'harga_diskon',
|
||||
'status_nara_sumber', 'harga', 'nama_nara_sumber','hak_properti','telepon',
|
||||
'kordinat_lat', 'kordinat_lng', 'jenis_aset','penawaran',
|
||||
'kordinat_lat', 'kordinat_lng', 'jenis_aset','penawaran', 'tanggal',
|
||||
];
|
||||
|
||||
$inspeksi = Inspeksi::where('permohonan_id', $request->input('permohonan_id'))
|
||||
@@ -1436,7 +1495,8 @@ class SurveyorController extends Controller
|
||||
'type' => $request->input('type'),
|
||||
'dokument_id' => $request->input('dokument_id'),
|
||||
'objek_penilaian' => $objekPenilaian,
|
||||
'data_pembanding' => $this->formatDataPembanding($request)
|
||||
'data_pembanding' => $this->formatDataPembanding($request),
|
||||
'keterangan' => $request->input('keterangan')
|
||||
];
|
||||
|
||||
|
||||
@@ -2026,7 +2086,7 @@ class SurveyorController extends Controller
|
||||
});
|
||||
}
|
||||
|
||||
$query->whereRaw('LOWER(status) IN (?, ?, ?, ?, ?, ? ,?,?)', ['assign', 'survey', 'proses-survey', 'request-reschedule', 'reschedule', 'rejected-reschedule', 'approved-reschedule', 'revisi-laporan' ]);
|
||||
$query->whereRaw('LOWER(status) IN (?, ?, ?, ?, ?, ? ,?,?)', ['assign', 'survey', 'proses-survey', 'request-reschedule', 'reschedule', 'rejected-reschedule', 'approved-reschedule', 'revisi-survey' ]);
|
||||
|
||||
|
||||
if (!Auth::user()->hasRole('administrator')) {
|
||||
@@ -2347,7 +2407,7 @@ class SurveyorController extends Controller
|
||||
'province_code' => $data['province_code'] ?? null,
|
||||
];
|
||||
|
||||
$alamatKey = ($data['alamat_sesuai'] === 'sesuai') ? 'sesuai' : 'tidak sesuai';
|
||||
$alamatKey = ($data['alamat_sesuai'] ?? null) === 'sesuai' ? 'sesuai' : 'tidak sesuai';
|
||||
$alamat = [];
|
||||
|
||||
// Masukkan key baru yang sesuai
|
||||
@@ -2356,21 +2416,27 @@ class SurveyorController extends Controller
|
||||
'asset' => [
|
||||
'debitur_perwakilan' => $data['debitur_perwakilan'] ?? [],
|
||||
'jenis_asset' => [
|
||||
$data['jenis_asset'] => ($data['jenis_asset'] === 'sesuai')
|
||||
? $data['jenis_asset_name']
|
||||
: ($data['jenis_asset_tidak_sesuai'] ?? null)
|
||||
],
|
||||
'alamat' => $alamat,
|
||||
'hub_cadeb' => [
|
||||
$data['hub_cadeb'] => ($data['hub_cadeb'] == 'sesuai') ? $data['hub_cadeb_sesuai'] : $data['hub_cadeb_tidak_sesuai']
|
||||
],
|
||||
'hub_cadeb_penghuni' => [
|
||||
$data['hub_cadeb_penghuni'] => ($data['hub_cadeb_penghuni'] == 'sesuai') ? $data['hub_cadeb_penghuni_sesuai'] : $data['hub_penghuni_tidak_sesuai']
|
||||
],
|
||||
$data['jenis_asset'] ?? null => ($data['jenis_asset'] ?? null) === 'sesuai'
|
||||
? ($data['jenis_asset_name'] ?? null)
|
||||
: ($data['jenis_asset_tidak_sesuai'] ?? null)
|
||||
],
|
||||
'alamat' => $alamat,
|
||||
'hub_cadeb' => [
|
||||
$data['hub_cadeb'] ?? null => ($data['hub_cadeb'] ?? null) === 'sesuai'
|
||||
? ($data['hub_cadeb_sesuai'] ?? null)
|
||||
: ($data['hub_cadeb_tidak_sesuai'] ?? null)
|
||||
],
|
||||
'hub_cadeb_penghuni' => [
|
||||
$data['hub_cadeb_penghuni'] ?? null => ($data['hub_cadeb_penghuni'] ?? null) === 'sesuai'
|
||||
? ($data['hub_cadeb_penghuni_sesuai'] ?? null)
|
||||
: ($data['hub_penghuni_tidak_sesuai'] ?? null)
|
||||
],
|
||||
|
||||
'pihak_bank' => $data['pihak_bank'] ?? null,
|
||||
|
||||
'kordinat_lng' => $data['kordinat_lng'] ?? null,
|
||||
'kordinat_lat' => $data['kordinat_lat'] ?? null,
|
||||
'nomor_nib' => $data['nomor_nib'] ?? null
|
||||
]
|
||||
];
|
||||
}
|
||||
@@ -2378,16 +2444,22 @@ class SurveyorController extends Controller
|
||||
private function getTanahData(array $data): array
|
||||
{
|
||||
//luas tanah key
|
||||
$luas_tanah_key = ($data['luas_tanah'] === 'sesuai') ? 'sesuai' : 'tidak sesuai';
|
||||
// Luas tanah key
|
||||
$luas_tanah_key = ($data['luas_tanah'] ?? null) === 'sesuai' ? 'sesuai' : 'tidak sesuai';
|
||||
$luas_tanah = [];
|
||||
$hasil_tanah = $luas_tanah_key === 'sesuai' ? $data['luas_tanah_sesuai'] : $data['luas_tanah_tidak_sesuai'];
|
||||
$hasil_tanah = $luas_tanah_key === 'sesuai'
|
||||
? ($data['luas_tanah_sesuai'] ?? null)
|
||||
: ($data['luas_tanah_tidak_sesuai'] ?? null);
|
||||
$luas_tanah[$luas_tanah_key] = $hasil_tanah;
|
||||
|
||||
// hadap mata angin
|
||||
$hadap_mata_angin_key = ($data['hadap_mata_angin'] === 'sesuai') ? 'sesuai' : 'tidak sesuai';
|
||||
$hadap_mata_angin = [];
|
||||
$hasil_hadap_mata_angin = $hadap_mata_angin_key === 'sesuai' ? $data['hadap_mata_angin_sesuai'] : $data['hadap_mata_angin_tidak_sesuai'];
|
||||
$hadap_mata_angin[$hadap_mata_angin_key] = $hasil_hadap_mata_angin;
|
||||
// Hadap mata angin key
|
||||
$hadap_mata_angin_key = ($data['hadap_mata_angin'] ?? null) === 'sesuai' ? 'sesuai' : 'tidak sesuai';
|
||||
$hadap_mata_angin = [];
|
||||
$hasil_hadap_mata_angin = $hadap_mata_angin_key === 'sesuai'
|
||||
? ($data['hadap_mata_angin_sesuai'] ?? null)
|
||||
: ($data['hadap_mata_angin_tidak_sesuai'] ?? null);
|
||||
$hadap_mata_angin[$hadap_mata_angin_key] = $hasil_hadap_mata_angin;
|
||||
|
||||
|
||||
return [
|
||||
'tanah' => [
|
||||
@@ -2467,14 +2539,17 @@ class SurveyorController extends Controller
|
||||
|
||||
|
||||
|
||||
$luas_tanah_bagunan_key = ($data['luas_tanah_bagunan'] === 'sesuai') ? 'sesuai' : 'tidak sesuai';
|
||||
$luas_tanah_bagunan_key = ($data['luas_tanah_bagunan'] ?? null) === 'sesuai' ? 'sesuai' : 'tidak sesuai';
|
||||
$luas_tanah_bagunan = [];
|
||||
|
||||
$hasil_tanah_bagunan = $luas_tanah_bagunan_key === 'sesuai' ? $data['luas_bangunan_sesuai'] : $data['luas_tanah_bagunan_tidak_sesuai'];
|
||||
$hasil_tanah_bagunan = $luas_tanah_bagunan_key === 'sesuai'
|
||||
? ($data['luas_bangunan_sesuai'] ?? null)
|
||||
: ($data['luas_tanah_bagunan_tidak_sesuai'] ?? null);
|
||||
|
||||
// Masukkan key baru yang sesuai
|
||||
$luas_tanah_bagunan[$luas_tanah_bagunan_key] = $hasil_tanah_bagunan;
|
||||
|
||||
|
||||
return [
|
||||
'bangunan' => [
|
||||
'luas_tanah_bagunan' => $luas_tanah_bagunan,
|
||||
@@ -2513,10 +2588,11 @@ class SurveyorController extends Controller
|
||||
false,
|
||||
'lainnya'
|
||||
),
|
||||
'disekitar_lokasi' => $data['disekitar_lokasi'] === 'yes' ? [
|
||||
'kondisi' => $data['kondisi_bagunan_disekitar_lokasi'] ?? null,
|
||||
'sifat' => $data['sifat_bagunan_disekitar_lokasi'] ?? null,
|
||||
] : $data['disekitar_lokasi'],
|
||||
'disekitar_lokasi' => ($data['disekitar_lokasi'] ?? null) === 'yes' ? [
|
||||
'kondisi' => $data['kondisi_bagunan_disekitar_lokasi'] ?? null,
|
||||
'sifat' => $data['sifat_bagunan_disekitar_lokasi'] ?? null,
|
||||
] : ($data['disekitar_lokasi'] ?? null),
|
||||
|
||||
'kondisi_bagunan_disekitar_lokasi' => $data['kondisi_bagunan_disekitar_lokasi'] ?? null,
|
||||
'sifat_bagunan_disekitar_lokasi' => $data['sifat_bagunan_disekitar_lokasi'] ?? null,
|
||||
'dekat_makam' => $data['dekat_makam'] ?? null,
|
||||
@@ -2566,7 +2642,8 @@ class SurveyorController extends Controller
|
||||
'foto_gistaru',
|
||||
'foto_bhumi',
|
||||
'foto_argis_region',
|
||||
'foto_tempat'
|
||||
'foto_tempat',
|
||||
'foto_sentuh_tanahku'
|
||||
];
|
||||
|
||||
if ($inspeksi) {
|
||||
@@ -2574,16 +2651,17 @@ class SurveyorController extends Controller
|
||||
foreach ($fotoTypes as $fotoType) {
|
||||
// Jika ada file baru diupload
|
||||
if ($request->hasFile($fotoType)) {
|
||||
$factData[$fotoType] = $this->updateOrDeleteFile($dataForm, $request, $fotoType);
|
||||
$factData[$fotoType] = $this->updateOrDeleteFile($dataForm, $request, $fotoType) ?: null;
|
||||
} else {
|
||||
$factData[$fotoType] = $dataForm[$fotoType] ?? null;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
foreach ($fotoTypes as $fotoType) {
|
||||
$factData[$fotoType] = $this->updateOrDeleteFile($data, $request, $fotoType);
|
||||
$factData[$fotoType] = $this->updateOrDeleteFile($data, $request, $fotoType) ?: null;
|
||||
}
|
||||
}
|
||||
|
||||
return $factData;
|
||||
}
|
||||
|
||||
@@ -2698,6 +2776,7 @@ class SurveyorController extends Controller
|
||||
'target_market' => $data['target_market'] ?? null,
|
||||
'kerjasama_dengan_bank' => $data['kerjasama_dengan_bank'] ?? null,
|
||||
'rute_menuju_lokasi' => $data['rute_menuju_lokasi'] ?? null,
|
||||
'properti_sejenis' => $data['properti_sejenis'] ?? null,
|
||||
];
|
||||
|
||||
return $rapData;
|
||||
@@ -3459,17 +3538,17 @@ class SurveyorController extends Controller
|
||||
$arr1[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Bersihkan key lama yang tidak ada di array baru
|
||||
foreach ($arr1 as $key => $value) {
|
||||
if (!array_key_exists($key, $arr2) && $key !== 'signature') {
|
||||
unset($arr1[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $arr1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function print_out_inspeksi($permohonan_id, $dokument_id, $jenis_jaminan_id)
|
||||
|
||||
@@ -700,15 +700,17 @@ class TenderController extends Controller
|
||||
$kjpps = KJPP::whereIn('id', $detail_penawaran)
|
||||
->get()
|
||||
->map(function ($item) {
|
||||
$emails = [$item->email_kantor];
|
||||
$emails = collect(explode(',', $item->email_kantor))->filter()->unique();
|
||||
|
||||
// Parse JSON string jika ada dan tidak kosong
|
||||
if (!empty($item->detail_email_kantor) && $item->detail_email_kantor !== '[]') {
|
||||
$detail_emails = json_decode($item->detail_email_kantor, true);
|
||||
if (is_array($detail_emails)) {
|
||||
foreach ($detail_emails as $detail) {
|
||||
if (isset($detail['email_kantor'])) {
|
||||
$emails[] = $detail['email_kantor'];
|
||||
if (is_array($detail) && isset($detail['email_kantor'])) {
|
||||
$emails->push($detail['email_kantor']);
|
||||
} elseif (is_string($detail)) {
|
||||
$emails->push($detail);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -716,10 +718,11 @@ class TenderController extends Controller
|
||||
|
||||
return [
|
||||
'kjpp' => $item,
|
||||
'emails' => array_filter($emails)
|
||||
'emails' => array_filter($emails->unique()->values()->all())
|
||||
];
|
||||
});
|
||||
|
||||
|
||||
foreach ($permohonan->documents as $document) {
|
||||
$village_permohonan = $document->village_code;
|
||||
$district_permohonan = $document->district_code;
|
||||
@@ -894,26 +897,30 @@ class TenderController extends Controller
|
||||
|
||||
$detail_penawaran = PenawaranDetailTender::with('kjpp')->where('kjpp_rekanan_id', '=', $id)->pluck('kjpp_rekanan_id')->toArray();
|
||||
$kjpps = KJPP::whereIn('id', $detail_penawaran)
|
||||
->get()
|
||||
->map(function ($item) {
|
||||
$emails = [$item->email_kantor];
|
||||
->get()
|
||||
->map(function ($item) {
|
||||
$emails = collect(explode(',', $item->email_kantor))->filter()->unique();
|
||||
|
||||
// Parse JSON string jika ada dan tidak kosong
|
||||
if (!empty($item->detail_email_kantor) && $item->detail_email_kantor !== '[]') {
|
||||
$detail_emails = json_decode($item->detail_email_kantor, true);
|
||||
if (is_array($detail_emails)) {
|
||||
foreach ($detail_emails as $detail) {
|
||||
if (isset($detail['email_kantor'])) {
|
||||
$emails[] = $detail['email_kantor'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Parse JSON string jika ada dan tidak kosong
|
||||
if (!empty($item->detail_email_kantor) && $item->detail_email_kantor !== '[]') {
|
||||
$detail_emails = json_decode($item->detail_email_kantor, true);
|
||||
if (is_array($detail_emails)) {
|
||||
foreach ($detail_emails as $detail) {
|
||||
if (is_array($detail) && isset($detail['email_kantor'])) {
|
||||
$emails->add($detail['email_kantor']);
|
||||
} elseif (is_string($detail)) {
|
||||
$emails->add($detail);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return array_filter($emails);
|
||||
})
|
||||
->flatten()
|
||||
->toArray();
|
||||
return array_filter(array_values(iterator_to_array($emails)));
|
||||
})
|
||||
->flatten()
|
||||
->unique()
|
||||
->values()
|
||||
->toArray();
|
||||
|
||||
$dp1 = PenawaranDetailTender::with('kjpp')->where('kjpp_rekanan_id', '=', $id)->first();
|
||||
|
||||
|
||||
@@ -577,11 +577,11 @@ class FormSurveyorRequest extends FormRequest
|
||||
'alamat_sesuai' => 'required',
|
||||
'alamat_tidak_sesuai' => 'nullable|string',
|
||||
'pihak_bank' => 'nullable|string',
|
||||
|
||||
'hub_cadeb' => 'required',
|
||||
'nomor_nib' => 'nullable|string',
|
||||
'hub_cadeb' => 'nullable|string',
|
||||
'hub_cadeb_sesuai' => 'nullable|string',
|
||||
'hub_cadeb_tidak_sesuai' => 'nullable|string',
|
||||
'hub_cadeb_penghuni' => 'required',
|
||||
'hub_cadeb_penghuni' => 'nullable',
|
||||
'hub_cadeb_penghuni_sesuai' => 'nullable|string',
|
||||
'hub_penghuni_tidak_sesuai' => 'nullable|string',
|
||||
|
||||
|
||||
33
app/Jobs/SendJadwalKunjunganEmailJob.php
Normal file
33
app/Jobs/SendJadwalKunjunganEmailJob.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Jobs;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Modules\Lpj\Emails\SendJadwalKunjunganEmail;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
|
||||
class SendJadwalKunjunganEmailJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
protected $emailData;
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*/
|
||||
public function __construct(array $emailData)
|
||||
{
|
||||
$this->emailData = $emailData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the job.
|
||||
*/
|
||||
public function handle(): void
|
||||
{
|
||||
Mail::to($this->emailData['email'])->send(new SendJadwalKunjunganEmail($this->emailData));
|
||||
}
|
||||
}
|
||||
392
app/Services/SurveyorValidateService.php
Normal file
392
app/Services/SurveyorValidateService.php
Normal file
@@ -0,0 +1,392 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Services;
|
||||
|
||||
class SurveyorValidateService
|
||||
{
|
||||
/**
|
||||
* Validasi data asset
|
||||
*
|
||||
* @param array $assetData
|
||||
* @return string
|
||||
*/
|
||||
public function validateAsset(array $assetData): array
|
||||
{
|
||||
$invalidFields = [];
|
||||
|
||||
// Validasi data `debitur_perwakilan`
|
||||
if (empty($assetData['asset']['debitur_perwakilan'])) {
|
||||
$invalidFields[] = 'debitur perwakilan';
|
||||
}
|
||||
|
||||
// Validasi data `jenis_asset`
|
||||
$jenisAsset = $assetData['asset']['jenis_asset'] ?? [];
|
||||
foreach ($jenisAsset as $key => $value) {
|
||||
if (empty($key) || empty($value)) {
|
||||
$invalidFields[] = "jenis_asset[$key]";
|
||||
}
|
||||
}
|
||||
|
||||
// Validasi data `alamat`
|
||||
$alamat = $assetData['asset']['alamat'] ?? [];
|
||||
foreach ($alamat as $key => $alamatData) {
|
||||
if (empty($key)) {
|
||||
$invalidFields[] = "alamat[$key]";
|
||||
}
|
||||
|
||||
foreach ($alamatData as $field => $value) {
|
||||
if (empty($value)) {
|
||||
$invalidFields[] = "alamat[$key][$field]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Validasi data `hub_cadeb`
|
||||
$hubCadeb = $assetData['asset']['hub_cadeb'] ?? [];
|
||||
foreach ($hubCadeb as $key => $value) {
|
||||
if (empty($key) || empty($value)) {
|
||||
$invalidFields[] = "Hubungan cadeb/debitur dengan Pemilik Jaminan";
|
||||
}
|
||||
}
|
||||
|
||||
// Validasi data `hub_cadeb_penghuni`
|
||||
$hubCadebPenghuni = $assetData['asset']['hub_cadeb_penghuni'] ?? [];
|
||||
foreach ($hubCadebPenghuni as $key => $value) {
|
||||
if (empty($key) || empty($value)) {
|
||||
$invalidFields[] = "Hubungan Cadeb/Debitur dengan Penghuni Jaminan";
|
||||
}
|
||||
}
|
||||
|
||||
// Validasi data tambahan lainnya
|
||||
$fieldsToValidate = [
|
||||
'pihak_bank',
|
||||
'kordinat_lng',
|
||||
'kordinat_lat',
|
||||
'nomor_nib',
|
||||
];
|
||||
|
||||
foreach ($fieldsToValidate as $field) {
|
||||
if (empty($assetData['asset'][$field])) {
|
||||
$invalidFields[] = $field;
|
||||
}
|
||||
}
|
||||
|
||||
// validasi signature
|
||||
|
||||
$signature = [
|
||||
'penilai',
|
||||
'cabang',
|
||||
'debitur',
|
||||
];
|
||||
foreach ($signature as $value) {
|
||||
if (empty($assetData['signature'][$value])) {
|
||||
$invalidFields[] = 'Tanda tangan' . $value . ' tidak ada';
|
||||
}
|
||||
}
|
||||
|
||||
// Kembalikan daftar field yang tidak valid
|
||||
return $invalidFields;
|
||||
}
|
||||
|
||||
|
||||
public function validateTanah(array $data): array
|
||||
{
|
||||
$invalidFields = [];
|
||||
|
||||
if (empty($data['tanah']['luas_tanah'])) {
|
||||
$invalidFields[] = 'luas tanah';
|
||||
}
|
||||
|
||||
if (empty($data['tanah']['hadap_mata_angin'])) {
|
||||
$invalidFields[] = 'hadap mata angin';
|
||||
}
|
||||
|
||||
// Validasi bentuk tanah
|
||||
if (empty($data['tanah']['bentuk_tanah'])) {
|
||||
$invalidFields[] = 'bentuk tanah';
|
||||
}
|
||||
|
||||
// Validasi kontur tanah
|
||||
if (empty($data['tanah']['kontur_tanah'])) {
|
||||
$invalidFields[] = 'kontur tanah';
|
||||
}
|
||||
|
||||
// Validasi ketinggian tanah
|
||||
if (empty($data['tanah']['ketinggian_jalan']) && empty($data['tanah']['ketinggian_lebih_tinggi']) && empty($data['tanah']['ketinggian_lebih_rendah'])) {
|
||||
$invalidFields[] = 'ketinggian tanah';
|
||||
}
|
||||
|
||||
// Validasi kontur jalan
|
||||
if (empty($data['tanah']['kontur_jalan'])) {
|
||||
$invalidFields[] = 'kontur jalan';
|
||||
}
|
||||
|
||||
// Validasi posisi kavling
|
||||
if (empty($data['tanah']['posisi_kavling'])) {
|
||||
$invalidFields[] = 'posisi kavling';
|
||||
}
|
||||
|
||||
// Validasi tusuk sate
|
||||
if (!isset($data['tanah']['tusuk_sate'])) {
|
||||
$invalidFields[] = 'tusuk sate';
|
||||
}
|
||||
|
||||
// Validasi lockland
|
||||
if (!isset($data['tanah']['lockland'])) {
|
||||
$invalidFields[] = 'lockland';
|
||||
}
|
||||
|
||||
// Validasi kondisi fisik tanah
|
||||
if (empty($data['tanah']['kondisi_fisik_tanah'])) {
|
||||
$invalidFields[] = 'kondisi fisik tanah';
|
||||
}
|
||||
|
||||
return $invalidFields;
|
||||
}
|
||||
|
||||
|
||||
public function validateBangunan(array $data): array
|
||||
{
|
||||
$invalidFields = [];
|
||||
|
||||
// Validasi luas tanah banguna
|
||||
|
||||
if (empty($data['bangunan']['luas_tanah_bagunan'])) {
|
||||
$invalidFields[] = 'luas bangunan';
|
||||
}
|
||||
|
||||
|
||||
// Validasi jenis bangunan
|
||||
if (empty($data['bangunan']['jenis_bangunan'])) {
|
||||
$invalidFields[] = 'jenis bangunan';
|
||||
}
|
||||
|
||||
// Validasi kondisi bangunan
|
||||
if (empty($data['bangunan']['kondisi_bangunan'])) {
|
||||
$invalidFields[] = 'kondisi bangunan';
|
||||
}
|
||||
|
||||
// Validasi sifat bangunan
|
||||
if (empty($data['bangunan']['sifat_bangunan'])) {
|
||||
$invalidFields[] = 'sifat bangunan';
|
||||
}
|
||||
|
||||
// Validasi sifat bangunan input
|
||||
if (empty($data['bangunan']['sifat_bangunan_input'])) {
|
||||
$invalidFields[] = 'sifat bangunan input';
|
||||
}
|
||||
|
||||
// Validasi sarana pelengkap
|
||||
if (empty($data['bangunan']['sarana_pelengkap'])) {
|
||||
$invalidFields[] = 'sarana pelengkap';
|
||||
}
|
||||
|
||||
// Validasi sarana pelengkap input
|
||||
if (empty($data['bangunan']['sarana_pelengkap_input'])) {
|
||||
$invalidFields[] = 'sarana pelengkap input';
|
||||
}
|
||||
|
||||
return $invalidFields;
|
||||
}
|
||||
|
||||
public function validateLingkungan(array $data): array
|
||||
{
|
||||
$invalidFields = [];
|
||||
|
||||
// Validasi jarak jalan utama
|
||||
if (empty($data['lingkungan']['jarak_jalan_utama'])) {
|
||||
$invalidFields[] = 'jarak jalan utama';
|
||||
}
|
||||
|
||||
// Validasi jalan lingkungan
|
||||
if (empty($data['lingkungan']['jalan_linkungan'])) {
|
||||
$invalidFields[] = 'jalan lingkungan';
|
||||
}
|
||||
|
||||
// Validasi jarak CBD point
|
||||
if (empty($data['lingkungan']['jarak_cbd_point'])) {
|
||||
$invalidFields[] = 'jarak CBD point';
|
||||
}
|
||||
|
||||
// Validasi nama CBD point
|
||||
if (empty($data['lingkungan']['nama_cbd_point'])) {
|
||||
$invalidFields[] = 'nama CBD point';
|
||||
}
|
||||
|
||||
// Validasi lebar perkerasan jalan
|
||||
if (empty($data['lingkungan']['lebar_perkerasan_jalan'])) {
|
||||
$invalidFields[] = 'lebar perkerasan jalan';
|
||||
}
|
||||
|
||||
// Validasi perkerasan jalan
|
||||
if (empty($data['lingkungan']['perkerasan_jalan'])) {
|
||||
$invalidFields[] = 'perkerasan jalan';
|
||||
}
|
||||
|
||||
// Validasi lalu lintas
|
||||
if (empty($data['lingkungan']['lalu_lintas'])) {
|
||||
$invalidFields[] = 'lalu lintas';
|
||||
}
|
||||
|
||||
// Validasi golongan masyarakat sekitar
|
||||
if (empty($data['lingkungan']['gol_mas_sekitar'])) {
|
||||
$invalidFields[] = 'golongan masyarakat sekitar';
|
||||
}
|
||||
|
||||
// Validasi tingkat keramaian
|
||||
if (empty($data['lingkungan']['tingkat_keramaian'])) {
|
||||
$invalidFields[] = 'tingkat keramaian';
|
||||
}
|
||||
|
||||
// Validasi terletak di area
|
||||
if (empty($data['lingkungan']['terletak_diarea'])) {
|
||||
$invalidFields[] = 'terletak di area';
|
||||
}
|
||||
|
||||
// Validasi lokasi sekitar
|
||||
if (isset($data['lingkungan']['disekitar_lokasi']) && $data['lingkungan']['disekitar_lokasi'] === 'yes') {
|
||||
if (empty($data['lingkungan']['kondisi_bagunan_disekitar_lokasi'])) {
|
||||
$invalidFields[] = 'kondisi bangunan di sekitar lokasi';
|
||||
}
|
||||
|
||||
if (empty($data['lingkungan']['sifat_bagunan_disekitar_lokasi'])) {
|
||||
$invalidFields[] = 'sifat bangunan di sekitar lokasi';
|
||||
}
|
||||
}
|
||||
|
||||
// Validasi dekat makam
|
||||
if (isset($data['lingkungan']['dekat_makam']) && $data['lingkungan']['dekat_makam'] === 'yes') {
|
||||
if (empty($data['lingkungan']['jarak_makam'])) {
|
||||
$invalidFields[] = 'jarak makam';
|
||||
}
|
||||
|
||||
if (empty($data['lingkungan']['nama_makam'])) {
|
||||
$invalidFields[] = 'nama makam';
|
||||
}
|
||||
}
|
||||
|
||||
// Validasi dekat TPS
|
||||
if (isset($data['lingkungan']['dekat_tps']) && $data['lingkungan']['dekat_tps'] === 'yes') {
|
||||
if (empty($data['lingkungan']['jarak_tps'])) {
|
||||
$invalidFields[] = 'jarak TPS';
|
||||
}
|
||||
|
||||
if (empty($data['lingkungan']['nama_tps'])) {
|
||||
$invalidFields[] = 'nama TPS';
|
||||
}
|
||||
}
|
||||
|
||||
// Validasi fasilitas dekat object
|
||||
if (empty($data['lingkungan']['fasilitas_dekat_object'])) {
|
||||
$invalidFields[] = 'fasilitas dekat object';
|
||||
}
|
||||
|
||||
// Validasi fasilitas dekat object input
|
||||
if (empty($data['lingkungan']['fasilitas_dekat_object_input'])) {
|
||||
$invalidFields[] = 'fasilitas dekat object input';
|
||||
}
|
||||
|
||||
return $invalidFields;
|
||||
}
|
||||
|
||||
|
||||
public function validateFactData(array $data): array
|
||||
{
|
||||
$invalidFields = [];
|
||||
|
||||
// Validasi fakta_positif dan fakta_negatif
|
||||
if (empty($data['fakta']['fakta_positif'])) {
|
||||
$invalidFields[] = 'fakta_positif harus diisi';
|
||||
}
|
||||
if (empty($data['fakta']['fakta_negatif'])) {
|
||||
$invalidFields[] = 'fakta_negatif harus diisi';
|
||||
}
|
||||
|
||||
// Validasi rute_menuju
|
||||
if (empty($data['fakta']['rute_menuju'])) {
|
||||
$invalidFields[] = 'rute_menuju harus diisi';
|
||||
}
|
||||
|
||||
// Validasi batas_batas dan batas_batas_input
|
||||
if (empty($data['fakta']['batas_batas']) && empty($data['fakta']['batas_batas_input'])) {
|
||||
$invalidFields[] = 'Batas batas';
|
||||
}
|
||||
|
||||
// Validasi kondisi_lingkungan
|
||||
if (empty($data['fakta']['kondisi_lingkungan'])) {
|
||||
$invalidFields[] = 'kondisi_lingkungan harus diisi';
|
||||
}
|
||||
|
||||
return $invalidFields;
|
||||
}
|
||||
|
||||
|
||||
public function validateRapData(array $data): array
|
||||
{
|
||||
$invalidFields = [];
|
||||
|
||||
// Validasi pengalaman_developer
|
||||
if (empty($data['pengalaman_developer'])) {
|
||||
$invalidFields[] = 'Pengalaman developer harus diisi';
|
||||
}
|
||||
|
||||
// Validasi kondisi_perumahan
|
||||
if (empty($data['kondisi_perumahan'])) {
|
||||
$invalidFields[] = 'Kondisi perumahan harus diisi';
|
||||
}
|
||||
|
||||
// Validasi progres_pembangunan
|
||||
if (empty($data['progres_pembangunan'])) {
|
||||
$invalidFields[] = 'Progres pembangunan harus diisi';
|
||||
}
|
||||
|
||||
// Validasi partisi
|
||||
if (isset($data['partisi'])) {
|
||||
foreach ($data['partisi'] as $name => $values) {
|
||||
if (empty($values['value'])) {
|
||||
$invalidFields[] = "Partisi '{$name}' harus memiliki nilai";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Validasi jumlah_unit
|
||||
if (empty($data['jumlah_unit'])) {
|
||||
$invalidFields[] = 'Jumlah unit harus diisi';
|
||||
}
|
||||
|
||||
// Validasi batas_batas_perumahan
|
||||
if (empty($data['batas_batas_perumahan'])) {
|
||||
$invalidFields[] = 'Batas batas perumahan harus diisi';
|
||||
}
|
||||
|
||||
// Validasi fasus_fasum
|
||||
if (empty($data['fasus_fasum'])) {
|
||||
$invalidFields[] = 'Fasus fasum harus diisi';
|
||||
}
|
||||
|
||||
// Validasi harga_unit
|
||||
if (empty($data['harga_unit'])) {
|
||||
$invalidFields[] = 'Harga unit harus diisi';
|
||||
}
|
||||
|
||||
// Validasi target_market
|
||||
if (empty($data['target_market'])) {
|
||||
$invalidFields[] = 'Target market harus diisi';
|
||||
}
|
||||
|
||||
// Validasi kerjasama_dengan_bank
|
||||
if (empty($data['kerjasama_dengan_bank'])) {
|
||||
$invalidFields[] = 'Kerjasama dengan bank harus diisi';
|
||||
}
|
||||
|
||||
// Validasi rute_menuju_lokasi
|
||||
if (empty($data['rute_menuju_lokasi'])) {
|
||||
$invalidFields[] = 'Rute menuju lokasi harus diisi';
|
||||
}
|
||||
|
||||
return $invalidFields;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -103,6 +103,7 @@
|
||||
"roles": [
|
||||
"administrator",
|
||||
"senior-officer",
|
||||
"EO Appraisal",
|
||||
"DD Appraisal"
|
||||
]
|
||||
}
|
||||
@@ -332,6 +333,8 @@
|
||||
"pemohon-ao",
|
||||
"pemohon-eo",
|
||||
"admin",
|
||||
"DD Appraisal",
|
||||
"EO Appraisal",
|
||||
"senior-officer"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -56,6 +56,19 @@
|
||||
|
||||
|
||||
@if ($permohonan->status === 'done')
|
||||
|
||||
@foreach ($permohonan->documents as $dokumen)
|
||||
@php
|
||||
$inspeksiId = null;
|
||||
|
||||
foreach ($dokumen->inspeksi as $item) {
|
||||
$inspeksiId = $item->id;
|
||||
}
|
||||
|
||||
$jaminanId = $dokumen->id;
|
||||
$currentInspeksi = $inspeksiData[$jaminanId] ?? null;
|
||||
$tanahBangunanTypes = ['KAPAL', 'PESAWAT', 'ALAT BERAT'];
|
||||
@endphp
|
||||
<div class="card border border-agi-100 grow" id="activity_2024">
|
||||
|
||||
<div class="card-header bg-agi-50">
|
||||
@@ -66,17 +79,18 @@
|
||||
|
||||
<div class="card-body">
|
||||
|
||||
<a class="btn btn-info" {{-- href="{{ route('penilai.lampiran') }}?permohonanId={{ request('permohonanId') }}&documentId={{ request('documentId') }}&inspeksiId={{ request('inspeksiId') }}&jaminanId={{ request('jaminanId') }}&statusLpj=1" --}}>
|
||||
<a class="btn btn-info" href="{{ route('penilai.lampiran') }}?permohonanId={{ $permohonan->id }}&documentId={{ $dokumen->id }}&inspeksiId={{ $inspeksiId }}&jaminanId={{ $dokumen->jenis_jaminan_id }}&statusLpj=1">
|
||||
LAMPIRAN FOTO DAN DOKUMEN
|
||||
</a>
|
||||
<a {{-- href="{{ route('surveyor.print_out_inspeksi', ['permohonan_id' => $permohonan->id, 'dokument_id' => request('documentId'), 'jenis_jaminan_id' => request('jaminanId')]) }}" --}} class="btn btn-light">
|
||||
<a href="{{ route('surveyor.print_out_inspeksi', ['permohonan_id' => $permohonan->id, 'dokument_id' => $dokumen->id, 'jenis_jaminan_id' => $dokumen->jenis_jaminan_id ]) }}" class="btn btn-light">
|
||||
<i class="ki-filled ki-printer"></i> Hasil Inspeksi
|
||||
</a>
|
||||
<a class="btn btn-success" {{-- onclick="checkLaporan('{{ $permohonan->id }}', '{{ request('documentId') }}', '{{ request('inspeksiId') }}', {{ request('jaminanId') }}, )" --}}>
|
||||
<a class="btn btn-success" onclick="checkLaporan('{{ $permohonan->id }}', '{{ $dokumen->id }}', '{{ $inspeksiId }}', {{ $dokumen->jenis_jaminan_id }}, 0 )">
|
||||
<i class="ki-filled ki-printer"></i> Print Laporan
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
<div class="card border border-agi-100 grow" id="activity_2024">
|
||||
@@ -84,3 +98,4 @@
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@include('lpj::surveyor.js.utils')
|
||||
|
||||
@@ -246,7 +246,7 @@
|
||||
title: 'Due Date',
|
||||
render: (item, data) => {
|
||||
if (!data.due_date_sla) {
|
||||
return `<span class="badge badge-sm badge-outline badge-danger uppercase flex justify-center">Sudah melewati batas</span>`;
|
||||
return ``;
|
||||
}
|
||||
return `${window.formatTanggalIndonesia(data.due_date_sla)}`;
|
||||
}
|
||||
@@ -256,7 +256,7 @@
|
||||
title: 'Paparan',
|
||||
render: (item, data) => {
|
||||
if (!data.due_date_sla) {
|
||||
return `<span class="badge badge-sm badge-outline badge-danger uppercase flex justify-center">Sudah melewati batas</span>`;
|
||||
return `-`;
|
||||
}
|
||||
return `${window.formatTanggalIndonesia(data.due_date_sla)}`;
|
||||
}
|
||||
|
||||
@@ -1,547 +1,5 @@
|
||||
<div style="display: none">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5" style="margin-top: 20px">
|
||||
|
||||
<label class="form-label max-w-56">Debitur/Perwakilan</label>
|
||||
|
||||
@if (isset($forminspeksi['asset']['debitur_perwakilan']) && !empty($forminspeksi['asset']['debitur_perwakilan']))
|
||||
<div id="perwakilan" class="flex flex-wrap items-baseline w-full gap-5">
|
||||
@foreach ($forminspeksi['asset']['debitur_perwakilan'] as $key => $item)
|
||||
<div class="perwakilan flex flex-wrap w-full items-baseline gap-2 ">
|
||||
<input type="text" class="input form-control" name="debitur_perwakilan[]"
|
||||
value="{{ old('debitur_perwakilan.' . $key, $item) }}"
|
||||
placeholder="Masukkan Debitur/Perwakilan" />
|
||||
<button type="button" class="btn btn-danger btn-outline btn-xs remove-btn">Hapus</button>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
@else
|
||||
<div id="perwakilan" class="flex flex-wrap items-baseline w-full gap-5">
|
||||
<div class="perwakilan flex flex-wrap w-full items-baseline gap-2 ">
|
||||
<input type="text" class="input form-control" name="debitur_perwakilan[]"
|
||||
value="{{ old('debitur_perwakilan') }}" placeholder="Masukkan Debitur/Perwakilan" />
|
||||
<button type="button" class="btn btn-danger btn-outline btn-xs remove-btn"
|
||||
style="display: none">Hapus
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<button onclick="addClonableItem('perwakilan', 'perwakilan')" type="button" class="btn-md btn btn-primary">
|
||||
<i class="ki-filled ki-plus"></i>
|
||||
</button>
|
||||
<em id="error-debitur_perwakilan" class="alert text-danger text-sm"></em>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5" style="margin-top: 20px">
|
||||
<label class="form-label max-w-56">Pihak Bank</label>
|
||||
<div id="perwakilan" class="flex items-baseline w-full gap-5">
|
||||
<div class="flex gap-4 items-center w-full">
|
||||
<input class="input" type="text" placeholder="Masukan Pihak Bank Selain Pj" type="text"
|
||||
name="pihak_bank" id="lat"
|
||||
value="{{ old('pihak_bank', isset($forminspeksi['asset']['pihak_bank']) ? $forminspeksi['asset']['pihak_bank'] : '') }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card border border-agi-100 w-full bg-white rounded-lg shadow-md overflow-hidden">
|
||||
<div class="card-header bg-agi-50">
|
||||
<h1 class="text-md font-medium text-gray-900 uppercase">Nama Cadeb/Debitur</h1>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
|
||||
<div class="grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Nama</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
@if (isset($permohonan->debiture))
|
||||
<p class="text-2sm text-gray-700">{{ $permohonan->debiture->name }}</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="card border border-agi-100 w-full bg-white rounded-lg shadow-md ">
|
||||
<div class="card-header bg-agi-50">
|
||||
<h1 class="text-md font-medium text-gray-900 uppercase">Deskripsi Aset jaminan</h1>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="grid gap-5 w-full">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Jenis Aset</label>
|
||||
<div>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
@if (isset($permohonan->documents))
|
||||
@foreach ($permohonan->documents as $item)
|
||||
<p class="text-2sm text-gray-700">{{ $item->jenisJaminan->name }}</p>
|
||||
<input type="hidden" name="jenis_asset_name"
|
||||
value="{{ $item->jenisJaminan->name }}">
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
<div class="flex-wrap items-stretch">
|
||||
<div class="grid grid-cols-3 md:grid-cols-3 gap-4 mt-2">
|
||||
<label class="form-label flex items-center gap-3 text-nowrap">
|
||||
<input
|
||||
onclick="toggleFieldVisibility('jenis_asset', 'jenis_asset', ['tidak sesuai'])"
|
||||
type="radio" class="radio" name="jenis_asset" value="sesuai"
|
||||
{{ isset($forminspeksi['asset']['jenis_asset']['sesuai']) ? 'checked' : '' }}>
|
||||
<span class="ml-2">Ya</span>
|
||||
</label>
|
||||
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
||||
<input
|
||||
onclick="toggleFieldVisibility('jenis_asset', 'jenis_asset', ['tidak sesuai'])"
|
||||
type="radio" class="radio" name="jenis_asset" value="tidak sesuai"
|
||||
{{ isset($forminspeksi['asset']['jenis_asset']['tidak sesuai']) ? 'checked' : '' }}>
|
||||
<span class="ml-2">Tidak</span>
|
||||
</label>
|
||||
<!-- Select dropdown untuk "Tidak Sesuai" -->
|
||||
@php
|
||||
$statusKey = isset($forminspeksi['asset']['jenis_asset']['sesuai'])
|
||||
? 'sesuai'
|
||||
: 'tidak sesuai';
|
||||
$selectedValue = $forminspeksi['asset']['jenis_asset'][$statusKey] ?? null;
|
||||
@endphp
|
||||
<div id="jenis_asset" class="flex items-baseline gap-2"
|
||||
style="{{ isset($selectedValue) === 'tidak sesuai' ? '' : 'display: none;' }}">
|
||||
<select id="jenis_asset_tidak_sesuai" class="input w-full"
|
||||
name="jenis_asset_tidak_sesuai">
|
||||
<option value="">Select Jenis asset</option>
|
||||
@if (isset($basicData['jenisJaminan']))
|
||||
@foreach ($basicData['jenisJaminan'] as $item)
|
||||
<option value="{{ $item->id }}"
|
||||
{{ old('jenis_asset_tidak_sesuai', $forminspeksi['asset']['jenis_asset_tidak_sesuai'] ?? '') == $item->name ? 'selected' : '' }}>
|
||||
{{ $item->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
{{-- <button type="button" class="btn btn-md btn-primary"
|
||||
onclick="updateAnalisa('jenis_asset')">Save</button> --}}
|
||||
</div>
|
||||
</div>
|
||||
<em id="error-jenis_asset" class="alert text-danger text-sm"></em>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Alamat</label>
|
||||
<div class="w-full">
|
||||
|
||||
<span class="text-2sm text-gray-700">
|
||||
{{ formatAlamat($permohonan->debiture) }}
|
||||
</span>
|
||||
|
||||
|
||||
<div class="flex-wrap items-stretch">
|
||||
<div class="grid grid-cols-3 md:grid-cols-3 gap-4 mt-2">
|
||||
<label class="form-label flex items-center gap-3 text-nowrap">
|
||||
<input onclick="createAlamat('sesuai')" type="radio" class="radio"
|
||||
name="alamat_sesuai" value="sesuai"
|
||||
{{ old('jenis_asset', isset($forminspeksi['asset']['alamat']['sesuai'])) ? 'checked' : '' }}>
|
||||
<span class="ml-2">Ya</span>
|
||||
</label>
|
||||
<label class="form-label flex items-center gap-3 text-nowrap">
|
||||
<input onclick="createAlamat('tidak sesuai')" type="radio" class="radio"
|
||||
name="alamat_sesuai" value="tidak sesuai"
|
||||
{{ old('jenis_asset', isset($forminspeksi['asset']['alamat']['tidak sesuai'])) ? 'checked' : '' }}>
|
||||
<span class="ml-2">Tidak</span>
|
||||
</label>
|
||||
</div>
|
||||
<em id="error-alamat_sesuai" class="alert text-danger text-sm"></em>
|
||||
<em id="error-alamat_sesuai" class="alert text-danger text-sm"></em>
|
||||
</div>
|
||||
|
||||
@php
|
||||
$statusKey = isset($forminspeksi['asset']['alamat']['sesuai']) ? 'sesuai' : 'tidak sesuai';
|
||||
$address = $forminspeksi['asset']['alamat'][$statusKey] ?? null;
|
||||
|
||||
@endphp
|
||||
|
||||
<div id="alamat_form" class="grid gap-2 mt-5" style="display: none;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="card border border-agi-100 w-full bg-white rounded-lg shadow-md overflow-hidden">
|
||||
<div class="card-header bg-agi-50">
|
||||
<h1 class="text-md font-medium text-gray-900 uppercase">Titik Koordinat Google Maps</h1>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Koordinat</label>
|
||||
<div id="perwakilan" class="flex items-baseline w-full gap-5">
|
||||
<div class="grid grid-cols-2 gap-4 items-center w-full">
|
||||
<input class="input" type="text" placeholder="Masukan Koordinat Latitude" type="text"
|
||||
name="kordinat_lat" id="lat"
|
||||
value="{{ old('kordinat_lat', isset($forminspeksi['asset']['kordinat_lat']) ? $forminspeksi['asset']['kordinat_lat'] : '') }}">
|
||||
<input class="input" type="text" placeholder="Masukan Koordinat Longitude"
|
||||
name="kordinat_lng" id="lng"
|
||||
value="{{ old('kordinat_lng', isset($forminspeksi['asset']['kordinat_lng']) ? $forminspeksi['asset']['kordinat_lng'] : '') }}">
|
||||
</div>
|
||||
<a onclick="getCoordinates()" type="button" class="btn btn-md btn-outline btn-primary">
|
||||
<i class="ki-filled ki-map"></i>Ambil
|
||||
Koordinat </a>
|
||||
<a target="_blank" href="https://www.google.com/maps" type="button"
|
||||
class="btn btn-md btn-outline btn-success">
|
||||
<i class="ki-filled ki-map"></i>Ke google Maps</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header bg-agi-50">
|
||||
<h1 class="text-md font-medium text-gray-900 uppercase">Status</h1>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
<div class=" mx-auto rounded-lg overflow-hidden">
|
||||
<div class="py-4 ">
|
||||
<h1 class="text-md font-medium text-gray-900">Hubungan cadeb/debitur dengan Pemilik Jaminan
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Pemilik Jaminan</label>
|
||||
<div>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
@foreach ($permohonan->documents as $dokumen)
|
||||
@php
|
||||
$hubCadebPemilik = $dokumen->pemilik->hubungan_pemilik->name ?? 'N/A';
|
||||
@endphp
|
||||
{{ $hubCadebPemilik }}
|
||||
|
||||
<input type="hidden" name="hub_cadeb_sesuai" value="{{ $hubCadebPemilik }}"
|
||||
id="">
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
<div class="flex-wrap items-stretch">
|
||||
<div class="grid grid-cols-3 md:grid-cols-3 gap-4 mt-2">
|
||||
<label class="form-label flex items-center gap-3 text-nowrap">
|
||||
<input
|
||||
onclick="toggleFieldVisibility('hub_cadeb','hub_cadeb_tidak_sesuai', ['tidak sesuai'])"
|
||||
type="radio" class="radio" name="hub_cadeb" value="sesuai"
|
||||
{{ old('hub_cadeb', isset($forminspeksi['asset']['hub_cadeb']['sesuai'])) ? 'checked' : '' }}>
|
||||
<span class="ml-2">Ya</span>
|
||||
</label>
|
||||
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
||||
<input
|
||||
onclick="toggleFieldVisibility('hub_cadeb','hub_cadeb_tidak_sesuai', ['tidak sesuai'])"
|
||||
type="radio" class="radio" name="hub_cadeb" value="tidak sesuai"
|
||||
{{ old('hub_cadeb', isset($forminspeksi['asset']['hub_cadeb']['tidak sesuai'])) ? 'checked' : '' }}>
|
||||
<span class="ml-2">Tidak</span>
|
||||
</label>
|
||||
<!-- Select dropdown untuk "Tidak Sesuai" -->
|
||||
@php
|
||||
$statusKey = isset($forminspeksi['asset']['hub_cadeb']['sesuai'])
|
||||
? 'sesuai'
|
||||
: 'tidak sesuai';
|
||||
$selectedData = $forminspeksi['asset']['hub_cadeb'][$statusKey] ?? null;
|
||||
@endphp
|
||||
|
||||
<select id="hub_cadeb_tidak_sesuai" class="input w-full"
|
||||
name="hub_cadeb_tidak_sesuai"
|
||||
style="{{ old('hub_cadeb_tidak_sesuai', $selectedData) ? '' : 'display: none;' }}">
|
||||
<option value="">Select Hubungan Cadeb</option>
|
||||
@if (isset($basicData['hubCadeb']))
|
||||
@foreach ($basicData['hubCadeb'] as $item)
|
||||
@if ($item->name != $hubCadebPemilik)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('hub_cadeb_tidak_sesuai', $selectedData) == $item->name ? 'selected' : '' }}>
|
||||
{{ $item->name }}
|
||||
</option>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
|
||||
</div>
|
||||
<em id="error-hub_cadeb" class="alert text-danger text-sm"></em>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class=" mx-auto bg-white rounded-lg overflow-hidden">
|
||||
<div class="py-4 ">
|
||||
<h1 class="text-md font-medium text-gray-900">Hubungan Cadeb/Debitur dengan Penghuni Jaminan
|
||||
</h1>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Penghuni Jaminan</label>
|
||||
|
||||
<div class="mt-2">
|
||||
<div class="flex flex-wrap items-baseline w-full text-sm">
|
||||
<input type="hidden" name="hub_cadeb_penghuni_sesuai" value="ditempati sendiri"
|
||||
id="">
|
||||
</div>
|
||||
|
||||
<div class="flex-wrap items-stretch">
|
||||
<div class="grid grid-cols-3 md:grid-cols-3 gap-4 mt-2">
|
||||
<label class="form-label flex items-center gap-3 text-nowrap">
|
||||
|
||||
<input
|
||||
onclick="toggleFieldVisibility('hub_cadeb_penghuni','hub_penghuni_tidak_sesuai', ['tidak sesuai'])"
|
||||
type="radio" class="radio" name="hub_cadeb_penghuni" value="sesuai"
|
||||
{{ old('hub_cadeb_penghuni', isset($forminspeksi['asset']['hub_cadeb_penghuni'])) ? 'checked' : '' }}>
|
||||
|
||||
<span class="ml-2">Ditempati Sendiri</span>
|
||||
</label>
|
||||
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
||||
<input
|
||||
onclick="toggleFieldVisibility('hub_cadeb_penghuni','hub_penghuni_tidak_sesuai', ['tidak sesuai'])"
|
||||
type="radio" class="radio" name="hub_cadeb_penghuni"
|
||||
value="tidak sesuai"
|
||||
{{ old('hub_cadeb_penghuni', $forminspeksi['asset']['hub_cadeb_penghuni']['tidak sesuai'] ?? false) ? 'checked' : '' }}>
|
||||
<span class="ml-2">Tidak</span>
|
||||
</label>
|
||||
<!-- Select dropdown untuk "Tidak Sesuai" -->
|
||||
@php
|
||||
$statusKey = isset($forminspeksi['asset']['hub_cadeb_penghuni']['sesuai'])
|
||||
? 'sesuai'
|
||||
: 'tidak sesuai';
|
||||
$selectedData =
|
||||
$forminspeksi['asset']['hub_cadeb_penghuni'][$statusKey] ?? null;
|
||||
@endphp
|
||||
|
||||
|
||||
<input id="hub_penghuni_tidak_sesuai" class="input"
|
||||
name="hub_penghuni_tidak_sesuai"
|
||||
placeholder="Masukkan Hubungan penghuni jaminan"
|
||||
value="{{ old('hub_penghuni_tidak_sesuai', isset($selectedData) ? $selectedData : '') }}"
|
||||
style="{{ old('hub_penghuni_tidak_sesuai', $selectedData ?? false) ? '' : 'display: none;' }}">
|
||||
</div>
|
||||
<em id="error-hub_cadeb_penghuni" class="alert text-danger text-sm"></em>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card border border-agi-100 min-w-full">
|
||||
<div class="card border border-agi-100 min-w-full">
|
||||
<div class="card-header bg-agi-50">
|
||||
<h3 class="card-title">
|
||||
{{ $title ?? 'Data Jaminan' }}
|
||||
</h3>
|
||||
@php
|
||||
use Illuminate\Support\Facades\Route;
|
||||
@endphp
|
||||
<div class="flex items-center gap-2">
|
||||
@if (Auth::user()->hasAnyRole(['administrator', 'senior-officer', 'EO Appraisal', 'DD Appraisal']) &&
|
||||
Route::currentRouteName('otorisator.show'))
|
||||
<a href="{{ route('otorisator.show', ['id' => $permohonan->id, 'type' => 'Pelaporan']) }}"
|
||||
class="btn btn-xs btn-info">
|
||||
<i class="ki-filled ki-exit-left"></i> Back
|
||||
</a>
|
||||
@elseif (Auth::user()->hasAnyRole(['administrator', 'surveyor']) && Route::currentRouteName('penilai.show'))
|
||||
<a href="{{ route('penilai.show', $permohonan->id) }}" class="btn btn-xs btn-info">
|
||||
<i class="ki-filled ki-exit-left"></i> Back
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body grid gap-5 grid-cols-2">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Nama Debitur</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
@if (isset($permohonan->debiture))
|
||||
<p class="text-2sm text-gray-700">{{ $permohonan->debiture->name }}</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Alamat Object</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
@foreach ($permohonan->documents as $dokumen)
|
||||
<span class="text-2sm text-gray-700">
|
||||
{{ formatAlamat($dokumen->pemilik) }}
|
||||
{{ formatAlamat($dokumen->pemilik) }}
|
||||
</span>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Nomor Registrasi</label>
|
||||
<div class="flex flex-wrap items-base line w-full">
|
||||
<p class="text-2sm text-gray-700">{{ $permohonan->nomor_registrasi }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Cab/Direktorat</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
@if (isset($permohonan->branch))
|
||||
<p class="text-2sm text-gray-700">{{ $permohonan->branch->name }}</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Nomor Laporan</label>
|
||||
<div class="flex flex-wrap items-base line w-full">
|
||||
<p class="text-2sm text-gray-700">{{ $permohonan->nomor_registrasi }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">AO</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
@if (isset($permohonan->user))
|
||||
<p class="text-2sm text-gray-700">{{ $permohonan->user->name }}</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header bg-agi-50">
|
||||
<h3 class="card-title uppercase">
|
||||
Identitas Cadeb/Debitur
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body grid gap-2.5 w-full">
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Nama</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<span>
|
||||
@if (isset($permohonan->debiture))
|
||||
<p class="text-2sm text-gray-700">{{ $permohonan->debiture->name }}</p>
|
||||
@endif
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Perwakilan Cadeb/Debitur Di lokasi</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<span>
|
||||
{{ $forminspeksi['asset']['debitur_perwakilan'][0] ?? '' }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Pihak Bank Selain Appraisal</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<span> {{ $forminspeksi['asset']['pihak_bank'] ?? '' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header bg-agi-50">
|
||||
<h3 class="card-title uppercase">
|
||||
Deskripsi dan Alamat Aset
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body grid gap-2.5 w-full">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Jenis Asset</label>
|
||||
@php
|
||||
$statusKey = isset($forminspeksi['asset']['jenis_asset']['sesuai']) ? 'sesuai' : 'tidak sesuai';
|
||||
$selectedValue = $forminspeksi['asset']['jenis_asset'][$statusKey] ?? null;
|
||||
@endphp
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<span>{{ $selectedValue }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
@php
|
||||
$statusKey = isset($forminspeksi['asset']['alamat']['sesuai']) ? 'sesuai' : 'tidak sesuai';
|
||||
$selectedValue = $forminspeksi['asset']['alamat'][$statusKey] ?? null;
|
||||
@endphp
|
||||
<label class="form-label max-w-56">Terletak di</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<span>{{ $selectedValue['address'] ?? '' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="province" class="form-label max-w-56">Provinsi</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" id="province" class="input w-full cursor-not-allowed" readonly
|
||||
value="{{ isset($permohonan->debiture->province) ? $permohonan->debiture->province->name : '' }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="city" class="form-label max-w-56">Kabupaten/Kota</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" id="city" class="input w-full cursor-not-allowed" readonly
|
||||
value="{{ isset($permohonan->debiture->city) ? $permohonan->debiture->city->name : '' }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="district" class="form-label max-w-56">Kecamatan</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" id="district" class="input w-full cursor-not-allowed" readonly
|
||||
value="{{ isset($permohonan->debiture->district) ? $permohonan->debiture->district->name : '' }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="village" class="form-label max-w-56">Desa/Kelurahan</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" id="village" class="input w-full cursor-not-allowed" readonly
|
||||
value="{{ isset($permohonan->debiture->village) ? $permohonan->debiture->village->name : '' }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header bg-agi-50">
|
||||
<h3 class="card-title uppercase">
|
||||
dokumen
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@include('lpj::component.detail-jaminan', ['status' => true])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header bg-agi-50">
|
||||
<h3 class="card-title uppercase">
|
||||
Hubungan Cadeb/Debitur dengan pemilik dan penghuni
|
||||
</h3>
|
||||
</div>
|
||||
@php
|
||||
$statusKey = isset($forminspeksi['asset']['hub_cadeb']['sesuai']) ? 'sesuai' : 'tidak sesuai';
|
||||
$selectedData = $forminspeksi['asset']['hub_cadeb'][$statusKey] ?? null;
|
||||
@endphp
|
||||
<div class="card-body">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@foreach ($permohonan->documents as $dokumen)
|
||||
@if ($dokumen->jenisJaminan)
|
||||
@@ -558,6 +16,10 @@
|
||||
<input type="hidden" name="type" value="{{ implode(',', $kategoriUnik) }}">
|
||||
|
||||
|
||||
@if (array_intersect($kategoriUnik, ['tanah', 'bangunan', 'apartemen-kantor']))
|
||||
@include('lpj::surveyor.components.header')
|
||||
@endif
|
||||
|
||||
@foreach ($kategoriUnik as $kategori)
|
||||
{{-- Tampilkan komponen sesuai kategori --}}
|
||||
@include('lpj::surveyor.components.' . str_replace('-', '-', $kategori), [
|
||||
@@ -662,8 +124,8 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tambah mb-10" id="tambah-npw" style="margin-bottom: 20px;">
|
||||
<button type="button" class="btn btn-primary">
|
||||
<div class="tambah mb-10" style="margin-bottom: 20px;">
|
||||
<button type="button" id="tambah-npw" class="btn btn-primary">
|
||||
<i class="ki-filled ki-plus"></i>
|
||||
Tambah NPW </button>
|
||||
</div>
|
||||
@@ -723,7 +185,7 @@
|
||||
@if (!empty($lpjData['keterangan_penilai']) && is_array($lpjData['keterangan_penilai']))
|
||||
@foreach ($lpjData['keterangan_penilai'] as $index => $item)
|
||||
<div class="keterangan_penilai flex items-center gap-2 mt-2 textarea-group w-full">
|
||||
<textarea name="keterangan_penilai[]" class="textarea mt-2 " placeholder="Masukkan catatan penting" rows="10" >{{ old("keterangan_penilai.$index", $item) }}</textarea>
|
||||
<textarea name="keterangan_penilai[]" class="textarea mt-2 " placeholder="Masukkan catatan penting" rows="10">{{ old("keterangan_penilai.$index", $item) }}</textarea>
|
||||
<button class="btn btn-danger btn-sm remove-btn" type="button"
|
||||
style="display: none;">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
@@ -751,60 +213,12 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header bg-agi-50">
|
||||
<h3 class="card-title uppercase">
|
||||
nilai asuransi
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div>
|
||||
<label for="total_nilai_pasar_wajar" class="form-label uppercase">TOTAL NILAI ASURANSI</label>
|
||||
<div class="card-body grid gap-2.5 w-full">
|
||||
<div class="flex grid-col-3 gap-2.5 w-full">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="province" class="form-label">Luas Bangunan</label>
|
||||
<input type="text" class="input w-full" id="asuransi_luas_bangunan"
|
||||
name="asuransi_luas_bangunan"
|
||||
value="{{ old('asuransi_luas_bangunan', $lpjData['asuransi_luas_bangunan'] ?? null) }}"
|
||||
oninput="calculateTotal()">
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="province" class="">X</label>
|
||||
<label class="input">
|
||||
<i class="">Rp
|
||||
</i>
|
||||
<input type="text" class="input w-full currency" id="asuransi_nilai_1"
|
||||
name="asuransi_nilai_1"
|
||||
value="{{ old('asuransi_nilai_1', $lpjData['asuransi_nilai_1'] ?? null) }}"
|
||||
oninput="calculateTotal()">
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label class="input">
|
||||
<i class="">Rp
|
||||
</i>
|
||||
<input type="text" class="input w-full currency-format" name="asuransi_nilai_2"
|
||||
value="{{ old('asuransi_nilai_2', $lpjData['asuransi_nilai_2'] ?? null) }}">
|
||||
</label>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
const datas = @json($forminspeksi);
|
||||
console.log(datas);
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
|
||||
|
||||
const tambahNPWButton = document.getElementById('tambah-npw');
|
||||
const addPasarWajarContainer = document.getElementById('add_pasar_wajar');
|
||||
let npwCounter = 0;
|
||||
@@ -1000,88 +414,100 @@
|
||||
}
|
||||
|
||||
function calculateTotal() {
|
||||
const parseInput = (value) => parseFloat(value.replace(/[^0-9]/g, '')) || 0;
|
||||
const parseInput = (value) => {
|
||||
if (!value) return 0;
|
||||
return parseFloat(value.replace(/[^0-9]/g, '')) || 0;
|
||||
};
|
||||
|
||||
// Bagian Likuidasi
|
||||
let persentaseLikuidasiInput = document.getElementById('likuidasi');
|
||||
let persentaseLikuidasi = parseInput(persentaseLikuidasiInput.value);
|
||||
persentaseLikuidasiInput.value = formatPercentage(persentaseLikuidasiInput.value);
|
||||
|
||||
let totalNilaiPasarLikuidasi = document.querySelector('input[name="likuidasi_nilai_1"]');
|
||||
let totalLikuidasi = document.querySelector('input[name="likuidasi_nilai_2"]');
|
||||
|
||||
// Bagian Asuransi
|
||||
let luasBangunanAsuransi = parseInput(document.getElementById('asuransi_luas_bangunan').value);
|
||||
let hargaPerMeterAsuransi = parseInput(document.querySelector('input[name="asuransi_nilai_1"]').value);
|
||||
let totalNilaiAsuransi = document.querySelector('input[name="asuransi_nilai_2"]');
|
||||
|
||||
// Perhitungan Asuransi
|
||||
const hasilAsuransi = luasBangunanAsuransi * hargaPerMeterAsuransi;
|
||||
|
||||
let totalNilaiPasarWajar = 0;
|
||||
|
||||
// Perhitungan untuk input yang sudah ada
|
||||
const jenisAsetData = @json($jenisAset);
|
||||
|
||||
// Menentukan input yang akan dihitung berdasarkan jenis aset
|
||||
let standardInputs = [];
|
||||
|
||||
if (jenisAsetData.toUpperCase() === 'RUKO/RUKAN') {
|
||||
standardInputs = [{
|
||||
luas: 'luas_bangunan',
|
||||
nilai: 'nilai_bangunan_1',
|
||||
output: 'nilai_bangunan_2'
|
||||
}];
|
||||
} else {
|
||||
standardInputs = [{
|
||||
luas: 'luas_tanah',
|
||||
nilai: 'nilai_tanah_1',
|
||||
output: 'nilai_tanah_2'
|
||||
},
|
||||
{
|
||||
luas: 'luas_bangunan',
|
||||
nilai: 'nilai_bangunan_1',
|
||||
output: 'nilai_bangunan_2'
|
||||
}
|
||||
];
|
||||
// Function to format currency
|
||||
function formatCurrency(value) {
|
||||
// Ensure we have a valid number to format
|
||||
const num = parseFloat(value.replace(/[^0-9]/g, '')) || 0;
|
||||
return num.toLocaleString('id-ID');
|
||||
}
|
||||
|
||||
standardInputs.forEach(input => {
|
||||
let luas = parseInput(document.getElementById(input.luas).value);
|
||||
let hargaPerMeter = parseInput(document.querySelector(`input[name="${input.nilai}"]`).value);
|
||||
let totalNilai = luas * hargaPerMeter;
|
||||
// Function to format percentage
|
||||
function formatPercentage(value) {
|
||||
if (!value) return '';
|
||||
const num = parseFloat(value.replace(/[^0-9.]/g, '')) || 0;
|
||||
return num.toString();
|
||||
}
|
||||
|
||||
document.querySelector(`input[name="${input.output}"]`).value = formatCurrency(totalNilai
|
||||
.toString());
|
||||
totalNilaiPasarWajar += totalNilai;
|
||||
// Calculate total nilai pasar wajar
|
||||
let totalNilaiPasarWajar = 0;
|
||||
|
||||
// Get all kategori unik elements dynamically
|
||||
const kategoriItems = document.querySelectorAll('[id^="luas_"]');
|
||||
|
||||
kategoriItems.forEach(item => {
|
||||
const kategori = item.id.replace('luas_', '');
|
||||
const luasInput = document.getElementById(`luas_${kategori}`);
|
||||
const nilaiInput = document.querySelector(`input[name="nilai_${kategori}_1"]`);
|
||||
const outputElement = document.querySelector(`input[name="nilai_${kategori}_2"]`);
|
||||
|
||||
if (luasInput && nilaiInput && outputElement) {
|
||||
const luas = parseInput(luasInput.value);
|
||||
const nilai = parseInput(nilaiInput.value);
|
||||
const hasil = luas * nilai;
|
||||
|
||||
outputElement.value = formatCurrency(hasil.toString());
|
||||
totalNilaiPasarWajar += hasil;
|
||||
}
|
||||
});
|
||||
|
||||
// Tambahkan perhitungan untuk NPW tambahan
|
||||
const npwRows = document.querySelectorAll('.npw-row');
|
||||
npwRows.forEach(row => {
|
||||
let luasNPW = parseInput(row.querySelector('input[id^="luas_npw_"]').value);
|
||||
let nilaiNPW = parseInput(row.querySelector('input[id^="nilai_npw_"][id$="_1"]').value);
|
||||
let totalNilaiNPW = luasNPW * nilaiNPW;
|
||||
const luasInput = row.querySelector('input[id^="luas_npw_"]');
|
||||
const nilaiInput = row.querySelector('input[id^="nilai_npw_"][id$="_1"]');
|
||||
const outputElement = row.querySelector('input[id^="nilai_npw_"][id$="_2"]');
|
||||
|
||||
row.querySelector('input[id^="nilai_npw_"][id$="_2"]').value = formatCurrency(totalNilaiNPW
|
||||
.toString());
|
||||
totalNilaiPasarWajar += totalNilaiNPW;
|
||||
if (luasInput && nilaiInput && outputElement) {
|
||||
const luas = parseInput(luasInput.value);
|
||||
const nilai = parseInput(nilaiInput.value);
|
||||
const hasil = luas * nilai;
|
||||
|
||||
outputElement.value = formatCurrency(hasil.toString());
|
||||
totalNilaiPasarWajar += hasil;
|
||||
}
|
||||
});
|
||||
|
||||
// Update total nilai pasar wajar
|
||||
document.getElementById('total_nilai_pasar_wajar').value = formatCurrency(totalNilaiPasarWajar.toString());
|
||||
const totalElement = document.getElementById('total_nilai_pasar_wajar');
|
||||
if (totalElement) {
|
||||
totalElement.value = formatCurrency(totalNilaiPasarWajar.toString());
|
||||
}
|
||||
|
||||
// Perhitungan Likuidasi
|
||||
const hasilLikuidasi = (persentaseLikuidasi / 100) * totalNilaiPasarWajar;
|
||||
// Bagian Likuidasi
|
||||
const persentaseLikuidasiInput = document.getElementById('likuidasi');
|
||||
if (persentaseLikuidasiInput) {
|
||||
let persentaseLikuidasi = parseInput(persentaseLikuidasiInput.value);
|
||||
persentaseLikuidasiInput.value = formatPercentage(persentaseLikuidasiInput.value);
|
||||
|
||||
// Tampilkan nilai likuidasi dan asuransi
|
||||
totalNilaiPasarLikuidasi.value = formatCurrency(totalNilaiPasarWajar.toString());
|
||||
totalNilaiAsuransi.value = formatCurrency(hasilAsuransi.toString());
|
||||
const totalNilaiPasarLikuidasi = document.querySelector('input[name="likuidasi_nilai_1"]');
|
||||
const totalLikuidasi = document.querySelector('input[name="likuidasi_nilai_2"]');
|
||||
|
||||
// Total likuidasi (total nilai pasar wajar + nilai likuidasi)
|
||||
// const totalPasarWajarDenganLikuidasi = totalNilaiPasarWajar + hasilLikuidasi;
|
||||
totalLikuidasi.value = formatCurrency(hasilLikuidasi.toString());
|
||||
if (totalNilaiPasarLikuidasi && totalLikuidasi) {
|
||||
totalNilaiPasarLikuidasi.value = formatCurrency(totalNilaiPasarWajar.toString());
|
||||
|
||||
// Perhitungan Likuidasi
|
||||
const hasilLikuidasi = (persentaseLikuidasi / 100) * totalNilaiPasarWajar;
|
||||
totalLikuidasi.value = formatCurrency(hasilLikuidasi.toString());
|
||||
}
|
||||
}
|
||||
|
||||
// Bagian Asuransi (jika ada)
|
||||
const luasBangunanAsuransi = document.getElementById('asuransi_luas_bangunan');
|
||||
const hargaPerMeterAsuransi = document.querySelector('input[name="asuransi_nilai_1"]');
|
||||
const totalNilaiAsuransi = document.querySelector('input[name="asuransi_nilai_2"]');
|
||||
|
||||
if (luasBangunanAsuransi && hargaPerMeterAsuransi && totalNilaiAsuransi) {
|
||||
const luas = parseInput(luasBangunanAsuransi.value);
|
||||
const nilai = parseInput(hargaPerMeterAsuransi.value);
|
||||
const hasilAsuransi = luas * nilai;
|
||||
|
||||
totalNilaiAsuransi.value = formatCurrency(hasilAsuransi.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
Input Nilai Liquidasi (LPJ)
|
||||
</div>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('pembayaran.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
|
||||
<a href="{{ route('laporan.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
@@ -107,19 +107,19 @@
|
||||
nomor_registrasi: {
|
||||
title: 'Nomor Registrasi',
|
||||
render: (item, data) => {
|
||||
return `${data.permohonan.nomor_registrasi}`;
|
||||
return `${data.permohonan?.nomor_registrasi}`;
|
||||
},
|
||||
},
|
||||
nama_debitur: {
|
||||
title: 'Nama Debitur',
|
||||
render: (item, data) => {
|
||||
return `${data.permohonan.debiture.name}`;
|
||||
return `${data.permohonan?.debiture.name}`;
|
||||
},
|
||||
},
|
||||
cabang: {
|
||||
title: 'Cabang',
|
||||
render: (item, data) => {
|
||||
return `${data.permohonan.branch.name}`;
|
||||
return `${data.permohonan?.branch.name}`;
|
||||
},
|
||||
},
|
||||
user_pemohon: {
|
||||
|
||||
@@ -106,11 +106,14 @@
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
function pembayaranOtorisator(id) {
|
||||
// alert('hai id = ' + id);
|
||||
function handlePembayaran(id, type) {
|
||||
let rv = type
|
||||
let title = type === 'revisi' ? 'Apakah Anda yakin ingin merevisi pembayaran ini?' : 'Apakah Anda yakin?';
|
||||
let text = type === 'revisi' ? 'Untuk melakukan revisi pembayaran!' : 'Untuk melakukan approve pembayaran!';
|
||||
|
||||
Swal.fire({
|
||||
title: 'Apakah Anda yakin?',
|
||||
text: `Untuk melakukan approve Pembayaran!`,
|
||||
title: title,
|
||||
text: text,
|
||||
icon: 'warning',
|
||||
input: 'textarea', // Menambahkan input textarea
|
||||
inputLabel: 'Keterangan',
|
||||
@@ -133,6 +136,7 @@
|
||||
input_data._method = 'PUT';
|
||||
input_data.id = id;
|
||||
input_data.keterangan = keterangan;
|
||||
input_data.type = rv;
|
||||
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
@@ -324,10 +328,10 @@
|
||||
}
|
||||
|
||||
if(permohonan) {
|
||||
return `${permohonan.approve_keterangan_bayar}`;
|
||||
return `${permohonan.approve_keterangan_bayar}` || '-';
|
||||
}
|
||||
|
||||
return "";
|
||||
return "-";
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
@@ -339,12 +343,16 @@
|
||||
var permohonan = data.penawaran.permohonan;
|
||||
}
|
||||
|
||||
var iconPembayaranOtorisator = '';
|
||||
if(permohonan) {
|
||||
var iconPembayaranOtorisator = '';
|
||||
if (!permohonan.approve_bayar_by) {
|
||||
iconPembayaranOtorisator = `<a class="btn btn-sm btn-icon btn-clear btn-primary " onclick="pembayaranOtorisator(${permohonan.id})">
|
||||
iconPembayaranOtorisator = `<a class="btn btn-sm btn-icon btn-clear btn-primary " onclick="handlePembayaran(${permohonan.id},'otorisator')">
|
||||
<i class="ki-filled ki-double-check"></i>
|
||||
</a>`;
|
||||
}else{
|
||||
iconPembayaranOtorisator = `<a class="btn btn-sm btn-icon btn-clear btn-primary " onclick="handlePembayaran(${permohonan.id}, 'revisi')">
|
||||
<i class="ki-filled ki-arrow-circle-left"></i>
|
||||
</a>`;
|
||||
}
|
||||
|
||||
return `<div class="flex flex-nowrap justify-center">` + iconPembayaranOtorisator + `</div>`;
|
||||
|
||||
@@ -91,7 +91,10 @@
|
||||
@if ($row->status == 1)
|
||||
<option value="{{ $row->id }}"
|
||||
{{ in_array($row->id, old('kjpp', $kjpps ?? [])) ? 'selected' : '' }}>
|
||||
{{ $row->name }}
|
||||
{{ $row->name }} | {{ $row->jenis_kantor }}
|
||||
@if($row->jenis_kantor == 'Kantor Cabang')
|
||||
{{ str_replace(['KOTA','KAB.','KAB'],'',$row->city->name) }}
|
||||
@endif
|
||||
</option>
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
email_kantor: {
|
||||
title: 'Email Kantor',
|
||||
render: (item, data) => {
|
||||
let emails = [data.kjpp.email_kantor]; // Always include the main email
|
||||
let emails = new Set([data.kjpp.email_kantor]); // Always include the main email
|
||||
|
||||
// Check if there's a detail_email_kantor and try to parse it
|
||||
if (data.kjpp.detail_email_kantor) {
|
||||
@@ -56,15 +56,12 @@
|
||||
// If the parsed result is an array, extract emails from each object and concatenate
|
||||
if (Array.isArray(detailEmails)) {
|
||||
detailEmails.forEach(item => {
|
||||
if (item.email_kantor) {
|
||||
emails.push(item
|
||||
.email_kantor); // Add the email from each object
|
||||
}
|
||||
emails.add(item);
|
||||
});
|
||||
} else {
|
||||
// If it's a single object (not an array), just add the email
|
||||
if (detailEmails.email_kantor) {
|
||||
emails.push(detailEmails.email_kantor);
|
||||
if (detailEmails) {
|
||||
emails.add(detailEmails);
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
@@ -74,6 +71,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
emails = Array.from(emails);
|
||||
|
||||
// Helper function for basic email validation (regex pattern)
|
||||
const isValidEmail = (email) => {
|
||||
const emailRegex = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$/;
|
||||
|
||||
@@ -20,8 +20,13 @@
|
||||
|
||||
@foreach ($informasi as $key)
|
||||
@if (isset($forminspeksi['fakta'][$key]) && $forminspeksi['fakta'][$key] !== '-')
|
||||
<p> - {{ ucfirst(str_replace('_', ' ', $key)) }}:
|
||||
{{ $forminspeksi['fakta'][$key] }}</p>
|
||||
@php
|
||||
$displayKey = ucfirst(str_replace('_', ' ', $key));
|
||||
if (strlen($key) == 3) {
|
||||
$displayKey = strtoupper($key);
|
||||
}
|
||||
@endphp
|
||||
<p> - {{ $displayKey }}: {{ $forminspeksi['fakta'][$key] }}</p>
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
|
||||
@@ -16,17 +16,17 @@
|
||||
<tr>
|
||||
<td style=" width:25%; padding: 2px; vertical-align: top;">Jarak Jalan Utama</td>
|
||||
<td style=" width:1%; padding: 2px; vertical-align: top;">:</td>
|
||||
<td style="padding: 2px; vertical-align: top;">{{ $lingkungan['jarak_jalan_utama'] ?? '-' }} m</td>
|
||||
<td style="padding: 2px; vertical-align: top;">{{ $lingkungan['jarak_jalan_utama'] ?? '-' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding: 2px; vertical-align: top;">Jalan Lingkungan</td>
|
||||
<td style="padding: 2px; vertical-align: top;">:</td>
|
||||
<td style="padding: 2px; vertical-align: top;">{{ $lingkungan['jalan_linkungan'] ?? '-' }} m</td>
|
||||
<td style="padding: 2px; vertical-align: top;">{{ $lingkungan['jalan_linkungan'] ?? '-' }}</td>
|
||||
|
||||
<tr>
|
||||
<td style="padding: 2px; vertical-align: top;">Jarak CBD</td>
|
||||
<td style="padding: 2px; vertical-align: top;">:</td>
|
||||
<td style="padding: 2px; vertical-align: top;">{{ $lingkungan['jarak_cbd_point'] ?? '-' }} m
|
||||
<td style="padding: 2px; vertical-align: top;">{{ $lingkungan['jarak_cbd_point'] ?? '-' }}
|
||||
({{ $lingkungan['nama_cbd_point'] ?? '-' }})</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
@@ -116,14 +116,18 @@
|
||||
<td>Tusuk Sate</td>
|
||||
<td>:</td>
|
||||
<td>
|
||||
{{ $forminspeksi['tanah']['tusuk_sate'] == 'yes' ? 'Ya' : 'Tidak' }}
|
||||
{{ isset($forminspeksi['tanah']['tusuk_sate']) && $forminspeksi['tanah']['tusuk_sate']['Ya'] ? 'Ya' : 'Tidak' }}
|
||||
@if (isset($forminspeksi['tanah']['tusuk_sate']) && $forminspeksi['tanah']['tusuk_sate']['Ya'])
|
||||
{{ isset($forminspeksi['tanah']['tusuk_sate_ya']) ? ' (' . $forminspeksi['tanah']['tusuk_sate_ya'] . ')' : '' }}
|
||||
@endif
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Lockland</td>
|
||||
<td>:</td>
|
||||
<td>
|
||||
{{ $forminspeksi['tanah']['lockland'] == 'yes' ? 'Ya' : 'Tidak' }}
|
||||
{{ isset($forminspeksi['tanah']['lockland']) && $forminspeksi['tanah']['lockland'] == 'yes' ? 'Ya' : 'Tidak' }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
@@ -39,20 +39,57 @@
|
||||
@endphp
|
||||
<form id="formInspeksi" method="POST" enctype="multipart/form-data" class="grid gap-5">
|
||||
@csrf
|
||||
|
||||
@foreach ($permohonan->documents as $dokumen)
|
||||
@if ($dokumen->jenisJaminan)
|
||||
@php
|
||||
$formKategori = json_decode($dokumen->jenisJaminan->form_kategori, true);
|
||||
$jenisAset = $dokumen->jenisJaminan->name;
|
||||
@endphp
|
||||
@if (isset($formKategori) && $formKategori)
|
||||
@php
|
||||
$kategoriArray = is_array($formKategori) ? $formKategori : [$formKategori];
|
||||
$kategoriUnik = array_unique($kategoriArray);
|
||||
@endphp
|
||||
<input type="hidden" name="action" value="{{ implode(',', $kategoriUnik) }}">
|
||||
<input type="hidden" name="type" value="{{ implode(',', $kategoriUnik) }}">
|
||||
@endif
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
<input type="hidden" name="nomor_registrasi" value="{{ $permohonan->nomor_registrasi ?? '' }}">
|
||||
<input type="hidden" name="permohonan_id" value="{{ $permohonan->id ?? '' }}">
|
||||
<input type="hidden" name="dokument_id" value="{{ request('documentId') }}">
|
||||
<input type="hidden" name="action" value="callReport">
|
||||
<input type="hidden" name="type" value="callReport">
|
||||
|
||||
@include('lpj::assetsku.includenya')
|
||||
{{-- @include('lpj::surveyor.components.header')
|
||||
@include('lpj::surveyor.components.callReport') --}}
|
||||
|
||||
@php
|
||||
$paparan = $permohonan->status === 'proses-paparan' ? 'Paparan' : 'Pelaporan';
|
||||
@endphp
|
||||
<div class="card">
|
||||
<div class="card-header bg-agi-50">
|
||||
<h3 class="card-title uppercase">
|
||||
CALL Report
|
||||
</h3>
|
||||
@php
|
||||
use Illuminate\Support\Facades\Route;
|
||||
@endphp
|
||||
<div class="flex items-center gap-2">
|
||||
|
||||
@if (Auth::user()->hasAnyRole(['administrator', 'senior-officer', 'EO Appraisal', 'DD Appraisal']) &&
|
||||
Route::currentRouteName('otorisator.show'))
|
||||
<a href="{{ route('otorisator.show', ['id' => $permohonan->id, 'type' => $paparan]) }}"
|
||||
class="btn btn-xs btn-info">
|
||||
<i class="ki-filled ki-exit-left"></i> Back
|
||||
</a>
|
||||
@elseif (Auth::user()->hasAnyRole(['administrator', 'surveyor']) && Route::currentRouteName('penilai.show'))
|
||||
<a href="{{ route('penilai.show', $permohonan->id) }}" class="btn btn-xs btn-info">
|
||||
<i class="ki-filled ki-exit-left"></i> Back
|
||||
</a>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
@@ -214,40 +251,81 @@
|
||||
@include('lpj::component.detail-jaminan', ['status' => true])
|
||||
</div>
|
||||
</div>
|
||||
<div class="card border border-agi-100 w-full bg-white rounded-lg shadow-md">
|
||||
<div class="card-header bg-agi-50">
|
||||
<h1 class="text-md font-medium text-gray-900 uppercase">Nilai Likuidasi</h1>
|
||||
|
||||
<div class="w-full grid grid-cols-1 lg:grid-cols-2 gap-4">
|
||||
|
||||
<!-- Bagian Nilai KJPP -->
|
||||
<div class="card border border-agi-100 w-full bg-white rounded-lg shadow-md">
|
||||
<div class="card-header bg-agi-50">
|
||||
<h1 class="text-md font-medium text-gray-900 uppercase">Nilai KJPP</h1>
|
||||
</div>
|
||||
<div class="card-body grid gap-5 w-full">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="lelang-1" class="form-label max-w-56">Lelang ke </label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" id="lelang-1" name="lelang_kjpp" class="input w-full"
|
||||
placeholder="Masukkan Lelang" value="{{ $callReport['lelang_kjpp'] ?? '' }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="nilai-pasar-1" class="form-label max-w-56">Nilai Pasar Wajar (NPW)</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" id="nilai-pasar-1" name="nilai_pasar_kjpp"
|
||||
class="input w-full nilai-pasar currency-format" placeholder="Masukkan likuidasi" value="{{ $callReport['nilai_pasar_kjpp'] ?? '' }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="likuidasi-1" class="form-label max-w-56">Nilai Likuidasi(%)</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" id="likuidasi-1" name="persentase_likuidasi_kjpp" class="input w-full likuidasi"
|
||||
placeholder="Masukkan likuidasi dalam bentuk persen" onkeyup="calculateTotal(this)"
|
||||
data-group="1" value="{{ $callReport['persentase_likuidasi_kjpp'] ?? '' }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="total-likuidasi-1" class="form-label max-w-56">Total Nilai Likuidasi (NL)</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" id="total-likuidasi-1" name="hasil_nilai_likuidasi_kjpp"
|
||||
class="input w-full total-likuidasi currency-format" placeholder="Hasil perhitungan" value="{{ $callReport['hasil_nilai_likuidasi_kjpp'] ?? '' }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body grid gap-5 w-full">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="Lelang" class="form-label max-w-56">Lelang ke </label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" id="lelang" name="lelang" class="input w-full"
|
||||
placeholder="Masukkan Lelang" value="{{ $callReport['lelang'] ?? old('lelang') }}">
|
||||
</div>
|
||||
<!-- Bagian Nilai Internal -->
|
||||
<div class="card border border-agi-100 w-full bg-white rounded-lg shadow-md">
|
||||
<div class="card-header bg-agi-50">
|
||||
<h1 class="text-md font-medium text-gray-900 uppercase">Nilai Internal</h1>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="penilai" class="form-label max-w-56">Nilai Pasar Wajar (NPW)</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" id="nilai-pasar" name="nilai_pasar"
|
||||
class="input w-full nilai-pasar currency-format" placeholder="Masukkan likuidasi"
|
||||
value="{{ $callReport['nilai_pasar'] ?? old('likuidasi') }}">
|
||||
<div class="card-body grid gap-5 w-full">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="lelang-2" class="form-label max-w-56">Lelang ke </label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" id="lelang-2" name="lelang_internal" class="input w-full"
|
||||
placeholder="Masukkan Lelang" value="{{ $callReport['lelang_internal'] ?? '' }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="likuidasi_nilai_1" class="form-label max-w-56">Nilai Likuidasi(%)</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" id="likuidasi" name="likuidasi" class="input w-full likuidasi"
|
||||
placeholder="Masukkan likuidasi dalam bentuk persen" onkeyup="calculateTotal(this)" value="{{ $callReport['persentase_likuidasi'] ?? old('likuidasi') }}">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="nilai-pasar-2" class="form-label max-w-56">Nilai Pasar Wajar (NPW)</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" id="nilai-pasar-2" name="nilai_pasar_internal"
|
||||
class="input w-full nilai-pasar currency-format" placeholder="Masukkan likuidasi" value="{{ $callReport['nilai_pasar_internal'] ?? '' }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="total-likuidasi" class="form-label max-w-56">Total Nilai Likuidasi
|
||||
(NL)</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" id="total-likuidasi" name="likuidasi_nilai_1"
|
||||
class="input w-full total-likuidasi currency-format" placeholder="Masukkan likuidasi" value="{{ $callReport['hasil_nilai_likuidasi'] ?? old('likuidasi') }}">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="likuidasi-2" class="form-label max-w-56">Nilai Likuidasi(%)</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" id="likuidasi-2" name="persentase_likuidasi_internal" class="input w-full likuidasi"
|
||||
placeholder="Masukkan likuidasi dalam bentuk persen" onkeyup="calculateTotal(this)"
|
||||
data-group="2" value="{{ $callReport['persentase_likuidasi_internal'] ?? '' }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="total-likuidasi-2" class="form-label max-w-56">Total Nilai Likuidasi (NL)</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" id="total-likuidasi-2" name="hasil_nilai_likuidasi_internal"
|
||||
class="input w-full total-likuidasi currency-format" placeholder="Hasil perhitungan" value="{{ $callReport['hasil_nilai_likuidasi_internal'] ?? '' }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -278,10 +356,9 @@
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="penilai" class="form-label max-w-56">Pihak KJPP</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" id="penilai" name="pihak_kjjpp"
|
||||
class="input w-full "
|
||||
value="{{ $forminspeksi['signature']['kjjp']['name'] ?? $callReport['pihak_kjjpp'] ?? '' }}"
|
||||
placeholder="Masukkan Nama KJPP">
|
||||
<input type="text" id="penilai" name="pihak_kjjpp" class="input w-full "
|
||||
value="{{ $callReport['pihak_kjjpp'] ?? ($forminspeksi['signature']['kjjp']['name'] ?? '') }}"
|
||||
placeholder="Masukkan Nama KJPP">
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
@@ -332,10 +409,10 @@
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Faktor Positif</label>
|
||||
<div id="fakta-positif-container" class="flex flex-wrap items-baseline w-full">
|
||||
@if (!empty($callReport['fakta']['fakta_positif']))
|
||||
@foreach ($callReport['fakta']['fakta_positif'] as $index => $positif)
|
||||
@if (!empty($forminspeksi['fakta']['fakta_positif']))
|
||||
@foreach ($forminspeksi['fakta']['fakta_positif'] as $index => $positif)
|
||||
<div class="fakta_positif flex items-center gap-2 mt-2 textarea-group w-full">
|
||||
<textarea class="textarea mt-2" name="fakta_positif[]" rows="3">{{ old("fakta_positif.$index", $positif) }}</textarea>
|
||||
<textarea class="textarea mt-2" name="fakta_positif[]" rows="10">{{ old("fakta_positif.$index", $positif) }}</textarea>
|
||||
<button class="btn btn-danger btn-sm remove-btn" type="button"
|
||||
style="display: none;">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
@@ -344,7 +421,7 @@
|
||||
@endforeach
|
||||
@else
|
||||
<div class="fakta_positif flex items-center gap-2 mt-2 textarea-group w-full">
|
||||
<textarea class="textarea mt-2" name="fakta_positif[]" rows="3">{{ old('fakta_positif.0', '') }}</textarea>
|
||||
<textarea class="textarea mt-2" name="fakta_positif[]" rows="10">{{ old('fakta_positif.0', '') }}</textarea>
|
||||
<button class="btn btn-danger btn-sm remove-btn" type="button"
|
||||
style="display: none;">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
@@ -361,10 +438,10 @@
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Faktor Negatif</label>
|
||||
<div id="fakta-negatif-container" class="flex flex-wrap items-baseline w-full">
|
||||
@if (!empty($callReport['fakta']['fakta_negatif']))
|
||||
@foreach ($callReport['fakta']['fakta_negatif'] as $index => $negatif)
|
||||
@if (!empty($forminspeksi['fakta']['fakta_negatif']))
|
||||
@foreach ($forminspeksi['fakta']['fakta_negatif'] as $index => $negatif)
|
||||
<div class="fakta_negatif flex items-center gap-2 mt-2 textarea-group w-full">
|
||||
<textarea class="textarea mt-2" name="fakta_negatif[]" rows="3">{{ old("fakta_negatif.$index", $negatif) }}</textarea>
|
||||
<textarea class="textarea mt-2" name="fakta_negatif[]" rows="10">{{ old("fakta_negatif.$index", $negatif) }}</textarea>
|
||||
<button class="btn btn-danger btn-sm remove-btn" type="button"
|
||||
style="display: none;">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
@@ -373,7 +450,7 @@
|
||||
@endforeach
|
||||
@else
|
||||
<div class="fakta_negatif flex items-center gap-2 mt-2 textarea-group w-full">
|
||||
<textarea class="textarea mt-2" name="fakta_negatif[]" rows="3">{{ old('fakta_negatif.0', $callReport['fakta']['fakta_negatif'][0] ?? '') }}</textarea>
|
||||
<textarea class="textarea mt-2" name="fakta_negatif[]" rows="10">{{ old('fakta_negatif.0', $forminspeksi['fakta']['fakta_negatif'][0] ?? '') }}</textarea>
|
||||
<button class="btn btn-danger btn-sm remove-btn" type="button"
|
||||
style="display: none;">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
@@ -387,22 +464,64 @@
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 " style="margin-top: 20px ">
|
||||
|
||||
<label class="form-label lg:form-label max-w-56 ">Catatan yang Perlu Diperhatikan
|
||||
</label>
|
||||
<div class="w-full">
|
||||
<div id="keterangan-container" class="flex items-baseline flex-wrap gap-2.5 w-full">
|
||||
@if (!empty($forminspeksi['fakta']['keterangan']) && is_array($forminspeksi['fakta']['keterangan']))
|
||||
@foreach ($forminspeksi['fakta']['keterangan'] as $index => $item)
|
||||
<div class="keterangan flex items-center gap-2 mt-2 textarea-group w-full">
|
||||
<textarea name="keterangan[]" class="textarea mt-2" placeholder="Masukkan catatan penting" rows="10">{{ old("keterangan.$index", $item) }}</textarea>
|
||||
<button class="btn btn-danger btn-sm remove-btn" type="button"
|
||||
style="display: none;">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
@endforeach
|
||||
@else
|
||||
<div class="keterangan flex items-center gap-2 mt-2 textarea-group w-full">
|
||||
<textarea name="keterangan[]" class="textarea mt-2" placeholder="Masukkan catatan penting" rows="10"></textarea>
|
||||
<button class="btn btn-danger btn-sm remove-btn" type="button"
|
||||
style="display: none;">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</button>
|
||||
<em id="error-keterangan" class="alert text-danger text-sm"></em>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
<button type="button" onclick="addClonableItem('keterangan-container', 'keterangan')"
|
||||
class="btn btn-primary btn-sm mt-5 ">
|
||||
<i class="ki-outline ki-plus"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end gap-2" style="margin-right: 20px; margin-top: 20px">
|
||||
<button type="button" class="btn btn-primary" id="saveButton" onclick="submitData()">
|
||||
<i class="ki-filled ki-save-2"></i>
|
||||
<span id="saveButtonText">Save</span>
|
||||
</button>
|
||||
@if (Auth::user()->hasAnyRole(['senior-officer', 'surveyor', 'administrator']))
|
||||
<button type="button" class="btn btn-primary" id="saveButton" onclick="submitData()">
|
||||
<i class="ki-filled ki-save-2"></i>
|
||||
<span id="saveButtonText">Save</span>
|
||||
</button>
|
||||
@endif
|
||||
@if (Auth::user()->hasAnyRole(['senior-officer', 'EO Appraisal', 'DD Appraisal']))
|
||||
<a class="btn btn-info"
|
||||
href="{{ route('penilai.lampiran') }}?permohonanId={{ request('permohonanId') }}&documentId={{ request('documentId') }}&inspeksiId={{ request('inspeksiId') }}&jaminanId={{ request('jaminanId') }}&statusLpj=1">
|
||||
LAMPIRAN FOTO DAN DOKUMEN
|
||||
</a>
|
||||
<a href="{{ route('surveyor.print_out_inspeksi', ['permohonan_id' => $permohonan->id, 'dokument_id' => request('documentId'), 'jenis_jaminan_id' => request('jaminanId')]) }}"
|
||||
class="btn btn-light">
|
||||
<i class="ki-filled ki-printer"></i> Hasil Inspeksi
|
||||
</a>
|
||||
<a class="btn btn-primary"
|
||||
onclick="checkLaporan('{{ $permohonan->id }}', '{{ request('documentId') }}', '{{ request('inspeksiId') }}', {{ request('jaminanId') }}, )">
|
||||
<i class="ki-filled ki-printer"></i> Print
|
||||
<i class="ki-filled ki-printer"></i> Print Laporan
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
@@ -411,7 +530,7 @@
|
||||
@endsection
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
const callReports = @json($callReport);
|
||||
const callReports = @json($forminspeksi);
|
||||
console.log('callReport', callReports)
|
||||
|
||||
|
||||
@@ -424,42 +543,41 @@
|
||||
perihal: "",
|
||||
pihak_kjjpp: "",
|
||||
dari: "",
|
||||
lelang: "",
|
||||
fakta: {
|
||||
fakta_positif: [],
|
||||
fakta_negatif: []
|
||||
},
|
||||
nilai_pasar: "",
|
||||
persentase_likuidasi: "",
|
||||
hasil_nilai_likuidasi: ""
|
||||
lelang_kjpp: "",
|
||||
nilai_pasar_kjpp: "",
|
||||
persentase_likuidasi_kjpp: "",
|
||||
hasil_nilai_likuidasi_kjpp: "",
|
||||
lelang_internal: "",
|
||||
nilai_pasar_internal: "",
|
||||
persentase_likuidasi_internal: "",
|
||||
hasil_nilai_likuidasi_internal: "",
|
||||
|
||||
};
|
||||
|
||||
// Ambil fakta positif
|
||||
document.querySelectorAll('textarea[name="fakta_positif[]"]').forEach(textarea => {
|
||||
if (textarea.value.trim() !== "") {
|
||||
jsonData.fakta.fakta_positif.push(textarea.value.trim());
|
||||
}
|
||||
});
|
||||
|
||||
// Ambil fakta negatif
|
||||
document.querySelectorAll('textarea[name="fakta_negatif[]"]').forEach(textarea => {
|
||||
if (textarea.value.trim() !== "") {
|
||||
jsonData.fakta.fakta_negatif.push(textarea.value.trim());
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
jsonData.perihal = document.querySelector('input[name="perihal"]')?.value.trim() || "";
|
||||
jsonData.pihak_kjjpp = document.querySelector('input[name="pihak_kjjpp"]')?.value.trim() || "";
|
||||
jsonData.dari = document.querySelector('input[name="dari"]')?.value.trim() || "";
|
||||
jsonData.tanggal = document.querySelector('input[name="tanggal"]')?.value.trim() || "";
|
||||
jsonData.kepada = document.querySelector('input[name="kepada"]')?.value.trim() || "";
|
||||
jsonData.nomor_laporan = document.querySelector('input[name="nomor_laporan"]')?.value.trim() || "";
|
||||
jsonData.lelang = document.querySelector('input[name="lelang"]')?.value.trim() || "";
|
||||
jsonData.lelang_kjpp = document.querySelector('input[name="lelang_kjpp"]')?.value.trim() || "";
|
||||
|
||||
// Ambil nilai lainnya
|
||||
jsonData.nilai_pasar = cleanCurrencyValue(document.querySelector('input[name="nilai_pasar"]')?.value.trim() || "");
|
||||
jsonData.persentase_likuidasi = cleanCurrencyValue(document.querySelector('input[name="likuidasi"]')?.value.trim() || "");
|
||||
jsonData.hasil_nilai_likuidasi = cleanCurrencyValue(document.querySelector('input[name="likuidasi_nilai_1"]')?.value.trim() || "");
|
||||
jsonData.nilai_pasar_kjpp = cleanCurrencyValue(document.querySelector('input[name="nilai_pasar_kjpp"]')?.value.trim() ||
|
||||
"");
|
||||
jsonData.persentase_likuidasi_kjpp = cleanCurrencyValue(document.querySelector('input[name="persentase_likuidasi_kjpp"]')?.value
|
||||
.trim() || "");
|
||||
jsonData.hasil_nilai_likuidasi_kjpp = cleanCurrencyValue(document.querySelector('input[name="hasil_nilai_likuidasi_kjpp"]')
|
||||
?.value.trim() || "");
|
||||
|
||||
jsonData.lelang_internal = document.querySelector('input[name="lelang_internal"]')?.value.trim() || "";
|
||||
jsonData.nilai_pasar_internal = cleanCurrencyValue(document.querySelector('input[name="nilai_pasar_internal"]')?.value.trim() ||
|
||||
"");
|
||||
jsonData.persentase_likuidasi_internal = cleanCurrencyValue(document.querySelector('input[name="persentase_likuidasi_internal"]')?.value
|
||||
.trim() || "");
|
||||
jsonData.hasil_nilai_likuidasi_internal = cleanCurrencyValue(document.querySelector('input[name="hasil_nilai_likuidasi_internal"]')
|
||||
?.value.trim() || "");
|
||||
|
||||
return jsonData;
|
||||
}
|
||||
@@ -472,6 +590,24 @@
|
||||
const permohonanId = {{ $permohonan->id }};
|
||||
const documentId = urlParams.get('documentId');
|
||||
const inspeksiId = urlParams.get('inspeksiId');
|
||||
|
||||
const faktaPositif = Array.from(document.querySelectorAll('[name="fakta_positif[]"]'))
|
||||
.map(textarea => textarea.value.trim())
|
||||
.filter(value => value !== '');
|
||||
|
||||
const faktaNegatif = Array.from(document.querySelectorAll('[name="fakta_negatif[]"]'))
|
||||
.map(textarea => textarea.value.trim())
|
||||
.filter(value => value !== '');
|
||||
const keterangan = Array.from(document.querySelectorAll('[name="keterangan[]"]'))
|
||||
.map(textarea => textarea.value.trim())
|
||||
.filter(value => value !== '');
|
||||
|
||||
const action = Array.from(document.querySelectorAll('input[name="action"]'))
|
||||
.map(input => input.value)
|
||||
.join(',') || "";
|
||||
const type = Array.from(document.querySelectorAll('input[name="type"]'))
|
||||
.map(input => input.value)
|
||||
.join(',') || "";
|
||||
const requestUrl =
|
||||
`{{ route('penilai.storeCallReport') }}?permohonan_id=${permohonanId}&inspeksi_id=${inspeksiId}&dokument_id=${documentId}`;
|
||||
|
||||
@@ -485,6 +621,11 @@
|
||||
dokument_id: documentId,
|
||||
inspeksi_id: inspeksiId,
|
||||
data: jsonData,
|
||||
fakta_positif: faktaPositif,
|
||||
fakta_negatif: faktaNegatif,
|
||||
action: action,
|
||||
type: type,
|
||||
keterangan: keterangan
|
||||
}),
|
||||
contentType: 'application/json',
|
||||
headers: {
|
||||
@@ -531,29 +672,33 @@
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
function calculateTotal() {
|
||||
let nilaiPasarInput = document.getElementById('nilai-pasar');
|
||||
let nilaiLikuidasi = document.getElementById('likuidasi');
|
||||
let totalLikuidasi = document.getElementById('total-likuidasi');
|
||||
const cleanNilaiPasar = cleanCurrencyValue(nilaiPasarInput.value);
|
||||
let cleanLikuidasi = cleanCurrencyValue(nilaiLikuidasi.value);
|
||||
function calculateTotal(event) {
|
||||
const group = event.dataset.group;
|
||||
|
||||
// Batasi likuidasi maksimal hingga 100
|
||||
cleanLikuidasi = Math.min(parseFloat(cleanLikuidasi) || 0, 100);
|
||||
// Ambil elemen-elemen terkait berdasarkan group
|
||||
const nilaiPasarInput = document.querySelector(`#nilai-pasar-${group}`);
|
||||
const nilaiLikuidasi = document.querySelector(`#likuidasi-${group}`);
|
||||
const totalLikuidasi = document.querySelector(`#total-likuidasi-${group}`);
|
||||
|
||||
// Format nilai likuidasi dengan simbol %
|
||||
nilaiLikuidasi.value = cleanLikuidasi;
|
||||
const cleanNilaiPasar = cleanCurrencyValue(nilaiPasarInput.value);
|
||||
let cleanLikuidasi = cleanCurrencyValue(nilaiLikuidasi.value);
|
||||
|
||||
// Konversi ke angka untuk perhitungan
|
||||
const nilaiPasar = parseFloat(cleanNilaiPasar) || 0;
|
||||
const likuidasi = cleanLikuidasi / 100; // Konversi persentase ke desimal
|
||||
// Batasi likuidasi maksimal hingga 100
|
||||
cleanLikuidasi = Math.min(parseFloat(cleanLikuidasi) || 0, 100);
|
||||
|
||||
// Hitung total likuidasi
|
||||
const totalNilaiLikuidasi = nilaiPasar * likuidasi;
|
||||
// Format nilai likuidasi dengan simbol %
|
||||
nilaiLikuidasi.value = cleanLikuidasi;
|
||||
|
||||
// Tampilkan hasil dengan format yang benar
|
||||
totalLikuidasi.value = formatCurrency(totalNilaiLikuidasi.toString());
|
||||
}
|
||||
// Konversi ke angka untuk perhitungan
|
||||
const nilaiPasar = parseFloat(cleanNilaiPasar) || 0;
|
||||
const likuidasi = cleanLikuidasi / 100; // Konversi persentase ke desimal
|
||||
|
||||
// Hitung total likuidasi
|
||||
const totalNilaiLikuidasi = nilaiPasar * likuidasi;
|
||||
|
||||
// Tampilkan hasil dengan format yang benar
|
||||
totalLikuidasi.value = formatCurrency(totalNilaiLikuidasi.toString());
|
||||
}
|
||||
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
|
||||
@@ -13,72 +13,103 @@
|
||||
@foreach ($groupedPhotos as $category => $photos)
|
||||
<div class="mt-5">
|
||||
<h2 class="text-gray-800 font-bold text-xl mb-3">{{ $category ?? 'Tanpa Kategori' }}</h2>
|
||||
<div class="grid gap-5">
|
||||
@php
|
||||
$groupedBySubcategory = $photos->groupBy('sub');
|
||||
@endphp
|
||||
<div class="card border rounded-lg shadow-lg p-4">
|
||||
<!-- Carousel Container -->
|
||||
<div class="relative w-full overflow-hidden">
|
||||
<div class="flex transition-transform duration-500 ease-in-out" id="carousel-{{ $category }}">
|
||||
<span class="absolute top-0 right-2 text-white">
|
||||
<i class="ki-filled ki-maximize"></i>
|
||||
</span>
|
||||
@foreach ($photos as $index => $item)
|
||||
<div class="min-w-full flex flex-col items-center hover:cursor-pointer"
|
||||
onclick="openPreview('{{ asset('storage/' . $item['path']) }}', '{{ $item['name'] }}', '{{ $item['description'] }}')">
|
||||
|
||||
@if ($groupedBySubcategory->isEmpty())
|
||||
|
||||
@foreach ($photos as $index => $item)
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="grid gap-5">
|
||||
<h3 class="text-gray-600 font-semibold text-lg">
|
||||
{{ $item['name'] ?? 'Foto - ' . ($index + 1) }}
|
||||
</h3>
|
||||
<div class="flex items-center">
|
||||
<div class="w-full overflow-hidden rounded-md" style="height: 500px;">
|
||||
@if (isset($item['path']))
|
||||
<img src="{{ asset('storage/' . $item['path']) }}" alt="Gambar {{ $index + 1 }}"
|
||||
class="w-full h-auto object-cover rounded-md">
|
||||
<img src="{{ asset('storage/' . $item['path']) }}"
|
||||
alt="Gambar {{ $index + 1 }}" class="w-full h-full object-cover">
|
||||
@else
|
||||
<p class="text-gray-500">Gambar tidak tersedia</p>
|
||||
@endif
|
||||
</div>
|
||||
<p class="text-gray-500 text-sm">{{ $item['description'] ?? '-' }}</p>
|
||||
<h3 class="text-gray-600 font-semibold text-lg mt-3">
|
||||
{{ $item['name'] ?? 'Foto - ' . ($index + 1) }}
|
||||
</h3>
|
||||
<p class="text-gray-500 text-sm mt-1">{{ $item['description'] ?? '-' }}</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@else
|
||||
<!-- Jika ada subkategori, tampilkan berdasarkan subkategori -->
|
||||
@foreach ($groupedBySubcategory as $subcategory => $subPhotos)
|
||||
<div class="mb-4">
|
||||
<!-- Judul Subkategori -->
|
||||
<h4 class="text-gray-700 font-semibold text-lg mb-2">
|
||||
@if ($subcategory)
|
||||
{{ $subcategory }}
|
||||
@endif
|
||||
</h4>
|
||||
<div class="grid gap-5">
|
||||
@foreach ($subPhotos as $index => $item)
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="grid gap-5">
|
||||
<h3 class="text-gray-600 font-semibold text-lg">
|
||||
{{ $item['name'] ?? 'Foto - ' . ($index + 1) }}
|
||||
</h3>
|
||||
<div class="flex items-center">
|
||||
@if (isset($item['path']))
|
||||
<img src="{{ asset('storage/' . $item['path']) }}" alt="Gambar {{ $index + 1 }}"
|
||||
class="w-full h-auto object-cover rounded-md">
|
||||
@else
|
||||
<p class="text-gray-500">Gambar tidak tersedia</p>
|
||||
@endif
|
||||
</div>
|
||||
<p class="text-gray-500 text-sm">{{ $item['description'] ?? '-' }}</p>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
<!-- Navigation Buttons -->
|
||||
<button
|
||||
class="absolute top-1/2 left-0 transform -translate-y-1/2 bg-gray-800 text-white rounded-full p-2 focus:outline-none"
|
||||
onclick="prevSlide('{{ $category }}')">
|
||||
<i class="ki-outline ki-left-square"></i>
|
||||
</button>
|
||||
<button
|
||||
class="absolute top-1/2 right-0 transform -translate-y-1/2 bg-gray-800 text-white rounded-full p-2 focus:outline-none"
|
||||
onclick="nextSlide('{{ $category }}')">
|
||||
<i class="ki-outline ki-right-square"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
@endisset
|
||||
|
||||
<script>
|
||||
let currentIndex = {};
|
||||
|
||||
function nextSlide(category) {
|
||||
if (!currentIndex[category]) currentIndex[category] = 0;
|
||||
|
||||
const carousel = document.getElementById(`carousel-${category}`);
|
||||
const totalSlides = carousel.children.length;
|
||||
|
||||
currentIndex[category] = (currentIndex[category] + 1) % totalSlides;
|
||||
carousel.style.transform = `translateX(-${currentIndex[category] * 100}%)`;
|
||||
}
|
||||
|
||||
function prevSlide(category) {
|
||||
if (!currentIndex[category]) currentIndex[category] = 0;
|
||||
|
||||
const carousel = document.getElementById(`carousel-${category}`);
|
||||
const totalSlides = carousel.children.length;
|
||||
|
||||
currentIndex[category] = (currentIndex[category] - 1 + totalSlides) % totalSlides;
|
||||
carousel.style.transform = `translateX(-${currentIndex[category] * 100}%)`;
|
||||
}
|
||||
|
||||
function openPreview(imagePath, name, description) {
|
||||
const previewModal = document.createElement('div');
|
||||
previewModal.className = 'fixed inset-0 bg-black bg-opacity-75 flex items-center justify-center z-50';
|
||||
previewModal.innerHTML = `
|
||||
<div class="relative">
|
||||
<h3 class="text-white font-semibold text-lg mt-3 text-center">${name}</h3>
|
||||
<img src="${imagePath}" class="max-w-full max-h-screen object-contain">
|
||||
<button class="absolute top-2 right-2 bg-red-500 text-white rounded-full p-2"
|
||||
onclick="closePreview(this)">×</button>
|
||||
|
||||
<p class="text-white text-sm mt-1">${description}</p>
|
||||
</div>
|
||||
`;
|
||||
document.body.appendChild(previewModal);
|
||||
}
|
||||
|
||||
|
||||
function closePreview(button) {
|
||||
const modal = button.closest('div.fixed');
|
||||
if (modal) {
|
||||
modal.remove();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@php
|
||||
$fotoTypes = ['foto_gistaru', 'foto_bhumi', 'foto_argis_region', 'foto_tempat'];
|
||||
$fotoTypes = ['foto_gistaru', 'foto_bhumi', 'foto_argis_region', 'foto_tempat', 'foto_sentuh_tanahku'];
|
||||
if (($key = array_search('foto_tempat', $fotoTypes)) !== false) {
|
||||
unset($fotoTypes[$key]);
|
||||
array_unshift($fotoTypes, 'foto_tempat');
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
/** Define the header rules **/
|
||||
@page {
|
||||
margin-top: 100px;
|
||||
@@ -88,7 +89,11 @@
|
||||
border: 1px solid #000;
|
||||
}
|
||||
|
||||
|
||||
.no-break {
|
||||
page-break-inside: avoid;
|
||||
page-break-before: auto;
|
||||
page-break-after: auto;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
@@ -97,16 +102,15 @@
|
||||
<table style="width: 100%; border: none;">
|
||||
<tr>
|
||||
<td style="width: 20%; text-align: left;" class="header-left">
|
||||
@include('lpj::component.logo-bag')
|
||||
@include('lpj::component.logo-bag', ['width' => 150, 'height' => 40])
|
||||
</td>
|
||||
<td style="text-align: right;">
|
||||
<div style="">
|
||||
<p style="margin: 0; padding:0; font-size:10px;">Tanggal: {{ date('Y-m-d') }}</p>
|
||||
<p style="margin: 0; padding:0; font-size:10px;">Waktu: {{ date('H:i:s') }}</p>
|
||||
<p style="margin: 0; padding:0; font-size:10px;">User: {{ Auth::user()->name }}</p>
|
||||
<p style="margin: 0; padding:0; font-size:10px;">Waktu: {{ date('H:i:s') }}</p>
|
||||
<p style="margin: 0; padding:0; font-size:10px;">User: {{ Auth::user()->name }}</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</header>
|
||||
|
||||
|
||||
@@ -23,10 +23,24 @@
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Jenis Properti</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<span>{{ $item['jenis_aset'] }}</span>
|
||||
<span>{{ $item['jenis_aset'] ?? '' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Alamat Lokasi</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<span>{{ $item['address'] ?? '' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Status Hak Tanah</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<span>{{ $item['hak_properti'] ?? '' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Harga Penawaran</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
@@ -34,6 +48,12 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Indikasi Harga Transaksi</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<span>{{ isset($item['harga_diskon']) ? formatRupiah($item['harga_diskon']) : '' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Penjual (HP)</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
@@ -44,14 +64,14 @@
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Ditawarkan sejak</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<span>{{ $item['penawaran'] }}</span>
|
||||
<span>{{ $item['penawaran'] ?? '' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">LT</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<span>{{ $item['luas_tanah'] }} </span>
|
||||
<span>{{ $item['luas_tanah'] ?? '' }} </span>
|
||||
<sup> m2</sup>
|
||||
</div>
|
||||
</div>
|
||||
@@ -59,7 +79,7 @@
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">LB</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<span>{{ $item['luas_bangunan'] }} </span>
|
||||
<span>{{ $item['luas_bangunan'] ?? '' }} </span>
|
||||
<sup> m2</sup>
|
||||
</div>
|
||||
</div>
|
||||
@@ -67,7 +87,7 @@
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Titik Koordinat</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<span>{{ $item['kordinat_lat'] }} , {{ $item['kordinat_lng'] }}</span>
|
||||
<span>{{ $item['kordinat_lat'] ?? '' }} , {{ $item['kordinat_lng'] ?? '' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -44,10 +44,12 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex card-footer justify-end gap-5">
|
||||
@if (Auth::user()->hasAnyRole(['senior-officer', 'surveyor', 'administrator']))
|
||||
<button type="button" class="btn btn-primary" id="saveButton" onclick="saveLpjSederhanadanStandard()">
|
||||
<i class="ki-filled ki-save-2"></i>
|
||||
<span id="saveButtonText">Save</span>
|
||||
</button>
|
||||
@endif
|
||||
@if (Auth::user()->hasAnyRole(['senior-officer', 'EO Appraisal', 'DD Appraisal', 'administrator']))
|
||||
<a class="btn btn-info"
|
||||
href="{{ route('penilai.lampiran') }}?permohonanId={{ request('permohonanId') }}&documentId={{ request('documentId') }}&inspeksiId={{ request('inspeksiId') }}&jaminanId={{ request('jaminanId') }}&statusLpj=1">
|
||||
|
||||
@@ -292,14 +292,16 @@
|
||||
{{-- @include('lpj::penilai.components.foto-lampiran') --}}
|
||||
|
||||
<div class="flex card-footer justify-end gap-5">
|
||||
@if (Auth::user()->hasAnyRole(['senior-officer', 'surveyor', 'administrator']))
|
||||
<a class="btn btn-primary" onclick="saveMemo()">
|
||||
<i class="ki-filled ki-save-2"></i>
|
||||
SAVE
|
||||
Simpan
|
||||
</a>
|
||||
@if (Auth::user()->hasAnyRole(['senior-officer', 'EO Appraisal', 'DD Appraisal']))
|
||||
@endif
|
||||
@if (Auth::user()->hasAnyRole(['administrator', 'senior-officer', 'EO Appraisal', 'DD Appraisal']))
|
||||
<a class="btn btn-info"
|
||||
href="{{ route('penilai.lampiran') }}?permohonanId={{ request('permohonanId') }}&documentId={{ request('documentId') }}&inspeksiId={{ request('inspeksiId') }}&jaminanId={{ request('jaminanId') }}&statusLpj=1">
|
||||
LAMPIRAN FOTO DAN DOKUMEN
|
||||
Lampiran Foto dan Dokument
|
||||
</a>
|
||||
<a href="{{ route('surveyor.print_out_inspeksi', ['permohonan_id' => $permohonan->id, 'dokument_id' => request('documentId'), 'jenis_jaminan_id' => request('jaminanId')]) }}"
|
||||
class="btn btn-light">
|
||||
@@ -307,7 +309,7 @@
|
||||
</a>
|
||||
<a class="btn btn-success"
|
||||
onclick="checkLaporan('{{ $permohonan->id }}', '{{ request('documentId') }}', '{{ request('inspeksiId') }}', {{ request('jaminanId') }}, )">
|
||||
<i class="ki-filled ki-printer"></i> Print
|
||||
<i class="ki-filled ki-printer"></i> Cetak Laporan
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@@ -225,52 +225,52 @@
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@isset($report['fakta']['fakta_positif'])
|
||||
<table style="margin: 5px 0; border-collapse: collapse; width: 100%;">
|
||||
<tr>
|
||||
<td style="">
|
||||
<h6 style="text-transform: uppercase; margin: 0; ">Faktor positif</h2>
|
||||
<h6 style="text-transform: uppercase; margin: 0; ">Faktor Positif</h2>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@foreach ($report['fakta']['fakta_positif'] as $key => $item)
|
||||
@isset($forminspeksi['fakta']['fakta_positif'])
|
||||
@foreach ($forminspeksi['fakta']['fakta_positif'] as $key => $item)
|
||||
<tr>
|
||||
<td>{{ $item }}</td>
|
||||
<td>{!! nl2br(e($item)) !!}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tr>
|
||||
</table>
|
||||
@endisset
|
||||
@isset($report['fakta']['fakta_negatif'])
|
||||
</tr>
|
||||
</table>
|
||||
<table style="margin: 5px 0; border-collapse: collapse; width: 100%;">
|
||||
<tr>
|
||||
<td style="">
|
||||
<h6 style="text-transform: uppercase; margin: 0; ">Faktor negatif</h2>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@isset($forminspeksi['fakta']['fakta_negatif'])
|
||||
@foreach ($forminspeksi['fakta']['fakta_negatif'] as $key => $item)
|
||||
<tr>
|
||||
<td>{!! nl2br(e($item)) !!}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endisset
|
||||
</tr>
|
||||
</table>
|
||||
<table style="margin: 5px 0; border-collapse: collapse; width: 100%;">
|
||||
<tr>
|
||||
<td style="">
|
||||
<h6 style="text-transform: uppercase; margin: 0; ">Faktor negatif</h2>
|
||||
<h6 style="text-transform: uppercase; margin: 0; ">Catatan Yang Perlu Diperhatikan</h6>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@foreach ($report['fakta']['fakta_negatif'] as $key => $item)
|
||||
@isset($forminspeksi['fakta']['keterangan'])
|
||||
@foreach ($forminspeksi['fakta']['keterangan'] as $key => $item)
|
||||
<tr>
|
||||
<td>{{ $item }}</td>
|
||||
<td>{!! nl2br(e($item)) !!}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tr>
|
||||
</table>
|
||||
@endforeach
|
||||
@endisset
|
||||
<table style="margin: 5px 0; border-collapse: collapse; width: 100%;">
|
||||
<tr>
|
||||
<td style="">
|
||||
<h6 style="text-transform: uppercase; margin: 0; ">3. Catatan Yang Perlu Diperhatikan</h6>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@isset($report['kesimpulan_saran'])
|
||||
@foreach ($report['kesimpulan_saran'] as $key => $item)
|
||||
<tr>
|
||||
<td> {{ $item }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endisset
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
@@ -1,31 +1,31 @@
|
||||
@include('lpj::penilai.components.header')
|
||||
@php
|
||||
$data = '';
|
||||
foreach ($permohonan->documents as $dokumen) {
|
||||
$data .= $dokumen->jenisJaminan->name . ', ';
|
||||
$data = '';
|
||||
foreach ($permohonan->documents as $dokumen) {
|
||||
$data .= $dokumen->jenisJaminan->name . ', ';
|
||||
|
||||
$penilai = $permohonan->penilaian->userPenilai->where('role', 'penilai')->first();
|
||||
$surveyor = $permohonan->penilaian->userPenilai->where('role', 'surveyor')->first();
|
||||
$teams = $permohonan->region->teams;
|
||||
$penilai = $permohonan->penilaian->userPenilai->where('role', 'penilai')->first();
|
||||
$surveyor = $permohonan->penilaian->userPenilai->where('role', 'surveyor')->first();
|
||||
$teams = $permohonan->region->teams;
|
||||
|
||||
if ($teams) {
|
||||
foreach ($teams as $team) {
|
||||
$team_users = $team->teamsUsers;
|
||||
// print_r($team_users);
|
||||
if ($team_users) {
|
||||
foreach ($team_users as $team_user) {
|
||||
$user = $team_user->user;
|
||||
if ($teams) {
|
||||
foreach ($teams as $team) {
|
||||
$team_users = $team->teamsUsers;
|
||||
// print_r($team_users);
|
||||
if ($team_users) {
|
||||
foreach ($team_users as $team_user) {
|
||||
$user = $team_user->user;
|
||||
|
||||
if ($user && $user->hasRole('senior-officer')) {
|
||||
$senior_officer = $user;
|
||||
break 3;
|
||||
if ($user && $user->hasRole('senior-officer')) {
|
||||
$senior_officer = $user;
|
||||
break 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$data = rtrim($data, ', ');
|
||||
$data = rtrim($data, ', ');
|
||||
@endphp
|
||||
<main class="content">
|
||||
<table>
|
||||
@@ -86,21 +86,21 @@ $data = rtrim($data, ', ');
|
||||
<div style="border-top: 1px solid black; width: 100%;"></div>
|
||||
<h2 style="text-transform: uppercase;">NAMA DEVELOPER</h2>
|
||||
<table style="width: 100%; ">
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px;">Nama</td>
|
||||
<td style="vertical-align: top; width: 1%; padding: 2px;">:</td>
|
||||
<td style="width: 79%;">{{ $permohonan->debiture->name ?? '' }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px;">Nama</td>
|
||||
<td style="vertical-align: top; width: 1%; padding: 2px;">:</td>
|
||||
<td style="width: 79%;">{{ $permohonan->debiture->name ?? '' }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h2 style="text-transform: uppercase;">NAMA PROYEK</h2>
|
||||
<table style="width: 100%; ">
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px;">Proyek</td>
|
||||
<td style="vertical-align: top; width: 1%; padding: 2px;">:</td>
|
||||
<td style="width: 79%;">{{ $data ?? '' }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px;">Proyek</td>
|
||||
<td style="vertical-align: top; width: 1%; padding: 2px;">:</td>
|
||||
<td style="width: 79%;">{{ $data ?? '' }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2 style="text-transform: uppercase;">ALAMAT</h2>
|
||||
<table style="width: 100%; ">
|
||||
<tr>
|
||||
@@ -134,63 +134,65 @@ $data = rtrim($data, ', ');
|
||||
|
||||
@if (@isset($dokumen))
|
||||
@foreach ($dokumen->detail as $detail)
|
||||
<tr>
|
||||
@if (isset($detail->dokumen_jaminan))
|
||||
@if (isset($detail->dokumen_jaminan))
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px;">
|
||||
{{ $detail->name ?? '' }}
|
||||
</td>
|
||||
<td style="width: 1%; padding: 2px;">:</td>
|
||||
<td style="width: 79%; padding: 2px;">
|
||||
@if (isset($detail->dokumen_jaminan))
|
||||
@php
|
||||
$dokumen_jaminan = is_string($detail->dokumen_jaminan)
|
||||
? json_decode($detail->dokumen_jaminan, true)
|
||||
: [];
|
||||
$dokumen_jaminan = is_array($dokumen_jaminan)
|
||||
? $dokumen_jaminan
|
||||
: [$detail->dokumen_jaminan];
|
||||
<td style="width: 1%; padding: 2px;">:</td>
|
||||
<td style="width: 79%; padding: 2px;">
|
||||
@php
|
||||
$dokumen_jaminan = is_string($detail->dokumen_jaminan)
|
||||
? json_decode($detail->dokumen_jaminan, true)
|
||||
: [];
|
||||
$dokumen_jaminan = is_array($dokumen_jaminan)
|
||||
? $dokumen_jaminan
|
||||
: [$detail->dokumen_jaminan];
|
||||
|
||||
$dokumen_nomor = is_string($detail->dokumen_nomor)
|
||||
? json_decode($detail->dokumen_nomor, true)
|
||||
: [];
|
||||
$dokumen_nomor = is_array($dokumen_nomor)
|
||||
? $dokumen_nomor
|
||||
: [$detail->dokumen_nomor];
|
||||
@endphp
|
||||
$dokumen_nomor = is_string($detail->dokumen_nomor)
|
||||
? json_decode($detail->dokumen_nomor, true)
|
||||
: [];
|
||||
$dokumen_nomor = is_array($dokumen_nomor) ? $dokumen_nomor : [$detail->dokumen_nomor];
|
||||
@endphp
|
||||
|
||||
@foreach ($dokumen_jaminan as $index => $dokumen)
|
||||
<div>
|
||||
@if (!empty($dokumen_nomor[$index]))
|
||||
<span>{{ $dokumen_nomor[$index] }}</span>
|
||||
@endif
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
@foreach ($dokumen_jaminan as $index => $dokumen)
|
||||
<div>
|
||||
@if (!empty($dokumen_nomor[$index]))
|
||||
<span>{{ $dokumen_nomor[$index] }}</span>
|
||||
@endif
|
||||
</div>
|
||||
@endforeach
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
</tr>
|
||||
@endif
|
||||
|
||||
<tr>
|
||||
@if (isset($detail->details))
|
||||
@if (json_decode($detail->details))
|
||||
@foreach (json_decode($detail->details) as $key => $value)
|
||||
@if (!is_null($value) && $value !== '')
|
||||
<td style="width: 20%; padding: 2px;">
|
||||
{{ ucwords(str_replace('_', ' ', $key)) ?? '' }}</td>
|
||||
<td style="width: 1%; padding: 2px;">:</td>
|
||||
<td style="width: 79%; padding: 2px;">{{ $value }}
|
||||
@if (isset($detail->details))
|
||||
@php
|
||||
$detailItems = json_decode($detail->details, true);
|
||||
@endphp
|
||||
@if (is_array($detailItems))
|
||||
@foreach ($detailItems as $key => $value)
|
||||
@if (!is_null($value) && $value !== '')
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px;">
|
||||
{{ ucwords(str_replace('_', ' ', $key)) ?? '' }}
|
||||
</td>
|
||||
<td style="width: 1%; padding: 2px;">:</td>
|
||||
<td style="width: 79%; padding: 2px;">
|
||||
{{ $value }}
|
||||
@if ($key == 'luas_bangunan' || $key == 'luas_tanah')
|
||||
<sup>m2</sup>
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
</tr>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
</tr>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
|
||||
@if (isset($forminspeksi['perizinan']) && is_array($forminspeksi['perizinan']) && count($forminspeksi['perizinan']) > 0)
|
||||
@foreach ($forminspeksi['perizinan'] as $perizinan)
|
||||
<tr>
|
||||
@@ -414,6 +416,17 @@ $data = rtrim($data, ', ');
|
||||
|
||||
</table>
|
||||
@endisset
|
||||
@isset($forminspeksi['properti_sejenis'])
|
||||
<h2 style="text-transform: uppercase;">PROPERTI SEJENIS</h2>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
{{ $forminspeksi['properti_sejenis'] ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
@endisset
|
||||
@if (isset($forminspeksi['fakta']) && is_array($forminspeksi['fakta']))
|
||||
<h2 style="text-transform: uppercase;">ATURAN TATA KOTA</h2>
|
||||
<table>
|
||||
@@ -432,12 +445,17 @@ $data = rtrim($data, ', ');
|
||||
@endphp
|
||||
|
||||
@if (isset($forminspeksi['fakta']) && is_array($forminspeksi['fakta']))
|
||||
@foreach ($informasi as $key)
|
||||
@if (isset($forminspeksi['fakta'][$key]) && $forminspeksi['fakta'][$key] !== '-')
|
||||
<p> - {{ ucfirst(str_replace('_', ' ', $key)) }}:
|
||||
{{ $forminspeksi['fakta'][$key] }}</p>
|
||||
@endif
|
||||
@endforeach
|
||||
@foreach ($informasi as $key)
|
||||
@if (isset($forminspeksi['fakta'][$key]) && $forminspeksi['fakta'][$key] !== '-')
|
||||
@php
|
||||
$displayKey = ucfirst(str_replace('_', ' ', $key));
|
||||
if (strlen($key) == 3) {
|
||||
$displayKey = strtoupper($key);
|
||||
}
|
||||
@endphp
|
||||
<p> - {{ $displayKey }}: {{ $forminspeksi['fakta'][$key] }}</p>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
</table>
|
||||
@endif
|
||||
|
||||
@@ -166,61 +166,56 @@
|
||||
|
||||
@if (@isset($dokumen))
|
||||
@foreach ($dokumen->detail as $detail)
|
||||
<tr>
|
||||
@if (isset($detail->dokumen_jaminan))
|
||||
<td style=" padding: 2px; vertical-align: top;">
|
||||
{{ $detail->name ?? '' }}
|
||||
</td>
|
||||
<td style=" padding: 2px; vertical-align: top;">:</td>
|
||||
<td style=" padding: 2px; vertical-align: top;">
|
||||
@if (isset($detail->dokumen_jaminan))
|
||||
@php
|
||||
$dokumen_jaminan = is_array(json_decode($detail->dokumen_jaminan))
|
||||
? json_decode($detail->dokumen_jaminan)
|
||||
: [$detail->dokumen_jaminan];
|
||||
$dokumen_nomor = is_array(json_decode($detail->dokumen_nomor))
|
||||
? json_decode($detail->dokumen_nomor)
|
||||
: ($detail->dokumen_nomor
|
||||
? [$detail->dokumen_nomor]
|
||||
: []);
|
||||
@endphp
|
||||
|
||||
@foreach ($dokumen_jaminan as $index => $dokumen)
|
||||
<div>
|
||||
@if (!empty($dokumen_nomor[$index]))
|
||||
<span>{{ $dokumen_nomor[$index] }}</span>
|
||||
@endif
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
@if (isset($detail->details))
|
||||
@if (json_decode($detail->details))
|
||||
@foreach (json_decode($detail->details) as $key => $value)
|
||||
@if (!is_null($value) && $value !== '')
|
||||
<td style=" padding: 2px; vertical-align: top;">
|
||||
{{ ucwords(str_replace('_', ' ', $key)) ?? '' }}</td>
|
||||
<td style=" padding: 2px; vertical-align: top;">:</td>
|
||||
<td style=" padding: 2px; vertical-align: top;">{{ $value }}
|
||||
@if ($key == 'luas_bangunan' || $key == 'luas_tanah')
|
||||
<sup>m2</sup>
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@if (isset($detail->dokumen_jaminan))
|
||||
<tr>
|
||||
<td style="padding: 2px; vertical-align: top;">{{ $detail->name ?? '' }}</td>
|
||||
<td style="padding: 2px; vertical-align: top;">:</td>
|
||||
<td style="padding: 2px; vertical-align: top;">
|
||||
@php
|
||||
$dokumen_jaminan = is_array(json_decode($detail->dokumen_jaminan))
|
||||
? json_decode($detail->dokumen_jaminan)
|
||||
: [$detail->dokumen_jaminan];
|
||||
$dokumen_nomor = is_array(json_decode($detail->dokumen_nomor))
|
||||
? json_decode($detail->dokumen_nomor)
|
||||
: ($detail->dokumen_nomor
|
||||
? [$detail->dokumen_nomor]
|
||||
: []);
|
||||
@endphp
|
||||
@foreach ($dokumen_jaminan as $index => $dokumen)
|
||||
<div>
|
||||
@if (!empty($dokumen_nomor[$index]))
|
||||
<span>{{ $dokumen_nomor[$index] }}</span>
|
||||
@endif
|
||||
</div>
|
||||
@endforeach
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
|
||||
@if (isset($detail->details) && json_decode($detail->details))
|
||||
@foreach (json_decode($detail->details) as $key => $value)
|
||||
@if (!is_null($value) && $value !== '')
|
||||
<tr>
|
||||
<td style="padding: 2px; vertical-align: top;">
|
||||
{{ ucwords(str_replace('_', ' ', $key)) ?? '' }}
|
||||
</td>
|
||||
<td style="padding: 2px; vertical-align: top;">:</td>
|
||||
<td style="padding: 2px; vertical-align: top;">
|
||||
{{ $value }}
|
||||
@if ($key == 'luas_bangunan' || $key == 'luas_tanah')
|
||||
<sup>m2</sup>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
@endif
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
|
||||
@if (isset($forminspeksi['asset']['nomor_nib']))
|
||||
<tr>
|
||||
<td style=" padding: 2px; vertical-align: top;">Nomor NIB</td>
|
||||
<td style=" padding: 2px; vertical-align: top;">:</td>
|
||||
<td style=" padding: 2px; vertical-align: top;">
|
||||
{{ $forminspeksi['asset']['nomor_nib'] ?? '' }}</td>
|
||||
@@ -247,6 +242,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
<td>
|
||||
<table>
|
||||
<tr>
|
||||
@@ -338,8 +334,8 @@
|
||||
{{ !empty($bentukTanah) ? implode(', ', $bentukTanah) : '' }}
|
||||
|
||||
@if (in_array('lainnya', array_map('strtolower', $bentukTanah)) && !empty($lainnya))
|
||||
({{ $lainnya }})
|
||||
@endif
|
||||
({{ $lainnya }})
|
||||
@endif
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
@@ -741,429 +737,337 @@
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<td style="border: 1px solid #000;">
|
||||
D. ASURANSI
|
||||
</td>
|
||||
</tr>
|
||||
@if (!empty($lpjData['asuransi_luas_bangunan']))
|
||||
<div class="no-break">
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<td style=" border: 1px solid #000;">
|
||||
D. INFORMASI HARGA
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@include('lpj::penilai.components.print-pembanding')
|
||||
</div>
|
||||
<div class="no-break">
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<td style="border: 1px solid #000; "> <strong>E. INFORMASI NILAI</strong>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table style="width: 100%;">
|
||||
<tr>
|
||||
<td style="padding: 8px; width: 100%;">
|
||||
<table style="width: 100%; border-collapse: collapse;">
|
||||
<tr>
|
||||
<td colspan="3" style="padding: 8px; text-align: left;">
|
||||
<strong>a. Total Nilai Pasar Wajar</strong>
|
||||
</td>
|
||||
</tr>
|
||||
@php
|
||||
$labelNilai = [
|
||||
'bangunan' => 'Luas Bangunan',
|
||||
'tanah' => 'Luas Tanah',
|
||||
'apartement-kantor' => 'Luas Apartemen/Kantor',
|
||||
'alat-berat' => 'Luas Alat Berat',
|
||||
'mesin' => 'Luas Mesin',
|
||||
'kendaraan' => 'Luas Kendaraan',
|
||||
'pesawat' => 'Luas Pesawat',
|
||||
'kapal' => 'Luas Kapal',
|
||||
];
|
||||
@endphp
|
||||
@foreach ($labelNilai as $key => $label)
|
||||
@if (isset($lpjData['luas_' . $key]))
|
||||
<tr>
|
||||
<td style="padding: 3px; text-align: right; width:30%; ">
|
||||
{{ $label }} {{ $lpjData['luas_' . $key] ?? '' }} m<sup>2</sup>
|
||||
</td>
|
||||
<td style="padding: 3px; width:30%;">
|
||||
<span style="padding-left:20px; padding-right: 20px">X</span> Rp
|
||||
{{ $lpjData['nilai_' . $key . '_1'] ?? '' }}
|
||||
</td>
|
||||
<td style="padding: 3px; text-align: left; width:40%;">
|
||||
<span style="padding-left:20px; padding-right: 20px"> = </span> Rp
|
||||
{{ $lpjData['nilai_' . $key . '_2'] ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
@endforeach
|
||||
@if (isset($lpjData['npw_tambahan']))
|
||||
@foreach ($lpjData['npw_tambahan'] as $npw)
|
||||
<tr>
|
||||
<td style="padding: 3px; text-align: right;">
|
||||
{{ $npw['name'] }} {{ $npw['luas'] }} m<sup>2</sup>
|
||||
</td>
|
||||
<td style="padding: 3px;">
|
||||
<span style="padding-left:20px; padding-right: 20px">X</span> Rp
|
||||
{{ $npw['nilai_1'] }}
|
||||
</td>
|
||||
<td style="padding: 3px; text-align: left; width:40%">
|
||||
<span style="padding-left:20px; padding-right: 20px"> = </span> Rp
|
||||
{{ $npw['nilai_2'] }}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
<tr>
|
||||
<td style="padding: 3px; font-weight: bold; width:30%;">Total Nilai Pasar Wajar</td>
|
||||
<td style="padding: 3px; text-align: right; font-weight: bold; width:30%"></td>
|
||||
<td style="padding: 3px; text-align: left; font-weight: bold; width: 40%;">
|
||||
<span style="padding-left: 20px; padding-right: 20px;">=</span>
|
||||
<div style="display: inline-block; border-top: 1px solid black; padding-top: 3px;">
|
||||
Rp {{ $lpjData['total_nilai_pasar_wajar'] ?? '' }}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3" style="padding: 8px; text-align: left; font-weight: bold;">
|
||||
b. Total Nilai Likuidasi
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding: 3px; text-align: right; width:30%">
|
||||
{{ $lpjData['likuidasi'] ?? '' }}%
|
||||
</td>
|
||||
<td style="padding: 3px; text-align: left; font-weight: bold; width:30%">
|
||||
<span style="padding-left:20px; padding-right: 20px">X</span> Total Nilai Pasar Wajar
|
||||
</td>
|
||||
<td style="padding: 3px; text-align: left; width:40%;">
|
||||
<span style="padding-left:20px; padding-right: 20px"> = </span> Rp
|
||||
{{ $lpjData['likuidasi_nilai_2'] ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="no-break">
|
||||
<table style="width: 100%;">
|
||||
<tr>
|
||||
<td style="border: 1px solid #000;">
|
||||
F. ANALISA FAKTA
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<table>
|
||||
<tr>
|
||||
<td width="25%" style="vertical-align: top;"><strong>Faktor Positif</strong></td>
|
||||
<td>
|
||||
@isset($forminspeksi['fakta']['fakta_positif'])
|
||||
<table style="width: 100%; border-collapse: collapse;">
|
||||
@foreach ($forminspeksi['fakta']['fakta_positif'] as $key => $item)
|
||||
<tr>
|
||||
<td>{!! nl2br(e($item)) !!}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
@endisset
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="vertical-align: top;"><strong>Faktor Negatif</strong></td>
|
||||
<td>
|
||||
@isset($forminspeksi['fakta']['fakta_negatif'])
|
||||
<table style="width: 100%; border-collapse: collapse;">
|
||||
@foreach ($forminspeksi['fakta']['fakta_negatif'] as $key => $item)
|
||||
<tr>
|
||||
<td>{!! nl2br(e($item)) !!}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
@endisset
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="vertical-align: top;"><strong>Batas batas</strong></td>
|
||||
<td>
|
||||
@foreach ($forminspeksi['fakta']['batas_batas_input'] ?? [] as $arah => $batas)
|
||||
@if ($batas)
|
||||
<p> - {{ $arah }} : {{ $batas }}</p>
|
||||
@endif
|
||||
@endforeach
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="vertical-align: top;"><strong>Informasi Dinas Tata Ruang</strong>
|
||||
</td>
|
||||
<td>
|
||||
@php
|
||||
$informasi = [
|
||||
'peruntukan',
|
||||
'kdb',
|
||||
'kdh',
|
||||
'gsb',
|
||||
'max_lantai',
|
||||
'klb',
|
||||
'gss',
|
||||
'pelebaran_jalan',
|
||||
'nama_petugas',
|
||||
];
|
||||
@endphp
|
||||
|
||||
@foreach ($informasi as $key)
|
||||
@if (isset($forminspeksi['fakta'][$key]) && $forminspeksi['fakta'][$key] !== '-')
|
||||
@php
|
||||
$displayKey = ucfirst(str_replace('_', ' ', $key));
|
||||
if (strlen($key) == 3) {
|
||||
$displayKey = strtoupper($key);
|
||||
}
|
||||
@endphp
|
||||
<p> - {{ $displayKey }}: {{ $forminspeksi['fakta'][$key] }}</p>
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@if (!empty($forminspeksi['fakta']['keterangan']))
|
||||
<tr>
|
||||
<td width="25%" style="vertical-align: top;"><strong>Catatan yang Perlu
|
||||
Diperhatikan</strong></td>
|
||||
<td>
|
||||
@php
|
||||
$keterangan = $forminspeksi['fakta']['keterangan'] ?? '';
|
||||
if (is_array($keterangan)) {
|
||||
$keterangan = implode(', ', array_filter($keterangan));
|
||||
}
|
||||
@endphp
|
||||
|
||||
@if (!empty($keterangan))
|
||||
<table style="width: 100%; border-collapse: collapse;">
|
||||
<tr>
|
||||
<td>{{ $keterangan }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
</table>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<table border="1" style="width: 100%; border-collapse: collapse; margin-bottom: 10px;">
|
||||
<tr>
|
||||
<table>
|
||||
<div style="margin-top: 20px;">
|
||||
<label style="font-weight: bold;">DISCLAIMER</label>
|
||||
<div>
|
||||
<ol style="padding-left: 20px; list-style-type: decimal; margin-top: 0;">
|
||||
|
||||
<td style="border: 1px solid #000; padding: 4px;">Luas Bangunan</td>
|
||||
<td style="border: 1px solid #000; padding: 4px;">Harga</td>
|
||||
<td style="border: 1px solid #000; padding: 4px;">Nilai Pasar Wajar (Rp)</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="border: 1px solid #000; padding: 4px;">
|
||||
{{ $lpjData['asuransi_luas_bangunan'] ?? '' }}</td>
|
||||
|
||||
<td style="border: 1px solid #000; padding: 4px;">
|
||||
{{ formatRupiah($lpjData['asuransi_nilai_1']) ?? '' }}</td>
|
||||
<td style="border: 1px solid #000; padding: 4px;">
|
||||
{{ formatRupiah($lpjData['asuransi_nilai_2']) ?? '' }}</td>
|
||||
</tr>
|
||||
<li style="margin-bottom: 5px;">PENILAIAN INI DIBUAT BERDASARKAN ATURAN YANG
|
||||
BERLAKU DI SUBDIT APPRAISAL</li>
|
||||
<li style="margin-bottom: 5px;">LAPORAN INI DIBUAT BERDASARKAN DATA FOTOCOPY
|
||||
DOKUMEN YANG DITERIMA PENILAI DENGAN ASUMSI BAHWA DATA TERSEBUT SESUAI DENGAN
|
||||
DOKUMEN ASLINYA</li>
|
||||
<li style="margin-bottom: 5px;">PENILAI TIDAK MELAKUKAN PEMBUKTIAN LEBIH RINCI ATAU
|
||||
PENGAKUAN TERTULIS DARI PIHAK YANG DITEMUI SAAT PENILAIAN, ATAS INFORMASI YANG
|
||||
DIBERIKAN SECARA LISAN SEHUBUNGAN DENGAN IDENTITAS DIRI DAN HUBUNGAN DI ANTARA
|
||||
PIHAK TERKAIT SAAT MELAKUKAN INSPEKSI OBJEK YANG DINILAI</li>
|
||||
<li style="margin-bottom: 5px;">LAPORAN INI DIGUNAKAN HANYA UNTUK KEPENTINGAN
|
||||
INTERNAL DAN DILARANG MENYEBARKAN KEPADA PIHAK KETIGA</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
@else
|
||||
|
||||
<tr>
|
||||
<td>Tidak Ada</td>
|
||||
<td>Demikian laporan penilai jaminan ini di buat secara objektif, tanpa adanya pengaruh baik intern
|
||||
maupun ekstern</td>
|
||||
</tr>
|
||||
@endif
|
||||
</table>
|
||||
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<td style=" border: 1px solid #000;">
|
||||
E. INFORMASI HARGA
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table style="width: 100%;">
|
||||
<tr>
|
||||
<td style="vertical-align: top;">Informasi data pembanding</td>
|
||||
<td>:</td>
|
||||
<td>
|
||||
@php
|
||||
$exportData = [];
|
||||
if (isset($dataPembanding['data_pembanding'])) {
|
||||
foreach ($dataPembanding['data_pembanding'] as $index => $pembanding) {
|
||||
$exportData['pembanding' . ($index + 1)] = $pembanding;
|
||||
}
|
||||
}
|
||||
|
||||
$fields = [
|
||||
'jenis_aset' => 'Jenis properti',
|
||||
'harga' => 'Harga Penawaran',
|
||||
'telepon' => 'Penjual (HP)',
|
||||
'penawaran' => 'Ditawarkan Sejak',
|
||||
'luas_tanah' => 'Luas Tanah',
|
||||
'luas_bangunan' => 'Luas Bangunan',
|
||||
'kordinat' => 'Titik Kordinat',
|
||||
];
|
||||
@endphp
|
||||
|
||||
@foreach ($exportData as $index => $data)
|
||||
<table style="width: 100%; margin-bottom: 15px; border-bottom: 1px solid #ddd;">
|
||||
<tr>
|
||||
<td style="font-weight: bold; padding-bottom: 8px;">
|
||||
Pembanding {{ substr($index, -1) }}
|
||||
</td>
|
||||
</tr>
|
||||
@foreach ($fields as $key => $label)
|
||||
<tr>
|
||||
<td style="width: 33%;">{{ $label }}</td>
|
||||
<td style="width: 5%;">:</td>
|
||||
<td style="width: 62%;">
|
||||
@if ($key == 'luas_tanah' || $key == 'luas_bangunan')
|
||||
{{ $data[$key] ?? '-' }} m²
|
||||
@elseif($key == 'harga' || $key == 'harga_diskon')
|
||||
Rp. {{ $data[$key] ?? 0 }}
|
||||
@elseif($key == 'kordinat')
|
||||
@php
|
||||
$lat = $data['kordinat_lat'] ?? null;
|
||||
$lng = $data['kordinat_lng'] ?? null;
|
||||
@endphp
|
||||
@if ($lat && $lng)
|
||||
{{ $lat }},{{ $lng }}
|
||||
@else
|
||||
-
|
||||
@endif
|
||||
@else
|
||||
{{ $data[$key] ?? '-' }}
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
@endforeach
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<td style="border: 1px solid #000; "> <strong>F. INFORMASI NILAI</strong>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table style="width: 100%;">
|
||||
<tr>
|
||||
<td style="padding: 8px; width: 100%;">
|
||||
<table style="width: 100%; border-collapse: collapse;">
|
||||
<tr>
|
||||
<td colspan="3" style="padding: 8px; text-align: left;">
|
||||
<strong>a. Total Nilai Pasar Wajar</strong>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<table style="width: 100%; border-collapse: collapse; text-align: center;">
|
||||
@php
|
||||
$labelNilai = [
|
||||
'bangunan' => 'Luas Bangunan',
|
||||
'tanah' => 'Luas Tanah',
|
||||
'apartement-kantor' => 'Luas Apartemen/Kantor',
|
||||
'alat-berat' => 'Luas Alat Berat',
|
||||
'mesin' => 'Luas Mesin',
|
||||
'kendaraan' => 'Luas Kendaraan',
|
||||
'pesawat' => 'Luas Pesawat',
|
||||
'kapal' => 'Luas Kapal',
|
||||
];
|
||||
use Modules\Usermanagement\Models\User;
|
||||
$penilaiUser = User::where('id', $penilai->userPenilaiTeam->id)->first();
|
||||
$imagePathPenilai = storage_path(
|
||||
'app/public/signatures/' . $penilaiUser->id . '/' . $penilaiUser->sign,
|
||||
);
|
||||
|
||||
$soUser = User::where('id', $senior_officer->id)->first();
|
||||
$imagePathSo = storage_path('app/public/signatures/' . $soUser->id . '/' . $soUser->sign);
|
||||
|
||||
$imagePathEO = storage_path(
|
||||
'app/public/signatures/' .
|
||||
User::role('EO Appraisal')->first()->id .
|
||||
'/' .
|
||||
User::role('EO Appraisal')->first()->sign,
|
||||
);
|
||||
|
||||
$imagePathDD = storage_path(
|
||||
'app/public/signatures/' .
|
||||
User::role('DD Appraisal')->first()->id .
|
||||
'/' .
|
||||
User::role('DD Appraisal')->first()->sign,
|
||||
);
|
||||
@endphp
|
||||
@foreach ($labelNilai as $key => $label)
|
||||
@if (isset($lpjData['luas_' . $key]))
|
||||
<tr>
|
||||
<td style="padding: 3px; text-align: right; width:30%; ">
|
||||
{{ $label }} {{ $lpjData['luas_' . $key] ?? '' }} m<sup>2</sup>
|
||||
</td>
|
||||
<td style="padding: 3px; width:30%;">
|
||||
<span style="padding-left:20px; padding-right: 20px">X</span> Rp
|
||||
{{ $lpjData['nilai_' . $key . '_1'] ?? '' }}
|
||||
</td>
|
||||
<td style="padding: 3px; text-align: left; width:40%;">
|
||||
<span style="padding-left:20px; padding-right: 20px"> = </span> Rp
|
||||
{{ $lpjData['nilai_' . $key . '_2'] ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style=" padding: 4px;height: 50px">
|
||||
@if (file_exists($imagePathPenilai))
|
||||
<img src="{{ $imagePathPenilai }}" alt="{{ $imagePathPenilai }}" width="80px">
|
||||
@endif
|
||||
</td>
|
||||
@if ($permohonan->approval_so != null)
|
||||
<td style=" padding: 4px;height: 50px">
|
||||
@if (file_exists($imagePathSo))
|
||||
<img src="{{ $imagePathSo }}" alt="{{ $imagePathSo }}" width="80px">
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@if ($permohonan->approval_eo != null)
|
||||
<td style=" padding: 4px;height: 50px">
|
||||
@if (file_exists($imagePathEO))
|
||||
<img src="{{ $imagePathEO }}" alt="{{ $imagePathEO }}" width="80px">
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@if ($permohonan->approval_dd != null)
|
||||
<td style=" padding: 4px;height: 50px">
|
||||
@if (file_exists($imagePathDD))
|
||||
<img src="{{ $imagePathDD }}" alt="{{ $imagePathDD }}" width="80px">
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@endforeach
|
||||
@if (isset($lpjData['npw_tambahan']))
|
||||
@foreach ($lpjData['npw_tambahan'] as $npw)
|
||||
<tr>
|
||||
<td style="padding: 3px; text-align: right;">
|
||||
{{ $npw['name'] }} {{ $npw['luas'] }} m<sup>2</sup>
|
||||
</td>
|
||||
<td style="padding: 3px;">
|
||||
<span style="padding-left:20px; padding-right: 20px">X</span> Rp
|
||||
{{ $npw['nilai_1'] }}
|
||||
</td>
|
||||
<td style="padding: 3px; text-align: left; width:40%">
|
||||
<span style="padding-left:20px; padding-right: 20px"> = </span> Rp
|
||||
{{ $npw['nilai_2'] }}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
<tr>
|
||||
<td style="padding: 3px; font-weight: bold; width:30%;">Total Nilai Pasar Wajar</td>
|
||||
<td style="padding: 3px; text-align: right; font-weight: bold; width:30%"></td>
|
||||
<td style="padding: 3px; text-align: left; font-weight: bold; width: 40%;">
|
||||
<span style="padding-left: 20px; padding-right: 20px;">=</span>
|
||||
<div style="display: inline-block; border-top: 1px solid black; padding-top: 3px;">
|
||||
Rp {{ $lpjData['total_nilai_pasar_wajar'] ?? '' }}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3" style="padding: 8px; text-align: left; font-weight: bold;">
|
||||
b. Total Nilai Likuidasi
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding: 3px; text-align: right; width:30%">
|
||||
{{ $lpjData['likuidasi'] ?? '' }}%
|
||||
</td>
|
||||
<td style="padding: 3px; text-align: left; font-weight: bold; width:30%">
|
||||
<span style="padding-left:20px; padding-right: 20px">X</span> Total Nilai Pasar Wajar
|
||||
</td>
|
||||
<td style="padding: 3px; text-align: left; width:40%;">
|
||||
<span style="padding-left:20px; padding-right: 20px"> = </span> Rp
|
||||
{{ $lpjData['likuidasi_nilai_2'] ?? '' }}
|
||||
<td style=" padding: 4px;">{{ $penilai->userPenilaiTeam->name ?? '' }}</br>
|
||||
<span>
|
||||
{{ ucwords(strtolower('PENILAI')) }}
|
||||
</span>
|
||||
</td>
|
||||
@if ($permohonan->approval_so != null)
|
||||
<td style=" padding: 4px;">
|
||||
{{ $senior_officer->name ?? '' }}</br>
|
||||
<span>
|
||||
{{ ucwords(strtolower('SENIOR OFFICER')) }}
|
||||
</span>
|
||||
|
||||
</td>
|
||||
@endif
|
||||
|
||||
@if ($permohonan->approval_eo != null)
|
||||
<td style=" padding: 4px;">
|
||||
{{ User::role('EO Appraisal')->first()->name ?? '' }}</br>
|
||||
<span>
|
||||
{{ ucwords(strtolower('EXECUTIVE OFFICER')) }}
|
||||
</span>
|
||||
</td>
|
||||
@endif
|
||||
@if ($permohonan->approval_dd != null)
|
||||
<td style=" padding: 4px;">
|
||||
{{ User::role('DD Appraisal')->first()->name ?? '' }}</br>
|
||||
<span>
|
||||
{{ ucwords(strtolower('DEPUTY DIRECTOR')) }}
|
||||
</span>
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table style="width: 100%;">
|
||||
<tr>
|
||||
<td style="border: 1px solid #000;">
|
||||
G. ANALISA FAKTA
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<table>
|
||||
<tr>
|
||||
<td width="25%" style="vertical-align: top;"><strong>Faktor Positif</strong></td>
|
||||
<td>
|
||||
@isset($forminspeksi['fakta']['fakta_positif'])
|
||||
<table style="width: 100%; border-collapse: collapse;">
|
||||
@foreach ($forminspeksi['fakta']['fakta_positif'] as $key => $item)
|
||||
<tr>
|
||||
<td>{!! nl2br(e($item)) !!}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
@endisset
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="vertical-align: top;"><strong>Faktor Negatif</strong></td>
|
||||
<td>
|
||||
@isset($forminspeksi['fakta']['fakta_negatif'])
|
||||
<table style="width: 100%; border-collapse: collapse;">
|
||||
@foreach ($forminspeksi['fakta']['fakta_negatif'] as $key => $item)
|
||||
<tr>
|
||||
<td>{!! nl2br(e($item)) !!}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
@endisset
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="vertical-align: top;"><strong>Batas batas</strong></td>
|
||||
<td>
|
||||
@foreach ($forminspeksi['fakta']['batas_batas_input'] ?? [] as $arah => $batas)
|
||||
@if ($batas)
|
||||
<p> - {{ $arah }} : {{ $batas }}</p>
|
||||
@endif
|
||||
@endforeach
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" style="vertical-align: top;"><strong>Informasi Dinas Tata Ruang</strong>
|
||||
</td>
|
||||
<td>
|
||||
@php
|
||||
$informasi = [
|
||||
'peruntukan',
|
||||
'kdb',
|
||||
'kdh',
|
||||
'gsb',
|
||||
'max_lantai',
|
||||
'klb',
|
||||
'gss',
|
||||
'pelebaran_jalan',
|
||||
'nama_petugas',
|
||||
];
|
||||
@endphp
|
||||
|
||||
@foreach ($informasi as $key)
|
||||
@if (isset($forminspeksi['fakta'][$key]) && $forminspeksi['fakta'][$key] !== '-')
|
||||
<p> - {{ ucfirst(str_replace('_', ' ', $key)) }}:
|
||||
{{ $forminspeksi['fakta'][$key] }}</p>
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@if (!empty($forminspeksi['fakta']['keterangan']))
|
||||
<tr>
|
||||
<td width="25%" style="vertical-align: top;"><strong>Catatan yang Perlu
|
||||
Diperhatikan</strong></td>
|
||||
<td>
|
||||
@php
|
||||
$keterangan = $forminspeksi['fakta']['keterangan'] ?? '';
|
||||
if (is_array($keterangan)) {
|
||||
$keterangan = implode(', ', array_filter($keterangan));
|
||||
}
|
||||
@endphp
|
||||
|
||||
@if (!empty($keterangan))
|
||||
<table style="width: 100%; border-collapse: collapse;">
|
||||
<tr>
|
||||
<td>{{ $keterangan }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
</table>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<table>
|
||||
<div style="margin-top: 20px;">
|
||||
<label style="font-weight: bold;">DISCLAIMER</label>
|
||||
<div>
|
||||
<ol style="padding-left: 20px; list-style-type: decimal; margin-top: 0;">
|
||||
|
||||
<li style="margin-bottom: 5px;">PENILAIAN INI DIBUAT BERDASARKAN ATURAN YANG
|
||||
BERLAKU DI SUBDIT APPRAISAL</li>
|
||||
<li style="margin-bottom: 5px;">LAPORAN INI DIBUAT BERDASARKAN DATA FOTOCOPY
|
||||
DOKUMEN YANG DITERIMA PENILAI DENGAN ASUMSI BAHWA DATA TERSEBUT SESUAI DENGAN
|
||||
DOKUMEN ASLINYA</li>
|
||||
<li style="margin-bottom: 5px;">PENILAI TIDAK MELAKUKAN PEMBUKTIAN LEBIH RINCI ATAU
|
||||
PENGAKUAN TERTULIS DARI PIHAK YANG DITEMUI SAAT PENILAIAN, ATAS INFORMASI YANG
|
||||
DIBERIKAN SECARA LISAN SEHUBUNGAN DENGAN IDENTITAS DIRI DAN HUBUNGAN DI ANTARA
|
||||
PIHAK TERKAIT SAAT MELAKUKAN INSPEKSI OBJEK YANG DINILAI</li>
|
||||
<li style="margin-bottom: 5px;">LAPORAN INI DIGUNAKAN HANYA UNTUK KEPENTINGAN
|
||||
INTERNAL DAN DILARANG MENYEBARKAN KEPADA PIHAK KETIGA</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Demikian laporan penilai jaminan ini di buat secara objektif, tanpa adanya pengaruh baik intern
|
||||
maupun ekstern</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<table style="width: 100%; border-collapse: collapse; text-align: center;">
|
||||
@php
|
||||
use Modules\Usermanagement\Models\User;
|
||||
$penilaiUser = User::where('id', $penilai->userPenilaiTeam->id)->first();
|
||||
$imagePathPenilai = storage_path(
|
||||
'app/public/signatures/' . $penilaiUser->id . '/' . $penilaiUser->sign,
|
||||
);
|
||||
|
||||
$soUser = User::where('id', $senior_officer->id)->first();
|
||||
$imagePathSo = storage_path('app/public/signatures/' . $soUser->id . '/' . $soUser->sign);
|
||||
|
||||
$imagePathEO = storage_path(
|
||||
'app/public/signatures/' .
|
||||
User::role('EO Appraisal')->first()->id .
|
||||
'/' .
|
||||
User::role('EO Appraisal')->first()->sign,
|
||||
);
|
||||
|
||||
$imagePathDD = storage_path(
|
||||
'app/public/signatures/' .
|
||||
User::role('DD Appraisal')->first()->id .
|
||||
'/' .
|
||||
User::role('DD Appraisal')->first()->sign,
|
||||
);
|
||||
@endphp
|
||||
<tr>
|
||||
<td style=" padding: 4px;height: 50px">
|
||||
@if (file_exists($imagePathPenilai))
|
||||
<img src="{{ $imagePathPenilai }}" alt="{{ $imagePathPenilai }}" width="80px">
|
||||
@endif
|
||||
</td>
|
||||
@if ($permohonan->approval_so != null)
|
||||
<td style=" padding: 4px;height: 50px">
|
||||
@if (file_exists($imagePathSo))
|
||||
<img src="{{ $imagePathSo }}" alt="{{ $imagePathSo }}" width="80px">
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@if ($permohonan->approval_eo != null)
|
||||
<td style=" padding: 4px;height: 50px">
|
||||
@if (file_exists($imagePathEO))
|
||||
<img src="{{ $imagePathEO }}" alt="{{ $imagePathEO }}" width="80px">
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@if ($permohonan->approval_dd != null)
|
||||
<td style=" padding: 4px;height: 50px">
|
||||
@if (file_exists($imagePathDD))
|
||||
<img src="{{ $imagePathDD }}" alt="{{ $imagePathDD }}" width="80px">
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
<tr>
|
||||
<td style=" padding: 4px;">{{ $penilai->userPenilaiTeam->name ?? '' }}</br>
|
||||
<span>
|
||||
{{ ucwords(strtolower('PENILAI')) }}
|
||||
</span>
|
||||
</td>
|
||||
@if ($permohonan->approval_so != null)
|
||||
<td style=" padding: 4px;">
|
||||
{{ $senior_officer->name ?? '' }}</br>
|
||||
<span>
|
||||
{{ ucwords(strtolower('SENIOR OFFICER')) }}
|
||||
</span>
|
||||
|
||||
</td>
|
||||
@endif
|
||||
|
||||
@if ($permohonan->approval_eo != null)
|
||||
<td style=" padding: 4px;">
|
||||
{{ User::role('EO Appraisal')->first()->name ?? '' }}</br>
|
||||
<span>
|
||||
{{ ucwords(strtolower('EXECUTIVE OFFICER')) }}
|
||||
</span>
|
||||
</td>
|
||||
@endif
|
||||
@if ($permohonan->approval_dd != null)
|
||||
<td style=" padding: 4px;">
|
||||
{{ User::role('DD Appraisal')->first()->name ?? '' }}</br>
|
||||
<span>
|
||||
{{ ucwords(strtolower('DEPUTY DIRECTOR')) }}
|
||||
</span>
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
</table>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="page-break"></div>
|
||||
<table style="width: 100%; border-collapse: collapse; border: 1px solid #000;">
|
||||
<tr>
|
||||
@@ -1191,7 +1095,7 @@
|
||||
</div>
|
||||
<div class="photo-container">
|
||||
@php
|
||||
$fotoTypes = ['foto_gistaru', 'foto_bhumi', 'foto_argis_region', 'foto_tempat'];
|
||||
$fotoTypes = ['foto_gistaru', 'foto_bhumi', 'foto_argis_region', 'foto_tempat', 'foto_sentuh_tanahku'];
|
||||
// Memindahkan foto_tempat ke depan jika ada
|
||||
if (($key = array_search('foto_tempat', $fotoTypes)) !== false) {
|
||||
unset($fotoTypes[$key]);
|
||||
|
||||
@@ -87,357 +87,312 @@
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="no-break">
|
||||
<table style="width: 100%; ">
|
||||
<tr>
|
||||
<td style="width: 100%; border: 1px solid #000; text-align: center;">
|
||||
IDENTITAS CADEB/DEBITUR
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table style="width: 100%; ">
|
||||
<tr>
|
||||
<td style="width: 100%; border: 1px solid #000; text-align: center;">
|
||||
IDENTITAS CADEB/DEBITUR
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table style="width: 100%; ">
|
||||
<tr>
|
||||
<td style="width: 5%; padding: 2px; vertical-align: top;">Nama Debitur</td>
|
||||
<td style="width: 1%; vertical-align: top;">:</td>
|
||||
<td style="vertical-align: top; ">{{ $permohonan->debiture->name ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 25%; padding: 2px; vertical-align: top;">Debitur / Wakil Debitur</td>
|
||||
<td style="width: 1%; vertical-align: top;">:</td>
|
||||
<td>{{ $permohonan->debiture->name ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 25%; padding: 2px; vertical-align: top;">Pihak Bank selain Appraisal</td>
|
||||
<td style="width: 1%; vertical-align: top;">:</td>
|
||||
<td style="vertical-align: top;">{{ $forminspeksi['asset']['pihak_bank'] ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<table style="width: 100%; ">
|
||||
<tr>
|
||||
<td style="width: 5%; padding: 2px; vertical-align: top;">Nama Debitur</td>
|
||||
<td style="width: 1%; vertical-align: top;">:</td>
|
||||
<td style="vertical-align: top; ">{{ $permohonan->debiture->name ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 25%; padding: 2px; vertical-align: top;">Debitur / Wakil Debitur</td>
|
||||
<td style="width: 1%; vertical-align: top;">:</td>
|
||||
<td>{{ $permohonan->debiture->name ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 25%; padding: 2px; vertical-align: top;">Pihak Bank selain Apraisal</td>
|
||||
<td style="width: 1%; vertical-align: top;">:</td>
|
||||
<td style="vertical-align: top;">{{ $forminspeksi['asset']['pihak_bank'] ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table style="width: 100%; ">
|
||||
<tr>
|
||||
<td style="width: 100%; border: 1px solid #000; text-align: center;">
|
||||
DESKRIPSI DAN ALAMAT ASET
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table style="width: 100%; ">
|
||||
<tr>
|
||||
<td width="25%">Terletak di</td>
|
||||
<td style="width: 1%; vertical-align: top;">:</td>
|
||||
<td> {{ $alamat['address'] ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Desa/Kelurahan</td>
|
||||
<td style="width: 1%; vertical-align: top;">:</td>
|
||||
<td>{{ $alamat['village_code'] ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Kecamatan</td>
|
||||
<td style="width: 1%; vertical-align: top;">:</td>
|
||||
<td>{{ $alamat['district_code'] ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Kabupaten/Kota</td>
|
||||
<td style="width: 1%; vertical-align: top;">:</td>
|
||||
<td> {{ $alamat['city_code'] ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Provinsi</td>
|
||||
<td style="width: 1%; vertical-align: top;">:</td>
|
||||
<td>{{ $alamat['province_code'] ?? '' }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table style="width: 100%; ">
|
||||
<tr>
|
||||
<td style="width: 100%; border: 1px solid #000; text-align: center;">
|
||||
DOKUMEN
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table style="width: 100%; ">
|
||||
@if (@isset($dokumen))
|
||||
@foreach ($dokumen->detail as $detail)
|
||||
<tr>
|
||||
@if (isset($detail->dokumen_jaminan))
|
||||
<td style="width:25%; padding: 2px; vertical-align: top;">
|
||||
{{ $detail->name ?? '' }}
|
||||
</td>
|
||||
<td style="width:1%; padding: 2px; vertical-align: top;">:</td>
|
||||
<td style=" padding: 2px; vertical-align: top;">
|
||||
@if (isset($detail->dokumen_jaminan))
|
||||
@php
|
||||
$dokumen_jaminan = is_array(json_decode($detail->dokumen_jaminan))
|
||||
? json_decode($detail->dokumen_jaminan)
|
||||
: [$detail->dokumen_jaminan];
|
||||
$dokumen_nomor = is_array(json_decode($detail->dokumen_nomor))
|
||||
? json_decode($detail->dokumen_nomor)
|
||||
: ($detail->dokumen_nomor
|
||||
? [$detail->dokumen_nomor]
|
||||
: []);
|
||||
@endphp
|
||||
<div class="no-break">
|
||||
<table style="width: 100%; ">
|
||||
<tr>
|
||||
<td style="width: 100%; border: 1px solid #000; text-align: center;">
|
||||
DESKRIPSI DAN ALAMAT ASET
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table style="width: 100%; ">
|
||||
<tr>
|
||||
<td width="25%">Terletak di</td>
|
||||
<td style="width: 1%; vertical-align: top;">:</td>
|
||||
<td> {{ $alamat['address'] ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Desa/Kelurahan</td>
|
||||
<td style="width: 1%; vertical-align: top;">:</td>
|
||||
<td>{{ $alamat['village_code'] ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Kecamatan</td>
|
||||
<td style="width: 1%; vertical-align: top;">:</td>
|
||||
<td>{{ $alamat['district_code'] ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Kabupaten/Kota</td>
|
||||
<td style="width: 1%; vertical-align: top;">:</td>
|
||||
<td> {{ $alamat['city_code'] ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Provinsi</td>
|
||||
<td style="width: 1%; vertical-align: top;">:</td>
|
||||
<td>{{ $alamat['province_code'] ?? '' }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@foreach ($dokumen_jaminan as $index => $dokumen)
|
||||
<div>
|
||||
@if (!empty($dokumen_nomor[$index]))
|
||||
<span>{{ $dokumen_nomor[$index] }}</span>
|
||||
@endif
|
||||
</div>
|
||||
<div class="no-break">
|
||||
<table style="width: 100%; ">
|
||||
<tr>
|
||||
<td style="width: 100%; border: 1px solid #000; text-align: center;">
|
||||
DOKUMEN
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table style="width: 100%; ">
|
||||
@if (@isset($dokumen))
|
||||
@foreach ($dokumen->detail as $detail)
|
||||
<tr>
|
||||
@if (isset($detail->dokumen_jaminan))
|
||||
<td style="width:25%; padding: 2px; vertical-align: top;">
|
||||
{{ $detail->name ?? '' }}
|
||||
</td>
|
||||
<td style="width:1%; padding: 2px; vertical-align: top;">:</td>
|
||||
<td style=" padding: 2px; vertical-align: top;">
|
||||
@if (isset($detail->dokumen_jaminan))
|
||||
@php
|
||||
$dokumen_jaminan = is_array(json_decode($detail->dokumen_jaminan))
|
||||
? json_decode($detail->dokumen_jaminan)
|
||||
: [$detail->dokumen_jaminan];
|
||||
$dokumen_nomor = is_array(json_decode($detail->dokumen_nomor))
|
||||
? json_decode($detail->dokumen_nomor)
|
||||
: ($detail->dokumen_nomor
|
||||
? [$detail->dokumen_nomor]
|
||||
: []);
|
||||
@endphp
|
||||
|
||||
@foreach ($dokumen_jaminan as $index => $dokumen)
|
||||
<div>
|
||||
@if (!empty($dokumen_nomor[$index]))
|
||||
<span>{{ $dokumen_nomor[$index] }}</span>
|
||||
@endif
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
@if (isset($detail->details))
|
||||
@if (json_decode($detail->details))
|
||||
@foreach (json_decode($detail->details) as $key => $value)
|
||||
@if (!is_null($value) && $value !== '')
|
||||
<td style="width:25%; padding: 2px; vertical-align: top;">
|
||||
{{ ucwords(str_replace('_', ' ', $key)) ?? '' }}</td>
|
||||
<td style="width:1%; padding: 2px; vertical-align: top;">:</td>
|
||||
<td style=" padding: 2px; vertical-align: top;">{{ $value }}
|
||||
@if ($key == 'luas_bangunan' || $key == 'luas_tanah')
|
||||
<sup>m2</sup>
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
@if (isset($detail->details))
|
||||
@if (json_decode($detail->details))
|
||||
@foreach (json_decode($detail->details) as $key => $value)
|
||||
@if (!is_null($value) && $value !== '')
|
||||
<td style="width:25%; padding: 2px; vertical-align: top;">
|
||||
{{ ucwords(str_replace('_', ' ', $key)) ?? '' }}</td>
|
||||
<td style="width:1%; padding: 2px; vertical-align: top;">:</td>
|
||||
<td style=" padding: 2px; vertical-align: top;">{{ $value }}
|
||||
@if ($key == 'luas_bangunan' || $key == 'luas_tanah')
|
||||
<sup>m2</sup>
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
@endif
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
</table>
|
||||
<table style="width: 100%; ">
|
||||
<tr>
|
||||
<td style="width: 100%; border: 1px solid #000; text-align: center;">
|
||||
HUBUNGAN CADEB/DEBITUR DENGAN PEMILIK DAN PENGHUNI
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table style="width:100%">
|
||||
<tr>
|
||||
@php
|
||||
|
||||
$cekHub =
|
||||
isset($forminspeksi['asset']['hub_cadeb']) && $forminspeksi['asset']['hub_cadeb'] === 'sesuai'
|
||||
? 'sesuai'
|
||||
: 'tidak sesuai';
|
||||
|
||||
$hubCadeb = isset($forminspeksi['asset']['hub_cadeb'][$cekHub])
|
||||
? $forminspeksi['asset']['hub_cadeb']['tidak sesuai']
|
||||
: $forminspeksi['asset']['hub_cadeb']['sesuai'];
|
||||
@endphp
|
||||
<td style="width:25%; padding: 2px; vertical-align: top;">Hubungan Pemilik Jaminan dengan Debitu</td>
|
||||
<td style="width:1%; padding: 2px; vertical-align: top;">:</td>
|
||||
<td style=" padding: 2px; vertical-align: top;">{{ $hubCadeb ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@php
|
||||
|
||||
$cekHub =
|
||||
isset($forminspeksi['asset']['hub_cadeb_penghuni']) &&
|
||||
$forminspeksi['asset']['hub_cadeb_penghuni'] === 'sesuai'
|
||||
? 'sesuai'
|
||||
: 'tidak sesuai';
|
||||
|
||||
$hubCadeb = isset($forminspeksi['asset']['hub_cadeb_penghuni'][$cekHub])
|
||||
? $forminspeksi['asset']['hub_cadeb_penghuni']['tidak sesuai']
|
||||
: $forminspeksi['asset']['hub_cadeb_penghuni']['sesuai'];
|
||||
@endphp
|
||||
<td style=" padding: 2px; vertical-align: top;">Hubungan Penghuni Jaminan dengan Debitur</td>
|
||||
<td style=" padding: 2px; vertical-align: top;">:</td>
|
||||
<td style=" padding: 2px; vertical-align: top;">{{ $hubCadeb ?? '' }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
@foreach ($permohonan->documents as $dokumen)
|
||||
@if ($dokumen->jenisJaminan)
|
||||
@php
|
||||
$formKategori = json_decode($dokumen->jenisJaminan->form_kategori, true);
|
||||
@endphp
|
||||
@if (isset($formKategori) && $formKategori)
|
||||
@php
|
||||
$kategoriArray = is_array($formKategori) ? $formKategori : [$formKategori];
|
||||
$kategoriUnik = array_unique($kategoriArray);
|
||||
@endphp
|
||||
|
||||
@foreach ($kategoriUnik as $kategori)
|
||||
@include('lpj::penilai.components.analisa.' . str_replace('-', '-', $kategori), [
|
||||
'dokumen' => $dokumen,
|
||||
])
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
@endif
|
||||
@endforeach
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<table style="width: 100%; ">
|
||||
<tr>
|
||||
<td style="width: 100%; border: 1px solid #000; text-align: center;">
|
||||
INFORMASI DATA PEMBANDING
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table style="width: 100%; ">
|
||||
<tr>
|
||||
<td style="width:25%; vertical-align: top;">Informasi data pembanding</td>
|
||||
<td style="width:1%; vertical-align: top;">:</td>
|
||||
<td style="vertical-align: top;">
|
||||
<div class="no-break">
|
||||
<table style="width: 100%; ">
|
||||
<tr>
|
||||
<td style="width: 100%; border: 1px solid #000; text-align: center;">
|
||||
HUBUNGAN CADEB/DEBITUR DENGAN PEMILIK DAN PENGHUNI
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table style="width:100%">
|
||||
<tr>
|
||||
@php
|
||||
$exportData = [];
|
||||
if (isset($dataPembanding['data_pembanding'])) {
|
||||
foreach ($dataPembanding['data_pembanding'] as $index => $pembanding) {
|
||||
$exportData['pembanding' . ($index + 1)] = $pembanding;
|
||||
}
|
||||
}
|
||||
|
||||
$fields = [
|
||||
'jenis_aset' => 'Jenis properti',
|
||||
'harga' => 'Harga Penawaran',
|
||||
'telepon' => 'Penjual (HP)',
|
||||
'penawaran' => 'Ditawarkan Sejak',
|
||||
'luas_tanah' => 'Luas Tanah',
|
||||
'luas_bangunan' => 'Luas Bangunan',
|
||||
'kordinat' => 'Titik Kordinat',
|
||||
];
|
||||
$cekHub =
|
||||
isset($forminspeksi['asset']['hub_cadeb']) && $forminspeksi['asset']['hub_cadeb'] === 'sesuai'
|
||||
? 'sesuai'
|
||||
: 'tidak sesuai';
|
||||
|
||||
$hubCadeb = isset($forminspeksi['asset']['hub_cadeb'][$cekHub])
|
||||
? $forminspeksi['asset']['hub_cadeb']['tidak sesuai']
|
||||
: $forminspeksi['asset']['hub_cadeb']['sesuai'];
|
||||
@endphp
|
||||
<td style="width:25%; padding: 2px; vertical-align: top;">Hubungan Pemilik Jaminan dengan Debitur</td>
|
||||
<td style="width:1%; padding: 2px; vertical-align: top;">:</td>
|
||||
<td style=" padding: 2px; vertical-align: top;">{{ $hubCadeb ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@php
|
||||
|
||||
@foreach ($exportData as $index => $data)
|
||||
<table style="width: 100%; margin-bottom: 15px; border-bottom: 1px solid #ddd;">
|
||||
<tr>
|
||||
<td style="font-weight: bold; padding-bottom: 8px;">
|
||||
Pembanding {{ substr($index, -1) }}
|
||||
</td>
|
||||
</tr>
|
||||
@foreach ($fields as $key => $label)
|
||||
<tr>
|
||||
<td style="width: 33%;">{{ $label }}</td>
|
||||
<td style="width: 5%;">:</td>
|
||||
<td style="width: 62%;">
|
||||
@if ($key == 'luas_tanah' || $key == 'luas_bangunan')
|
||||
{{ $data[$key] ?? '-' }} m²
|
||||
@elseif($key == 'harga' || $key == 'harga_diskon')
|
||||
{{ formatRupiah($data[$key]) ?? 0 }}
|
||||
@elseif($key == 'kordinat')
|
||||
@php
|
||||
$lat = $data['kordinat_lat'] ?? null;
|
||||
$lng = $data['kordinat_lng'] ?? null;
|
||||
@endphp
|
||||
@if ($lat && $lng)
|
||||
{{ $lat }},{{ $lng }}
|
||||
@else
|
||||
-
|
||||
@endif
|
||||
@else
|
||||
{{ $data[$key] ?? '-' }}
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
@endforeach
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table style="width: 100%; ">
|
||||
<tr>
|
||||
<td style="width: 100%; border: 1px solid #000; text-align: center;">
|
||||
TOTAL NILAI PASAR WAJAR
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table>
|
||||
<tr>
|
||||
<td colspan="3" style=" padding: 8px; text-align: left;">1. Total Nilai Pasar Wajar
|
||||
</td>
|
||||
</tr>
|
||||
@php
|
||||
$labelNilai = [
|
||||
'bangunan' => 'Luas Bangunan',
|
||||
'tanah' => 'Luas Tanah',
|
||||
'apartement-kantor' => 'Luas Apartemen/Kantor',
|
||||
'alat-berat' => 'Luas Alat Berat',
|
||||
'mesin' => 'Luas Mesin',
|
||||
'kendaraan' => 'Luas Kendaraan',
|
||||
'pesawat' => 'Luas Pesawat',
|
||||
'kapal' => 'Luas Kapal',
|
||||
];
|
||||
$cekHub =
|
||||
isset($forminspeksi['asset']['hub_cadeb_penghuni']) &&
|
||||
$forminspeksi['asset']['hub_cadeb_penghuni'] === 'sesuai'
|
||||
? 'sesuai'
|
||||
: 'tidak sesuai';
|
||||
|
||||
// if (strcasecmp($jenisAset, 'RUKO/RUKAN') === 0) {
|
||||
// $labelNilai['bangunan'] = 'Luas Unit';
|
||||
// unset($labelNilai['tanah']);
|
||||
// }
|
||||
$hubCadeb = isset($forminspeksi['asset']['hub_cadeb_penghuni'][$cekHub])
|
||||
? $forminspeksi['asset']['hub_cadeb_penghuni']['tidak sesuai']
|
||||
: $forminspeksi['asset']['hub_cadeb_penghuni']['sesuai'];
|
||||
@endphp
|
||||
<td style=" padding: 2px; vertical-align: top;">Hubungan Penghuni Jaminan dengan Debitur</td>
|
||||
<td style=" padding: 2px; vertical-align: top;">:</td>
|
||||
<td style=" padding: 2px; vertical-align: top;">{{ $hubCadeb ?? '' }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@endphp
|
||||
@foreach ($labelNilai as $key => $label)
|
||||
@if (isset($lpjData['luas_' . $key]))
|
||||
<tr>
|
||||
<td style="padding: 3px; text-align: right; width:45%; ">
|
||||
{{ $label }} {{ $lpjData['luas_' . $key] ?? '' }} m<sup>2</sup>
|
||||
</td>
|
||||
<td style="padding: 3px; width:5%;">
|
||||
<span style="padding-left:20px; padding-right: 20px">X</span> Rp
|
||||
{{ $lpjData['nilai_' . $key . '_1'] ?? '' }}
|
||||
</td>
|
||||
<td style="padding: 3px; text-align: left; width:60%;">
|
||||
<span style="padding-left:20px; padding-right: 20px"> = </span> Rp
|
||||
{{ $lpjData['nilai_' . $key . '_2'] ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
<div class="no-break">
|
||||
@foreach ($permohonan->documents as $dokumen)
|
||||
@if ($dokumen->jenisJaminan)
|
||||
@php
|
||||
$formKategori = json_decode($dokumen->jenisJaminan->form_kategori, true);
|
||||
@endphp
|
||||
@if (isset($formKategori) && $formKategori)
|
||||
@php
|
||||
$kategoriArray = is_array($formKategori) ? $formKategori : [$formKategori];
|
||||
$kategoriUnik = array_unique($kategoriArray);
|
||||
@endphp
|
||||
|
||||
@foreach ($kategoriUnik as $kategori)
|
||||
@include('lpj::penilai.components.analisa.' . str_replace('-', '-', $kategori), [
|
||||
'dokumen' => $dokumen,
|
||||
])
|
||||
@endforeach
|
||||
@endif
|
||||
@endif
|
||||
@endforeach
|
||||
</div>
|
||||
<div class="no-break">
|
||||
<table style="width: 100%; ">
|
||||
<tr>
|
||||
<td style="width: 100%; border: 1px solid #000; text-align: center;">
|
||||
INFORMASI DATA PEMBANDING
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@include('lpj::penilai.components.print-pembanding')
|
||||
</div>
|
||||
|
||||
@if (isset($lpjData['npw_tambahan']))
|
||||
@foreach ($lpjData['npw_tambahan'] as $npw)
|
||||
<tr>
|
||||
<td style="padding: 3px; text-align: right;">
|
||||
{{ $npw['name'] }} {{ $npw['luas'] }} m<sup>2</sup>
|
||||
</td>
|
||||
<td style="padding: 3px;">
|
||||
<span style="padding-left:20px; padding-right: 20px">X</span> Rp
|
||||
{{ $npw['nilai_1'] }}
|
||||
</td>
|
||||
<td style="padding: 3px; text-align: left; width:70%">
|
||||
<span style="padding-left:20px; padding-right: 20px"> = </span> Rp
|
||||
{{ $npw['nilai_2'] }}
|
||||
</td>
|
||||
</tr>
|
||||
<div class="no-break">
|
||||
<table style="width: 100%; ">
|
||||
<tr>
|
||||
<td style="width: 100%; border: 1px solid #000; text-align: center;">
|
||||
TOTAL NILAI PASAR WAJAR
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table>
|
||||
<tr>
|
||||
<td colspan="3" style=" padding: 8px; text-align: left;">1. Total Nilai Pasar Wajar
|
||||
</td>
|
||||
</tr>
|
||||
@php
|
||||
$labelNilai = [
|
||||
'bangunan' => 'Luas Bangunan',
|
||||
'tanah' => 'Luas Tanah',
|
||||
'apartement-kantor' => 'Luas Apartemen/Kantor',
|
||||
'alat-berat' => 'Luas Alat Berat',
|
||||
'mesin' => 'Luas Mesin',
|
||||
'kendaraan' => 'Luas Kendaraan',
|
||||
'pesawat' => 'Luas Pesawat',
|
||||
'kapal' => 'Luas Kapal',
|
||||
];
|
||||
|
||||
// if (strcasecmp($jenisAset, 'RUKO/RUKAN') === 0) {
|
||||
// $labelNilai['bangunan'] = 'Luas Unit';
|
||||
// unset($labelNilai['tanah']);
|
||||
// }
|
||||
|
||||
@endphp
|
||||
@foreach ($labelNilai as $key => $label)
|
||||
@if (isset($lpjData['luas_' . $key]))
|
||||
<tr>
|
||||
<td style="padding: 3px; text-align: right; width:45%; ">
|
||||
{{ $label }} {{ $lpjData['luas_' . $key] ?? '' }} m<sup>2</sup>
|
||||
</td>
|
||||
<td style="padding: 3px; width:5%;">
|
||||
<span style="padding-left:20px; padding-right: 20px">X</span> Rp
|
||||
{{ $lpjData['nilai_' . $key . '_1'] ?? '' }}
|
||||
</td>
|
||||
<td style="padding: 3px; text-align: left; width:60%;">
|
||||
<span style="padding-left:20px; padding-right: 20px"> = </span> Rp
|
||||
{{ $lpjData['nilai_' . $key . '_2'] ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
<tr>
|
||||
<td style="padding: 3px; font-weight: bold; width:10%;">Total Nilai Pasar Wajar</td>
|
||||
<td style="padding: 3px; text-align: right; font-weight: bold; width:10%"></td>
|
||||
<td style="padding: 3px; text-align: left; font-weight: bold; width: 70%;">
|
||||
<span style="padding-left: 20px; padding-right: 20px;">=</span>
|
||||
<div style="display: inline-block; border-top: 1px solid black; padding-top: 3px;">
|
||||
Rp {{ $lpjData['total_nilai_pasar_wajar'] ?? '' }}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- Total Nilai Likuidasi -->
|
||||
<tr>
|
||||
<td colspan="3" style="padding: 8px; text-align: left">
|
||||
2. Total Nilai Likuidasi
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding: 3px; text-align: right; width:10%">
|
||||
{{ $lpjData['likuidasi'] ?? '' }}%
|
||||
</td>
|
||||
<td style="padding: 3px; text-align: left; font-weight: bold; width:10%">
|
||||
<span style="padding-left:20px; padding-right: 20px">X</span> Total Nilai Pasar Wajar
|
||||
</td>
|
||||
<td style="padding: 3px; text-align: left; width:70%;">
|
||||
<span style="padding-left:20px; padding-right: 20px"> = </span> Rp
|
||||
{{ $lpjData['likuidasi_nilai_2'] ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@if (isset($lpjData['npw_tambahan']))
|
||||
@foreach ($lpjData['npw_tambahan'] as $npw)
|
||||
<tr>
|
||||
<td style="padding: 3px; text-align: right;">
|
||||
{{ $npw['name'] }} {{ $npw['luas'] }} m<sup>2</sup>
|
||||
</td>
|
||||
<td style="padding: 3px;">
|
||||
<span style="padding-left:20px; padding-right: 20px">X</span> Rp
|
||||
{{ $npw['nilai_1'] }}
|
||||
</td>
|
||||
<td style="padding: 3px; text-align: left; width:70%">
|
||||
<span style="padding-left:20px; padding-right: 20px"> = </span> Rp
|
||||
{{ $npw['nilai_2'] }}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
<tr>
|
||||
<td style="padding: 3px; font-weight: bold; width:10%;">Total Nilai Pasar Wajar</td>
|
||||
<td style="padding: 3px; text-align: right; font-weight: bold; width:10%"></td>
|
||||
<td style="padding: 3px; text-align: left; font-weight: bold; width: 70%;">
|
||||
<span style="padding-left: 20px; padding-right: 20px;">=</span>
|
||||
<div style="display: inline-block; border-top: 1px solid black; padding-top: 3px;">
|
||||
Rp {{ $lpjData['total_nilai_pasar_wajar'] ?? '' }}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- Total Nilai Likuidasi -->
|
||||
<tr>
|
||||
<td colspan="3" style="padding: 8px; text-align: left">
|
||||
2. Total Nilai Likuidasi
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding: 3px; text-align: right; width:10%">
|
||||
{{ $lpjData['likuidasi'] ?? '' }}%
|
||||
</td>
|
||||
<td style="padding: 3px; text-align: left; font-weight: bold; width:10%">
|
||||
<span style="padding-left:20px; padding-right: 20px">X</span> Total Nilai Pasar Wajar
|
||||
</td>
|
||||
<td style="padding: 3px; text-align: left; width:70%;">
|
||||
<span style="padding-left:20px; padding-right: 20px"> = </span> Rp
|
||||
{{ $lpjData['likuidasi_nilai_2'] ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
@php
|
||||
$keterangan = $lpjData['keterangan_penilai'] ?? '';
|
||||
if (is_array($keterangan)) {
|
||||
@@ -458,133 +413,103 @@
|
||||
</tr>
|
||||
</table>
|
||||
@endif
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<td>Demikian laporan penilai jaminan ini di buat secara objektif, tanpa adanya pengaruh baik intern
|
||||
maupun ekstern</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="no-break">
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<td>Demikian laporan penilai jaminan ini di buat secara objektif, tanpa adanya pengaruh baik intern
|
||||
maupun ekstern</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table style="width: 100%; border-collapse: collapse; text-align: center;">
|
||||
@php
|
||||
use Modules\Usermanagement\Models\User;
|
||||
<table style="width: 100%; border-collapse: collapse; text-align: center;">
|
||||
@php
|
||||
use Modules\Usermanagement\Models\User;
|
||||
|
||||
$penilaiUser = User::where('id', $penilai->userPenilaiTeam->id)->first();
|
||||
$imagePathPenilai = storage_path('app/public/signatures/' . $penilaiUser->id . '/' . $penilaiUser->sign);
|
||||
$penilaiUser = User::where('id', $penilai->userPenilaiTeam->id)->first();
|
||||
$imagePathPenilai = storage_path(
|
||||
'app/public/signatures/' . $penilaiUser->id . '/' . $penilaiUser->sign,
|
||||
);
|
||||
|
||||
$soUser = User::where('id', $senior_officer->id)->first();
|
||||
$imagePathSo = storage_path('app/public/signatures/' . $soUser->id . '/' . $soUser->sign);
|
||||
$soUser = User::where('id', $senior_officer->id)->first();
|
||||
$imagePathSo = storage_path('app/public/signatures/' . $soUser->id . '/' . $soUser->sign);
|
||||
|
||||
$imagePathEO = storage_path(
|
||||
'app/public/signatures/' .
|
||||
User::role('EO Appraisal')->first()->id .
|
||||
'/' .
|
||||
User::role('EO Appraisal')->first()->sign,
|
||||
);
|
||||
$imagePathEO = storage_path(
|
||||
'app/public/signatures/' .
|
||||
User::role('EO Appraisal')->first()->id .
|
||||
'/' .
|
||||
User::role('EO Appraisal')->first()->sign,
|
||||
);
|
||||
|
||||
$imagePathDD = storage_path(
|
||||
'app/public/signatures/' .
|
||||
User::role('DD Appraisal')->first()->id .
|
||||
'/' .
|
||||
User::role('DD Appraisal')->first()->sign,
|
||||
);
|
||||
@endphp
|
||||
<tr>
|
||||
<td style=" padding: 4px;height: 50px">
|
||||
@if (file_exists($imagePathPenilai))
|
||||
<img src="{{ $imagePathPenilai }}" alt="{{ $imagePathPenilai }}" width="80px">
|
||||
$imagePathDD = storage_path(
|
||||
'app/public/signatures/' .
|
||||
User::role('DD Appraisal')->first()->id .
|
||||
'/' .
|
||||
User::role('DD Appraisal')->first()->sign,
|
||||
);
|
||||
@endphp
|
||||
<tr>
|
||||
<td style=" padding: 4px;height: 50px">
|
||||
@if (file_exists($imagePathPenilai))
|
||||
<img src="{{ $imagePathPenilai }}" alt="{{ $imagePathPenilai }}" width="80px">
|
||||
@endif
|
||||
</td>
|
||||
@if ($permohonan->approval_so != null)
|
||||
<td style=" padding: 4px;height: 50px">
|
||||
@if (file_exists($imagePathSo))
|
||||
<img src="{{ $imagePathSo }}" alt="{{ $imagePathSo }}" width="80px">
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
</td>
|
||||
@if ($permohonan->approval_so != null)
|
||||
<td style=" padding: 4px;height: 50px">
|
||||
@if (file_exists($imagePathSo))
|
||||
<img src="{{ $imagePathSo }}" alt="{{ $imagePathSo }}" width="80px">
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@if ($permohonan->approval_eo != null)
|
||||
<td style=" padding: 4px;height: 50px">
|
||||
@if (file_exists($imagePathEO))
|
||||
<img src="{{ $imagePathEO }}" alt="{{ $imagePathEO }}" width="80px">
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@if ($permohonan->approval_dd != null)
|
||||
<td style=" padding: 4px;height: 50px">
|
||||
@if (file_exists($imagePathDD))
|
||||
<img src="{{ $imagePathDD }}" alt="{{ $imagePathDD }}" width="80px">
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
<tr>
|
||||
<td style=" padding: 4px;">{{ $penilai->userPenilaiTeam->name ?? '' }}</br>
|
||||
<span>
|
||||
{{ ucwords(strtolower('PENILAI')) }}
|
||||
</span>
|
||||
</td>
|
||||
@if ($permohonan->approval_so != null)
|
||||
<td style=" padding: 4px;">
|
||||
{{ $senior_officer->name ?? '' }}</br>
|
||||
@if ($permohonan->approval_eo != null)
|
||||
<td style=" padding: 4px;height: 50px">
|
||||
@if (file_exists($imagePathEO))
|
||||
<img src="{{ $imagePathEO }}" alt="{{ $imagePathEO }}" width="80px">
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@if ($permohonan->approval_dd != null)
|
||||
<td style=" padding: 4px;height: 50px">
|
||||
@if (file_exists($imagePathDD))
|
||||
<img src="{{ $imagePathDD }}" alt="{{ $imagePathDD }}" width="80px">
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
<tr>
|
||||
<td style=" padding: 4px;">{{ $penilai->userPenilaiTeam->name ?? '' }}</br>
|
||||
<span>
|
||||
{{ ucwords(strtolower('SENIOR OFFICER')) }}
|
||||
</span>
|
||||
|
||||
</td>
|
||||
@endif
|
||||
|
||||
@if ($permohonan->approval_eo != null)
|
||||
<td style=" padding: 4px;">
|
||||
{{ User::role('EO Appraisal')->first()->name ?? '' }}</br>
|
||||
<span>
|
||||
{{ ucwords(strtolower('EXECUTIVE OFFICER')) }}
|
||||
{{ ucwords(strtolower('PENILAI')) }}
|
||||
</span>
|
||||
</td>
|
||||
@endif
|
||||
@if ($permohonan->approval_dd != null)
|
||||
<td style=" padding: 4px;">
|
||||
{{ User::role('DD Appraisal')->first()->name ?? '' }}</br>
|
||||
<span>
|
||||
{{ ucwords(strtolower('DEPUTY DIRECTOR')) }}
|
||||
</span>
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
</table>
|
||||
@if ($permohonan->approval_so != null)
|
||||
<td style=" padding: 4px;">
|
||||
{{ $senior_officer->name ?? '' }}</br>
|
||||
<span>
|
||||
{{ ucwords(strtolower('SENIOR OFFICER')) }}
|
||||
</span>
|
||||
|
||||
<table style="width: 100%; ">
|
||||
<tr>
|
||||
<td style="width: 100%; border: 1px solid #000; text-align: center;">
|
||||
NILAI ASURANSI
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table>
|
||||
@if (!empty($lpjData['asuransi_luas_bangunan']))
|
||||
<tr>
|
||||
</td>
|
||||
@endif
|
||||
|
||||
<td width="25%">Luas Bangunan</td>
|
||||
<td style="">
|
||||
{{ $lpjData['asuransi_luas_bangunan'] ?? '' }}</td>
|
||||
@if ($permohonan->approval_eo != null)
|
||||
<td style=" padding: 4px;">
|
||||
{{ User::role('EO Appraisal')->first()->name ?? '' }}</br>
|
||||
<span>
|
||||
{{ ucwords(strtolower('EXECUTIVE OFFICER')) }}
|
||||
</span>
|
||||
</td>
|
||||
@endif
|
||||
@if ($permohonan->approval_dd != null)
|
||||
<td style=" padding: 4px;">
|
||||
{{ User::role('DD Appraisal')->first()->name ?? '' }}</br>
|
||||
<span>
|
||||
{{ ucwords(strtolower('DEPUTY DIRECTOR')) }}
|
||||
</span>
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="">Harga</td>
|
||||
<td style="">Rp.
|
||||
{{ $lpjData['asuransi_nilai_1'] ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="">Nilai Pasar Wajar (Rp)</td>
|
||||
|
||||
<td style="">Rp.
|
||||
{{ $lpjData['asuransi_nilai_2'] ?? '' }}</td>
|
||||
</tr>
|
||||
@else
|
||||
<tr>
|
||||
<td>Tidak Ada</td>
|
||||
</tr>
|
||||
@endif
|
||||
</table>
|
||||
</table>
|
||||
</div>
|
||||
<hr />
|
||||
<table style="width: 100%; ">
|
||||
<div style="margin-top: 20px;">
|
||||
@@ -637,7 +562,7 @@
|
||||
</table>
|
||||
<div class="photo-container">
|
||||
@php
|
||||
$fotoTypes = ['foto_gistaru', 'foto_bhumi', 'foto_argis_region', 'foto_tempat'];
|
||||
$fotoTypes = ['foto_gistaru', 'foto_bhumi', 'foto_argis_region', 'foto_tempat','foto_sentuh_tanahku'];
|
||||
// Memindahkan foto_tempat ke depan jika ada
|
||||
if (($key = array_search('foto_tempat', $fotoTypes)) !== false) {
|
||||
unset($fotoTypes[$key]);
|
||||
@@ -645,7 +570,8 @@
|
||||
}
|
||||
// Filter fotoTypes untuk memastikan hanya yang memiliki imagePath valid
|
||||
$validPhotoTypes = array_filter($fotoTypes, function ($type) use ($forminspeksi) {
|
||||
return isset($forminspeksi[$type]) && file_exists(storage_path('app/public/' . $forminspeksi[$type]));
|
||||
return isset($forminspeksi[$type]) &&
|
||||
file_exists(storage_path('app/public/' . $forminspeksi[$type]));
|
||||
});
|
||||
@endphp
|
||||
|
||||
@@ -656,7 +582,8 @@
|
||||
$type = reset($validPhotoTypes); // Ambil elemen pertama
|
||||
$imagePath = $forminspeksi[$type] ?? null;
|
||||
@endphp
|
||||
<td style="width: 100%; vertical-align: top; text-align: center" colspan="2" class="photo-item border">
|
||||
<td style="width: 100%; vertical-align: top; text-align: center" colspan="2"
|
||||
class="photo-item border">
|
||||
<p style="margin: 0; font-size: 10px; text-align: center;">
|
||||
{{ Str::title(str_replace('_', ' ', $type)) }}
|
||||
</p>
|
||||
@@ -676,19 +603,20 @@
|
||||
{{ Str::title(str_replace('_', ' ', $type)) }}
|
||||
</p>
|
||||
@if ($imagePath && file_exists(storage_path('app/public/' . $imagePath)))
|
||||
<img src="{{ storage_path('app/public/' . $imagePath) }}" alt="{{ $imagePath }}"
|
||||
class="photo-image" style="width: 100%; max-width: 300px;">
|
||||
<img src="{{ storage_path('app/public/' . $imagePath) }}"
|
||||
alt="{{ $imagePath }}" class="photo-image"
|
||||
style="width: 100%; max-width: 300px;">
|
||||
@endif
|
||||
</td>
|
||||
@endisset
|
||||
@if (($index + 1) % 2 == 0)
|
||||
</tr>
|
||||
<tr>
|
||||
@endif
|
||||
@endforeach
|
||||
@if (count($fotoTypes) % 2 != 0)
|
||||
<td style="width: 50%;"></td>
|
||||
@endif
|
||||
@endif
|
||||
@endforeach
|
||||
@if (count($fotoTypes) % 2 != 0)
|
||||
<td style="width: 50%;"></td>
|
||||
@endif
|
||||
@endif
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
<table style="width: 100%; ">
|
||||
<tr>
|
||||
<td style="width:25%; vertical-align: top;">Informasi data pembanding</td>
|
||||
<td style="width:1%; vertical-align: top;">:</td>
|
||||
<td style="vertical-align: top;">
|
||||
@php
|
||||
$exportData = [];
|
||||
if (isset($dataPembanding['data_pembanding'])) {
|
||||
foreach ($dataPembanding['data_pembanding'] as $index => $pembanding) {
|
||||
$exportData['pembanding' . ($index + 1)] = $pembanding;
|
||||
}
|
||||
}
|
||||
|
||||
$fields = [
|
||||
'jenis_aset' => 'Jenis properti',
|
||||
'hak_properti' => 'Status Hak Tanah',
|
||||
'address' => 'Alamat Lokasi',
|
||||
'harga' => 'Harga Penawaran',
|
||||
'harga_diskon' => 'Indikasi Harga Transaksi',
|
||||
'telepon' => 'Penjual (HP)',
|
||||
'penawaran' => 'Ditawarkan Sejak',
|
||||
'luas_tanah' => 'Luas Tanah',
|
||||
'luas_bangunan' => 'Luas Bangunan',
|
||||
'kordinat' => 'Titik Kordinat',
|
||||
];
|
||||
@endphp
|
||||
|
||||
@foreach ($exportData as $index => $data)
|
||||
<table style="width: 100%; margin-bottom: 15px; border-bottom: 1px solid #ddd;">
|
||||
<tr>
|
||||
<td style="font-weight: bold; padding-bottom: 8px;">
|
||||
Pembanding {{ substr($index, -1) }}
|
||||
</td>
|
||||
</tr>
|
||||
@foreach ($fields as $key => $label)
|
||||
<tr>
|
||||
<td style="width: 33%;">{{ $label }}</td>
|
||||
<td style="width: 5%;">:</td>
|
||||
<td style="width: 62%;">
|
||||
@if ($key == 'luas_tanah' || $key == 'luas_bangunan')
|
||||
{{ $data[$key] ?? '-' }} m²
|
||||
@elseif($key == 'harga' || $key == 'harga_diskon')
|
||||
{{ formatRupiah($data[$key]) ?? 0 }}
|
||||
@elseif($key == 'kordinat')
|
||||
@php
|
||||
$lat = $data['kordinat_lat'] ?? null;
|
||||
$lng = $data['kordinat_lng'] ?? null;
|
||||
@endphp
|
||||
@if ($lat && $lng)
|
||||
{{ $lat }},{{ $lng }}
|
||||
@else
|
||||
-
|
||||
@endif
|
||||
@else
|
||||
{{ $data[$key] ?? '-' }}
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
@endforeach
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -178,8 +178,8 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@isset($resumeData['fakta']['fakta_positif'])
|
||||
@foreach ($resumeData['fakta']['fakta_positif'] as $key => $item)
|
||||
@isset($forminspeksi['fakta']['fakta_positif'])
|
||||
@foreach ($forminspeksi['fakta']['fakta_positif'] as $key => $item)
|
||||
<tr>
|
||||
<td>{!! nl2br(e($item)) !!}</td>
|
||||
</tr>
|
||||
@@ -195,8 +195,8 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@isset($resumeData['fakta']['fakta_negatif'])
|
||||
@foreach ($resumeData['fakta']['fakta_negatif'] as $key => $item)
|
||||
@isset($forminspeksi['fakta']['fakta_negatif'])
|
||||
@foreach ($forminspeksi['fakta']['fakta_negatif'] as $key => $item)
|
||||
<tr>
|
||||
<td>{!! nl2br(e($item)) !!}</td>
|
||||
</tr>
|
||||
@@ -226,13 +226,13 @@
|
||||
<table border="1" style="width: 100%; border-collapse: collapse; margin-bottom: 10px;">
|
||||
|
||||
@foreach ($resumeData['fisik'] as $item)
|
||||
<tr>
|
||||
<td style="border: 1px solid #000; padding: 4px; text-align: center">Sertifikat</td>
|
||||
<td style="border: 1px solid #000; padding: 4px; text-align: center">Luas Tanah</td>
|
||||
<td style="border: 1px solid #000; padding: 4px; text-align: center">Luas Bangunan</td>
|
||||
<td style="border: 1px solid #000; padding: 4px; text-align: center">Nilai Pasar Wajar</td>
|
||||
<td style="border: 1px solid #000; padding: 4px; text-align: center">Nilai Likuidasi {{ isset($item['likuidasi']) ? '('. $item['likuidasi'] . ' %)' : '-' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border: 1px solid #000; padding: 4px; text-align: center">Sertifikat</td>
|
||||
<td style="border: 1px solid #000; padding: 4px; text-align: center">Luas Tanah</td>
|
||||
<td style="border: 1px solid #000; padding: 4px; text-align: center">Luas Bangunan</td>
|
||||
<td style="border: 1px solid #000; padding: 4px; text-align: center">Nilai Pasar Wajar</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border: 1px solid #000; padding: 4px; text-align: center">{{ $item['sertifikat'] ?? '' }}
|
||||
</td>
|
||||
@@ -242,54 +242,19 @@
|
||||
{{ isset($item['luas_bangunan']) ? $item['luas_bangunan'] . ' m²' : '-' }}</td>
|
||||
<td style="border: 1px solid #000; padding: 4px; text-align: center">
|
||||
{{ isset($item['nilai']) ? formatRupiah($item['nilai']) : '-' }}</td>
|
||||
<td style="border: 1px solid #000; padding: 4px; text-align: center">
|
||||
{{ isset($item['total_likuidasi']) ? formatRupiah($item['total_likuidasi']) : '-' }}</td>
|
||||
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
|
||||
@if (!empty($resumeData['sesuai_imb']))
|
||||
<table style="margin: 5px 0; border-collapse: collapse; width: 100%;">
|
||||
<tr>
|
||||
<td style="">
|
||||
<h6 style="text-transform: uppercase; margin: 0; ">2. Sesuai IMB</h6>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table border="1" style="width: 100%; border-collapse: collapse; margin-bottom: 10px;">
|
||||
|
||||
@foreach ($resumeData['sesuai_imb'] as $item)
|
||||
<tr>
|
||||
<td style="border: 1px solid #000; padding: 4px; text-align: center">Sertifikat</td>
|
||||
<td style="border: 1px solid #000; padding: 4px; text-align: center">Luas Tanah</td>
|
||||
<td style="border: 1px solid #000; padding: 4px; text-align: center">Luas Bangunan</td>
|
||||
<td style="border: 1px solid #000; padding: 4px; text-align: center">Nilai Pasar Wajar</td>
|
||||
<td style="border: 1px solid #000; padding: 4px; text-align: center">Nilai Likuidasi {{ isset($item['likuidasi']) ? '('. $item['likuidasi'] . ' %)' : '-' }}</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border: 1px solid #000; padding: 4px; text-align: center">
|
||||
{{ $item['sertifikat'] ?? '' }}</td>
|
||||
<td style="border: 1px solid #000; padding: 4px; text-align: center">
|
||||
{{ isset($item['luas_tanah']) ? $item['luas_tanah'] . ' m²' : '-' }}</td>
|
||||
<td style="border: 1px solid #000; padding: 4px; text-align: center">
|
||||
{{ isset($item['luas_bangunan']) ? $item['luas_bangunan'] . ' m²' : '-' }}</td>
|
||||
<td style="border: 1px solid #000; padding: 4px; text-align: center">
|
||||
{{ isset($item['nilai']) ? formatRupiah($item['nilai']) : '-' }}</td>
|
||||
<td style="border: 1px solid #000; padding: 4px; text-align: center">
|
||||
{{ isset($item['total_likuidasi']) ? formatRupiah($item['total_likuidasi']) : '-' }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
@endif
|
||||
@if (!empty($resumeData['tambahan']))
|
||||
@foreach ($resumeData['tambahan'] as $index => $item)
|
||||
<table style="margin: 5px 0; border-collapse: collapse; width: 100%;">
|
||||
<tr>
|
||||
<td style="">
|
||||
<h6 style="text-transform: uppercase; margin: 0; ">
|
||||
{{ $index + 3 }}. {{ $item['tambahan_nama_kesimpulan'] ?? '-' }}
|
||||
{{ $index + 2 }}. {{ $item['tambahan_nama_kesimpulan'] ?? '-' }}
|
||||
</h6>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -301,7 +266,7 @@
|
||||
<td style="border: 1px solid #000; padding: 4px; text-align: center">Luas Tanah</td>
|
||||
<td style="border: 1px solid #000; padding: 4px; text-align: center">Luas Bangunan</td>
|
||||
<td style="border: 1px solid #000; padding: 4px; text-align: center">Nilai Pasar Wajar</td>
|
||||
<td style="border: 1px solid #000; padding: 4px; text-align: center">Nilai Likuidasi {{ isset($item['likuidasi']) ? '('. $item['likuidasi'] . ' %)' : '' }}</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border: 1px solid #000; padding: 4px; text-align: center">
|
||||
@@ -312,8 +277,7 @@
|
||||
{{ isset($item['luas_bangunan']) ? $item['luas_bangunan'] . ' m²' : '-' }}</td>
|
||||
<td style="border: 1px solid #000; padding: 4px; text-align: center">
|
||||
{{ isset($item['nilai']) ? formatRupiah($item['nilai']) : '-' }}</td>
|
||||
<td style="border: 1px solid #000; padding: 4px; text-align: center">
|
||||
{{ isset($item['total_likuidasi']) ? formatRupiah($item['total_likuidasi']) : '-' }}</td>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
@endforeach
|
||||
@@ -326,9 +290,14 @@
|
||||
<h6 style="text-transform: uppercase; margin: 0; ">lain lain</h2>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{!! nl2br(e($resumeData['keterangan'] ?? '')) !!}</td>
|
||||
</tr>
|
||||
@isset($forminspeksi['fakta']['keterangan'])
|
||||
@foreach ($forminspeksi['fakta']['keterangan'] as $key => $item)
|
||||
<tr>
|
||||
<td>{!! nl2br(e($item)) !!}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endisset
|
||||
|
||||
</table>
|
||||
|
||||
<table style="width: 100%">
|
||||
@@ -363,101 +332,8 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Demikian Kami Sampaikan, atas perhatiannya kami ucapkan terimakasih</td>
|
||||
<td>Resume ini sudah di setujui</td>
|
||||
</tr>
|
||||
<table style="width: 100%;">
|
||||
<tr>
|
||||
<td>
|
||||
<table style="width: 100%; border-collapse: collapse; text-align: center;">
|
||||
@php
|
||||
use Modules\Usermanagement\Models\User;
|
||||
$penilaiUser = User::where('id', $penilai->userPenilaiTeam->id)->first();
|
||||
$imagePathPenilai = storage_path(
|
||||
'app/public/signatures/' . $penilaiUser->id . '/' . $penilaiUser->sign,
|
||||
);
|
||||
|
||||
$soUser = User::where('id', $senior_officer->id)->first();
|
||||
$imagePathSo = storage_path('app/public/signatures/' . $soUser->id . '/' . $soUser->sign);
|
||||
|
||||
$imagePathEO = storage_path(
|
||||
'app/public/signatures/' .
|
||||
User::role('EO Appraisal')->first()->id .
|
||||
'/' .
|
||||
User::role('EO Appraisal')->first()->sign,
|
||||
);
|
||||
|
||||
$imagePathDD = storage_path(
|
||||
'app/public/signatures/' .
|
||||
User::role('DD Appraisal')->first()->id .
|
||||
'/' .
|
||||
User::role('DD Appraisal')->first()->sign,
|
||||
);
|
||||
@endphp
|
||||
<tr>
|
||||
<td style=" padding: 4px;height: 50px">
|
||||
@if (file_exists($imagePathPenilai))
|
||||
<img src="{{ $imagePathPenilai }}" alt="{{ $imagePathPenilai }}" width="80px">
|
||||
@endif
|
||||
</td>
|
||||
@if ($permohonan->approval_so != null)
|
||||
<td style=" padding: 4px;height: 50px">
|
||||
@if (file_exists($imagePathSo))
|
||||
<img src="{{ $imagePathSo }}" alt="{{ $imagePathSo }}" width="80px">
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@if ($permohonan->approval_eo != null)
|
||||
<td style=" padding: 4px;height: 50px">
|
||||
@if (file_exists($imagePathEO))
|
||||
<img src="{{ $imagePathEO }}" alt="{{ $imagePathEO }}" width="80px">
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@if ($permohonan->approval_dd != null)
|
||||
<td style=" padding: 4px;height: 50px">
|
||||
@if (file_exists($imagePathDD))
|
||||
<img src="{{ $imagePathDD }}" alt="{{ $imagePathDD }}" width="80px">
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
<tr>
|
||||
<td style=" padding: 4px;">{{ $penilai->userPenilaiTeam->name ?? '' }}</br>
|
||||
<span>
|
||||
{{ ucwords(strtolower('PENILAI')) }}
|
||||
</span>
|
||||
</td>
|
||||
@if ($permohonan->approval_so != null)
|
||||
<td style=" padding: 4px;">
|
||||
{{ $senior_officer->name ?? '' }}</br>
|
||||
<span>
|
||||
{{ ucwords(strtolower('SENIOR OFFICER')) }}
|
||||
</span>
|
||||
|
||||
</td>
|
||||
@endif
|
||||
|
||||
@if ($permohonan->approval_eo != null)
|
||||
<td style=" padding: 4px;">
|
||||
{{ User::role('EO Appraisal')->first()->name ?? '' }}</br>
|
||||
<span>
|
||||
{{ ucwords(strtolower('EXECUTIVE OFFICER')) }}
|
||||
</span>
|
||||
</td>
|
||||
@endif
|
||||
@if ($permohonan->approval_dd != null)
|
||||
<td style=" padding: 4px;">
|
||||
{{ User::role('DD Appraisal')->first()->name ?? '' }}</br>
|
||||
<span>
|
||||
{{ ucwords(strtolower('DEPUTY DIRECTOR')) }}
|
||||
</span>
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</table>
|
||||
|
||||
<div class="page-break"></div>
|
||||
|
||||
@@ -65,6 +65,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end gap-2" style="margin-right: 20px; margin-top: 20px">
|
||||
@if (Auth::user()->hasAnyRole(['senior-officer', 'surveyor', 'administrator']))
|
||||
<button type="button" class="btn btn-primary" id="saveButton" onclick="submitData()">
|
||||
<i class="ki-filled ki-save-2"></i>
|
||||
<span id="saveButtonText">Save</span>
|
||||
@@ -73,6 +74,7 @@
|
||||
|
||||
</div>
|
||||
</button>
|
||||
@endif
|
||||
@if (Auth::user()->hasAnyRole(['senior-officer', 'EO Appraisal', 'DD Appraisal', 'administrator']))
|
||||
<a class="btn btn-info"
|
||||
href="{{ route('penilai.lampiran') }}?permohonanId={{ request('permohonanId') }}&documentId={{ request('documentId') }}&inspeksiId={{ request('inspeksiId') }}&jaminanId={{ request('jaminanId') }}&statusLpj=1">
|
||||
|
||||
@@ -21,9 +21,30 @@
|
||||
}
|
||||
</style>
|
||||
@include('lpj::assetsku.includenya')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
@php
|
||||
$paparan = $permohonan->status === 'proses-paparan' ? 'Paparan' : 'Pelaporan';
|
||||
@endphp
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto ">
|
||||
|
||||
<form id="formResume" method="POST" class="w-full grid gap-5">
|
||||
@csrf
|
||||
|
||||
@foreach ($permohonan->documents as $dokumen)
|
||||
@if ($dokumen->jenisJaminan)
|
||||
@php
|
||||
$formKategori = json_decode($dokumen->jenisJaminan->form_kategori, true);
|
||||
$jenisAset = $dokumen->jenisJaminan->name;
|
||||
@endphp
|
||||
@if (isset($formKategori) && $formKategori)
|
||||
@php
|
||||
$kategoriArray = is_array($formKategori) ? $formKategori : [$formKategori];
|
||||
$kategoriUnik = array_unique($kategoriArray);
|
||||
@endphp
|
||||
<input type="hidden" name="action" value="{{ implode(',', $kategoriUnik) }}">
|
||||
<input type="hidden" name="type" value="{{ implode(',', $kategoriUnik) }}">
|
||||
@endif
|
||||
@endif
|
||||
@endforeach
|
||||
<div class="card">
|
||||
<div class="card-header bg-agi-50">
|
||||
<h3 class="card-title uppercase">
|
||||
@@ -36,7 +57,7 @@
|
||||
|
||||
@if (Auth::user()->hasAnyRole(['administrator', 'senior-officer', 'EO Appraisal', 'DD Appraisal']) &&
|
||||
Route::currentRouteName('otorisator.show'))
|
||||
<a href="{{ route('otorisator.show', ['id' => $permohonan->id, 'type' => 'Pelaporan']) }}"
|
||||
<a href="{{ route('otorisator.show', ['id' => $permohonan->id, 'type' => $paparan]) }}"
|
||||
class="btn btn-xs btn-info">
|
||||
<i class="ki-filled ki-exit-left"></i> Back
|
||||
</a>
|
||||
@@ -109,7 +130,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card ">
|
||||
<div class="card-header bg-agi-50">
|
||||
<h3 class="card-title uppercase">
|
||||
faktor
|
||||
@@ -119,10 +140,10 @@
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Faktor Positif</label>
|
||||
<div id="fakta-positif-container" class="flex flex-wrap items-baseline w-full">
|
||||
@if (!empty($resumeData['fakta']['fakta_positif']))
|
||||
@foreach ($resumeData['fakta']['fakta_positif'] as $index => $positif)
|
||||
@if (!empty($forminspeksi['fakta']['fakta_positif']))
|
||||
@foreach ($forminspeksi['fakta']['fakta_positif'] as $index => $positif)
|
||||
<div class="fakta_positif flex items-center gap-2 mt-2 textarea-group w-full">
|
||||
<textarea class="textarea mt-2" name="fakta_positif[]" rows="3">{{ old("fakta_positif.$index", $positif) }}</textarea>
|
||||
<textarea class="textarea mt-2" name="fakta_positif[]" rows="10">{{ old("fakta_positif.$index", $positif) }}</textarea>
|
||||
<button class="btn btn-danger btn-sm remove-btn" type="button"
|
||||
style="display: none;">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
@@ -131,7 +152,7 @@
|
||||
@endforeach
|
||||
@else
|
||||
<div class="fakta_positif flex items-center gap-2 mt-2 textarea-group w-full">
|
||||
<textarea class="textarea mt-2" name="fakta_positif[]" rows="3">{{ old('fakta_positif.0', '') }}</textarea>
|
||||
<textarea class="textarea mt-2" name="fakta_positif[]" rows="10">{{ old('fakta_positif.0', '') }}</textarea>
|
||||
<button class="btn btn-danger btn-sm remove-btn" type="button" style="display: none;">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</button>
|
||||
@@ -147,10 +168,10 @@
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Faktor Negatif</label>
|
||||
<div id="fakta-negatif-container" class="flex flex-wrap items-baseline w-full">
|
||||
@if (!empty($resumeData['fakta']['fakta_negatif']))
|
||||
@foreach ($resumeData['fakta']['fakta_negatif'] as $index => $negatif)
|
||||
@if (!empty($forminspeksi['fakta']['fakta_negatif']))
|
||||
@foreach ($forminspeksi['fakta']['fakta_negatif'] as $index => $negatif)
|
||||
<div class="fakta_negatif flex items-center gap-2 mt-2 textarea-group w-full">
|
||||
<textarea class="textarea mt-2" name="fakta_negatif[]" rows="3">{{ old("fakta_negatif.$index", $negatif) }}</textarea>
|
||||
<textarea class="textarea mt-2" name="fakta_negatif[]" rows="10">{{ old("fakta_negatif.$index", $negatif) }}</textarea>
|
||||
<button class="btn btn-danger btn-sm remove-btn" type="button"
|
||||
style="display: none;">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
@@ -159,7 +180,7 @@
|
||||
@endforeach
|
||||
@else
|
||||
<div class="fakta_negatif flex items-center gap-2 mt-2 textarea-group w-full">
|
||||
<textarea class="textarea mt-2" name="fakta_negatif[]" rows="3">{{ old('fakta_negatif.0', $resumeData['fakta']['fakta_negatif'][0] ?? '') }}</textarea>
|
||||
<textarea class="textarea mt-2" name="fakta_negatif[]" rows="10">{{ old('fakta_negatif.0', $forminspeksi['fakta']['fakta_negatif'][0] ?? '') }}</textarea>
|
||||
<button class="btn btn-danger btn-sm remove-btn" type="button" style="display: none;">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</button>
|
||||
@@ -176,7 +197,7 @@
|
||||
</div>
|
||||
|
||||
|
||||
<div class="card border border-agi-100 min-w-full">
|
||||
<div class="card border border-agi-100 min-w-full ">
|
||||
<div class="card-header bg-agi-50">
|
||||
<h3 class="card-title uppercase">
|
||||
KESIMPULAN NILAI PASAR WAJAR
|
||||
@@ -184,7 +205,7 @@
|
||||
</div>
|
||||
<div class="card-body grid gap-5">
|
||||
|
||||
<div class="gird gap-5">
|
||||
<div class="gird gap-5 ">
|
||||
<label class="form-label max-w-56">SESUAI FISIK</label>
|
||||
<div class="flex flex-wrap items-baseline w-full mt-5">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm">
|
||||
@@ -194,8 +215,7 @@
|
||||
<th class="text-center">Luas Tanah</th>
|
||||
<th class="text-center">Luas Bangunan</th>
|
||||
<th class="text-center">Nilai Pasar Wajar</th>
|
||||
<th class="text-center">Nilai Likuidasi(%)</th>
|
||||
<th class="text-center">Total Nilai Likuidasi</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
</thead>
|
||||
@@ -217,18 +237,9 @@
|
||||
<td class="text-center">
|
||||
<input type="text" name="fisik_nilai[]"
|
||||
class="input currency-format nilai-pasar"
|
||||
value="{{ $item['nilai'] }}" onkeyup="calculateTotal(this)">
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<input type="text" name="likuidasi[]" class="input likuidasi"
|
||||
value="{{ $item['likuidasi'] ?? 0 }}"
|
||||
onkeyup="calculateTotal(this)">
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<input type="text" name="total_nilai_likuidasi[]"
|
||||
class="input currency-format total-likuidasi"
|
||||
value="{{ $item['total_likuidasi'] ?? 0 }}" readonly>
|
||||
value="{{ $item['nilai'] }}">
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
@endforeach
|
||||
@else
|
||||
@@ -276,101 +287,9 @@
|
||||
class="input number-format" value="{{ $luas_bangunan }}"></td>
|
||||
<td class="text-center">
|
||||
<input type="text" name="fisik_nilai[]"
|
||||
class="input currency-format nilai-pasar"
|
||||
onkeyup="calculateTotal(this)">
|
||||
class="input currency-format nilai-pasar">
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<input type="text" name="likuidasi[]" class="input likuidasi"
|
||||
onkeyup="calculateTotal(this)">
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<input type="text" name="total_nilai_likuidasi[]"
|
||||
class="input currency-format total-likuidasi" readonly>
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="gird gap-5">
|
||||
<label class="form-label max-w-56">SESUAI IMB</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
|
||||
<table
|
||||
class="table table-auto table-border align-middle text-gray-700 font-medium text-sm mt-5">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">Sertipikat</th>
|
||||
<th class="text-center">Luas Tanah</th>
|
||||
<th class="text-center">Luas Bangunan</th>
|
||||
<th class="text-center">Nilai Pasar Wajar</th>
|
||||
<th class="text-center">Nilai Likuidasi (%)</th>
|
||||
<th class="text-center">Total Nilai Likuidasi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if (!empty($resumeData['fisik']))
|
||||
@foreach ($resumeData['fisik'] as $item)
|
||||
<tr>
|
||||
<td class="text-center">
|
||||
<input type="text" name="sesuai_sertifikat[]"
|
||||
class="input number-format" value="{{ $item['sertifikat'] }}">
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<input type="text" name="sesuai_luas_tanah[]"
|
||||
class="input number-format" value="{{ $item['luas_tanah'] }}">
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<input type="text" name="sesuai_luas_bangunan[]"
|
||||
class="input number-format" value="{{ $item['luas_bangunan'] }}">
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<input type="text" name="sesuai_nilai[]"
|
||||
class="input currency-format nilai-pasar"
|
||||
value="{{ $item['nilai'] }}" onkeyup="calculateTotal(this)">
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<input type="text" name="sesuai_likuidasi[]"
|
||||
class="input likuidasi" value="{{ $item['likuidasi'] ?? '' }}"
|
||||
onkeyup="calculateTotal(this)">
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<input type="text" name="sesuai_total_likuidasi[]"
|
||||
class="input currency-format total-likuidasi"
|
||||
value="{{ $item['total_likuidasi'] ?? 0 }}">
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@else
|
||||
<tr>
|
||||
<td class="text-center">
|
||||
<input type="text" name="sesuai_sertifikat[]"
|
||||
class="input number-format">
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<input type="text" name="sesuai_luas_tanah[]"
|
||||
class="input number-format">
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<input type="text" name="sesuai_luas_bangunan[]"
|
||||
class="input number-format">
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<input type="text" name="sesuai_nilai[]" class="input currency-format"
|
||||
onkeyup="calculateTotal(this)">
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<input type="text" name="sesuai_likuidasi[]" class="input likuidasi"
|
||||
value="{{ $item['likuidasi'] ?? 0 }}" onkeyup="calculateTotal(this)">
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<input type="text" name="sesuai_total_likuidasi[]"
|
||||
class="input currency-format total-likudasi"
|
||||
value="{{ $item['total_likuidasi'] ?? 0 }}">
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
</tbody>
|
||||
@@ -380,7 +299,7 @@
|
||||
|
||||
@if (!empty($resumeData['tambahan']))
|
||||
@foreach ($resumeData['tambahan'] as $counter => $item)
|
||||
<div id="kesimpulan" class="gird gap-5">
|
||||
<div id="kesimpulan" class="gird gap-5 ">
|
||||
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
|
||||
@@ -398,8 +317,7 @@
|
||||
<th class="text-center">Luas Tanah</th>
|
||||
<th class="text-center">Luas Bangunan</th>
|
||||
<th class="text-center">Nilai Pasar Wajar</th>
|
||||
<th class="text-center">Nilai Likuidasi (%)</th>
|
||||
<th class="text-center">Total Nilai Likuidasi</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
</thead>
|
||||
@@ -421,18 +339,9 @@
|
||||
<td class="text-center">
|
||||
<input type="text" name="tambahan_nilai[]"
|
||||
class="input currency-format nilai-pasar"
|
||||
value="{{ $item['nilai'] }}" onkeyup="calculateTotal(this)">
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<input type="text" name="tambahan_nilai_likuidasi[]"
|
||||
class="input likuidasi " value="{{ $item['likuidasi'] ?? 0 }}"
|
||||
onkeyup="calculateTotal(this)">
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<input type="text" name="tambahan_total_likuidasi[]"
|
||||
class="input currency-format total-likuidasi"
|
||||
value="{{ $item['total_likuidasi'] ?? 0 }}">
|
||||
value="{{ $item['nilai'] }}">
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
@@ -441,8 +350,8 @@
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
<div id="kesimpulans" class="grid gap-5 w-full"></div>
|
||||
<div>
|
||||
<div id="kesimpulan" class="grid gap-5 w-full"></div>
|
||||
<div class="">
|
||||
<button type="button" class="btn btn-primary btn-sm mt-5" onclick="tambahKesimpulanNilai()">
|
||||
<i class="ki-outline ki-plus"></i>
|
||||
Kesimpulan Nilai
|
||||
@@ -450,13 +359,37 @@
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5" style="margin-top: 20px">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 " style="margin-top: 20px ">
|
||||
|
||||
<label class="form-label lg:form-label max-w-56 ">Catatan yang Perlu Diperhatikan
|
||||
</label>
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<textarea name="keterangan" class="textarea mt-2" placeholder="Masukkan catatan penting" rows="3">{{ old('keterangan', $resumeData['keterangan'] ?? '') }}</textarea>
|
||||
<div class="w-full">
|
||||
<div id="keterangan-container" class="flex items-baseline flex-wrap gap-2.5 w-full">
|
||||
@if (!empty($forminspeksi['fakta']['keterangan']) && is_array($forminspeksi['fakta']['keterangan']))
|
||||
@foreach ($forminspeksi['fakta']['keterangan'] as $index => $item)
|
||||
<div class="keterangan flex items-center gap-2 mt-2 textarea-group w-full">
|
||||
<textarea name="keterangan[]" class="textarea mt-2" placeholder="Masukkan catatan penting" rows="10">{{ old("keterangan.$index", $item) }}</textarea>
|
||||
<button class="btn btn-danger btn-sm remove-btn" type="button"
|
||||
style="display: none;">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
@endforeach
|
||||
@else
|
||||
<div class="keterangan flex items-center gap-2 mt-2 textarea-group w-full">
|
||||
<textarea name="keterangan[]" class="textarea mt-2" placeholder="Masukkan catatan penting" rows="10"></textarea>
|
||||
<button class="btn btn-danger btn-sm remove-btn" type="button"
|
||||
style="display: none;">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</button>
|
||||
<em id="error-keterangan" class="alert text-danger text-sm"></em>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
<button type="button" onclick="addClonableItem('keterangan-container', 'keterangan')"
|
||||
class="btn btn-primary btn-sm mt-5 ">
|
||||
<i class="ki-outline ki-plus"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5" style="margin-top: 20px">
|
||||
@@ -482,16 +415,20 @@
|
||||
YANG BERLAKU, APABILA LEWAT MAKA HARUS DILAKUKAN ORDER ULANG SESUAI PROSEDUR YANG
|
||||
BERLAKU
|
||||
</li>
|
||||
<li>Apabila sudah melewati 6 bulan, maka harus penilaian ulang kembali
|
||||
<li class="uppercase">Apabila sudah melewati 6 bulan, maka harus penilaian ulang kembali
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex card-footer justify-end gap-5">
|
||||
|
||||
@if (Auth::user()->hasAnyRole(['senior-officer', 'surveyor', 'administrator']))
|
||||
<button type="button" class="btn btn-primary" onclick="saveResume()">
|
||||
<i class="ki-filled ki-save-2"></i>
|
||||
Save</button>
|
||||
@endif
|
||||
|
||||
@if (Auth::user()->hasAnyRole(['senior-officer', 'EO Appraisal', 'DD Appraisal', 'administrator']))
|
||||
<a class="btn btn-info"
|
||||
href="{{ route('penilai.lampiran') }}?permohonanId={{ request('permohonanId') }}&documentId={{ request('documentId') }}&inspeksiId={{ request('inspeksiId') }}&jaminanId={{ request('jaminanId') }}&statusLpj=1">
|
||||
@@ -519,7 +456,7 @@
|
||||
let counter = 3;
|
||||
|
||||
function tambahKesimpulanNilai() {
|
||||
const kesimpulan = document.getElementById('kesimpulans');
|
||||
const kesimpulan = document.getElementById('kesimpulan');
|
||||
|
||||
kesimpulan.innerHTML += `
|
||||
<div class="grid gap-5 w-full mt-5" id="kesimpulan-${counter}">
|
||||
@@ -541,8 +478,7 @@
|
||||
<th class="text-center">Luas Tanah</th>
|
||||
<th class="text-center">Luas Bangunan</th>
|
||||
<th class="text-center">Nilai Pasar Wajar</th>
|
||||
<th class="text-center">Nilai Likuidasi (%)</th>
|
||||
<th class="text-center">Total Nilai Likuidasi</th>
|
||||
|
||||
<th class="text-center">Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -564,15 +500,8 @@
|
||||
<input type="text" name="tambahan_nilai[]"
|
||||
class="input currency-format nilai-pasar">
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<input type="text" name="tambahan_nilai_likuidasi[]"
|
||||
class="input likuidasi"
|
||||
onkeyup="calculateTotal(this)">
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<input type="text" name="tambahan_total_likuidasi[]"
|
||||
class="input currency-format total-likuidasi" >
|
||||
</td>
|
||||
|
||||
|
||||
<td class="text-center">
|
||||
<button type="button" class="btn btn-danger" onclick="deleteRow(this)">Delete</button>
|
||||
</td>
|
||||
@@ -617,12 +546,29 @@
|
||||
|
||||
const formElement = document.querySelector('form');
|
||||
const jsonData = formToJson(formElement);
|
||||
console.log('Data dalam format JSON:', JSON.stringify(formElement, null, 2));
|
||||
console.log('Data dalam format JSON:', JSON.stringify(jsonData, null, 2));
|
||||
|
||||
const urlParams = new URLSearchParams(window.location.search); // Mengambil query parameters dari URL
|
||||
const permohonanId = urlParams.get('permohonanId');
|
||||
const documentId = urlParams.get('documentId');
|
||||
const inspeksiId = urlParams.get('inspeksiId');
|
||||
const faktaPositif = Array.from(document.querySelectorAll('[name="fakta_positif[]"]'))
|
||||
.map(textarea => textarea.value.trim())
|
||||
.filter(value => value !== '');
|
||||
|
||||
const faktaNegatif = Array.from(document.querySelectorAll('[name="fakta_negatif[]"]'))
|
||||
.map(textarea => textarea.value.trim())
|
||||
.filter(value => value !== '');
|
||||
const keterangan = Array.from(document.querySelectorAll('[name="keterangan[]"]'))
|
||||
.map(textarea => textarea.value.trim())
|
||||
.filter(value => value !== '');
|
||||
|
||||
const action = Array.from(document.querySelectorAll('input[name="action"]'))
|
||||
.map(input => input.value)
|
||||
.join(',') || "";
|
||||
const type = Array.from(document.querySelectorAll('input[name="type"]'))
|
||||
.map(input => input.value)
|
||||
.join(',') || "";
|
||||
|
||||
const requestUrl =
|
||||
`{{ route('penilai.storeResume') }}`;
|
||||
@@ -633,9 +579,15 @@
|
||||
type: 'POST',
|
||||
data: JSON.stringify({
|
||||
permohonan_id: permohonanId,
|
||||
document_id: documentId,
|
||||
dokument_id: documentId,
|
||||
inspeksi_id: inspeksiId,
|
||||
resume: jsonData,
|
||||
fakta_positif: faktaPositif,
|
||||
fakta_negatif: faktaNegatif,
|
||||
action: action,
|
||||
type: type,
|
||||
keterangan: keterangan
|
||||
|
||||
}),
|
||||
contentType: 'application/json',
|
||||
|
||||
@@ -687,58 +639,25 @@
|
||||
const formData = new FormData(formElement);
|
||||
const jsonData = {
|
||||
tanggal_resume: "",
|
||||
fakta: {
|
||||
fakta_positif: [],
|
||||
fakta_negatif: []
|
||||
},
|
||||
fisik: [],
|
||||
sesuai_imb: [],
|
||||
tambahan: [],
|
||||
keterangan: ""
|
||||
tambahan: []
|
||||
};
|
||||
|
||||
|
||||
// Ambil fakta positif
|
||||
document.querySelectorAll('textarea[name="fakta_positif[]"]').forEach(textarea => {
|
||||
jsonData.fakta.fakta_positif.push(textarea.value);
|
||||
});
|
||||
|
||||
// Ambil fakta negatif
|
||||
document.querySelectorAll('textarea[name="fakta_negatif[]"]').forEach(textarea => {
|
||||
jsonData.fakta.fakta_negatif.push(textarea.value);
|
||||
});
|
||||
|
||||
// Ambil data fisik
|
||||
document.querySelectorAll('table tbody tr').forEach(row => {
|
||||
const fisikData = {
|
||||
sertifikat: row.querySelector('input[name="fisik_sertifikat[]"]')?.value || "",
|
||||
luas_tanah: row.querySelector('input[name="fisik_luas_tanah[]"]')?.value || "",
|
||||
luas_bangunan: row.querySelector('input[name="fisik_luas_bangunan[]"]')?.value || "",
|
||||
nilai: cleanCurrencyValue(row.querySelector('input[name="fisik_nilai[]"]')?.value || ""),
|
||||
likuidasi: row.querySelector('input[name="likuidasi[]"]')?.value || "",
|
||||
total_likuidasi: cleanCurrencyValue(row.querySelector(
|
||||
'input[name="total_nilai_likuidasi[]"]')?.value || "")
|
||||
nilai: cleanCurrencyValue(row.querySelector('input[name="fisik_nilai[]"]')?.value || "")
|
||||
};
|
||||
if (fisikData.sertifikat) {
|
||||
jsonData.fisik.push(fisikData);
|
||||
}
|
||||
});
|
||||
|
||||
// Ambil data sesuai IMB
|
||||
document.querySelectorAll('table tbody tr').forEach(row => {
|
||||
const imbData = {
|
||||
sertifikat: row.querySelector('input[name="sesuai_sertifikat[]"]')?.value || "",
|
||||
luas_tanah: row.querySelector('input[name="sesuai_luas_tanah[]"]')?.value || "",
|
||||
luas_bangunan: row.querySelector('input[name="sesuai_luas_bangunan[]"]')?.value || "",
|
||||
nilai: cleanCurrencyValue(row.querySelector('input[name="sesuai_nilai[]"]')?.value || ""),
|
||||
likuidasi: row.querySelector('input[name="sesuai_likuidasi[]"]')?.value || "",
|
||||
total_likuidasi: cleanCurrencyValue(row.querySelector(
|
||||
'input[name="sesuai_total_likuidasi[]"]')?.value || "")
|
||||
};
|
||||
if (imbData.sertifikat) {
|
||||
jsonData.sesuai_imb.push(imbData);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
document.querySelectorAll('#kesimpulan > div').forEach(row => {
|
||||
const imbData = {
|
||||
@@ -747,10 +666,7 @@
|
||||
sertifikat: row.querySelector('input[name="tambahan_sertifikat[]"]')?.value || "",
|
||||
luas_tanah: row.querySelector('input[name="tambahan_luas_tanah[]"]')?.value || "",
|
||||
luas_bangunan: row.querySelector('input[name="tambahan_luas_bangunan[]"]')?.value || "",
|
||||
nilai: cleanCurrencyValue(row.querySelector('input[name="tambahan_nilai[]"]')?.value || ""),
|
||||
likuidasi: row.querySelector('input[name="tambahan_nilai_likuidasi[]"]')?.value || "",
|
||||
total_likuidasi: cleanCurrencyValue(row.querySelector(
|
||||
'input[name="tambahan_total_likuidasi[]"]')?.value || "")
|
||||
nilai: cleanCurrencyValue(row.querySelector('input[name="tambahan_nilai[]"]')?.value || "")
|
||||
};
|
||||
console.log(imbData);
|
||||
if (imbData.sertifikat) {
|
||||
@@ -758,10 +674,6 @@
|
||||
}
|
||||
});
|
||||
|
||||
// Ambil keterangan
|
||||
const keterangan = formElement.querySelector('textarea[name="keterangan"]')?.value || "";
|
||||
jsonData.keterangan = keterangan;
|
||||
|
||||
const tanggal_resume = formElement.querySelector('input[name="tanggal_resume"]')?.value || "";
|
||||
jsonData.tanggal_resume = tanggal_resume;
|
||||
|
||||
@@ -781,40 +693,4 @@
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
function calculateTotal(element) {
|
||||
|
||||
|
||||
const row = element.closest('tr');
|
||||
|
||||
const nilaiPasarInput = row.querySelector('.nilai-pasar');
|
||||
let likuidasiInput = row.querySelector('.likuidasi');
|
||||
|
||||
const totalLikuidasiInput = row.querySelector('.total-likuidasi');
|
||||
|
||||
const cleanNilaiPasar = cleanCurrencyValue(nilaiPasarInput.value);
|
||||
let cleanLikuidasi = cleanCurrencyValue(likuidasiInput.value);
|
||||
|
||||
// Batasi likuidasi maksimal hingga 100
|
||||
cleanLikuidasi = Math.min(parseFloat(cleanLikuidasi) || 0, 100);
|
||||
|
||||
// Format nilai likuidasi dengan simbol %
|
||||
likuidasiInput.value = cleanLikuidasi;
|
||||
|
||||
// Konversi ke angka untuk perhitungan
|
||||
const nilaiPasar = parseFloat(cleanNilaiPasar) || 0;
|
||||
const likuidasi = cleanLikuidasi / 100; // Konversi persentase ke desimal
|
||||
|
||||
// Hitung total likuidasi
|
||||
const totalLikuidasi = nilaiPasar * likuidasi;
|
||||
|
||||
// Tampilkan hasil dengan format yang benar
|
||||
totalLikuidasiInput.value = formatCurrency(totalLikuidasi.toString());
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
@@ -191,7 +191,7 @@
|
||||
actions: {
|
||||
title: 'Action',
|
||||
render: (item, data) => {
|
||||
if (data.status === 'survey-completed' || data.status === 'proses-laporan' || data.status === 'paparan' || data.status === 'proses-paparan' || data.status === 'paparan') {
|
||||
if (data.status === 'survey-completed' || data.status === 'proses-laporan' || data.status === 'paparan' || data.status === 'proses-paparan' || data.status === 'paparan' || data.status == 'revisi-laporan' || data.status === 'done') {
|
||||
return `
|
||||
<div class="flex flex-nowrap justify-center gap-1.5">
|
||||
<a class="btn btn-sm btn-outline btn-info" href="penilai/${data.id}/show">
|
||||
|
||||
@@ -38,14 +38,14 @@
|
||||
<div class="card-body ">
|
||||
<div class="w-full grid gap-5 ">
|
||||
<!-- Preview Container -->
|
||||
<div class="preview-container-{{ $index }}">
|
||||
<div class="preview-container-{{ $index }}" class="flex items-center">
|
||||
@if (isset($denah['foto_denah']))
|
||||
@php
|
||||
$fileExtension = pathinfo($denah['foto_denah'], PATHINFO_EXTENSION);
|
||||
@endphp
|
||||
|
||||
@if (in_array($fileExtension, ['jpg', 'jpeg', 'png']))
|
||||
<img src="{{ asset('storage/' . $denah['foto_denah']) }}" style="max-width: 30rem;">
|
||||
<img src="{{ asset('storage/' . $denah['foto_denah']) }}" class="max-w-full max-h-screen object-contain">
|
||||
@elseif($fileExtension === 'pdf')
|
||||
<embed src="{{ asset('storage/' . $denah['foto_denah']) }}" type="application/pdf"
|
||||
width="100%" height="500px">
|
||||
@@ -82,6 +82,7 @@
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($penilai && $penilai->kertas_kerja)
|
||||
<div class="card">
|
||||
<div class="card-header bg-agi-50 uppercase">
|
||||
Kertas Kerja
|
||||
@@ -108,5 +109,6 @@
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<h3 class="card-title">
|
||||
Detail Penilai
|
||||
Detail Penilaian
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('penilai.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i>
|
||||
@@ -188,6 +188,21 @@
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if ($permohonan->status == 'revisi-laporan')
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
Catatan Revisi
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<p class="flex w-full text-gray-600 font-medium text-sm">
|
||||
{{ $permohonan->keterangan ?? '' }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endif
|
||||
|
||||
</div>
|
||||
@php
|
||||
$inspeksiId = null;
|
||||
@@ -316,7 +331,6 @@
|
||||
PRINT OUT
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@@ -324,7 +338,14 @@
|
||||
<a class="btn btn-success" onclick="savePenilai()">
|
||||
REPORT
|
||||
</a>
|
||||
<a class="btn btn-warning" onclick="revisiSurveyor('{{ $permohonan->id }}', '{{$permohonan->debiture->name }}', '{{$permohonan->nomor_registrasi }}')">
|
||||
REVISI
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -626,6 +647,55 @@
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function revisiSurveyor(dataId, debitur, noreg) {
|
||||
|
||||
Swal.fire({
|
||||
title: 'Apakah Anda yakin?',
|
||||
text: `Untuk melakukan Revisi nomor registrasi ${noreg} atas nama debiture ${debitur} !`,
|
||||
icon: 'warning',
|
||||
input: 'textarea',
|
||||
inputLabel: 'Keterangan',
|
||||
inputPlaceholder: 'Masukkan keterangan...',
|
||||
inputAttributes: {
|
||||
'aria-label': 'Masukkan keterangan'
|
||||
},
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Ya, Lanjutkan!',
|
||||
cancelButtonText: 'Batal',
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
const userMessage = result.value || '';
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
},
|
||||
});
|
||||
$.ajax({
|
||||
url: `/penilai/revisi-surveyor/${dataId}`,
|
||||
type: 'PUT',
|
||||
data: {
|
||||
message: userMessage
|
||||
},
|
||||
success: (response) => {
|
||||
Swal.fire('Berhasil!', response.message , 'success').then(
|
||||
() => {
|
||||
window.location.href =
|
||||
'{{ route('penilai.index') }}';
|
||||
});
|
||||
console.log(response);
|
||||
},
|
||||
error: (error) => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire('Gagal!', 'Terjadi kesalahan saat melakukan Revisi.',
|
||||
'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
@include('lpj::surveyor.js.utils')
|
||||
|
||||
@@ -6,35 +6,50 @@
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="min-w-full card-grid" data-datatable="false" data-datatable-page-size="10"
|
||||
data-datatable-state-save="false" id="permohonan-table"
|
||||
data-api-url="{{ route('otorisator.datatables', ['otorisator' => $header]) }}">
|
||||
<div class="flex-wrap py-5 card-header bg-agi-50">
|
||||
<h3 class="card-title">
|
||||
Daftar {{ $header }}
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 lg:gap-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="permohonan-table"
|
||||
data-api-url="{{ route('otorisator.datatables', ['otorisator' => $header]) }}">
|
||||
<div class="flex-wrap py-5 card-header bg-agi-50">
|
||||
<h3 class="card-title">
|
||||
Daftar {{ $header }}
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
<div class="flex">
|
||||
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
|
||||
<input placeholder="Search Penilaian" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
|
||||
@if ($header == 'Pelaporan')
|
||||
<div class="flex">
|
||||
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
|
||||
<input placeholder="Search Penilaian" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2.5">
|
||||
<div class="h-[24px] border border-r-gray-200"></div>
|
||||
<a class="btn btn-sm btn-light" href="{{ route('permohonan.export') }}"> Export to Excel </a>
|
||||
<select class="select select-sm w-28" id="region">
|
||||
<option value="">
|
||||
Pilih Region
|
||||
</option>
|
||||
@foreach ($regions as $region)
|
||||
<option value="{{ $region->name }}">
|
||||
{{ $region->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="flex flex-wrap gap-2.5">
|
||||
<div class="h-[24px] border border-r-gray-200"></div>
|
||||
<a class="btn btn-sm btn-light" href="{{ route('permohonan.export') }}"> Export to Excel </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table text-sm font-medium text-gray-700 align-middle table-auto table-border"
|
||||
data-datatable-table="true">
|
||||
<thead>
|
||||
<div class="card-body">
|
||||
<div class="scrollable-x-auto">
|
||||
<table class="table table-auto table-border align-middle text-gray-700 font-medium text-sm"
|
||||
data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<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" />
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nomor_registrasi">
|
||||
<span class="sort"> <span class="sort-label"> Nomor Registrasi </span>
|
||||
@@ -93,20 +108,19 @@
|
||||
|
||||
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div
|
||||
class="flex-col justify-center gap-3 font-medium text-gray-600 card-footer md:justify-between md:flex-row text-2sm">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="w-16 select select-sm" data-datatable-size="true" name="perpage"> </select> per
|
||||
page
|
||||
</div>
|
||||
<div
|
||||
class="flex-col justify-center gap-3 font-medium text-gray-600 card-footer md:justify-between md:flex-row text-2sm">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="w-16 select select-sm" data-datatable-size="true" name="perpage"> </select> per
|
||||
page
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<span data-datatable-info="true"> </span>
|
||||
<div class="pagination" data-datatable-pagination="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -208,7 +222,7 @@
|
||||
penilai: {
|
||||
title: 'Penilai',
|
||||
render: (item, data) => {
|
||||
if(data.penilaian.user_penilai[0]){
|
||||
if (data.penilaian.user_penilai[0]) {
|
||||
console.log(data.penilaian.user_penilai[0]);
|
||||
return `${data.penilaian.user_penilai[0].user.name} | ${data.penilaian.user_penilai[0].team.name} | ${data.penilaian.user_penilai[0].team.regions.name}`;
|
||||
}
|
||||
@@ -219,7 +233,7 @@
|
||||
jenis_laporan: {
|
||||
title: 'Jenis laporan',
|
||||
render: (item, data) => {
|
||||
if(data.penilai.type_penilai){
|
||||
if (data.penilai.type_penilai) {
|
||||
return `<span class="text-md font-bold capitalize">${data.penilai.type_penilai}</span>`;
|
||||
}
|
||||
return '';
|
||||
@@ -240,7 +254,7 @@
|
||||
approval_so: {
|
||||
title: 'Approval SO',
|
||||
render: (item, data) => {
|
||||
if(data.approve_so) {
|
||||
if (data.approve_so) {
|
||||
return `${data.approve_so.name} | ${window.formatTanggalIndonesia(data.approval_so_at)}`;
|
||||
}
|
||||
return '';
|
||||
@@ -249,7 +263,7 @@
|
||||
approval_eo: {
|
||||
title: 'Approval EO',
|
||||
render: (item, data) => {
|
||||
if(data.approve_eo) {
|
||||
if (data.approve_eo) {
|
||||
return `${data.approve_eo.name} | ${window.formatTanggalIndonesia(data.approval_eo_at)}`;
|
||||
}
|
||||
return '';
|
||||
@@ -258,7 +272,7 @@
|
||||
approval_dd: {
|
||||
title: 'Approval DD',
|
||||
render: (item, data) => {
|
||||
if(data.approve_dd) {
|
||||
if (data.approve_dd) {
|
||||
return `${data.approve_dd.name} | ${window.formatTanggalIndonesia(data.approval_dd_at)}`;
|
||||
}
|
||||
return '';
|
||||
@@ -285,11 +299,17 @@
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
// Custom search functionality
|
||||
searchInput.addEventListener('input', function () {
|
||||
searchInput.addEventListener('input', function() {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
|
||||
});
|
||||
|
||||
const regionSelect = document.getElementById('region');
|
||||
regionSelect.addEventListener('change', function() {
|
||||
const selectedRegion = this.value;
|
||||
dataTable.search(selectedRegion, true);
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
@@ -325,7 +345,9 @@
|
||||
message: userMessage // Kirim pesan sebagai bagian dari data
|
||||
},
|
||||
success: (response) => {
|
||||
Swal.fire('Berhasil!', 'Data berhasil diotorisasi. Menunggu Approval EO dan atau DD', 'success').then(() => {
|
||||
Swal.fire('Berhasil!',
|
||||
'Data berhasil diotorisasi. Menunggu Approval EO dan atau DD',
|
||||
'success').then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
console.log(response);
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
@if (in_array($permohonan->nilai_plafond_id, [1,2, 4]) && $permohonan->approval_dd != null)
|
||||
@if (in_array($permohonan->nilai_plafond_id, [1, 2, 4]) && $permohonan->approval_dd != null)
|
||||
<tr>
|
||||
<td>Disetujui Oleh (DD)</td>
|
||||
<td>{{ getUser($permohonan->approval_dd)->name ?? 'N/A' }}</td>
|
||||
@@ -134,14 +134,12 @@
|
||||
<i class="ki-filled ki-double-check"></i>
|
||||
Otorisator {{ $header ?? '' }}
|
||||
</button>
|
||||
<button class="btn btn-warning" onclick="revisiLaporan({{ $permohonan->id }})">
|
||||
<i class="ki-filled ki-arrow-circle-right"></i> Revisi
|
||||
</button>
|
||||
@endif
|
||||
|
||||
@if (Auth::user()->hasAnyRole(['administrator', 'EO Appraisal']) &&
|
||||
$permohonan->approval_so &&
|
||||
$permohonan->approval_eo == null)
|
||||
$permohonan->approval_eo == null &&
|
||||
in_array($permohonan->nilai_plafond_id, [1, 2]))
|
||||
<button onclick="otorisatorData({{ $permohonan->id }})" type="button" class="btn btn-primary">
|
||||
<i class="ki-filled ki-double-check"></i>
|
||||
Otorisator {{ $header ?? '' }}
|
||||
@@ -157,24 +155,45 @@
|
||||
Otorisator {{ $header ?? '' }}
|
||||
</button>
|
||||
@endif
|
||||
|
||||
@elseif($dataHeader == 'paparan')
|
||||
@if($permohonan->penilai->file_paparan)
|
||||
<span class="btn btn-success"
|
||||
onclick="viewPDF('{{ Storage::url($permohonan->penilai->file_paparan) }}')"><i
|
||||
@if ($permohonan->penilai->file_paparan)
|
||||
<span class="btn btn-success btn-outline"
|
||||
onclick="viewPDF('{{ Storage::url($permohonan->penilai->file_paparan) }}')"><i
|
||||
class="ki-filled ki-eye mr-2"></i>Lihat Data Paparan</span>
|
||||
@endif
|
||||
@if(Auth::user()->hasAnyRole(['administrator','senior-officer']) && $authorization->approve_so==null)
|
||||
<button onclick="otorisatorData({{ $authorization->id }},'SO')" type="button" class="btn btn-primary">
|
||||
|
||||
@if ($permohonan->penilai->kertas_kerja)
|
||||
<span class="btn btn-warning btn-outline"
|
||||
onclick="viewPDF('{{ Storage::url($permohonan->penilai->kertas_kerja) }}')"><i
|
||||
class="ki-filled ki-eye mr-2"></i>Lihat Kertas Kerja</span>
|
||||
@endif
|
||||
|
||||
|
||||
<a class="btn btn-success"
|
||||
href="{{ route('otorisator.view-laporan') }}?permohonanId={{ $permohonan->id }}&documentId={{ $documentId }}&inspeksiId={{ $inspeksiId }}&jaminanId={{ $jenisJaminanId }}&statusLpj={{ true }}">
|
||||
Lihat resume
|
||||
</a>
|
||||
|
||||
|
||||
@if (Auth::user()->hasAnyRole(['administrator', 'senior-officer']) && $authorization->approve_so == null)
|
||||
<button onclick="otorisatorData({{ $authorization->id }},'SO')" type="button"
|
||||
class="btn btn-primary">
|
||||
<i class="ki-filled ki-double-check"></i>
|
||||
Otorisator {{ $header ?? '' }}
|
||||
</button>
|
||||
@endif
|
||||
|
||||
@if(Auth::user()->hasAnyRole(['administrator', 'DD Appraisal']) &&
|
||||
$authorization->approve_so &&
|
||||
$authorization->approve_dd == null)
|
||||
<button onclick="otorisatorData({{ $authorization->id }},'DD')" type="button" class="btn btn-primary">
|
||||
@if (Auth::user()->hasAnyRole(['administrator', 'EO Appraisal']) && $authorization->approve_eo == null)
|
||||
<button onclick="otorisatorData({{ $authorization->id }},'EO')" type="button"
|
||||
class="btn btn-primary">
|
||||
<i class="ki-filled ki-double-check"></i>
|
||||
Otorisator {{ $header ?? '' }}
|
||||
</button>
|
||||
@endif
|
||||
|
||||
@if (Auth::user()->hasAnyRole(['administrator', 'DD Appraisal']) && $authorization->approve_dd == null)
|
||||
<button onclick="otorisatorData({{ $authorization->id }},'DD')" type="button"
|
||||
class="btn btn-primary">
|
||||
<i class="ki-filled ki-double-check"></i>
|
||||
Otorisator {{ $header ?? '' }}
|
||||
</button>
|
||||
@@ -187,210 +206,143 @@
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
function otorisatorData(dataId, role='') {
|
||||
const dataHeader = @json($header);
|
||||
if(dataHeader == 'Paparan'){
|
||||
if(role == 'SO'){
|
||||
Swal.fire({
|
||||
title: 'Apakah Anda yakin?',
|
||||
text: `Untuk melakukan otorisator ${dataHeader}!`,
|
||||
icon: 'warning',
|
||||
html: `
|
||||
<input id="swal-keterangan" class="swal2-input input" placeholder="Keterangan">
|
||||
<input id="swal-tanggal-paparan" class="swal2-input input" type="date" placeholder="Tanggal paparan">
|
||||
`,
|
||||
focusConfirm: false,
|
||||
preConfirm: () => {
|
||||
const keterangan = document.getElementById('swal-keterangan').value;
|
||||
const tanggalPaparan = document.getElementById('swal-tanggal-paparan').value;
|
||||
|
||||
if (!keterangan || !tanggalPaparan) {
|
||||
Swal.showValidationMessage('Keterangan atau Tanggal Paparan Harus diisi!');
|
||||
return false;
|
||||
}
|
||||
|
||||
return { keterangan, tanggalPaparan };
|
||||
},
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Ya, Lanjutkan!',
|
||||
cancelButtonText: 'Batal',
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
const keterangan = result.value.keterangan || '';
|
||||
const tanggalPaparan = result.value.tanggalPaparan || '';
|
||||
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
},
|
||||
});
|
||||
$.ajax({
|
||||
url: `/otorisator/otorisator/${dataId}/${dataHeader}`,
|
||||
type: 'POST',
|
||||
data: {
|
||||
message: keterangan,
|
||||
tanggalPaparan: tanggalPaparan
|
||||
},
|
||||
success: (response) => {
|
||||
Swal.fire('Berhasil!',
|
||||
'Data berhasil diotorisasi.',
|
||||
'success').then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
console.log(response);
|
||||
},
|
||||
error: (error) => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire('Gagal!', 'Terjadi kesalahan saat melakukan otorisator.',
|
||||
'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}else{
|
||||
Swal.fire({
|
||||
title: 'Apakah Yakin?',
|
||||
text: `Pastikan bahwa paparan sudah dilakukan!`,
|
||||
icon: 'warning',
|
||||
input: 'textarea',
|
||||
inputLabel: 'Keterangan',
|
||||
inputPlaceholder: 'Masukkan keterangan...',
|
||||
inputAttributes: {
|
||||
'aria-label': 'Masukkan keterangan'
|
||||
},
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Ya, Lanjutkan!',
|
||||
cancelButtonText: 'Batal',
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
const userMessage = result.value || ''; // Ambil pesan dari textarea
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
},
|
||||
});
|
||||
$.ajax({
|
||||
url: `/otorisator/otorisator/${dataId}/${dataHeader}`,
|
||||
type: 'POST',
|
||||
data: {
|
||||
message: userMessage
|
||||
},
|
||||
success: (response) => {
|
||||
Swal.fire('Berhasil!',
|
||||
'Data berhasil diotorisasi',
|
||||
'success').then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
console.log(response);
|
||||
},
|
||||
error: (error) => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire('Gagal!', 'Terjadi kesalahan saat melakukan otorisator.',
|
||||
'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}else{
|
||||
Swal.fire({
|
||||
title: 'Apakah Anda yakin?',
|
||||
text: `Untuk melakukan otorisator ${dataHeader}!`,
|
||||
icon: 'warning',
|
||||
input: 'textarea',
|
||||
inputLabel: 'Keterangan',
|
||||
inputPlaceholder: 'Masukkan keterangan...',
|
||||
inputAttributes: {
|
||||
'aria-label': 'Masukkan keterangan'
|
||||
},
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Ya, Lanjutkan!',
|
||||
cancelButtonText: 'Batal',
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
const userMessage = result.value || ''; // Ambil pesan dari textarea
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
},
|
||||
});
|
||||
$.ajax({
|
||||
url: `/otorisator/otorisator/${dataId}/${dataHeader}`,
|
||||
type: 'POST',
|
||||
data: {
|
||||
message: userMessage
|
||||
},
|
||||
success: (response) => {
|
||||
Swal.fire('Berhasil!',
|
||||
'Data berhasil diotorisasi. Menunggu Approval EO dan atau DD',
|
||||
'success').then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
console.log(response);
|
||||
},
|
||||
error: (error) => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire('Gagal!', 'Terjadi kesalahan saat melakukan otorisator.',
|
||||
'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function revisiLaporan(dataId) {
|
||||
const dataHeader = @json($header);
|
||||
const handleRejection = (dataId) => {
|
||||
Swal.fire({
|
||||
title: 'Apakah Anda yakin?',
|
||||
text: `Untuk melakukan Revisi ${dataHeader}!`,
|
||||
icon: 'warning',
|
||||
title: 'Masukkan alasan penolakan:',
|
||||
input: 'textarea',
|
||||
inputLabel: 'Keterangan',
|
||||
inputPlaceholder: 'Masukkan keterangan...',
|
||||
inputAttributes: {
|
||||
'aria-label': 'Masukkan keterangan'
|
||||
},
|
||||
inputPlaceholder: 'Tuliskan alasan...',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#f39c12',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Kirim',
|
||||
cancelButtonText: 'Batal',
|
||||
preConfirm: (alasan) => {
|
||||
if (!alasan) {
|
||||
Swal.showValidationMessage('Alasan harus diisi!');
|
||||
return false;
|
||||
}
|
||||
return alasan;
|
||||
}
|
||||
}).then((rejectResult) => {
|
||||
if (rejectResult.isConfirmed) {
|
||||
handleAjaxRequest(
|
||||
`/otorisator/revisi/${dataId}`, {
|
||||
message: rejectResult.value
|
||||
},
|
||||
'Data berhasil ditolak.',
|
||||
'Terjadi kesalahan saat melakukan penolakan.'
|
||||
);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const showSwalConfirmation = (
|
||||
title, text, html, confirmText, denyText, cancelText, preConfirm, icon = 'question'
|
||||
) => {
|
||||
return Swal.fire({
|
||||
title: title,
|
||||
text: text,
|
||||
html: html,
|
||||
icon: icon,
|
||||
focusConfirm: false,
|
||||
preConfirm: preConfirm,
|
||||
showCancelButton: true,
|
||||
showDenyButton: !!denyText,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Ya, Lanjutkan!',
|
||||
cancelButtonText: 'Batal',
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
const userMessage = result.value || '';
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
},
|
||||
denyButtonColor: '#f39c12',
|
||||
confirmButtonText: confirmText,
|
||||
denyButtonText: denyText,
|
||||
cancelButtonText: cancelText,
|
||||
});
|
||||
};
|
||||
|
||||
const handleAjaxRequest = (url, data, successMessage, errorMessage) => {
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
},
|
||||
});
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'POST',
|
||||
data: data,
|
||||
success: () => {
|
||||
Swal.fire('Berhasil!', successMessage, 'success').then(() => {
|
||||
const dataHeader = @json($header);
|
||||
const redirectUrl = `/otorisator/${dataHeader.toLowerCase()}`;
|
||||
window.location.href = redirectUrl;
|
||||
});
|
||||
$.ajax({
|
||||
url: `/otorisator/revisi/${dataId}`,
|
||||
type: 'POST',
|
||||
data: {
|
||||
message: userMessage
|
||||
},
|
||||
success: (response) => {
|
||||
Swal.fire('Berhasil!', 'Data berhasil Revisi Laporan', 'success').then(
|
||||
() => {
|
||||
window.location.href =
|
||||
'{{ route('otorisator.pelaporan.index') }}';
|
||||
});
|
||||
console.log(response);
|
||||
},
|
||||
error: (error) => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire('Gagal!', 'Terjadi kesalahan saat melakukan Revisi.',
|
||||
'error');
|
||||
},
|
||||
error: (error) => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire('Gagal!', errorMessage, 'error');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function otorisatorData(dataId, role = '') {
|
||||
const dataHeader = @json($header);
|
||||
const isPaparanSO = dataHeader === 'Paparan' && role === 'SO';
|
||||
|
||||
const swalHtml = isPaparanSO ? `
|
||||
<div class="text-left space-y-4">
|
||||
<p class="text-gray-700 text-center">Untuk melakukan otorisasi ${dataHeader}!</p>
|
||||
<div>
|
||||
<label for="swal-keterangan" class="block text-sm font-medium text-gray-700 mb-1">Keterangan</label>
|
||||
<input id="swal-keterangan" class="input" placeholder="Masukkan Keterangan">
|
||||
</div>
|
||||
<div>
|
||||
<label for="swal-tanggal-paparan" class="block text-sm font-medium text-gray-700 mb-1">Tanggal Paparan</label>
|
||||
<input id="swal-tanggal-paparan" class="input" type="date" placeholder="Tanggal paparan">
|
||||
</div>
|
||||
</div>` : '';
|
||||
|
||||
showSwalConfirmation(
|
||||
'Apakah Anda yakin?',
|
||||
`Untuk melakukan otorisasi ${dataHeader}!`,
|
||||
swalHtml,
|
||||
'Ya, Lanjutkan!',
|
||||
'Tolak',
|
||||
'Batal',
|
||||
() => {
|
||||
if (isPaparanSO) {
|
||||
const message = document.getElementById('swal-keterangan')?.value;
|
||||
const tanggalPaparan = document.getElementById('swal-tanggal-paparan').value;
|
||||
|
||||
if (!message || !tanggalPaparan) {
|
||||
Swal.showValidationMessage('Keterangan dan Tanggal Paparan harus diisi!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
return {
|
||||
message,
|
||||
tanggalPaparan
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
message: 'Ya, lanjutkan.'
|
||||
};
|
||||
}
|
||||
},
|
||||
'question'
|
||||
).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
const requestData = isPaparanSO ? {
|
||||
message: result.value.message,
|
||||
tanggalPaparan: result.value.tanggalPaparan
|
||||
} : {
|
||||
message: result.value.message
|
||||
};
|
||||
|
||||
handleAjaxRequest(
|
||||
`/otorisator/otorisator/${dataId}/${dataHeader}`,
|
||||
requestData,
|
||||
'Data berhasil diotorisasi.',
|
||||
'Terjadi kesalahan saat melakukan otorisasi.'
|
||||
);
|
||||
} else if (result.isDenied) {
|
||||
handleRejection(dataId);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card border border-agi-100 pb-2.5">
|
||||
<div class="w-full card grid gap-5 lg:gap-7.5 mx-auto">
|
||||
|
||||
<div class="min-w-full card-grid" data-datatable="false" data-datatable-page-size="10"
|
||||
data-datatable-state-save="false" id="permohonan-table"
|
||||
data-api-url="{{ route('otorisator.datatables', ['otorisator' => $header]) }}">
|
||||
@@ -82,6 +82,10 @@
|
||||
<span class="sort"> <span class="sort-label"> Approval SO </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="approval_eo">
|
||||
<span class="sort"> <span class="sort-label"> Approval EO </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="approval_dd">
|
||||
<span class="sort"> <span class="sort-label"> Approval DD </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
@@ -108,7 +112,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@@ -251,6 +255,15 @@
|
||||
return '';
|
||||
},
|
||||
},
|
||||
approval_eo: {
|
||||
title: 'Approval EO',
|
||||
render: (item, data) => {
|
||||
if (data.approve_eo) {
|
||||
return `${data.approve_eo.name} | ${window.formatTanggalIndonesia(data.approval_eo_at)}`;
|
||||
}
|
||||
return '';
|
||||
},
|
||||
},
|
||||
approval_dd: {
|
||||
title: 'Approval DD',
|
||||
render: (item, data) => {
|
||||
|
||||
@@ -206,7 +206,14 @@
|
||||
|
||||
if (data.status === 'proses-survey' || data.status == 'rejected-reschedule') {
|
||||
actionHtml += `
|
||||
<a onclick="surveyorRescheduleJadwalSurvey(${data.id},${data.penilaian.id},'${data.nomor_registrasi}', '${data.debiture.name}', '${data.penilaian.waktu_penilaian}', ${JSON.stringify(data.penilaian.rejected_note)})" class="delete btn btn-sm btn-outline btn-light" title="Reschedule Jadwal Survey">
|
||||
<a onclick="surveyorRescheduleJadwalSurvey(
|
||||
${data.id},
|
||||
${data.penilaian.id},
|
||||
${data.nomor_registrasi},
|
||||
${data.debiture.name},
|
||||
${data.penilaian.waktu_penilaian},
|
||||
${JSON.stringify(data.penilaian.rejected_note)}
|
||||
)" class="delete btn btn-sm btn-outline btn-light" title="Reschedule Jadwal Survey">
|
||||
<i class="ki-filled ki-calendar-remove"></i>
|
||||
</a>`;
|
||||
}
|
||||
|
||||
@@ -90,9 +90,9 @@
|
||||
</tr>
|
||||
@php
|
||||
$i=1;
|
||||
$totalAsset = count($data->debiture->documents);
|
||||
$totalAsset = count($data->dokumenjaminan);
|
||||
@endphp
|
||||
@foreach ($data->debiture->documents as $dokumen)
|
||||
@foreach ($data->dokumenjaminan as $dokumen)
|
||||
<tr valign="top">
|
||||
<td>Lokasi Jaminan {{ $totalAsset >1 ? $i : '' }}</td>
|
||||
<td>:</td>
|
||||
@@ -125,21 +125,26 @@
|
||||
@if(!$shouldExclude)
|
||||
@php $details = $dokumen_jaminans->detail; @endphp
|
||||
@foreach ($details as $index => $detail)
|
||||
@php
|
||||
$shouldExcludeNomor = false;
|
||||
foreach ($excludedDocuments as $excludedDoc) {
|
||||
if (str_contains(strtolower($detail->dokumen_nomor), strtolower($excludedDoc))) {
|
||||
$shouldExcludeNomor = true;
|
||||
break;
|
||||
@if($detail->dokumen_jaminan)
|
||||
{{ $detail->name }}
|
||||
@php
|
||||
$shouldExcludeNomor = false;
|
||||
foreach ($excludedDocuments as $excludedDoc) {
|
||||
if (str_contains(strtolower($detail->dokumen_nomor), strtolower($excludedDoc))) {
|
||||
$shouldExcludeNomor = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@endphp
|
||||
@if(!$shouldExcludeNomor)
|
||||
@if($detail->dokumen_nomor)
|
||||
@foreach(json_decode($detail->dokumen_nomor) as $item)
|
||||
{{ $item }}<br>
|
||||
@endforeach
|
||||
@endphp
|
||||
@if(!$shouldExcludeNomor)
|
||||
@if($detail->dokumen_nomor)
|
||||
{{ " | " }}
|
||||
@foreach(json_decode($detail->dokumen_nomor) as $key => $item)
|
||||
{{ $item }}{{ $key < count(json_decode($detail->dokumen_nomor)) - 1 ? ',' : '' }}
|
||||
@endforeach
|
||||
@endif
|
||||
@endif
|
||||
<br>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
@@ -106,10 +106,9 @@
|
||||
</tr>
|
||||
@php
|
||||
$i=1;
|
||||
$totalAsset = count($data->debiture->documents);
|
||||
$totalAsset = count($data->dokumenjaminan);
|
||||
@endphp
|
||||
|
||||
@foreach ($data->debiture->documents as $dokumen)
|
||||
@foreach ($data->dokumenjaminan as $dokumen)
|
||||
<tr valign="top">
|
||||
<td>Lokasi Jaminan {{ $totalAsset >1 ? $i : '' }}</td>
|
||||
<td>:</td>
|
||||
@@ -127,7 +126,7 @@
|
||||
@endphp
|
||||
|
||||
@foreach ($data->dokumenjaminan as $dokumen_jaminans)
|
||||
@if ($dokumen->id== $dokumen_jaminans->id)
|
||||
@if ($dokumen->id == $dokumen_jaminans->id)
|
||||
@php
|
||||
$shouldExclude = false;
|
||||
$shouldExcludeNomor = false;
|
||||
@@ -142,6 +141,8 @@
|
||||
@if(!$shouldExclude)
|
||||
@php $details = $dokumen_jaminans->detail; @endphp
|
||||
@foreach ($details as $index => $detail)
|
||||
@if($detail->dokumen_jaminan)
|
||||
{{ $detail->name }}
|
||||
@php
|
||||
$shouldExcludeNomor = false;
|
||||
foreach ($excludedDocuments as $excludedDoc) {
|
||||
@@ -153,11 +154,14 @@
|
||||
@endphp
|
||||
@if(!$shouldExcludeNomor)
|
||||
@if($detail->dokumen_nomor)
|
||||
@foreach(json_decode($detail->dokumen_nomor) as $item)
|
||||
{{ $item }}<br>
|
||||
{{ " | " }}
|
||||
@foreach(json_decode($detail->dokumen_nomor) as $key => $item)
|
||||
{{ $item }}{{ $key < count(json_decode($detail->dokumen_nomor)) - 1 ? ',' : '' }}
|
||||
@endforeach
|
||||
@endif
|
||||
@endif
|
||||
<br>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
@endif
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<div class="card-body">
|
||||
<div class="grid gap-5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Luas Bangunan</label>
|
||||
<label class="form-label max-w-56">Luas Bangunan(IMB)</label>
|
||||
<div class="mt-2">
|
||||
|
||||
@if (isset($permohonan->documents))
|
||||
|
||||
@@ -16,37 +16,57 @@
|
||||
$dokumentName = null;
|
||||
@endphp
|
||||
|
||||
<form id="dataPembandingForm" method="POST" enctype="multipart/form-data">
|
||||
<form id="dataPembandingForm" method="POST" enctype="multipart/form-data" class="grid gap-5">
|
||||
@csrf
|
||||
<input type="hidden" name="permohonan_id" value="{{ $permohonan->id }}">
|
||||
<input type="hidden" name="type" value="tanah">
|
||||
<input type="hidden" name="dokument_id" value="{{ request('dokument') }}">
|
||||
<input type="hidden" name="nomor_registrasi" value="{{ $permohonan->nomor_registrasi }}">
|
||||
<div class="card">
|
||||
@foreach ($permohonan->documents as $dokumen)
|
||||
@if ($dokumen->jenisJaminan)
|
||||
@php
|
||||
$dokumentName = $dokumen->jenisJaminan->name;
|
||||
$formKategori = json_decode($dokumen->jenisJaminan->form_kategori, true);
|
||||
@endphp
|
||||
<input type="hidden" name="action"
|
||||
value="{{ is_array($formKategori) ? implode(',', $formKategori) : $formKategori }}">
|
||||
@if (!in_array(strtoupper($dokumentName), $tanahBangunanTypes))
|
||||
@include('lpj::surveyor.components.pembanding-tanah-bangunan-unit')
|
||||
@else
|
||||
@include('lpj::surveyor.components.pembanding-kendaraan')
|
||||
<div class="card-body">
|
||||
@foreach ($permohonan->debiture->documents as $dokumen)
|
||||
@if ($dokumen->jenisJaminan)
|
||||
@php
|
||||
$dokumentName = $dokumen->jenisJaminan->name;
|
||||
$formKategori = json_decode($dokumen->jenisJaminan->form_kategori, true);
|
||||
@endphp
|
||||
<input type="hidden" name="action"
|
||||
value="{{ is_array($formKategori) ? implode(',', $formKategori) : $formKategori }}">
|
||||
@if (!in_array(strtoupper($dokumentName), $tanahBangunanTypes))
|
||||
@include('lpj::surveyor.components.pembanding-tanah-bangunan-unit')
|
||||
@else
|
||||
@include('lpj::surveyor.components.pembanding-kendaraan')
|
||||
@endif
|
||||
@endif
|
||||
@endif
|
||||
@endforeach
|
||||
<div class="card-footer">
|
||||
<div class="flex justify-end gap-2">
|
||||
<button type="button" onclick="submitData()" class="btn btn-primary">
|
||||
<i class="ki-duotone ki-save-2 fs-2"></i>
|
||||
Simpan
|
||||
</button>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body ">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5" style="margin: 20px">
|
||||
<label class="form-label lg:form-label max-w-56 ">Catatan yang Perlu Diperhatikan
|
||||
</label>
|
||||
<div class="w-full">
|
||||
<div id="keterangan-container" class="flex items-baseline flex-wrap gap-2.5 w-full">
|
||||
<div class="keterangan flex items-center gap-2 mt-2 textarea-group w-full">
|
||||
<textarea name="keterangan" class="textarea mt-2" placeholder="Masukkan catatan penting" rows="10">{{ $comparisons['keterangan'] ?? old('keterangan') }}</textarea>
|
||||
<em id="error-keterangan" class="alert text-danger text-sm"></em>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<div class="flex justify-end gap-2">
|
||||
<button type="button" onclick="submitData()" class="btn btn-primary">
|
||||
<i class="ki-duotone ki-save-2 fs-2"></i>
|
||||
Simpan
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -125,7 +145,7 @@
|
||||
}
|
||||
} else {
|
||||
// Format currency untuk input harga
|
||||
if (name.includes('diskon')) {
|
||||
if (name.includes('diskon')) {
|
||||
element.value = value || '0';
|
||||
} else {
|
||||
element.value = value || '';
|
||||
@@ -170,7 +190,7 @@
|
||||
'total_pembanding[]': currentData.total,
|
||||
'diskon_pembanding[]': currentData.diskon,
|
||||
'telepon_pembanding[]': currentData.telepon,
|
||||
'penawaran_pembanding[]': currentData.penawaran,
|
||||
'penawaran_pembanding[]': currentData.penawaran
|
||||
} : {
|
||||
'jenis_aset_pembanding[]': currentData.jenis_aset,
|
||||
'luas_tanah_pembanding[]': currentData.luas_tanah,
|
||||
@@ -191,6 +211,8 @@
|
||||
'hak_properti_pembanding[]': currentData.hak_properti,
|
||||
'telepon_pembanding[]': currentData.telepon,
|
||||
'penawaran_pembanding[]': currentData.penawaran,
|
||||
'tanggal_pembanding[]': currentData.tanggal
|
||||
|
||||
};
|
||||
|
||||
Object.entries(inputs).forEach(([name, value]) => {
|
||||
@@ -339,10 +361,10 @@
|
||||
} else if (!input.id.includes('province')) {
|
||||
// Reset opsi untuk select lokasi
|
||||
input.innerHTML = `<option value="">Pilih ${
|
||||
input.id.includes('city') ? 'Kota/Kabupaten' :
|
||||
input.id.includes('district') ? 'Kecamatan' :
|
||||
'Desa/Kelurahan'
|
||||
}</option>`;
|
||||
input.id.includes('city') ? 'Kota/Kabupaten' :
|
||||
input.id.includes('district') ? 'Kecamatan' :
|
||||
'Desa/Kelurahan'
|
||||
}</option>`;
|
||||
}
|
||||
|
||||
if (input.id.includes('province')) {
|
||||
@@ -358,6 +380,8 @@
|
||||
handleDistrictChange(this);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (input.type !== 'file' && input.tagName !== 'SELECT') {
|
||||
|
||||
@@ -5,8 +5,7 @@
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<link rel="stylesheet" href="https://unpkg.com/dropzone@5/dist/min/dropzone.min.css" type="text/css" />
|
||||
{{-- <link rel="stylesheet" href="https://uicdn.toast.com/tui-image-editor/latest/tui-image-editor.css" /> --}}
|
||||
<link rel="stylesheet" href="https://unpkg.com/dropzone@5/dist/min/dropzone.min.css" type="text/css" />
|
||||
<style>
|
||||
.dropzone {
|
||||
border: 2px dashed #3498db;
|
||||
@@ -234,8 +233,8 @@
|
||||
<div class="flex gap-2.5">
|
||||
<button id="saveEditDataButton" type="button" class="btn btn-primary"
|
||||
onclick="saveEditedFoto()">Simpan</button>
|
||||
{{-- <button type="button" class="btn btn-light" data-modal-toggle="#modal_10"
|
||||
data-drawer-dismiss="true" onclick="openEditPhotoModal(file)">Edit Foto</button> --}}
|
||||
<button type="button" class="btn btn-light" data-modal-toggle="#modal_10"
|
||||
data-drawer-dismiss="true">Edit Foto</button>
|
||||
<button type="button" class="btn btn-danger" data-drawer-dismiss="true">Batal</button>
|
||||
</div>
|
||||
</form>
|
||||
@@ -244,7 +243,7 @@
|
||||
|
||||
<div class="modal" data-modal="true" id="modal_10">
|
||||
<div class="modal-content modal-overlay">
|
||||
<div class="modal-header">
|
||||
{{-- <div class="modal-header">
|
||||
<h3 class="modal-title">
|
||||
Edit Foto
|
||||
</h3>
|
||||
@@ -252,9 +251,9 @@
|
||||
<i class="ki-outline ki-cross">
|
||||
</i>
|
||||
</button>
|
||||
</div>
|
||||
</div> --}}
|
||||
<div class="modal-body scrollable-y-auto">
|
||||
<div id="tui-image-editor"></div>
|
||||
<div id="editor_container" class="w-full h-full"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -266,8 +265,7 @@
|
||||
@include('lpj::surveyor.js.fotojs')
|
||||
@include('lpj::surveyor.js.utils')
|
||||
@push('scripts')
|
||||
{{-- <script src="https://uicdn.toast.com/tui-image-editor/latest/tui-image-editor.js"></script> --}}
|
||||
<script src="https://unpkg.com/dropzone@5/dist/min/dropzone.min.js"></script>
|
||||
<script src="https://unpkg.com/dropzone@5/dist/min/dropzone.min.js"></script>
|
||||
<script>
|
||||
let jsonDataContoh = @json($formFoto);
|
||||
Dropzone.autoDiscover = false;
|
||||
@@ -283,11 +281,14 @@
|
||||
console.error(`Dropzone element not found: ${selector}`);
|
||||
return null;
|
||||
}
|
||||
const processedFiles = new Set();
|
||||
|
||||
// Track files that are already on the server
|
||||
const existingFiles = new Set();
|
||||
|
||||
myDropzone = new Dropzone(selector, {
|
||||
url: "{{ route('surveyor.storeFoto') }}",
|
||||
paramName: paramName,
|
||||
maxFilesize: 30,
|
||||
acceptedFiles: 'image/*',
|
||||
uploadMultiple: false,
|
||||
parallelUploads: 1,
|
||||
@@ -305,15 +306,51 @@
|
||||
nomor_registrasi: '{{ $permohonan->nomor_registrasi ?? '' }}',
|
||||
},
|
||||
|
||||
accept: function(file, done) {
|
||||
// Generate a unique identifier for the file - use hash or content-based ID if possible
|
||||
const fileId = file.name + '_' + file.size;
|
||||
|
||||
// If file is already being processed, reject it
|
||||
if (processedFiles.has(fileId)) {
|
||||
done('File sudah dalam antrian upload.');
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if file already exists on server
|
||||
if (existingFiles.has(file.name)) {
|
||||
done('File dengan nama ini sudah ada.');
|
||||
return;
|
||||
}
|
||||
|
||||
// Add file to processed set
|
||||
processedFiles.add(fileId);
|
||||
done();
|
||||
},
|
||||
|
||||
addedfiles: function(files) {
|
||||
uploadQueue += files.length;
|
||||
uploadBatch = Array.from(files);
|
||||
if (files.length > 0) showLoadingOverlay();
|
||||
const validFiles = Array.from(files).filter(file => {
|
||||
// Only count files that haven't been rejected
|
||||
return !file.rejected;
|
||||
});
|
||||
|
||||
uploadQueue += validFiles.length;
|
||||
uploadBatch = validFiles;
|
||||
|
||||
if (validFiles.length > 0) showLoadingOverlay();
|
||||
},
|
||||
|
||||
error: function(file, response) {
|
||||
handleUploadComplete(file, false, response.message);
|
||||
// Remove file from processed list on error
|
||||
const fileId = file.name + '_' + file.size;
|
||||
processedFiles.delete(fileId);
|
||||
|
||||
// Format error message
|
||||
let errorMsg = typeof response === 'string' ? response :
|
||||
(response.message || 'Gagal mengupload file');
|
||||
|
||||
handleUploadComplete(file, false, errorMsg);
|
||||
},
|
||||
|
||||
success: function(file, response) {
|
||||
if (response.success) {
|
||||
const fileData = {
|
||||
@@ -325,6 +362,9 @@
|
||||
param_name: paramName
|
||||
};
|
||||
|
||||
// Add file to existing files set to prevent duplicates
|
||||
existingFiles.add(file.name);
|
||||
|
||||
addEditAndDeleteButtons(file, fileData);
|
||||
handleUploadComplete(file, true);
|
||||
} else {
|
||||
@@ -333,10 +373,16 @@
|
||||
},
|
||||
|
||||
init: function() {
|
||||
// var myDropzone = this;
|
||||
loadExistingPhotos(this, paramName);
|
||||
}
|
||||
const dz = this;
|
||||
|
||||
// Clear processed files when all uploads complete
|
||||
this.on("queuecomplete", function() {
|
||||
processedFiles.clear();
|
||||
});
|
||||
|
||||
// Load existing photos
|
||||
loadExistingPhotos(this, paramName, existingFiles);
|
||||
}
|
||||
});
|
||||
|
||||
return myDropzone;
|
||||
@@ -346,7 +392,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
function loadExistingPhotos(dropzone, paramName) {
|
||||
function loadExistingPhotos(dropzone, paramName, existingFilesSet) {
|
||||
showLoadingOverlay();
|
||||
|
||||
$.ajax({
|
||||
@@ -369,6 +415,9 @@
|
||||
originalPath: foto.path
|
||||
};
|
||||
|
||||
// Add to existing files set to prevent duplicates
|
||||
existingFilesSet.add(foto.name);
|
||||
|
||||
dropzone.emit("addedfile", mockFile);
|
||||
dropzone.emit("thumbnail", mockFile, foto.path);
|
||||
dropzone.emit("complete", mockFile);
|
||||
@@ -433,17 +482,17 @@
|
||||
const loadingOverlay = document.createElement('div');
|
||||
loadingOverlay.className = 'loading-overlay';
|
||||
loadingOverlay.style.cssText = `
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
z-index: 9999;
|
||||
`;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
z-index: 9999;
|
||||
`;
|
||||
|
||||
// Tambahkan loader di dalam overlay
|
||||
loadingOverlay.innerHTML = '<div class="loader"></div>';
|
||||
@@ -456,7 +505,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function hideLoadingOverlay() {
|
||||
const overlay = document.querySelector('.loading-overlay');
|
||||
if (overlay) overlay.style.display = 'none';
|
||||
@@ -481,7 +529,6 @@
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// Inisialisasi Dropzone untuk elemen awal dengan pengecekan
|
||||
function safeInitDropzone(selector, paramName) {
|
||||
setTimeout(() => {
|
||||
@@ -494,7 +541,6 @@
|
||||
|
||||
// Inisialisasi dropzone untuk elemen awal
|
||||
safeInitDropzone('#upload-dropzone', 'upload_foto');
|
||||
|
||||
});
|
||||
|
||||
let fotoObjekJaminan = @json($fotoObjekJaminan);
|
||||
@@ -541,35 +587,110 @@
|
||||
}
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// Create container for Filerobot editor
|
||||
const editorContainer = document.createElement('div');
|
||||
editorContainer.id = 'editor_container';
|
||||
editorContainer.style.width = '100%';
|
||||
editorContainer.style.height = '100%';
|
||||
|
||||
function openEditPhotoModal() {
|
||||
const imageEditorContainer = document.getElementById('tui-image-editor');
|
||||
// Add container to modal body
|
||||
const modalBody = document.querySelector('#modal_10 .modal-body');
|
||||
modalBody.innerHTML = '';
|
||||
modalBody.appendChild(editorContainer);
|
||||
|
||||
// Update the Edit Foto button event handler
|
||||
const editFotoButton = document.querySelector('[data-modal-toggle="#modal_10"]');
|
||||
if (editFotoButton) {
|
||||
editFotoButton.addEventListener('click', function(e) {
|
||||
e.preventDefault();
|
||||
// Get the file path from hidden input
|
||||
const filePath = document.getElementById('editDataFilePath').value;
|
||||
|
||||
if (filePath) {
|
||||
openFilerobotEditor(filePath);
|
||||
} else {
|
||||
alert('Tidak ada foto untuk diedit');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function openFilerobotEditor(imagePath) {
|
||||
// Get the editor container
|
||||
const editorContainer = document.getElementById('editor_container');
|
||||
|
||||
if (!editorContainer) {
|
||||
console.error('Editor container not found');
|
||||
return;
|
||||
}
|
||||
// Configuration for the editor
|
||||
const config = {
|
||||
source: imagePath || '',
|
||||
onSave: (editedImageObject, designState) => {
|
||||
saveEditedImage(editedImageObject, document.getElementById('editDataFilePath').value);
|
||||
window.FilerobotImageEditor.terminate();
|
||||
|
||||
// Inisialisasi TUI Image Editor
|
||||
const imageEditor = new tui.ImageEditor(imageEditorContainer, {
|
||||
includeUI: {
|
||||
loadImage: {
|
||||
path: file.dataURL,
|
||||
name: 'Uploaded Photo'
|
||||
},
|
||||
theme: {
|
||||
'common.bi.image': '',
|
||||
'common.bisize.width': '25px',
|
||||
'common.bisize.height': '25px',
|
||||
'common.backgroundImage': 'none',
|
||||
'common.backgroundColor': '#fff',
|
||||
'common.border': '1px solid #ccc'
|
||||
},
|
||||
menu: ['crop', 'flip', 'rotate', 'draw', 'shape', 'icon', 'text', 'filter'],
|
||||
initMenu: 'filter'
|
||||
},
|
||||
cssMaxWidth: 700,
|
||||
cssMaxHeight: 500
|
||||
annotationsCommon: {
|
||||
fill: '#ff0000'
|
||||
},
|
||||
Text: {
|
||||
text: 'Tambahkan teks...'
|
||||
},
|
||||
Rotate: {
|
||||
angle: 90,
|
||||
componentType: 'slider'
|
||||
},
|
||||
tabsIds: [
|
||||
window.FilerobotImageEditor.TABS.ADJUST,
|
||||
window.FilerobotImageEditor.TABS.FILTERS,
|
||||
window.FilerobotImageEditor.TABS.FINETUNE,
|
||||
window.FilerobotImageEditor.TABS.ANNOTATE,
|
||||
window.FilerobotImageEditor.TABS.WATERMARK,
|
||||
window.FilerobotImageEditor.TABS.RESIZE,
|
||||
],
|
||||
defaultTabId: window.FilerobotImageEditor.TABS.ADJUST,
|
||||
Language: {
|
||||
Save: 'Simpan',
|
||||
Cancel: 'Batal',
|
||||
Reset: 'Reset',
|
||||
Edit: 'Edit',
|
||||
Delete: 'Hapus'
|
||||
}
|
||||
};
|
||||
|
||||
// Initialize the Filerobot Image Editor
|
||||
const filerobotImageEditor = new FilerobotImageEditor(
|
||||
editorContainer,
|
||||
config
|
||||
);
|
||||
|
||||
|
||||
filerobotImageEditor.render({
|
||||
onClose: (closingReason) => {
|
||||
console.log('Editor closed:', closingReason);
|
||||
|
||||
filerobotImageEditor.terminate();
|
||||
|
||||
let closeButton = document.getElementById('modal_10');
|
||||
|
||||
if (!closeButton) {
|
||||
closeButton = document.createElement('button');
|
||||
closeButton.setAttribute('data-modal-dismiss', 'true');
|
||||
closeButton.setAttribute('type', 'button');
|
||||
closeButton.setAttribute('class', 'btn btn-primary');
|
||||
closeButton.setAttribute('data-modal-toggle', '#modal_10');
|
||||
document.body.appendChild(closeButton);
|
||||
}
|
||||
|
||||
closeButton.click();
|
||||
console.log('Modal closed via close button simulation');
|
||||
}
|
||||
});
|
||||
|
||||
// openModal('editPhotoModal');
|
||||
}
|
||||
|
||||
window.addEditAndDeleteButtons = function(file, response) {
|
||||
|
||||
const filePreviewElement = file.previewElement;
|
||||
@@ -646,8 +767,6 @@
|
||||
filePreviewElement.appendChild(buttonContainer);
|
||||
}
|
||||
|
||||
|
||||
|
||||
async function saveEditedFoto() {
|
||||
$.ajax({
|
||||
url: `{{ route('surveyor.updateFoto') }}`,
|
||||
@@ -688,6 +807,69 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function saveEditedImage(editedImageObject, originalFilePath) {
|
||||
// Get the image data (base64 or canvas)
|
||||
const imageData = editedImageObject.imageBase64 ||
|
||||
(editedImageObject.imageCanvas ? editedImageObject.imageCanvas.toDataURL() : null);
|
||||
|
||||
if (!imageData) {
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Gagal Menyimpan',
|
||||
text: 'Tidak ada data gambar untuk disimpan',
|
||||
});
|
||||
return;
|
||||
}
|
||||
const formData = new FormData();
|
||||
formData.append('edited_image', imageData);
|
||||
formData.append('original_path', originalFilePath);
|
||||
|
||||
formData.forEach((value, key) => {
|
||||
console.log(`${key}:`, value);
|
||||
});
|
||||
|
||||
|
||||
$.ajax({
|
||||
url: `{{ route('surveyor.saveEditedImage') }}`,
|
||||
type: 'POST',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
},
|
||||
data: {
|
||||
edited_image: imageData,
|
||||
original_path: originalFilePath,
|
||||
nomor_registrasi: '{{ $permohonan->nomor_registrasi }}'
|
||||
},
|
||||
|
||||
success: function(response) {
|
||||
Swal.fire({
|
||||
icon: 'success',
|
||||
title: 'Perubahan Disimpan',
|
||||
text: response.message,
|
||||
confirmButtonText: 'OK'
|
||||
}).then((response) => {
|
||||
if (response.isConfirmed) {
|
||||
window.location.reload();
|
||||
|
||||
}
|
||||
});
|
||||
},
|
||||
error: function(xhr) {
|
||||
const errorMessage = xhr.responseJSON?.message || 'Terjadi kesalahan';
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Gagal Menyimpan',
|
||||
text: errorMessage,
|
||||
}).then((response) => {
|
||||
if (response.isConfirmed) {
|
||||
window.location.reload();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@include('lpj::surveyor.js.camera-editor')
|
||||
@endpush
|
||||
|
||||
@@ -8,14 +8,13 @@
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
@php
|
||||
use Illuminate\Support\Facades\Route;
|
||||
@endphp
|
||||
use Illuminate\Support\Facades\Route;
|
||||
@endphp
|
||||
@if (isset($id))
|
||||
<a href="{{ route($backLink, ['id' => $id]) }}" class="btn btn-xs btn-info">
|
||||
<i class="ki-filled ki-exit-left"></i> Back
|
||||
</a>
|
||||
@else
|
||||
|
||||
@if (Auth::user()->hasAnyRole(['administrator', 'senior-officer', 'EO Appraisal', 'DD Appraisal']) &&
|
||||
Route::currentRouteName('otorisator.show'))
|
||||
<a href="{{ route('otorisator.show', ['id' => $permohonan->id, 'type' => 'Pelaporan']) }}"
|
||||
@@ -23,9 +22,15 @@
|
||||
<i class="ki-filled ki-exit-left"></i> Back
|
||||
</a>
|
||||
@elseif (Auth::user()->hasAnyRole(['administrator', 'surveyor']) && Route::currentRouteName('penilai.show'))
|
||||
<a href="{{ route('penilai.show', $permohonan->id) }}" class="btn btn-xs btn-info">
|
||||
<i class="ki-filled ki-exit-left"></i> Back
|
||||
</a>
|
||||
@if (Request::is('surveyor/inspeksi/*/create') && request()->has('dokument') && request()->has('jenis_jaminan'))
|
||||
<a href="{{ route('surveyor.show', request()->get('dokument')) }}" class="btn btn-xs btn-info">
|
||||
<i class="ki-filled ki-exit-left"></i> Back
|
||||
</a>
|
||||
@else
|
||||
<a href="{{ route('penilai.show', $permohonan->id) }}" class="btn btn-xs btn-info">
|
||||
<i class="ki-filled ki-exit-left"></i> Back
|
||||
</a>
|
||||
@endif
|
||||
@endif
|
||||
@endif
|
||||
{{-- <a href="{{ route('surveyor.show', ['id' => request('inspeksi')]) }}" class="btn btn-xs btn-info">
|
||||
@@ -280,6 +285,15 @@
|
||||
<div class="card-body w-full">
|
||||
@include('lpj::component.detail-jaminan', ['status' => true])
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label class="form-label font-medium max-w-56">Nomor NIB</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" name="nomor_nib" class="input w-full"
|
||||
value="{{ isset($forminspeksi['asset']['nomor_nib']) ? $forminspeksi['asset']['nomor_nib'] : '' }}"
|
||||
placeholder="Masukkan Nomor NIB">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class=" mx-auto rounded-lg overflow-hidden">
|
||||
<div class="py-4 ">
|
||||
<h1 class="text-md font-medium text-gray-900">Hubungan cadeb/debitur dengan Pemilik Jaminan</h1>
|
||||
@@ -325,7 +339,7 @@
|
||||
@endphp
|
||||
|
||||
<select id="hub_cadeb_tidak_sesuai" class="input w-full" name="hub_cadeb_tidak_sesuai"
|
||||
style="{{ old('hub_cadeb_tidak_sesuai', $selectedData) ? '' : 'display: none;' }}">
|
||||
style="{{ $statusKey != 'sesuai' ? '' : 'display: none;' }}">
|
||||
<option value="">Select Hubungan Cadeb</option>
|
||||
@if (isset($basicData['hubCadeb']))
|
||||
@foreach ($basicData['hubCadeb'] as $item)
|
||||
@@ -389,7 +403,7 @@
|
||||
<input id="hub_penghuni_tidak_sesuai" class="input" name="hub_penghuni_tidak_sesuai"
|
||||
placeholder="Masukkan Hubungan penghuni jaminan"
|
||||
value="{{ old('hub_penghuni_tidak_sesuai', isset($selectedData) ? $selectedData : '') }}"
|
||||
style="{{ old('hub_penghuni_tidak_sesuai', $selectedData ?? false) ? '' : 'display: none;' }}">
|
||||
style="{{ $statusKey != 'sesuai' ? '' : 'display: none;' }}">
|
||||
</div>
|
||||
<em id="error-hub_cadeb_penghuni" class="alert text-danger text-sm"></em>
|
||||
</div>
|
||||
|
||||
@@ -115,6 +115,28 @@
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">Sentuh Tanahku</span>
|
||||
</label>
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input class="name_rute" type="hidden" name="name_rute" value="rute">
|
||||
<div class="w-full">
|
||||
<input id="inputGistaru" type="file" name="foto_sentuh_tanahku"
|
||||
class="file-input file-input-bordered w-full"
|
||||
accept=".jpg,.jpeg,.png,.gif,.bmp,.tiff,.tif,.webp,.svg"
|
||||
onchange="previewImage(this, 'sentuh_tanahku-preview')">
|
||||
|
||||
<img id="sentuh_tanahku-preview"
|
||||
src="{{ asset('storage/' . (isset($forminspeksi['foto_sentuh_tanahku']) ? $forminspeksi['foto_sentuh_tanahku'] : '')) }}"
|
||||
alt="Foto Bhumi" class="mt-2 max-w-full h-auto"
|
||||
style="{{ isset($forminspeksi['foto_sentuh_tanahku']) ? '' : 'display: none;' }} max-width: 30rem;" />
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
@@ -194,6 +216,8 @@
|
||||
</div>
|
||||
<!-- Upload Photo Button -->
|
||||
|
||||
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5" style="margin-top: 20px">
|
||||
<label for="" class="form-label max-w-56 text-sm font-medium text-gray-700">Upload Peta</label>
|
||||
<div class="w-full grid gap-5">
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
@include('lpj::surveyor.components.header')
|
||||
@include('lpj::surveyor.components.rap')
|
||||
@else
|
||||
@foreach ($permohonan->documents as $dokumen)
|
||||
@foreach ($permohonan->debiture->documents as $dokumen)
|
||||
@if ($dokumen->jenisJaminan)
|
||||
@php
|
||||
$formKategori = json_decode($dokumen->jenisJaminan->form_kategori, true);
|
||||
@@ -91,6 +91,8 @@
|
||||
@push('scripts')
|
||||
<script src="https://cdn.jsdelivr.net/npm/signature_pad@4.1.7/dist/signature_pad.umd.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
const datas = @json($forminspeksi);
|
||||
console.log(datas);
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const signaturePads = {};
|
||||
const types = ['penilai', 'cabang', 'debitur', 'kjjp'];
|
||||
@@ -343,8 +345,6 @@
|
||||
showLoadingSwal('Mengirim data ke server...');
|
||||
const form = document.querySelector('form');
|
||||
const formData = new FormData(form);
|
||||
console.log('Form data entries:', Array.from(formData.entries()));
|
||||
|
||||
$.ajax({
|
||||
url: '{{ route('surveyor.store') }}',
|
||||
type: 'POST',
|
||||
@@ -364,8 +364,8 @@
|
||||
confirmButtonText: 'OK'
|
||||
}).then((response) => {
|
||||
if (response.isConfirmed) {
|
||||
window.location.href =
|
||||
'{{ route('surveyor.show', ['id' => $permohonan->id]) }}';
|
||||
// window.location.href =
|
||||
// '{{ route('surveyor.show', ['id' => $permohonan->id]) }}';
|
||||
}
|
||||
});
|
||||
} else {
|
||||
@@ -389,8 +389,6 @@
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
let errors = xhr.responseJSON?.errors;
|
||||
$('.alert').text('');
|
||||
if (errors) {
|
||||
|
||||
@@ -352,7 +352,7 @@
|
||||
|
||||
<!-- Merupakan daerah -->
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Merupakan daerah</label>
|
||||
<label class="form-label max-w-56">Merupakan Daerah</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="flex flex-col items-start gap-4">
|
||||
@if (isset($basicData['merupakanDaerah']))
|
||||
@@ -373,7 +373,7 @@
|
||||
<!-- Fasilitas Umum Sekitar -->
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Fasilitas Umum dekat Object</label>
|
||||
<label class="form-label max-w-56">Fasilitas Umum Dekat Objek</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<div class="flex flex-col items-start gap-4">
|
||||
@if (isset($basicData['fasilitasObjek']))
|
||||
|
||||
@@ -17,7 +17,7 @@ video, canvas {
|
||||
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-title">Ambil Foto</h3>
|
||||
<button class="btn btn-xs btn-icon btn-light" data-modal-dismiss="true" id="closeModal">
|
||||
<button type="button" class="btn btn-xs btn-icon btn-light" data-modal-dismiss="true" id="closeModal">
|
||||
<i class="ki-outline ki-cross"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -138,18 +138,17 @@
|
||||
}
|
||||
@endphp
|
||||
|
||||
@if (isset($inspectionData['bangunan']))
|
||||
<tr>
|
||||
<td class="px-4 py-2">Luas Bangunan (m²)</td>
|
||||
<td class="px-4 py-2">
|
||||
<input type="text" name="luas_tanah_bagunan" class="input"
|
||||
value="{{ $inspectionData['bangunan']['luas_tanah_bagunan']['sesuai'] ?? ($inspectionData['bangunan']['luas_tanah_bagunan']['tidak sesuai'] ?? '') }}">
|
||||
</td>
|
||||
<td class="px-4 py-2">
|
||||
<input type="text" name="luas_bangunan_pembanding[]" class="input ">
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
<tr>
|
||||
<td class="px-4 py-2">Luas Bangunan (m²)</td>
|
||||
<td class="px-4 py-2">
|
||||
<input type="text" name="luas_tanah_bagunan" class="input"
|
||||
value="{{ $inspectionData['bangunan']['luas_tanah_bagunan']['sesuai'] ?? ($inspectionData['bangunan']['luas_tanah_bagunan']['tidak sesuai'] ?? '') }}">
|
||||
</td>
|
||||
<td class="px-4 py-2">
|
||||
<input type="text" name="luas_bangunan_pembanding[]" class="input ">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<!-- Informasi Harga -->
|
||||
@@ -172,9 +171,20 @@
|
||||
<td class="px-4 py-2">
|
||||
<input type="text" name="penawaran" class="input"
|
||||
value="{{ $inspectionData['asset']['penawaran'] ?? '' }}">
|
||||
{{-- <select class="input w-full" name="penawaran">
|
||||
<option value="">Pilih</option>
|
||||
<option value="Penawaran" {{ (isset($inspectionData['asset']['penawaran']) && $inspectionData['asset']['penawaran'] == 'Penawaran') ? 'selected' : '' }}>Penawaran</option>
|
||||
<option value="Transaksi" {{ (isset($inspectionData['asset']['penawaran']) && $inspectionData['asset']['penawaran'] == 'Transaksi') ? 'selected' : '' }}>Transaksi</option>
|
||||
</select> --}}
|
||||
</td>
|
||||
<td class="px-4 py-2">
|
||||
<input type="text" name="penawaran_pembanding[]" class="input">
|
||||
{{-- <select class="input w-full" name="penawaran_pembanding[]">
|
||||
<option value="">Pilih</option>
|
||||
<option value="Penawaran" {{ (isset($inspectionData['penawaran']) && $inspectionData['penawaran'] == 'Penawaran') ? 'selected' : '' }}>Penawaran</option>
|
||||
<option value="Transaksi" {{ (isset($inspectionData['penawaran']) && $inspectionData['penawaran'] == 'Transaksi') ? 'selected' : '' }}>Transaksi</option>
|
||||
</select> --}}
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -211,6 +221,16 @@
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="px-4 py-2">Tanggal Data</td>
|
||||
<td class="px-4 py-2">
|
||||
<input type="date" name="tanggal" class="input"
|
||||
value="{{ $inspectionData['asset']['tanggal'] ?? '' }}">
|
||||
</td>
|
||||
<td class="px-4 py-2">
|
||||
<input type="date" name="tanggal_pembanding[]" class="input">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- Lokasi -->
|
||||
<tr class="bg-gray-100">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
: 'sesuai';
|
||||
$luasBangunan = $forminspeksi['bangunan']['luas_tanah_bagunan'][$cekLuasBangunan] ?? null;
|
||||
@endphp
|
||||
<td width="25%"><strong>Luas Tanah Bangunan</strong></td>
|
||||
<td width="25%"><strong>Luas Bangunan (IMB)</strong></td>
|
||||
<td>{{ $luasBangunan }}</td>
|
||||
</tr>
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
<input type="checkbox"
|
||||
{{ isset($forminspeksi['bangunan']['jenis_bangunan']) && in_array($item->name, $forminspeksi['bangunan']['jenis_bangunan']) ? 'checked' : '' }}>
|
||||
{{ $item->name }}
|
||||
|
||||
</label>
|
||||
</td>
|
||||
@endforeach
|
||||
@@ -80,6 +81,18 @@
|
||||
<input type="checkbox" name="sifat_bangunan[]" value="{{ $item->name }}"
|
||||
{{ isset($forminspeksi['bangunan']['sifat_bangunan']) && in_array($item->name, $forminspeksi['bangunan']['sifat_bangunan']) ? 'checked' : '' }}>
|
||||
{{ $item->name }}
|
||||
|
||||
@if (isset($forminspeksi['bangunan']['sifat_bangunan']) &&
|
||||
in_array($item->name, $forminspeksi['bangunan']['sifat_bangunan']))
|
||||
@php
|
||||
$inputValues = isset($forminspeksi['bangunan']['sifat_bangunan_input'][$index])
|
||||
? $forminspeksi['bangunan']['sifat_bangunan_input'][$index]
|
||||
: null;
|
||||
@endphp
|
||||
@if ($inputValues)
|
||||
<span class="label-checkbox"> - {{ $inputValues }}</span>
|
||||
@endif
|
||||
@endif
|
||||
</label>
|
||||
</td>
|
||||
@endforeach
|
||||
@@ -90,7 +103,8 @@
|
||||
</tr>
|
||||
|
||||
|
||||
@if (isset($forminspeksi['bangunan']['spesifikasi_bangunan']) && count($forminspeksi['bangunan']['spesifikasi_bangunan']) > 0)
|
||||
@if (isset($forminspeksi['bangunan']['spesifikasi_bangunan']) &&
|
||||
count($forminspeksi['bangunan']['spesifikasi_bangunan']) > 0)
|
||||
@foreach ($forminspeksi['bangunan']['spesifikasi_bangunan'] as $bangunanIndex => $bangunan)
|
||||
<tr>
|
||||
<td colspan="2"><strong>Spesifikasi Bangunan {{ $bangunanIndex + 1 }}</strong></td>
|
||||
@@ -109,14 +123,20 @@
|
||||
@php
|
||||
$selectedValues = [];
|
||||
if (isset($bangunan['spek_kategori_bangunan'][$spesifikasi->name])) {
|
||||
$selectedValues = array_values($bangunan['spek_kategori_bangunan'][$spesifikasi->name]);
|
||||
$selectedValues = array_values(
|
||||
$bangunan['spek_kategori_bangunan'][$spesifikasi->name],
|
||||
);
|
||||
}
|
||||
$lainnyaValue = $bangunan['spek_kategori_bangunan'][$spesifikasi->name]['lainnya'] ?? '';
|
||||
$lainnyaValue =
|
||||
$bangunan['spek_kategori_bangunan'][$spesifikasi->name][
|
||||
'lainnya'
|
||||
] ?? '';
|
||||
@endphp
|
||||
|
||||
<td class="checkbox-item">
|
||||
<label class="checkbox-label">
|
||||
<input type="checkbox" class="checkbox-lainnya" style="margin-right: 3px;"
|
||||
<input type="checkbox" class="checkbox-lainnya"
|
||||
style="margin-right: 3px;"
|
||||
name="spesifikasi_bangunan[{{ $bangunanIndex }}][{{ $spesifikasi->name }}][]"
|
||||
value="{{ $kategori->name }}"
|
||||
@if (in_array($kategori->name, $selectedValues)) checked @endif>
|
||||
@@ -134,19 +154,19 @@
|
||||
@php $count++; @endphp
|
||||
|
||||
@if ($count % 3 == 0)
|
||||
</tr>
|
||||
<tr>
|
||||
@endif
|
||||
@endif
|
||||
@endforeach
|
||||
</tr>
|
||||
<tr>
|
||||
@endif
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
@endforeach
|
||||
</tr>
|
||||
@endif
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
</table>
|
||||
|
||||
@@ -129,8 +129,13 @@
|
||||
|
||||
@foreach ($informasi as $key)
|
||||
@if (isset($forminspeksi['fakta'][$key]) && $forminspeksi['fakta'][$key] !== '-')
|
||||
<p> - {{ ucfirst(str_replace('_', ' ', $key)) }}:
|
||||
{{ $forminspeksi['fakta'][$key] }}</p>
|
||||
@php
|
||||
$displayKey = ucfirst(str_replace('_', ' ', $key));
|
||||
if (strlen($key) == 3) {
|
||||
$displayKey = strtoupper($key);
|
||||
}
|
||||
@endphp
|
||||
<p> - {{ $displayKey }}: {{ $forminspeksi['fakta'][$key] }}</p>
|
||||
@endif
|
||||
@endforeach
|
||||
</td>
|
||||
|
||||
@@ -13,23 +13,23 @@
|
||||
<table>
|
||||
<tr>
|
||||
<td width="25%">Jarak Jalan Utama</td>
|
||||
<td>{{ $forminspeksi['lingkungan']['jarak_jalan_utama'] ?? 'Tidak Diketahui' }}</td>
|
||||
<td>{{ $forminspeksi['lingkungan']['jarak_jalan_utama'] ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jalan Lingkungan</td>
|
||||
<td>{{ $forminspeksi['lingkungan']['jarak_jalan_utama'] ?? 'Tidak Diketahui' }}</td>
|
||||
<td>{{ $forminspeksi['lingkungan']['jalan_linkungan'] ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jarak CBD Point</td>
|
||||
<td>{{ $forminspeksi['lingkungan']['jarak_cbd_point'] ?? 'Tidak Diketahui' }}</td>
|
||||
<td>{{ $forminspeksi['lingkungan']['jarak_cbd_point'] ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Nama CBD Point</td>
|
||||
<td>{{ $forminspeksi['lingkungan']['nama_cbd_point'] ?? 'Tidak Diketahui' }}</td>
|
||||
<td>{{ $forminspeksi['lingkungan']['nama_cbd_point'] ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Lebar Perkerasan Jalan</td>
|
||||
<td>{{ $forminspeksi['lingkungan']['lebar_perkerasan_jalan'] ?? 'Tidak Diketahui' }}</td>
|
||||
<td>{{ $forminspeksi['lingkungan']['lebar_perkerasan_jalan'] ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="vertical-align: top;"><strong>Sarana Pelengkap</strong></td>
|
||||
@@ -191,6 +191,55 @@
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td style="vertical-align: top;"><strong>Dekat Makam</strong></td>
|
||||
<td>
|
||||
<div class="checkbox-item">
|
||||
<label class="checkbox-label">
|
||||
<input type="radio" name="disekitar_lokasi" value="ya"
|
||||
{{ ($forminspeksi['lingkungan']['dekat_makam'] ?? '') == 'ya' ? 'checked' : '' }}>
|
||||
Ya
|
||||
@if (($forminspeksi['lingkungan']['dekat_makam'] ?? '') == 'ya')
|
||||
- Nama Makam:
|
||||
{{ $forminspeksi['lingkungan']['nama_makam'] ?? '' }}
|
||||
, Jarak Makam:
|
||||
{{ $forminspeksi['lingkungan']['jarak_makam'] ?? '' }}
|
||||
@endif
|
||||
</label>
|
||||
<label class="checkbox-label">
|
||||
<input type="radio" name="disekitar_lokasi" value="tidak"
|
||||
{{ ($forminspeksi['lingkungan']['dekat_makam'] ?? '') == 'tidak' ? 'checked' : '' }}>
|
||||
Tidak
|
||||
</label>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td style="vertical-align: top;"><strong>Dekat TPS</strong></td>
|
||||
<td>
|
||||
<div class="checkbox-item">
|
||||
<label class="checkbox-label">
|
||||
<input type="radio" name="disekitar_lokasi" value="ya"
|
||||
{{ ($forminspeksi['lingkungan']['dekat_tps'] ?? '') == 'ya' ? 'checked' : '' }}>
|
||||
Ya
|
||||
@if (($forminspeksi['lingkungan']['dekat_tps'] ?? '') == 'ya')
|
||||
- Nama TPS:
|
||||
{{ $forminspeksi['lingkungan']['nama_tps'] ?? '' }}
|
||||
, Jarak TPS:
|
||||
{{ $forminspeksi['lingkungan']['jarak_tps'] ?? '' }}
|
||||
@endif
|
||||
</label>
|
||||
<label class="checkbox-label">
|
||||
<input type="radio" name="disekitar_lokasi" value="tidak"
|
||||
{{ ($forminspeksi['lingkungan']['dekat_tps'] ?? '') == 'tidak' ? 'checked' : '' }}>
|
||||
Tidak
|
||||
</label>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="vertical-align: top;"><strong>Merupakan Daerah</strong></td>
|
||||
<td>
|
||||
|
||||
@@ -193,6 +193,12 @@
|
||||
.page-break {
|
||||
page-break-after: always;
|
||||
}
|
||||
|
||||
.no-break {
|
||||
page-break-inside: avoid;
|
||||
page-break-before: auto;
|
||||
page-break-after: auto;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
@@ -308,7 +314,13 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Nama Debiture/ Wakil Debiture</strong></td>
|
||||
<td>{{ $permohonan->debiture->name ?? '' }}</td>
|
||||
<td>{{ $permohonan->debiture->name ?? '' }}
|
||||
@if (isset($forminspeksi['asset']['debitur_perwakilan']) && !empty($forminspeksi['asset']['debitur_perwakilan']))
|
||||
@foreach ($forminspeksi['asset']['debitur_perwakilan'] as $key => $item)
|
||||
/ {{ $item }}
|
||||
@endforeach
|
||||
@endif
|
||||
</td>
|
||||
<td><strong>Kunjungan Tanggal</strong></td>
|
||||
<td>{{ formatTanggalIndonesia($permohonan->penilaian->tanggal_kunjungan) }}</td>
|
||||
</tr>
|
||||
@@ -424,9 +436,11 @@
|
||||
<table>
|
||||
@if (@isset($dokumen))
|
||||
@foreach ($dokumen->detail as $detail)
|
||||
<tr>
|
||||
@if (isset($detail->dokumen_jaminan))
|
||||
@if (isset($detail->dokumen_jaminan))
|
||||
<tr>
|
||||
<td width="25%"><strong>{{ $detail->name ?? '' }}</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
@if (isset($detail->dokumen_jaminan))
|
||||
@php
|
||||
@@ -449,27 +463,28 @@
|
||||
@endforeach
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
</tr>
|
||||
@endif
|
||||
|
||||
<tr>
|
||||
@if (isset($detail->details))
|
||||
@if (json_decode($detail->details))
|
||||
@foreach (json_decode($detail->details) as $key => $value)
|
||||
@if (!is_null($value) && $value !== '')
|
||||
<td style=" padding: 2px;">{{ ucwords(str_replace('_', ' ', $key)) ?? '' }}
|
||||
@if (isset($detail->details))
|
||||
@if (json_decode($detail->details))
|
||||
@foreach (json_decode($detail->details) as $key => $value)
|
||||
@if (!is_null($value) && $value !== '')
|
||||
<tr>
|
||||
<td style="padding: 2px;">
|
||||
{{ ucwords(str_replace('_', ' ', $key)) ?? '' }}
|
||||
</td>
|
||||
|
||||
<td style=" padding: 2px;">{{ $value }}
|
||||
<td style="padding: 2px;">
|
||||
{{ $value }}
|
||||
@if ($key == 'luas_bangunan' || $key == 'luas_tanah')
|
||||
<sup>m2</sup>
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
</tr>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
</tr>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
@@ -553,10 +568,12 @@
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@if (strtolower($permohonan->tujuanPenilaian->name) == 'rap')
|
||||
@include('lpj::surveyor.components.print-out.rap')
|
||||
@else
|
||||
<tr>
|
||||
|
||||
<td style="text-align: center; border: 1px solid #000;">
|
||||
E
|
||||
</td>
|
||||
@@ -597,7 +614,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
@endIf
|
||||
|
||||
</div>
|
||||
{{-- <tr>
|
||||
<td style="text-align: center; border: 1px solid #000;">
|
||||
G
|
||||
|
||||
@@ -174,7 +174,7 @@
|
||||
|
||||
<tr>
|
||||
<td style="text-align: center; border: 1px solid #000;">
|
||||
|
||||
|
||||
</td>
|
||||
<td style=" border: 1px solid #000;">
|
||||
<table>
|
||||
@@ -201,7 +201,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: center; border: 1px solid #000;">
|
||||
|
||||
|
||||
</td>
|
||||
<td style=" border: 1px solid #000;">
|
||||
<table>
|
||||
@@ -228,7 +228,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: center; border: 1px solid #000;">
|
||||
|
||||
|
||||
</td>
|
||||
<td style=" border: 1px solid #000;">
|
||||
<table>
|
||||
@@ -254,7 +254,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: center; border: 1px solid #000;">
|
||||
|
||||
|
||||
</td>
|
||||
<td style=" border: 1px solid #000;">
|
||||
<table>
|
||||
@@ -281,7 +281,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: center; border: 1px solid #000;">
|
||||
|
||||
|
||||
</td>
|
||||
<td style=" border: 1px solid #000;">
|
||||
<table>
|
||||
@@ -307,7 +307,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: center; border: 1px solid #000;">
|
||||
|
||||
|
||||
</td>
|
||||
<td style=" border: 1px solid #000;">
|
||||
<table>
|
||||
@@ -333,7 +333,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: center; border: 1px solid #000;">
|
||||
|
||||
|
||||
</td>
|
||||
<td style=" border: 1px solid #000;">
|
||||
<table>
|
||||
@@ -347,7 +347,7 @@
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
@endisset
|
||||
@isset($forminspeksi['rute_menuju_lokasi'])
|
||||
<tr>
|
||||
@@ -360,7 +360,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: center; border: 1px solid #000;">
|
||||
|
||||
|
||||
</td>
|
||||
<td style=" border: 1px solid #000;">
|
||||
<table>
|
||||
@@ -373,12 +373,36 @@
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@endisset
|
||||
@isset($forminspeksi['properti_sejenis'])
|
||||
<tr>
|
||||
<td style="text-align: center; border: 1px solid #000;">
|
||||
P
|
||||
</td>
|
||||
<td style="text-align: center; border: 1px solid #000;">
|
||||
PROPERTI SEJENIS
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: center; border: 1px solid #000;">
|
||||
|
||||
</td>
|
||||
<td style=" border: 1px solid #000;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
{{ $forminspeksi['properti_sejenis'] ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
@endisset
|
||||
@if (isset($forminspeksi['fakta']) && is_array($forminspeksi['fakta']))
|
||||
<tr>
|
||||
<td style="text-align: center; border: 1px solid #000;">
|
||||
P
|
||||
Q
|
||||
</td>
|
||||
<td style="text-align: center; border: 1px solid #000;">
|
||||
ATURAN TATA KOTA
|
||||
@@ -386,7 +410,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: center; border: 1px solid #000;">
|
||||
|
||||
|
||||
</td>
|
||||
<td style=" border: 1px solid #000;">
|
||||
<table>
|
||||
@@ -403,7 +427,7 @@
|
||||
'nama_petugas',
|
||||
];
|
||||
@endphp
|
||||
|
||||
|
||||
@if (isset($forminspeksi['fakta']) && is_array($forminspeksi['fakta']))
|
||||
@foreach ($informasi as $key)
|
||||
@if (isset($forminspeksi['fakta'][$key]) && $forminspeksi['fakta'][$key] !== '-')
|
||||
@@ -415,14 +439,14 @@
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
@endif
|
||||
|
||||
@isset($forminspeksi['fakta']['keterangan'])
|
||||
|
||||
<tr>
|
||||
<td style="text-align: center; border: 1px solid #000;">
|
||||
P
|
||||
R
|
||||
</td>
|
||||
<td style="text-align: center; border: 1px solid #000;">
|
||||
CATATAN LAINNYA
|
||||
@@ -430,7 +454,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: center; border: 1px solid #000;">
|
||||
|
||||
|
||||
</td>
|
||||
<td style=" border: 1px solid #000;">
|
||||
<table>
|
||||
@@ -444,5 +468,5 @@
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
@endisset
|
||||
|
||||
@@ -123,13 +123,16 @@
|
||||
<td><strong>Tusuk Sate</strong></td>
|
||||
<td>
|
||||
<label>
|
||||
<input type="radio" name="tusuk_sate" value="yes"
|
||||
{{ $forminspeksi['tanah']['tusuk_sate'] == 'yes' ? 'checked' : '' }}>
|
||||
<input type="radio" name="tusuk_sate" value="Ya"
|
||||
{{ isset($forminspeksi['tanah']['tusuk_sate']['Ya']) && $forminspeksi['tanah']['tusuk_sate']['Ya'] ? 'checked' : '' }}>
|
||||
Ya
|
||||
@if (isset($forminspeksi['tanah']['tusuk_sate']) && $forminspeksi['tanah']['tusuk_sate']['Ya'])
|
||||
{{ isset($forminspeksi['tanah']['tusuk_sate']['Ya']) ? ' (' . $forminspeksi['tanah']['tusuk_sate']['Ya'] . ')' : '' }}
|
||||
@endif
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="tusuk_sate" value="no"
|
||||
{{ $forminspeksi['tanah']['tusuk_sate'] == 'no' ? 'checked' : '' }}>
|
||||
<input type="radio" name="tusuk_sate" value="Tidak"
|
||||
{{isset($forminspeksi['tanah']['tusuk_sate']['Tidak']) && $forminspeksi['tanah']['tusuk_sate']['Tidak'] ? 'checked' : '' }}>
|
||||
Tidak
|
||||
</label>
|
||||
</td>
|
||||
@@ -139,12 +142,12 @@
|
||||
<td>
|
||||
<label>
|
||||
<input type="radio" name="lockland" value="yes"
|
||||
{{ $forminspeksi['tanah']['lockland'] == 'yes' ? 'checked' : '' }}>
|
||||
{{ isset($forminspeksi['tanah']['lockland']) && $forminspeksi['tanah']['lockland'] == 'yes' ? 'checked' : '' }}>
|
||||
Ya
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="lockland" value="no"
|
||||
{{ $forminspeksi['tanah']['lockland'] == 'no' ? 'checked' : '' }}>
|
||||
{{ isset($forminspeksi['tanah']['lockland']) && $forminspeksi['tanah']['lockland'] == 'no' ? 'checked' : '' }}>
|
||||
Tidak
|
||||
</label>
|
||||
</td>
|
||||
|
||||
@@ -693,4 +693,36 @@
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card border border-agi-100 w-full rounded-lg shadow-md overflow-hidden">
|
||||
<div class="card-header bg-agi-50">
|
||||
<h3 class="card-title uppercase">
|
||||
Properti Sejenis
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
|
||||
<div id="fakta-positif-container" class="flex flex-wrap items-baseline w-full">
|
||||
@if (!empty($forminspeksi['properti_sejenis']))
|
||||
<div class="properti_sejenis flex items-center gap-2 mt-2 textarea-group w-full">
|
||||
<textarea class="textarea mt-2" name="properti_sejenis" rows="10">{{ old('properti_sejenis', $forminspeksi['properti_sejenis']) }}</textarea>
|
||||
<button class="btn btn-danger btn-sm remove-btn" type="button" style="display: none;">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
@else
|
||||
<div class="properti_sejenis flex items-center gap-2 mt-2 textarea-group w-full">
|
||||
<textarea class="textarea mt-2" name="properti_sejenis" rows="10">{{ old('properti_sejenis') }}</textarea>
|
||||
<button class="btn btn-danger btn-sm remove-btn" type="button" style="display: none;">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@include('lpj::surveyor.components.informasi')
|
||||
|
||||
@@ -13,16 +13,16 @@
|
||||
@if (isset($permohonan->documents))
|
||||
@foreach ($permohonan->documents as $item)
|
||||
@php
|
||||
$luas_tanah = 0;
|
||||
if ($item->detail) {
|
||||
foreach ($item->detail as $luas) {
|
||||
if (isset($luas->name) && $luas->jenis_legalitas_jaminan_id === 1) {
|
||||
$details = json_decode($luas->details, true);
|
||||
$luas_tanah = isset($details['luas_tanah']) ? $details['luas_tanah'] : 0;
|
||||
break;
|
||||
$luas_tanah = 0;
|
||||
if ($item->detail) {
|
||||
foreach ($item->detail as $luas) {
|
||||
if (isset($luas->name) && $luas->jenis_legalitas_jaminan_id === 1) {
|
||||
$details = json_decode($luas->details, true);
|
||||
$luas_tanah = isset($details['luas_tanah']) ? $details['luas_tanah'] : 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@endphp
|
||||
<input type="hidden" name="luas_tanah_sesuai" class="input" value="{{ $luas_tanah }}">
|
||||
<p class="text-2sm text-gray-700">{{ $luas_tanah }} m<sup>2</sup></p>
|
||||
@@ -33,26 +33,26 @@
|
||||
<div class="grid grid-cols-3 md:grid-cols-3 gap-4 mt-2">
|
||||
<label class="form-label flex items-center gap-3 text-nowrap">
|
||||
<input type="radio" class="radio" name="luas_tanah" value="sesuai"
|
||||
onclick="toggleFieldVisibility('luas_tanah', 'luas_tanah_tidak_sesuai', ['tidak sesuai'])"
|
||||
onclick="toggleFieldVisibility('luas_tanah', 'luas_tanah_tidak_sesuai', ['tidak sesuai'])"
|
||||
{{ old('luas_tanah', isset($forminspeksi['tanah']['luas_tanah']['sesuai'])) ? 'checked' : '' }}>
|
||||
<span class="ml-2">Sesuai</span>
|
||||
</label>
|
||||
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
||||
<input type="radio" class="radio" name="luas_tanah" value="tidak sesuai"
|
||||
onclick="toggleFieldVisibility('luas_tanah', 'luas_tanah_tidak_sesuai', ['tidak sesuai'])"
|
||||
onclick="toggleFieldVisibility('luas_tanah', 'luas_tanah_tidak_sesuai', ['tidak sesuai'])"
|
||||
{{ old('luas_tanah', isset($forminspeksi['tanah']['luas_tanah']['tidak sesuai'])) ? 'checked' : '' }}>
|
||||
<span class="ml-2">Tidak Sesuai</span>
|
||||
</label>
|
||||
<div id="luas_tanah_tidak_sesuai" class="flex items-baseline gap-2"
|
||||
style="{{ old('luas_tanah', isset($forminspeksi['tanah']['luas_tanah']['tidak sesuai'])) ? '' : 'display: none;' }}">
|
||||
<div class="input">
|
||||
<input id="analisa_tanah_tidak_sesuai" type="text" name="luas_tanah_tidak_sesuai"
|
||||
class="w-full number-format" placeholder="Masukan Luas Tanah"
|
||||
value="{{ old('luas_tanah_tidak_sesuai', $forminspeksi['tanah']['luas_tanah']['tidak sesuai'] ?? '') }}">
|
||||
<i>M<sup>2</sup></i>
|
||||
</div>
|
||||
style="{{ old('luas_tanah', isset($forminspeksi['tanah']['luas_tanah']['tidak sesuai'])) ? '' : 'display: none;' }}">
|
||||
<div class="input">
|
||||
<input id="analisa_tanah_tidak_sesuai" type="text" name="luas_tanah_tidak_sesuai"
|
||||
class="w-full number-format" placeholder="Masukan Luas Tanah"
|
||||
value="{{ old('luas_tanah_tidak_sesuai', $forminspeksi['tanah']['luas_tanah']['tidak sesuai'] ?? '') }}">
|
||||
<i>M<sup>2</sup></i>
|
||||
</div>
|
||||
<button type="button" class="btn btn-md btn-primary"
|
||||
onclick="updateAnalisa('analisa_tanah')">Save
|
||||
onclick="updateAnalisa('analisa_tanah')">Save
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -70,42 +70,41 @@
|
||||
<div class="grid grid-cols-3 md:grid-cols-3 gap-4 mt-2">
|
||||
<label class="form-label flex items-center gap-3 text-nowrap">
|
||||
<input type="radio" class="radio" name="hadap_mata_angin" value="sesuai"
|
||||
onclick="toggleFieldVisibility('hadap_mata_angin', 'hadap_mata_angin_tidak_sesuai' ,['tidak sesuai'])"
|
||||
onclick="toggleFieldVisibility('hadap_mata_angin', 'hadap_mata_angin_tidak_sesuai' ,['tidak sesuai'])"
|
||||
{{ old('hadap_mata_angin', isset($forminspeksi['tanah']['hadap_mata_angin']['sesuai'])) ? 'checked' : '' }}>
|
||||
<span class="ml-2">Sesuai</span>
|
||||
</label>
|
||||
|
||||
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
||||
<input type="radio" class="radio" name="hadap_mata_angin" value="tidak sesuai"
|
||||
onclick="toggleFieldVisibility('hadap_mata_angin', 'hadap_mata_angin_tidak_sesuai' ,['tidak sesuai'])"
|
||||
onclick="toggleFieldVisibility('hadap_mata_angin', 'hadap_mata_angin_tidak_sesuai' ,['tidak sesuai'])"
|
||||
{{ old('hadap_mata_angin', isset($forminspeksi['tanah']['hadap_mata_angin']['tidak sesuai'])) ? 'checked' : '' }}>
|
||||
<span class="ml-2">Tidak Sesuai</span>
|
||||
</label>
|
||||
|
||||
<!-- Select dropdown untuk "Tidak Sesuai" -->
|
||||
<div id="hadap_mata_angin_tidak_sesuai" class="flex items-baseline gap-2"
|
||||
style="{{ old('hadap_mata_angin', isset($forminspeksi['tanah']['hadap_mata_angin']['tidak sesuai'])) ? '' : 'display: none;' }}">
|
||||
<select
|
||||
class="input w-full
|
||||
id=" hadap_mata_angin_tidak_sesuai"
|
||||
name="hadap_mata_angin_tidak_sesuai">
|
||||
@php
|
||||
$statusKey = isset($forminspeksi['tanah']['hadap_mata_angin']['sesuai'])
|
||||
? 'sesuai'
|
||||
: 'tidak sesuai';
|
||||
$selectedData = $forminspeksi['tanah']['hadap_mata_angin'][$statusKey] ?? null;
|
||||
@endphp
|
||||
<option value="">Select Hadap Mata Angin</option>
|
||||
@if (isset($basicData['arahMataAngin']))
|
||||
@foreach ($basicData['arahMataAngin'] as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('hadap_mata_angin_tidak_sesuai', $selectedData ?? '') == $item->name ? 'selected' : '' }}>
|
||||
{{ $item->name }}
|
||||
</option>
|
||||
style="{{ old('hadap_mata_angin', isset($forminspeksi['tanah']['hadap_mata_angin']['tidak sesuai'])) ? '' : 'display: none;' }}">
|
||||
<select class="input w-full
|
||||
id="
|
||||
hadap_mata_angin_tidak_sesuai" name="hadap_mata_angin_tidak_sesuai">
|
||||
@php
|
||||
$statusKey = isset($forminspeksi['tanah']['hadap_mata_angin']['sesuai'])
|
||||
? 'sesuai'
|
||||
: 'tidak sesuai';
|
||||
$selectedData = $forminspeksi['tanah']['hadap_mata_angin'][$statusKey] ?? null;
|
||||
@endphp
|
||||
<option value="">Select Hadap Mata Angin</option>
|
||||
@if (isset($basicData['arahMataAngin']))
|
||||
@foreach ($basicData['arahMataAngin'] as $item)
|
||||
<option value="{{ $item->name }}"
|
||||
{{ old('hadap_mata_angin_tidak_sesuai', $selectedData ?? '') == $item->name ? 'selected' : '' }}>
|
||||
{{ $item->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
{{-- <button type="button" class="btn btn-md btn-primary" onclick="updateAnalisa('hadap_mata_angin')">Save</button> --}}
|
||||
@endif
|
||||
</select>
|
||||
{{-- <button type="button" class="btn btn-md btn-primary" onclick="updateAnalisa('hadap_mata_angin')">Save</button> --}}
|
||||
</div>
|
||||
</div>
|
||||
<em id="error-hadap_mata_angin" class="alert text-danger text-sm"></em>
|
||||
@@ -122,22 +121,22 @@
|
||||
<div class="flex items-center">
|
||||
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
||||
<input class="checkbox" name="bentuk_tanah[]" type="checkbox"
|
||||
value="{{ $item->name }}"
|
||||
{{ in_array($item->name, old('bentuk_tanah', [])) ||
|
||||
(isset($forminspeksi['tanah']['bentuk_tanah']['bentuk_tanah']) &&
|
||||
is_array($forminspeksi['tanah']['bentuk_tanah']['bentuk_tanah']) &&
|
||||
in_array($item->name, $forminspeksi['tanah']['bentuk_tanah']['bentuk_tanah']))
|
||||
? 'checked'
|
||||
: '' }}
|
||||
onclick="toggleCheckboxVisibility('bentuk_tanah', 'bentuk_tanah_lainnya', ['lainnya'])"/>
|
||||
value="{{ $item->name }}"
|
||||
{{ in_array($item->name, old('bentuk_tanah', [])) ||
|
||||
(isset($forminspeksi['tanah']['bentuk_tanah']['bentuk_tanah']) &&
|
||||
is_array($forminspeksi['tanah']['bentuk_tanah']['bentuk_tanah']) &&
|
||||
in_array($item->name, $forminspeksi['tanah']['bentuk_tanah']['bentuk_tanah']))
|
||||
? 'checked'
|
||||
: '' }}
|
||||
onclick="toggleCheckboxVisibility('bentuk_tanah', 'bentuk_tanah_lainnya', ['lainnya'])" />
|
||||
{{ $item->name }}
|
||||
</label>
|
||||
@if (strcasecmp($item->name, 'lainnya') == 0)
|
||||
<input id="bentuk_tanah_lainnya" type="text"
|
||||
style="{{ isset($forminspeksi['tanah']['bentuk_tanah']['lainnya']) && $forminspeksi['tanah']['bentuk_tanah']['lainnya'] ? '' : 'display: none;' }}"
|
||||
name="bentuk_tanah_lainnya" class="input w-full mt-2"
|
||||
placeholder="Masukkan bentuk tanah..."
|
||||
value="{{ old('bentuk_tanah_lainnya', $forminspeksi['tanah']['bentuk_tanah']['lainnya'] ?? '') }}"/>
|
||||
style="{{ isset($forminspeksi['tanah']['bentuk_tanah']['lainnya']) && $forminspeksi['tanah']['bentuk_tanah']['lainnya'] ? '' : 'display: none;' }}"
|
||||
name="bentuk_tanah_lainnya" class="input w-full mt-2"
|
||||
placeholder="Masukkan bentuk tanah..."
|
||||
value="{{ old('bentuk_tanah_lainnya', $forminspeksi['tanah']['bentuk_tanah']['lainnya'] ?? '') }}" />
|
||||
@endif
|
||||
</div>
|
||||
@endforeach
|
||||
@@ -155,7 +154,7 @@
|
||||
@foreach ($basicData['konturTanah'] as $item)
|
||||
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
||||
<input class="checkbox" name="kontur_tanah[]" type="checkbox"
|
||||
value="{{ $item->name }}"
|
||||
value="{{ $item->name }}"
|
||||
{{ in_array($item->name, old('kontur_tanah', $forminspeksi['tanah']['kontur_tanah'] ?? [])) ? 'checked' : '' }} />
|
||||
{{ $item->name }}
|
||||
</label>
|
||||
@@ -175,24 +174,24 @@
|
||||
<div class="flex flex-col gap-2">
|
||||
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
||||
<input class="checkbox" name="ketinggian_jalan[]" type="checkbox"
|
||||
value="{{ $item->name }}"
|
||||
{{ in_array($item->name, old('ketinggian_jalan', $forminspeksi['tanah']['ketinggian_jalan'] ?? [])) ? 'checked' : '' }}
|
||||
onclick="toggleMultipleFields('ketinggian_jalan', {
|
||||
value="{{ $item->name }}"
|
||||
{{ in_array($item->name, old('ketinggian_jalan', $forminspeksi['tanah']['ketinggian_jalan'] ?? [])) ? 'checked' : '' }}
|
||||
onclick="toggleMultipleFields('ketinggian_jalan', {
|
||||
'Lebih Tinggi': 'input-lebih-tinggi',
|
||||
'Lebih Rendah': 'input-lebih-rendah'
|
||||
})"/>
|
||||
})" />
|
||||
{{ $item->name }}
|
||||
</label>
|
||||
@if (strcasecmp($item->name, 'Lebih Tinggi') == 0)
|
||||
<input id="input-lebih-tinggi" type="text"
|
||||
style="{{ isset($forminspeksi['tanah']['ketinggian_tanah']['lebih_tinggi']) && $forminspeksi['tanah']['ketinggian_tanah']['lebih_tinggi'] ? '' : 'display: none;' }}"
|
||||
name="ketinggian_lebih_tinggi" class="input w-full mt-2" placeholder="m2"
|
||||
value="{{ old('ketinggian_lebih_tinggi', $forminspeksi['tanah']['ketinggian_tanah']['lebih_tinggi'] ?? '') }}"/>
|
||||
style="{{ isset($forminspeksi['tanah']['ketinggian_tanah']['lebih_tinggi']) && $forminspeksi['tanah']['ketinggian_tanah']['lebih_tinggi'] ? '' : 'display: none;' }}"
|
||||
name="ketinggian_lebih_tinggi" class="input w-full mt-2" placeholder="m2"
|
||||
value="{{ old('ketinggian_lebih_tinggi', $forminspeksi['tanah']['ketinggian_tanah']['lebih_tinggi'] ?? '') }}" />
|
||||
@elseif (strcasecmp($item->name, 'Lebih Rendah') == 0)
|
||||
<input id="input-lebih-rendah" type="text"
|
||||
style="{{ isset($forminspeksi['tanah']['ketinggian_tanah']['lebih_rendah']) && $forminspeksi['tanah']['ketinggian_tanah']['lebih_rendah'] ? '' : 'display: none;' }}"
|
||||
name="ketinggian_lebih_rendah" class="input w-full mt-2" placeholder="m"
|
||||
value="{{ old('ketinggian_lebih_rendah', $forminspeksi['tanah']['ketinggian_tanah']['lebih_rendah'] ?? '') }}"/>
|
||||
style="{{ isset($forminspeksi['tanah']['ketinggian_tanah']['lebih_rendah']) && $forminspeksi['tanah']['ketinggian_tanah']['lebih_rendah'] ? '' : 'display: none;' }}"
|
||||
name="ketinggian_lebih_rendah" class="input w-full mt-2" placeholder="m"
|
||||
value="{{ old('ketinggian_lebih_rendah', $forminspeksi['tanah']['ketinggian_tanah']['lebih_rendah'] ?? '') }}" />
|
||||
@endif
|
||||
|
||||
</div>
|
||||
@@ -247,17 +246,17 @@
|
||||
<div class="flex items-center">
|
||||
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
||||
<input class="checkbox" name="posisi_kavling[]" type="checkbox"
|
||||
value="{{ $item->name }}"
|
||||
{{ in_array($item->name, $selectedPosisiKavling) ? 'checked' : '' }}
|
||||
onclick="toggleCheckboxVisibility('posisi_kavling', 'posisi_kavling_lainnya', ['Lainnya'])"/>
|
||||
value="{{ $item->name }}"
|
||||
{{ in_array($item->name, $selectedPosisiKavling) ? 'checked' : '' }}
|
||||
onclick="toggleCheckboxVisibility('posisi_kavling', 'posisi_kavling_lainnya', ['Lainnya'])" />
|
||||
{{ $item->name }}
|
||||
</label>
|
||||
@if (strcasecmp($item->name, 'Lainnya') == 0)
|
||||
<input id="posisi_kavling_lainnya" type="text"
|
||||
style="{{ $lainnyaValue ? '' : 'display: none' }}"
|
||||
name="posisi_kavling_lainnya" class="input w-full mt-2"
|
||||
placeholder="Masukkan Posisi Kavling lainnya..."
|
||||
value="{{ $lainnyaValue }}"/>
|
||||
style="{{ $lainnyaValue ? '' : 'display: none' }}"
|
||||
name="posisi_kavling_lainnya" class="input w-full mt-2"
|
||||
placeholder="Masukkan Posisi Kavling lainnya..."
|
||||
value="{{ $lainnyaValue }}" />
|
||||
@endif
|
||||
</div>
|
||||
@endforeach
|
||||
@@ -272,14 +271,25 @@
|
||||
<label class="form-label max-w-56">Tusuk Sate</label>
|
||||
<div class="flex-wrap items-stretch">
|
||||
<div class="grid grid-cols-2 md:grid-cols-3 gap-4 mt-2">
|
||||
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
||||
<input type="radio" class="radio" name="tusuk_sate" value="yes"
|
||||
{{ old('tusuk_sate') == 'yes' || (isset($forminspeksi['tanah']['tusuk_sate']) && $forminspeksi['tanah']['tusuk_sate'] == 'yes') ? 'checked' : '' }}>
|
||||
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
||||
<input onclick="toggleFieldVisibility('tusuk_sate', 'tusuk_sate_ya', ['Ya'])"
|
||||
type="radio" class="radio" name="tusuk_sate" value="Ya"
|
||||
{{ old('tusuk_sate') == 'Ya' || (isset($forminspeksi['tanah']['tusuk_sate']['Ya']) && $forminspeksi['tanah']['tusuk_sate']['Ya']) ? 'checked' : '' }}>
|
||||
<span class="ml-2">Ya</span>
|
||||
|
||||
@php
|
||||
$statusKey = isset($forminspeksi['tanah']['tusuk_sate']['Ya']) ? 'Ya' : 'Tidak';
|
||||
$selectedData = $forminspeksi['tanah']['tusuk_sate'][$statusKey] ?? null;
|
||||
@endphp
|
||||
<input id="tusuk_sate_ya" class="input" name="tusuk_sate_ya"
|
||||
placeholder="Masukkan Tusuk Sate..."
|
||||
value="{{ old('tusuk_sate_ya', isset($selectedData) ? $selectedData : '') }}"
|
||||
style="{{ $statusKey == 'Ya' ? '' : 'display: none;' }}">
|
||||
</label>
|
||||
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
||||
<input type="radio" class="radio" name="tusuk_sate" value="no"
|
||||
{{ old('tusuk_sate') == 'no' || (isset($forminspeksi['tanah']['tusuk_sate']) && $forminspeksi['tanah']['tusuk_sate'] == 'no') ? 'checked' : '' }}>
|
||||
<input onclick="toggleFieldVisibility('tusuk_sate', 'tusuk_sate_ya', ['Ya'])"
|
||||
type="radio" class="radio" name="tusuk_sate" value="Tidak"
|
||||
{{ old('tusuk_sate') == 'Tidak' || (isset($forminspeksi['tanah']['tusuk_sate']['Tidak']) && $forminspeksi['tanah']['tusuk_sate']['Tidak']) ? 'checked' : '' }}>
|
||||
<span class="ml-2">Tidak</span>
|
||||
</label>
|
||||
</div>
|
||||
@@ -316,9 +326,9 @@
|
||||
@foreach ($basicData['kondisiFisikTanah'] as $item)
|
||||
<label class="form-label flex items-center gap-2.5 text-nowrap">
|
||||
<input class="checkbox" name="kondisi_fisik_tanah[]" type="checkbox"
|
||||
value="{{ $item->name }}"
|
||||
{{ in_array($item->name, old('kondisi_fisik_tanah', [])) || (isset($forminspeksi['tanah']['kondisi_fisik_tanah']['kondisi_fisik_tanah']) && in_array($item->name, $forminspeksi['tanah']['kondisi_fisik_tanah']['kondisi_fisik_tanah'])) ? 'checked' : '' }}
|
||||
onclick="toggleInputLainnya(this, 'kondisi_fisik_tanah_lainnya', '{{ $item->name }}')"/>
|
||||
value="{{ $item->name }}"
|
||||
{{ in_array($item->name, old('kondisi_fisik_tanah', [])) || (isset($forminspeksi['tanah']['kondisi_fisik_tanah']['kondisi_fisik_tanah']) && in_array($item->name, $forminspeksi['tanah']['kondisi_fisik_tanah']['kondisi_fisik_tanah'])) ? 'checked' : '' }}
|
||||
onclick="toggleInputLainnya(this, 'kondisi_fisik_tanah_lainnya', '{{ $item->name }}')" />
|
||||
{{ $item->name }}
|
||||
</label>
|
||||
|
||||
@@ -326,9 +336,9 @@
|
||||
@if (strcasecmp($item->name, 'lainnya') == 0)
|
||||
<div class="flex items-center">
|
||||
<input type="text" name="kondisi_fisik_tanah_lainnya"
|
||||
id="kondisi_fisik_tanah_lainnya" class="input mt-2"
|
||||
placeholder="Masukkan Kondisi Fisik Tanah..." style="display: none;"
|
||||
value="{{ old('kondisi_fisik_tanah_lainnya', isset($forminspeksi['tanah']['kondisi_fisik_tanah']['lainnya'])) }}">
|
||||
id="kondisi_fisik_tanah_lainnya" class="input mt-2"
|
||||
placeholder="Masukkan Kondisi Fisik Tanah..." style="display: none;"
|
||||
value="{{ old('kondisi_fisik_tanah_lainnya', isset($forminspeksi['tanah']['kondisi_fisik_tanah']['lainnya'])) }}">
|
||||
</div>
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
@@ -22,6 +22,21 @@
|
||||
|
||||
@include('lpj::component.detail-jaminan',['backLink'=>'surveyor.index'])
|
||||
|
||||
@if ($permohonan->status == 'revisi-survey')
|
||||
<div class="card border border-agi-100 min-w-full">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<div class="card-title flex flex-row gap-1.5">
|
||||
Catatan Revisi
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p>{{ $permohonan->keterangan ?? '' }}</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
<div class="card border border-agi-100 min-w-full">
|
||||
<div class="card-header bg-agi-50" id="basic_settings">
|
||||
<div class="card-title flex flex-row gap-1.5">
|
||||
|
||||
@@ -97,65 +97,13 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal" data-modal="true" id="modal_jadwal">
|
||||
<div class="modal-content modal-center-y max-w-[600px]">
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-title">Kunjungan</h3>
|
||||
<button class="btn btn-xs btn-icon btn-light" data-modal-dismiss="true">
|
||||
<i class="ki-outline ki-cross"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form action="{{ route('surveyor.storeJadwal') }}" method="POST" enctype="multipart/form-data"
|
||||
id="revisiForm">
|
||||
@method('put')
|
||||
@csrf
|
||||
<input id="ids" type="hidden" name="id">
|
||||
|
||||
<div class="pl-1 grid gap-2.5">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Tanggal Kunjungan</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input @error('waktu_penilaian') border-danger bg-danger-light @enderror"
|
||||
type="datetime-local" name="waktu_penilaian" value="">
|
||||
@error('waktu_penilaian')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">Catatan</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<textarea id="deskripsi_penilaian"
|
||||
class="textarea @error('deskripsi_penilaian') border-danger bg-danger-light @enderror" rows="3"
|
||||
name="deskripsi_penilaian"></textarea>
|
||||
@error('deskripsi_penilaian')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer justify-end mt-2">
|
||||
<div class="flex gap-4">
|
||||
<button type="button" class="btn btn-light" data-modal-dismiss="true">Cancel</button>
|
||||
<button id="btnSubmit" type="submit" class="btn btn-primary">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css">
|
||||
<script src="https://cdn.jsdelivr.net/npm/flatpickr"></script>
|
||||
<script>
|
||||
function jadwal(id) {
|
||||
document.getElementById('ids').value = id;
|
||||
}
|
||||
|
||||
function surveyorFreeze(permohonanId, noReg, debitur) {
|
||||
|
||||
Swal.fire({
|
||||
@@ -329,11 +277,13 @@
|
||||
};
|
||||
|
||||
// Melakukan AJAX request
|
||||
|
||||
$.ajax({
|
||||
url: useURL,
|
||||
type: "PUT",
|
||||
cache: false,
|
||||
data: input_data,
|
||||
|
||||
dataType: "json",
|
||||
success: function(response) {
|
||||
if (response.status === 'success') {
|
||||
@@ -352,6 +302,224 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function prosesJadwalSurvey(permohonanId) {
|
||||
Swal.fire({
|
||||
title: 'Apakah Anda Yakin?',
|
||||
html: `
|
||||
<div class="text-left space-y-4">
|
||||
<p class="text-gray-700 text-center">Untuk membuat jadwal kunjungan, silahkan isi form berikut!</p>
|
||||
<div>
|
||||
<label for="tanggal_kunjungan" class="block text-sm font-medium text-gray-700 mb-1" style="text-align: start;">Tanggal Kunjungan <span class="text-danger">*</span></label>
|
||||
<input type="date" id="tanggal_kunjungan" class="input" style="margin-top: 10px; width: 100%;" required>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-1 mt-2" style="text-align: start;">Waktu Kunjungan (Format 24 Jam) <span class="text-danger">*</span></label>
|
||||
<div style="display: flex; align-items: center; gap: 10px; margin-top: 10px;">
|
||||
<div style="position: relative; flex: 1;">
|
||||
<input type="text" id="jam_kunjungan" class="input" maxlength="2" style="width: 100%; text-align: center; padding-right: 30px;" placeholder="00">
|
||||
<div style="position: absolute; right: 5px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column;">
|
||||
<button type="button" id="jam_up" class="btn btn-xs btn-light" style="height: 12px; padding: 0 4px; font-size: 10px; margin-bottom: 2px;">▲</button>
|
||||
<button type="button" id="jam_down" class="btn btn-xs btn-light" style="height: 12px; padding: 0 4px; font-size: 10px;">▼</button>
|
||||
</div>
|
||||
</div>
|
||||
<span style="font-weight: bold;">:</span>
|
||||
<div style="position: relative; flex: 1;">
|
||||
<input type="text" id="menit_kunjungan" class="input" maxlength="2" style="width: 100%; text-align: center; padding-right: 30px;" placeholder="00">
|
||||
<div style="position: absolute; right: 5px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column;">
|
||||
<button type="button" id="menit_up" class="btn btn-xs btn-light" style="height: 12px; padding: 0 4px; font-size: 10px; margin-bottom: 2px;">▲</button>
|
||||
<button type="button" id="menit_down" class="btn btn-xs btn-light" style="height: 12px; padding: 0 4px; font-size: 10px;">▼</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div>
|
||||
<label for="deskripsi-penilaian" class="block text-sm font-medium text-gray-700 mb-1 mt-2" style="text-align: start;">Keterangan <span class="text-danger">*</span> </label>
|
||||
<textarea id="deskripsi-penilaian" class="textarea" placeholder="Masukkan keterangan" style="margin-top: 10px;" required></textarea>
|
||||
</div>
|
||||
</div>
|
||||
`,
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Submit',
|
||||
cancelButtonText: 'Batal',
|
||||
didOpen: () => {
|
||||
// Set default value ke waktu saat ini
|
||||
const now = new Date();
|
||||
const dateString = now.toISOString().slice(0, 10);
|
||||
const hours = now.getHours();
|
||||
const minutes = now.getMinutes();
|
||||
|
||||
// Set default values
|
||||
document.getElementById('tanggal_kunjungan').value = dateString;
|
||||
document.getElementById('jam_kunjungan').value = hours.toString().padStart(2, '0');
|
||||
document.getElementById('menit_kunjungan').value = minutes.toString().padStart(2, '0');
|
||||
|
||||
// Handler untuk input jam
|
||||
const jamInput = document.getElementById('jam_kunjungan');
|
||||
const jamUp = document.getElementById('jam_up');
|
||||
const jamDown = document.getElementById('jam_down');
|
||||
|
||||
// Validasi hanya angka untuk jam
|
||||
jamInput.addEventListener('input', function(e) {
|
||||
this.value = this.value.replace(/[^0-9]/g, '').substring(0, 2);
|
||||
let value = parseInt(this.value, 10);
|
||||
|
||||
if (!isNaN(value)) {
|
||||
if (value > 23) {
|
||||
this.value = "00";
|
||||
} else {
|
||||
this.value = value.toString().padStart(2, '0');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
jamInput.addEventListener('blur', function() {
|
||||
if (this.value === "" || isNaN(parseInt(this.value, 10))) {
|
||||
this.value = "00";
|
||||
} else {
|
||||
this.value = parseInt(this.value, 10).toString().padStart(2, '0');
|
||||
}
|
||||
});
|
||||
|
||||
// Button handlers untuk jam
|
||||
jamUp.addEventListener('click', function() {
|
||||
let value = parseInt(jamInput.value, 10);
|
||||
if (isNaN(value)) value = 0;
|
||||
|
||||
value = (value + 1) % 24;
|
||||
jamInput.value = value.toString().padStart(2, '0');
|
||||
});
|
||||
|
||||
jamDown.addEventListener('click', function() {
|
||||
let value = parseInt(jamInput.value, 10);
|
||||
if (isNaN(value)) value = 0;
|
||||
|
||||
value = (value - 1 + 24) % 24;
|
||||
jamInput.value = value.toString().padStart(2, '0');
|
||||
});
|
||||
|
||||
// Handler untuk input menit
|
||||
const menitInput = document.getElementById('menit_kunjungan');
|
||||
const menitUp = document.getElementById('menit_up');
|
||||
const menitDown = document.getElementById('menit_down');
|
||||
|
||||
// Validasi hanya angka untuk menit
|
||||
menitInput.addEventListener('input', function(e) {
|
||||
this.value = this.value.replace(/[^0-9]/g, '').substring(0, 2);
|
||||
let value = parseInt(this.value, 10);
|
||||
|
||||
if (!isNaN(value)) {
|
||||
if (value > 59) {
|
||||
this.value = "00";
|
||||
} else {
|
||||
this.value = value.toString().padStart(2, '0');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
menitInput.addEventListener('blur', function() {
|
||||
if (this.value === "" || isNaN(parseInt(this.value, 10))) {
|
||||
this.value = "00";
|
||||
} else {
|
||||
this.value = parseInt(this.value, 10).toString().padStart(2, '0');
|
||||
}
|
||||
});
|
||||
|
||||
// Button handlers untuk menit
|
||||
menitUp.addEventListener('click', function() {
|
||||
let value = parseInt(menitInput.value, 10);
|
||||
if (isNaN(value)) value = 0;
|
||||
|
||||
value = (value + 1) % 60;
|
||||
menitInput.value = value.toString().padStart(2, '0');
|
||||
});
|
||||
|
||||
menitDown.addEventListener('click', function() {
|
||||
let value = parseInt(menitInput.value, 10);
|
||||
if (isNaN(value)) value = 0;
|
||||
|
||||
value = (value - 1 + 60) % 60;
|
||||
menitInput.value = value.toString().padStart(2, '0');
|
||||
});
|
||||
},
|
||||
preConfirm: () => {
|
||||
// Ambil nilai input
|
||||
const tanggalKunjungan = document.getElementById('tanggal_kunjungan').value;
|
||||
let jamKunjungan = document.getElementById('jam_kunjungan').value;
|
||||
let menitKunjungan = document.getElementById('menit_kunjungan').value;
|
||||
const keteranganInspeksi = document.getElementById('deskripsi-penilaian').value;
|
||||
|
||||
// Validasi input: cek apakah input kosong
|
||||
if (!tanggalKunjungan.trim()) {
|
||||
Swal.showValidationMessage('Harap mengisi Tanggal Kunjungan.');
|
||||
return false;
|
||||
}
|
||||
if (!jamKunjungan || !menitKunjungan) {
|
||||
Swal.showValidationMessage('Harap mengisi Waktu Kunjungan.');
|
||||
return false;
|
||||
}
|
||||
if (!keteranganInspeksi.trim()) {
|
||||
Swal.showValidationMessage('Harap mengisi Keterangan.');
|
||||
return false;
|
||||
}
|
||||
|
||||
// Pastikan format 2 digit
|
||||
jamKunjungan = parseInt(jamKunjungan, 10).toString().padStart(2, '0');
|
||||
menitKunjungan = parseInt(menitKunjungan, 10).toString().padStart(2, '0');
|
||||
|
||||
// Gabungkan tanggal dan waktu dalam format ISO
|
||||
const datetimeValue = `${tanggalKunjungan}T${jamKunjungan}:${menitKunjungan}`;
|
||||
|
||||
// Jika semua valid, kembalikan data
|
||||
return {
|
||||
tanggal: datetimeValue,
|
||||
keterangan: keteranganInspeksi
|
||||
};
|
||||
}
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
const {
|
||||
tanggal,
|
||||
keterangan
|
||||
} = result.value;
|
||||
|
||||
let token = "{{ csrf_token() }}";
|
||||
let useURL = "/surveyor/store-jadwal/" + permohonanId;
|
||||
|
||||
let input_data = {
|
||||
_token: token,
|
||||
id: permohonanId,
|
||||
waktu_penilaian: tanggal,
|
||||
deskripsi_penilaian: keterangan
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
url: useURL,
|
||||
type: "POST",
|
||||
cache: false,
|
||||
data: input_data,
|
||||
success: function(response) {
|
||||
if (response.success) {
|
||||
Swal.fire('Berhasil!', 'Berhasil membuat jadwal.', 'success').then(
|
||||
() => {
|
||||
window.location.reload();
|
||||
});
|
||||
} else {
|
||||
Swal.fire('Error!', response.message, 'error');
|
||||
}
|
||||
},
|
||||
error: function(response) {
|
||||
const errorMessage = response.responseJSON?.message ||
|
||||
'Terjadi kesalahan saat memproses data.';
|
||||
Swal.fire('Error!', errorMessage, 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<script type="module">
|
||||
@@ -410,12 +578,10 @@
|
||||
render: (item, data) => {
|
||||
let tooltip = '';
|
||||
|
||||
if (data.status === 'revisi-laporan') {
|
||||
if (data.status === 'revisi-laporan' || data.status === 'revisi-survey') {
|
||||
tooltip = data.keterangan || '';
|
||||
} else if (data.status === 'reschedule') {
|
||||
tooltip = data.penilaian?.reschedule_note || '';
|
||||
} else {
|
||||
tooltip = '';
|
||||
}
|
||||
|
||||
return `
|
||||
@@ -444,8 +610,7 @@
|
||||
(data.penilaian.waktu_penilaian && data.penilaian.authorized_status == null)) {
|
||||
actionHtml += `
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-primary"
|
||||
data-modal-toggle="#modal_jadwal"
|
||||
onclick="jadwal(${data.penilaian.id})"
|
||||
onclick="prosesJadwalSurvey(${data.penilaian.id})"
|
||||
title="Buat Jadwal Kunjungan">
|
||||
<i class="ki-filled ki-calendar-edit"></i>
|
||||
</a>
|
||||
|
||||
@@ -3,19 +3,7 @@
|
||||
const ruteLainnyaDiv = document.getElementById("ruteLainnya");
|
||||
const lantaiLainnyaDiv = document.getElementById("lantaiLainnya");
|
||||
|
||||
// Function to add delete event listeners to existing buttons
|
||||
function addDeleteListeners(container) {
|
||||
container.querySelectorAll(".delete-btn").forEach(button => {
|
||||
button.addEventListener("click", function() {
|
||||
this.closest(
|
||||
".flex.items-baseline.flex-wrap.lg\\:flex-nowrap.gap-2\\.5.mb-5")
|
||||
.remove();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// Add delete listeners to existing buttons
|
||||
addDeleteListeners(ruteLainnyaDiv);
|
||||
|
||||
// Create new div for additional items
|
||||
function createNewDiv(container, inputName) {
|
||||
@@ -64,13 +52,8 @@
|
||||
}
|
||||
|
||||
// Event listener for adding more items
|
||||
document.getElementById("btnAddMore").addEventListener("click", function() {
|
||||
createNewDiv(ruteLainnyaDiv, "rute_lainnya");
|
||||
});
|
||||
|
||||
document.getElementById("btnAddMoreObject").addEventListener("click", function() {
|
||||
createNewDiv(lantaiLainnyaDiv, "lantai_lainnya");
|
||||
});
|
||||
|
||||
|
||||
function setupInputHandlers(containerId, buttonId, labelText, inputDataClass, buttonDeleteClass) {
|
||||
const addButton = document.getElementById(buttonId);
|
||||
|
||||
@@ -600,7 +600,7 @@
|
||||
|
||||
Breadcrumbs::for('penilai.show', function (BreadcrumbTrail $trail) {
|
||||
$trail->parent('penilai');
|
||||
$trail->push('Detail Penilai');
|
||||
$trail->push('Detail Penilaian');
|
||||
});
|
||||
|
||||
Breadcrumbs::for('penilai.edit', function (BreadcrumbTrail $trail) {
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Modules\Lpj\Http\Controllers\ActivityController;
|
||||
use Modules\Lpj\Http\Controllers\ArahMataAnginController;
|
||||
use Modules\Lpj\Http\Controllers\CustomFieldController;
|
||||
use Modules\Lpj\Http\Controllers\DebitureController;
|
||||
use Modules\Lpj\Http\Controllers\CustomFieldController;
|
||||
use Modules\Lpj\Http\Controllers\DebitureController;
|
||||
use Modules\Lpj\Http\Controllers\DokumenJaminanController;
|
||||
use Modules\Lpj\Http\Controllers\HubunganPemilikJaminanController;
|
||||
use Modules\Lpj\Http\Controllers\HubunganPenghuniJaminanController;
|
||||
@@ -552,7 +552,7 @@ Route::middleware(['auth'])->group(function () {
|
||||
Route::get('{id}/show', [SurveyorController::class, 'show'])->name('show');
|
||||
Route::post('store', [SurveyorController::class, 'store'])->name('store');
|
||||
Route::post('storeDenah', [SurveyorController::class, 'storeDenah'])->name('storeDenah');
|
||||
Route::put('storeJadwal', [SurveyorController::class, 'storeJadwal'])->name('storeJadwal');
|
||||
Route::post('store-jadwal/{id}', [SurveyorController::class, 'storeJadwal'])->name('storeJadwal');
|
||||
|
||||
Route::post('storeFreeze/{id}', [SurveyorController::class, 'storeFreeze'])->name('storeFreeze');
|
||||
Route::post('storeFoto', [SurveyorController::class, 'storeFoto'])->name('storeFoto');
|
||||
@@ -583,6 +583,7 @@ Route::middleware(['auth'])->group(function () {
|
||||
Route::put('store-approve-reschedule/{id}', [SurveyorController::class, 'approveReschedule'])->name('approveReschedule');
|
||||
Route::put('store-rejected-reschedule/{id}', [SurveyorController::class, 'rejectReschedule'])->name('rejectReschedule');
|
||||
Route::put('store-proses-survey/{id}', [SurveyorController::class, 'storeProsesSurvey'])->name('storeProsesSurvey');
|
||||
Route::post('save-edited-image/', [SurveyorController::class, 'saveEditedImage'])->name('saveEditedImage');
|
||||
|
||||
});
|
||||
|
||||
@@ -616,6 +617,7 @@ Route::middleware(['auth'])->group(function () {
|
||||
Route::post('storeMemo', [PenilaiController::class, 'storeMemo'])->name('storeMemo');
|
||||
Route::post('storeRap', [PenilaiController::class, 'storeRap'])->name('storeRap');
|
||||
Route::post('storeLpjSederhanadanStandard', [PenilaiController::class, 'storeLpjSederhanadanStandard'])->name('storeLpjSederhanadanStandard');
|
||||
Route::put('revisi-surveyor/{id}', [PenilaiController::class, 'revisiSurveyor'])->name('revisiSurveyor');
|
||||
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user