Compare commits
121 Commits
5f9ebc3b13
...
23aa158cc2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
23aa158cc2 | ||
|
|
25889577c8 | ||
|
|
bcb4246ee9 | ||
|
|
a5902305d0 | ||
|
|
4647e75733 | ||
|
|
2e07d526a8 | ||
|
|
d9c3f12ee6 | ||
|
|
f5c2ea3ba4 | ||
|
|
c2c998e48c | ||
|
|
1c1eee8e3a | ||
|
|
8e081e6968 | ||
|
|
15e75c286c | ||
|
|
f227093c95 | ||
|
|
a38b09d1a8 | ||
|
|
4b0e651cf5 | ||
|
|
105bd1ce4b | ||
|
|
0f6efabeb3 | ||
|
|
22f6e3c8b2 | ||
|
|
5fa1526f1e | ||
|
|
6eed0f3635 | ||
|
|
4e9c4cea0f | ||
|
|
548956d403 | ||
|
|
159dea6573 | ||
|
|
5bcc3f7e53 | ||
|
|
188fda91ce | ||
|
|
573b2e2c74 | ||
|
|
0cf3f27a13 | ||
|
|
8c8b7aa7c5 | ||
|
|
10cf04e05c | ||
|
|
1b87f62b36 | ||
|
|
c8183fd3c1 | ||
|
|
e087b81655 | ||
|
|
2a671842e4 | ||
|
|
b1aa7bf42c | ||
|
|
fcbf2ba979 | ||
|
|
b8864ded0c | ||
|
|
f644002c79 | ||
|
|
891e05c400 | ||
|
|
686dec7727 | ||
|
|
1b8df943d5 | ||
|
|
2df46f1396 | ||
|
|
825cc9c5f9 | ||
|
|
12a13c5264 | ||
|
|
ee2e5e81e0 | ||
|
|
a95d2de9bd | ||
|
|
6035400e96 | ||
|
|
4178621b2c | ||
|
|
46167baf92 | ||
|
|
94e49a4cc3 | ||
|
|
7d15d60b32 | ||
|
|
b79ccac892 | ||
|
|
9f51a2cf4e | ||
|
|
138b811314 | ||
|
|
e351e5c0df | ||
|
|
52f86c4f86 | ||
|
|
db0ba8cc40 | ||
|
|
fbd8805b84 | ||
|
|
d5a4c019cb | ||
|
|
b6e71ac865 | ||
|
|
850074ee7e | ||
|
|
bb052decae | ||
|
|
977d53d696 | ||
|
|
9b88a601c5 | ||
|
|
cb9a650bc4 | ||
|
|
57e66642ef | ||
|
|
155fe5f011 | ||
|
|
bfc9b989ef | ||
|
|
5e50138d8e | ||
|
|
3430423749 | ||
|
|
fa4a97a2cb | ||
|
|
47b585062b | ||
|
|
39c5214075 | ||
|
|
0a25a32fc8 | ||
|
|
3c429a71c8 | ||
|
|
fcdcfd2757 | ||
|
|
fe5f643906 | ||
|
|
f9cbc43110 | ||
|
|
23c85c1539 | ||
|
|
644cd75522 | ||
|
|
8647063b4b | ||
|
|
1cb38ba9dd | ||
|
|
ea2f303ea4 | ||
|
|
7cc687814f | ||
|
|
51d68b5c03 | ||
|
|
992d748a2a | ||
|
|
047e543d8d | ||
|
|
6befc5faa7 | ||
|
|
3a54b20f84 | ||
|
|
14e9435684 | ||
|
|
8a7dccc784 | ||
|
|
7e027680ab | ||
|
|
ddbd98127e | ||
|
|
65818ab063 | ||
|
|
f2dda625f4 | ||
|
|
adfc1b3cec | ||
|
|
5c00c22b5e | ||
|
|
e34f5f67f5 | ||
|
|
afea3ac60f | ||
|
|
a0fe45dff7 | ||
|
|
48a8623aa2 | ||
|
|
80c3eaa30a | ||
|
|
b2d5747a11 | ||
|
|
4a5a3ffaf0 | ||
|
|
941847d460 | ||
|
|
7cd4c0a9b7 | ||
|
|
c5f18bbf50 | ||
|
|
31245457cd | ||
|
|
831561b83b | ||
|
|
05b64f94e2 | ||
|
|
5d4ec11af8 | ||
|
|
bbb0e006e7 | ||
|
|
8f1c91827c | ||
|
|
3ee55149fa | ||
|
|
05d63fe6eb | ||
|
|
6fd0f35934 | ||
|
|
ea18cf2fba | ||
|
|
aa8f184b38 | ||
|
|
a4d0a5d942 | ||
|
|
2a980a39f4 | ||
|
|
0dee937f07 | ||
|
|
1450b8e2c8 |
70
app/Exports/LaporanAdminKreditExport.php
Normal file
70
app/Exports/LaporanAdminKreditExport.php
Normal file
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Exports;
|
||||
|
||||
use Maatwebsite\Excel\Concerns\FromCollection;
|
||||
use Maatwebsite\Excel\Concerns\WithColumnFormatting;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadings;
|
||||
use Maatwebsite\Excel\Concerns\WithMapping;
|
||||
use Modules\Lpj\Models\LaporanAdminKredit;
|
||||
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
|
||||
|
||||
class LaporanAdminKreditExport implements WithColumnFormatting, WithHeadings, FromCollection, WithMapping
|
||||
{
|
||||
public function collection()
|
||||
{
|
||||
return LaporanAdminKredit::with('debiture')->get();
|
||||
}
|
||||
|
||||
public function map($row): array
|
||||
{
|
||||
return [
|
||||
$row->id,
|
||||
$row->debiture->cif,
|
||||
$row->debiture->name,
|
||||
$row->debiture->branch->name,
|
||||
$row->kode_register_t24,
|
||||
$row->jenis_agunan,
|
||||
$row->bukti_kepemilikan,
|
||||
$row->alamat_agunan,
|
||||
$row->nama_pemilik,
|
||||
$row->tanggal_kunjungan,
|
||||
$row->nilai_pasar_wajar,
|
||||
$row->nilai_likuidasi,
|
||||
$row->nama_penilai,
|
||||
$row->created_at
|
||||
];
|
||||
}
|
||||
|
||||
public function headings(): array
|
||||
{
|
||||
return [
|
||||
'ID',
|
||||
'CIF',
|
||||
'Nama Debitur',
|
||||
'Cabang',
|
||||
'Kode Register T24',
|
||||
'Jenis Agunan',
|
||||
'Bukti Kepemilikan',
|
||||
'Alamat Agunan',
|
||||
'Nama Pemilik',
|
||||
'Tanggal Kunjungan',
|
||||
'Nilai Pasar Wajar',
|
||||
'Nilai Likuidasi',
|
||||
'Nama Penilai',
|
||||
'Created At'
|
||||
];
|
||||
}
|
||||
|
||||
public function columnFormats(): array
|
||||
{
|
||||
return [
|
||||
'A' => NumberFormat::FORMAT_NUMBER,
|
||||
'B' => NumberFormat::FORMAT_NUMBER,
|
||||
'J' => NumberFormat::FORMAT_DATE_DDMMYYYY,
|
||||
'K' => NumberFormat::FORMAT_NUMBER_COMMA_SEPARATED1,
|
||||
'L' => NumberFormat::FORMAT_NUMBER_COMMA_SEPARATED1,
|
||||
'M' => NumberFormat::FORMAT_DATE_DATETIME,
|
||||
];
|
||||
}
|
||||
}
|
||||
102
app/Exports/LaporanPembatalanExport.php
Normal file
102
app/Exports/LaporanPembatalanExport.php
Normal file
@@ -0,0 +1,102 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Exports;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Maatwebsite\Excel\Concerns\FromCollection;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadings;
|
||||
use Maatwebsite\Excel\Concerns\WithMapping;
|
||||
use Modules\Lpj\Models\PermohonanPembatalan;
|
||||
|
||||
class LaporanPembatalanExport implements FromCollection, WithHeadings, WithMapping
|
||||
{
|
||||
protected $request;
|
||||
|
||||
public function __construct(Request $request)
|
||||
{
|
||||
$this->request = $request;
|
||||
}
|
||||
|
||||
public function collection()
|
||||
{
|
||||
$query = PermohonanPembatalan::where('status', 'batal');
|
||||
|
||||
if (!Auth::user()->hasAnyRole(['administrator'])) {
|
||||
$query = $query->whereHas('permohonan', function ($q) {
|
||||
$q->where('branch_id', Auth::user()->branch_id);
|
||||
});
|
||||
}
|
||||
|
||||
// Apply search filter if provided
|
||||
if ($this->request->has('search') && !empty($this->request->get('search'))) {
|
||||
$search = $this->request->get('search');
|
||||
$query->where(function ($q) use ($search) {
|
||||
$q->whereHas('permohonan', function ($subq) use ($search) {
|
||||
$subq->where('nomor_registrasi', 'LIKE', '%' . $search . '%');
|
||||
$subq->orWhereRelation('user', 'name', 'LIKE', '%' . $search . '%');
|
||||
$subq->orWhereRelation('branch', 'name', 'LIKE', '%' . $search . '%');
|
||||
});
|
||||
$q->orWhere('alasan', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhere('status', 'LIKE', '%' . $search . '%');
|
||||
});
|
||||
}
|
||||
|
||||
// Filter by date range if provided
|
||||
if ($this->request->has('start_date') || $this->request->has('end_date')) {
|
||||
$query->whereBetween('created_at', [
|
||||
$this->request->get('start_date') ?? '1900-01-01',
|
||||
$this->request->get('end_date') ?? now()->toDateString()
|
||||
]);
|
||||
}
|
||||
|
||||
// Filter by status if provided
|
||||
if ($this->request->has('status') && !empty($this->request->get('status'))) {
|
||||
$query->where('status', $this->request->get('status'));
|
||||
}
|
||||
|
||||
// Filter by branch if provided
|
||||
if ($this->request->has('branch_id') && !empty($this->request->get('branch_id'))) {
|
||||
$query->whereHas('permohonan', function ($q) {
|
||||
$q->where('branch_id', $this->request->get('branch_id'));
|
||||
});
|
||||
}
|
||||
|
||||
return $query->orderBy('created_at', 'desc')
|
||||
->get();
|
||||
}
|
||||
|
||||
public function headings(): array
|
||||
{
|
||||
return [
|
||||
'No. Registrasi',
|
||||
'Tanggal Permohonan',
|
||||
'Tanggal Pembatalan',
|
||||
'Cabang',
|
||||
'Pemohon',
|
||||
'Debitur',
|
||||
'Alasan Pembatalan',
|
||||
'Status',
|
||||
'Diajukan Oleh',
|
||||
'Disetujui Oleh',
|
||||
'Tanggal Disetujui'
|
||||
];
|
||||
}
|
||||
|
||||
public function map($pembatalan): array
|
||||
{
|
||||
return [
|
||||
$pembatalan->permohonan->nomor_registrasi ?? '-',
|
||||
$pembatalan->permohonan->tanggal_permohonan ? date('d-m-Y', strtotime($pembatalan->permohonan->tanggal_permohonan)) : '-',
|
||||
date('d-m-Y', strtotime($pembatalan->created_at)),
|
||||
$pembatalan->permohonan->branch->name ?? '-',
|
||||
$pembatalan->permohonan->user->name ?? '-',
|
||||
$pembatalan->permohonan->debiture->name ?? '-',
|
||||
$pembatalan->alasan_pembatalan,
|
||||
$pembatalan->status,
|
||||
$pembatalan->user->name ?? '-',
|
||||
$pembatalan->authorized_by ? $pembatalan->authorizedUser->name : '-',
|
||||
$pembatalan->authorized_at ? formatTanggalIndonesia(strtotime($pembatalan->authorized_at),1) : '-'
|
||||
];
|
||||
}
|
||||
}
|
||||
177
app/Exports/LaporanPenilaiJaminanExport.php
Normal file
177
app/Exports/LaporanPenilaiJaminanExport.php
Normal file
@@ -0,0 +1,177 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Exports;
|
||||
|
||||
use Maatwebsite\Excel\Concerns\FromQuery;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadings;
|
||||
use Maatwebsite\Excel\Concerns\WithMapping;
|
||||
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
|
||||
use Modules\Lpj\Models\Debiture;
|
||||
use Modules\Lpj\Models\Permohonan;
|
||||
use Modules\Lpj\Helpers\Lpj;
|
||||
|
||||
class LaporanPenilaiJaminanExport implements FromQuery, WithHeadings, WithMapping, ShouldAutoSize
|
||||
{
|
||||
protected $tanggalAwal;
|
||||
protected $tanggalAkhir;
|
||||
protected $status;
|
||||
protected $selectedIds;
|
||||
|
||||
public function __construct($tanggalAwal = null, $tanggalAkhir = null, $status = null, $selectedIds = null)
|
||||
{
|
||||
$this->tanggalAwal = $tanggalAwal;
|
||||
$this->tanggalAkhir = $tanggalAkhir;
|
||||
$this->status = $status;
|
||||
$this->selectedIds = $selectedIds;
|
||||
}
|
||||
|
||||
|
||||
public function query()
|
||||
{
|
||||
$query = Permohonan::query()
|
||||
->with(['user', 'debiture', 'branch', 'tujuanPenilaian', 'penilaian', 'dokumenjaminan.jenisJaminan','nilaiPlafond', 'penilai', 'inspeksi']);
|
||||
|
||||
// Filter by date range if provided
|
||||
if ($this->tanggalAwal && $this->tanggalAkhir) {
|
||||
$query->whereBetween('tanggal_permohonan', [$this->tanggalAwal, $this->tanggalAkhir]);
|
||||
}
|
||||
|
||||
$query->where('status', 'done');
|
||||
// Filter by status if provided
|
||||
if ($this->status) {
|
||||
$types = is_array($this->status) ? $this->status : [$this->status];
|
||||
$types = array_map('strtolower', $types);
|
||||
$query->whereHas('penilai', function (Builder $query) use ($types) {
|
||||
$query->whereIn('type_penilai', $types);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// Filter by selected IDs if provided
|
||||
if ($this->selectedIds) {
|
||||
$selectedIds = is_array($this->selectedIds) ? $this->selectedIds : explode(',', $this->selectedIds);
|
||||
$query->whereIn('id', $selectedIds);
|
||||
}
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
|
||||
public function map($row): array
|
||||
{
|
||||
|
||||
// ambil data alamat dari inspeksi
|
||||
$alamat_inspeksi = null;
|
||||
|
||||
if ($row->inspeksi) {
|
||||
$alamat_inspeksi = json_decode($row->inspeksi->data_form, true) ?? null;
|
||||
$alamat_inspeksi = $alamat_inspeksi['asset']['alamat']['sesuai'] ?? $alamat_inspeksi['asset']['alamat']['tidak sesuai'] ?? [];
|
||||
}
|
||||
$alamat_inspeksi = $alamat_inspeksi['address'] ?? '-';
|
||||
|
||||
|
||||
// ambil data dari table penilai
|
||||
$fieldPenilai = ['lpj', 'resume', 'memo', 'rap', 'call-report'];
|
||||
$penilaiCek = null;
|
||||
|
||||
// Cari field yang tersedia
|
||||
foreach ($fieldPenilai as $value) {
|
||||
if (!empty($row->penilai->$value)) {
|
||||
$penilaiCek = $row->penilai->$value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$decodePenilai = json_decode($penilaiCek, true) ?? [];
|
||||
// Ambil nilai utama
|
||||
$luasTanah = $decodePenilai['luas_tanah'] ?? 0;
|
||||
$nilaiTanah1 = $decodePenilai['nilai_tanah_1'] ?? 0;
|
||||
$luasBangunan = $decodePenilai['luas_bangunan'] ?? 0;
|
||||
$nilaiBangunan1 = $decodePenilai['nilai_bangunan_1'] ?? 0;
|
||||
$totalNilaiPasar = $decodePenilai['total_nilai_pasar_wajar'] ?? 0;
|
||||
$likuidasi = $decodePenilai['likuidasi'] ?? 0;
|
||||
|
||||
// Ambil data npw_tambahan jika ada
|
||||
$npwTambahan = $decodePenilai['npw_tambahan'] ?? [];
|
||||
$tambahanDetails = [];
|
||||
foreach ($npwTambahan as $tambahan) {
|
||||
$tambahanDetails[] = sprintf(
|
||||
'%s: Luas: %s, Nilai 1: %s, Nilai 2: %s',
|
||||
$tambahan['name'] ?? '-',
|
||||
$tambahan['luas'] ?? 0,
|
||||
$tambahan['nilai_1'] ?? 0,
|
||||
$tambahan['nilai_2'] ?? 0
|
||||
);
|
||||
}
|
||||
$tambahanSummary = implode("; ", $tambahanDetails);
|
||||
|
||||
// Ambil data penilaian dari table penilaian
|
||||
$user_penilai = $row->penilaian->userPenilai ?? null;
|
||||
$user_penilai_name = null;
|
||||
foreach ($user_penilai as $value) {
|
||||
if ($value->role == 'penilai') {
|
||||
$user_penilai_name = $value->user->name;
|
||||
$nik_penilai = $value->user->nik ?? '-';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return [
|
||||
$row->id,
|
||||
$row->nomor_registrasi,
|
||||
$row->user->name,
|
||||
$row->branch->name,
|
||||
$row->tujuanPenilaian->name,
|
||||
$row->debiture->name,
|
||||
$row->penilai->type_penilai ?? '-',
|
||||
$alamat_inspeksi ?? '-',
|
||||
$luasTanah,
|
||||
$luasBangunan,
|
||||
$nilaiTanah1,
|
||||
$nilaiBangunan1,
|
||||
$totalNilaiPasar,
|
||||
$likuidasi,
|
||||
$row->laporan->created_at ?? '-',
|
||||
$user_penilai_name,
|
||||
$nik_penilai,
|
||||
$row->created_at,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
public function headings(): array
|
||||
{
|
||||
return [
|
||||
'ID',
|
||||
'Nomor Registrasi',
|
||||
'User Pemohon',
|
||||
'Cabang',
|
||||
'Tujuan Penilaian',
|
||||
'Debitur',
|
||||
'Jenis Laporan',
|
||||
'Lokasi Jaminan',
|
||||
'Luas Tanah',
|
||||
'Luas Bangunan',
|
||||
'Harga Tanah',
|
||||
'Harga Bangunan',
|
||||
'Nilai Pasar Wajar',
|
||||
'Likuidasi',
|
||||
'Tanggal Laporan',
|
||||
'Nama Penilai',
|
||||
'Nik Penilai',
|
||||
'Created At',
|
||||
];
|
||||
}
|
||||
public function columnFormats(): array
|
||||
{
|
||||
return [
|
||||
'A' => NumberFormat::FORMAT_NUMBER,
|
||||
'C' => NumberFormat::FORMAT_DATE_DATETIME,
|
||||
'K' => NumberFormat::FORMAT_DATE_DATETIME,
|
||||
'N' => NumberFormat::FORMAT_DATE_DATETIME
|
||||
];
|
||||
}
|
||||
}
|
||||
99
app/Exports/LaporanPermohonanExport.php
Normal file
99
app/Exports/LaporanPermohonanExport.php
Normal file
@@ -0,0 +1,99 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Exports;
|
||||
|
||||
use Maatwebsite\Excel\Concerns\FromCollection;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadings;
|
||||
use Maatwebsite\Excel\Concerns\WithMapping;
|
||||
use Modules\Lpj\Models\Permohonan;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class LaporanPermohonanExport implements FromCollection, WithHeadings, WithMapping
|
||||
{
|
||||
protected $request;
|
||||
|
||||
public function __construct($request)
|
||||
{
|
||||
$this->request = $request;
|
||||
}
|
||||
|
||||
public function collection()
|
||||
{
|
||||
$query = Permohonan::with(['user', 'branch', 'tujuanPenilaian', 'jenisFasilitasKredit', 'jenisPenilaian'])
|
||||
->select('permohonan.*');
|
||||
|
||||
// Apply role-based filtering
|
||||
if (!Auth::user()->hasAnyRole(['administrator'])) {
|
||||
$query->where('branch_id', Auth::user()->branch_id);
|
||||
}
|
||||
|
||||
|
||||
// Apply date range filter if provided
|
||||
if ($this->request->has('start_date') || $this->request->has('end_date')) {
|
||||
$query->whereBetween('tanggal_permohonan', [
|
||||
$this->request->start_date ?? '1900-01-01',
|
||||
$this->request->end_date ?? now()->toDateString()
|
||||
]);
|
||||
}
|
||||
|
||||
// Apply status filter if provided
|
||||
if ($this->request->has('status') && !empty($this->request->status)) {
|
||||
$query->where('status', $this->request->status);
|
||||
}
|
||||
|
||||
// Apply branch filter if provided
|
||||
if ($this->request->has('branch_id') && !empty($this->request->branch_id)) {
|
||||
$query->where('branch_id', $this->request->branch_id);
|
||||
}
|
||||
|
||||
// Apply search filter if provided
|
||||
if ($this->request->has('search') && !empty($this->request->search)) {
|
||||
$search = $this->request->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('tujuanPenilaian', 'name', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhereRelation('branch', 'name', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhereRelation('jenisFasilitasKredit', 'name', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhereRelation('jenisPenilaian', 'name', 'LIKE', '%' . $search . '%');
|
||||
$q->orWhere('status', 'LIKE', '%' . $search . '%');
|
||||
});
|
||||
}
|
||||
|
||||
// Default ordering
|
||||
$query->orderBy('nomor_registrasi', 'asc');
|
||||
|
||||
return $query->get();
|
||||
}
|
||||
|
||||
public function map($permohonan): array
|
||||
{
|
||||
return [
|
||||
$permohonan->id,
|
||||
$permohonan->nomor_registrasi,
|
||||
$permohonan->tanggal_permohonan,
|
||||
$permohonan->user ? $permohonan->user->name : '',
|
||||
$permohonan->branch ? $permohonan->branch->name : '',
|
||||
$permohonan->tujuanPenilaian ? $permohonan->tujuanPenilaian->name : '',
|
||||
$permohonan->jenisFasilitasKredit ? $permohonan->jenisFasilitasKredit->name : '',
|
||||
$permohonan->jenisPenilaian ? $permohonan->jenisPenilaian->name : '',
|
||||
$permohonan->status,
|
||||
];
|
||||
}
|
||||
|
||||
public function headings(): array
|
||||
{
|
||||
return [
|
||||
'ID',
|
||||
'Nomor Registrasi',
|
||||
'Tanggal Permohonan',
|
||||
'Pemohon',
|
||||
'Cabang',
|
||||
'Tujuan Penilaian',
|
||||
'Jenis Fasilitas Kredit',
|
||||
'Jenis Penilaian',
|
||||
'Status',
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -19,24 +19,29 @@ use Modules\Location\Models\Village;
|
||||
function formatTanggalIndonesia($date, $time = false)
|
||||
{
|
||||
Carbon::setLocale('id');
|
||||
$waktu = Carbon::parse($date);
|
||||
if (!$time) {
|
||||
return $waktu->translatedFormat('d F Y');
|
||||
try {
|
||||
$waktu = Carbon::parse($date);
|
||||
if (!$time) {
|
||||
return $waktu->translatedFormat('d F Y');
|
||||
}
|
||||
return $waktu->translatedFormat('d F Y') . ' pukul ' . $waktu->format('H.i') . ' WIB';
|
||||
} catch (\Throwable $e) {
|
||||
return $date;
|
||||
}
|
||||
return $waktu->translatedFormat('d F Y') . ' pukul ' . $waktu->format('H.i') . ' WIB';
|
||||
|
||||
}
|
||||
|
||||
|
||||
function formatRupiah($number)
|
||||
function formatRupiah($number,$decimals = 0)
|
||||
{
|
||||
$number = (float) $number;
|
||||
return 'Rp ' . number_format($number, 0, ',', '.');
|
||||
return 'Rp ' . number_format($number, $decimals, ',', '.');
|
||||
}
|
||||
|
||||
|
||||
function formatAlamat($alamat)
|
||||
{
|
||||
return ($alamat->address ? $alamat->address . ', ' : '') . (isset($alamat->village) ? $alamat->village->name . ', ' : '') . (isset($alamat->city) ? $alamat->city->name . ', ' : '') . (isset($alamat->province) ? $alamat->province->name . ', ' : '') . ($alamat->postal_code ?? '');
|
||||
return ($alamat->address ? $alamat->address . ', ' : '') . (isset($alamat->village) ? $alamat->village->name . ', ' : '') . (isset($alamat->city) ? $alamat->city->name . ', ' : '') . (isset($alamat->province) ? $alamat->province->name . ', ' : '') . ($alamat->village->postal_code ?? '');
|
||||
}
|
||||
|
||||
// andy add
|
||||
@@ -485,7 +490,7 @@ function calculateSLA($permohonan, $type)
|
||||
* @param int $jenisLegalitas
|
||||
* @return int
|
||||
*/
|
||||
function calculateTotalLuas($detailsArray, $key, $jenisLegalitas, $defaultJenisLegalitas)
|
||||
function calculateTotalLuas($detailsArray, $key, $jenisLegalitas, $defaultJenisLegalitas, $fallbackJenisLegalitas)
|
||||
{
|
||||
$total = 0;
|
||||
|
||||
|
||||
311
app/Http/Controllers/BankDataController.php
Normal file
311
app/Http/Controllers/BankDataController.php
Normal file
@@ -0,0 +1,311 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Routing\Controller;
|
||||
use Log;
|
||||
use Modules\Location\Models\Province;
|
||||
use Modules\Lpj\Http\Requests\BankDataRequest;
|
||||
use Modules\Lpj\Models\BankData;
|
||||
use Modules\Lpj\Models\Inspeksi;
|
||||
use Modules\Lpj\Models\JenisJaminan;
|
||||
use Modules\Lpj\Services\BankDataService;
|
||||
|
||||
class BankDataController extends Controller
|
||||
{
|
||||
protected $bankDataService;
|
||||
protected $user;
|
||||
|
||||
public function __construct(BankDataService $bankDataService)
|
||||
{
|
||||
$this->bankDataService = $bankDataService;
|
||||
}
|
||||
|
||||
public function index(Request $request)
|
||||
{
|
||||
$provinces = Province::all();
|
||||
$jenisJaminan = JenisJaminan::all();
|
||||
|
||||
//insert data pembanding
|
||||
|
||||
$inspeksi = Inspeksi::all();
|
||||
|
||||
foreach ($inspeksi as $item) {
|
||||
if (isset($item->data_pembanding)) {
|
||||
$data_pembanding = json_decode($item->data_pembanding);
|
||||
|
||||
$objekPenilaian = $data_pembanding->objek_penilaian;
|
||||
if (isset($objekPenilaian)) {
|
||||
$_lat = $objekPenilaian->kordinat_lat;
|
||||
$_lng = $objekPenilaian->kordinat_lng;
|
||||
|
||||
if (!empty($_lat) && !empty($_lng) && $_lng !== null && $_lat !== null && $_lat !== '' && $_lng !== '') {
|
||||
$_lat = floatval($_lat);
|
||||
$_lng = floatval($_lng);
|
||||
if ($_lat >= -90 && $_lat <= 90 && $_lng >= -180 && $_lng <= 180) {
|
||||
|
||||
$_data = [
|
||||
'address' => $objekPenilaian->address,
|
||||
'village_code' => $objekPenilaian->village_code,
|
||||
'district_code' => $objekPenilaian->district_code,
|
||||
'city_code' => $objekPenilaian->city_code,
|
||||
'province_code' => $objekPenilaian->province_code,
|
||||
'tahun' => $item->created_at->format('Y'),
|
||||
//
|
||||
'luas_tanah' => isset($objekPenilaian->luas_tanah) && is_numeric($objekPenilaian->luas_tanah) ? $objekPenilaian->luas_tanah : 0,
|
||||
'luas_bangunan' => isset($objekPenilaian->luas_bangunan) && is_numeric($objekPenilaian->luas_bangunan) ? $objekPenilaian->luas_bangunan : 0,
|
||||
//
|
||||
'tahun_bangunan' => isset($objekPenilaian->tahun_bangunan) && is_numeric($objekPenilaian->tahun_bangunan) ? $objekPenilaian->tahun_bangunan : 0,
|
||||
//
|
||||
'harga' => isset($objekPenilaian->harga) && is_numeric($objekPenilaian->harga) ? $objekPenilaian->harga : 0,
|
||||
'harga_diskon' => isset($objekPenilaian->harga_diskon) && is_numeric($objekPenilaian->harga_diskon) ? $objekPenilaian->harga_diskon : 0,
|
||||
'diskon' => isset($objekPenilaian->diskon) && is_numeric(str_replace(',', '.', $objekPenilaian->diskon)) ? str_replace(',', '.', $objekPenilaian->diskon) : 0,
|
||||
'total' => isset($objekPenilaian->total) && is_numeric($objekPenilaian->total) ? $objekPenilaian->total : 0,
|
||||
'harga_penawaran' => isset($objekPenilaian->harga_penawaran) && is_numeric($objekPenilaian->harga_penawaran) ? $objekPenilaian->harga_penawaran : 0,
|
||||
'nama_nara_sumber' => $objekPenilaian->nama_nara_sumber,
|
||||
'peruntukan' => $objekPenilaian->peruntukan ?? "",
|
||||
//
|
||||
'penawaran' => $objekPenilaian->penawaran ?? "",
|
||||
//
|
||||
'telepon' => $objekPenilaian->telepon ?? "",
|
||||
'hak_properti' => $objekPenilaian->hak_properti ?? "",
|
||||
'jenis_aset' => $objekPenilaian->jenis_aset ?? "",
|
||||
'foto_objek' => $objekPenilaian->foto_objek ?? "",
|
||||
'tanggal' => $objekPenilaian->tanggal ?? null,
|
||||
'kategori' => 'penilaian',
|
||||
];
|
||||
|
||||
|
||||
BankData::updateOrCreate(
|
||||
[
|
||||
'kordinat_lat' => $_lat,
|
||||
'kordinat_lng' => $_lng,
|
||||
'kategori' => 'penilaian'
|
||||
],
|
||||
$_data
|
||||
);
|
||||
}
|
||||
} else {
|
||||
// Invalid coordinates
|
||||
Log::warning("Invalid coordinates: Lat: $_lat, Lng: $_lng");// Do something to handle this situation, such as logging an error or skipping the record
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($data_pembanding->data_pembanding as $dataPembanding) {
|
||||
$lat = $dataPembanding->kordinat_lat;
|
||||
$lng = $dataPembanding->kordinat_lng;
|
||||
|
||||
if (!empty($lat) && !empty($lng) && $lng !== null && $lat !== null && $lat !== '' && $lng !== '') {
|
||||
$lat = floatval($lat);
|
||||
$lng = floatval($lng);
|
||||
|
||||
if ($lat >= -90 && $lat <= 90 && $lng >= -180 && $lng <= 180) {
|
||||
$data = [
|
||||
'address' => $dataPembanding->address,
|
||||
'village_code' => $dataPembanding->village_code,
|
||||
'district_code' => $dataPembanding->district_code,
|
||||
'city_code' => $dataPembanding->city_code,
|
||||
'province_code' => $dataPembanding->province_code,
|
||||
'tahun' => isset($dataPembanding->tahun) && is_numeric($dataPembanding->tahun) ? $dataPembanding->tahun : 0,
|
||||
'luas_tanah' => isset($dataPembanding->luas_tanah) && is_numeric($dataPembanding->luas_tanah) ? $dataPembanding->luas_tanah : 0,
|
||||
'luas_bangunan' => isset($dataPembanding->luas_bangunan) && is_numeric($dataPembanding->luas_bangunan) ? $dataPembanding->luas_bangunan : 0,
|
||||
'tahun_bangunan' => isset($dataPembanding->tahun_bangunan) && is_numeric($dataPembanding->tahun_bangunan) ? $dataPembanding->tahun_bangunan : 0,
|
||||
'harga' => isset($dataPembanding->harga) && is_numeric($dataPembanding->harga) ? $dataPembanding->harga : 0,
|
||||
'harga_diskon' => isset($dataPembanding->harga_diskon) && is_numeric($dataPembanding->harga_diskon) ? $dataPembanding->harga_diskon : 0,
|
||||
'diskon' => isset($dataPembanding->diskon) && is_numeric(str_replace(',', '.', $dataPembanding->diskon)) ? str_replace(',', '.', $dataPembanding->diskon) : 0,
|
||||
'total' => isset($dataPembanding->total) && is_numeric($dataPembanding->total) ? $dataPembanding->total : 0,
|
||||
'harga_penawaran' => isset($dataPembanding->harga_penawaran) && is_numeric($dataPembanding->harga_penawaran) ? $dataPembanding->harga_penawaran : 0,
|
||||
'nama_nara_sumber' => $dataPembanding->nama_nara_sumber,
|
||||
'peruntukan' => $dataPembanding->peruntukan,
|
||||
'penawaran' => $dataPembanding->penawaran,
|
||||
'telepon' => $dataPembanding->telepon,
|
||||
'hak_properti' => $dataPembanding->hak_properti,
|
||||
'jenis_aset' => $dataPembanding->jenis_aset,
|
||||
'foto_objek' => $dataPembanding->foto_objek,
|
||||
'tanggal' => $dataPembanding->tanggal,
|
||||
'kategori' => 'data_pembanding',
|
||||
];
|
||||
|
||||
BankData::updateOrCreate(
|
||||
[
|
||||
'kordinat_lat' => $lat,
|
||||
'kordinat_lng' => $lng,
|
||||
'kategori' => 'data_pembanding'
|
||||
],
|
||||
$data
|
||||
);
|
||||
}
|
||||
} else {
|
||||
// Invalid coordinates
|
||||
Log::warning("Invalid coordinates: Lat: $lat, Lng: $lng");// Do something to handle this situation, such as logging an error or skipping the record
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return view('lpj::bank-data.index', compact('provinces', 'jenisJaminan'));
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
return view('lpj::bank-data.create');
|
||||
}
|
||||
|
||||
public function store(BankDataRequest $request)
|
||||
{
|
||||
$data = $request->validated();
|
||||
$bankData = $this->bankDataService->createBankData($data);
|
||||
return redirect()
|
||||
->route('lpj.bank-data.show', $bankData->id)
|
||||
->with('success', 'Bank data created successfully.');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$bankData = $this->bankDataService->findBankData($id);
|
||||
return view('lpj::bank-data.show', compact('bankData'));
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$bankData = $this->bankDataService->findBankData($id);
|
||||
return view('lpj::bank-data.edit', compact('bankData'));
|
||||
}
|
||||
|
||||
public function update(BankDataRequest $request, $id)
|
||||
{
|
||||
$data = $request->validated();
|
||||
$bankData = $this->bankDataService->updateBankData($id, $data);
|
||||
return redirect()
|
||||
->route('lpj.bank-data.show', $bankData->id)
|
||||
->with('success', 'Bank data updated successfully.');
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
$this->bankDataService->deleteBankData($id);
|
||||
return redirect()->route('lpj.bank-data.index')->with('success', 'Bank data deleted successfully.');
|
||||
}
|
||||
|
||||
public function dataForDatatables(Request $request)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('bank-data.view')) {
|
||||
//abort(403, 'Sorry! You are not allowed to view bank data.');
|
||||
}
|
||||
|
||||
// Retrieve data from the database
|
||||
$query = BankData::query();
|
||||
|
||||
// Apply search filter if provided
|
||||
if ($request->has('search') && !empty($request->get('search'))) {
|
||||
$search = $request->get('search');
|
||||
$search = json_decode($search, true);
|
||||
if (is_array($search)) {
|
||||
|
||||
if ($search['province_code']) {
|
||||
$query->ofProvince($search['province_code']);
|
||||
}
|
||||
|
||||
if ($search['kategori']) {
|
||||
$query->where('kategori', $search['kategori']);
|
||||
}
|
||||
|
||||
if ($search['city_code']) {
|
||||
$query->ofCity($search['city_code']);
|
||||
}
|
||||
|
||||
if ($search['district_code']) {
|
||||
$query->ofDistrict($search['district_code']);
|
||||
}
|
||||
|
||||
if ($search['village_code']) {
|
||||
$query->ofVillage($search['village_code']);
|
||||
}
|
||||
|
||||
if ($search['jenis_asset']) {
|
||||
$query->ofAssetType($search['jenis_asset']);
|
||||
}
|
||||
|
||||
if ($search['tahun']) {
|
||||
$query->where('tahun', $search['tahun']);
|
||||
}
|
||||
|
||||
if ($search['start_date'] && $search['end_date']) {
|
||||
$query->betweenDates($search['start_date'], $search['end_date']);
|
||||
}
|
||||
} else {
|
||||
$search = $request->get('search');
|
||||
$query->where(function ($q) use ($search) {
|
||||
$q->where('jenis_aset', '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->get();
|
||||
|
||||
// Format the data as needed
|
||||
$formattedData = $data->map(function ($item) {
|
||||
return [
|
||||
'id' => $item->id,
|
||||
'jenis_aset' => $item->jenis_aset,
|
||||
'tanggal' => $item->tanggal ? $item->tanggal->format('d-m-Y') : '-',
|
||||
'tahun' => $item->tahun,
|
||||
'luas_tanah' => $item->luas_tanah,
|
||||
'luas_bangunan' => $item->luas_bangunan,
|
||||
'harga' => $item->harga,
|
||||
'sumber' => $item->kategori ? ucwords(str_replace('_', ' ', $item->kategori)) : '-',
|
||||
'kategori' => $item->kategori ?? 'data_pembanding',
|
||||
'nilai_pasar' => $item->nilai_pasar,
|
||||
'location' => $item->kordinat_lat . ', ' . $item->kordinat_lng,
|
||||
'address' => formatAlamat($item),
|
||||
'photos' => json_decode($item->foto_objek, true) ?: [$item->foto_objek],
|
||||
// Add more fields as needed
|
||||
];
|
||||
});
|
||||
|
||||
// Calculate the page count
|
||||
$pageCount = ceil($totalRecords / $request->get('size'));
|
||||
|
||||
// Calculate the current page number
|
||||
$currentPage = $request->get('page', 1);
|
||||
|
||||
// Ensure current page doesn't exceed page count
|
||||
$currentPage = min($currentPage, $pageCount);
|
||||
|
||||
|
||||
// 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' => $formattedData,
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -19,6 +19,7 @@
|
||||
use Modules\Lpj\Models\JenisJaminan;
|
||||
use Modules\Lpj\Models\JenisLegalitasJaminan;
|
||||
use Modules\Lpj\Models\PemilikJaminan;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class DebitureController extends Controller
|
||||
{
|
||||
@@ -128,6 +129,10 @@
|
||||
// Retrieve data from the database
|
||||
$query = Debiture::query();
|
||||
|
||||
if (!Auth::user()->hasAnyRole(['administrator'])) {
|
||||
$query = $query->where('branch_id', Auth::user()->branch_id);
|
||||
}
|
||||
|
||||
// Apply search filter if provided
|
||||
if ($request->has('search') && !empty($request->get('search'))) {
|
||||
$search = $request->get('search');
|
||||
@@ -167,7 +172,7 @@
|
||||
$filteredRecords = $query->count();
|
||||
|
||||
// Get the data for the current page
|
||||
$data = $query->with('branch')->get();
|
||||
$data = $query->with(['branch','permohonan'])->get();
|
||||
|
||||
// Calculate the page count
|
||||
$pageCount = ceil($totalRecords / $request->get('size'));
|
||||
|
||||
@@ -488,7 +488,7 @@
|
||||
|
||||
if ($zip->open($zipFilePath, ZipArchive::CREATE) === true) {
|
||||
foreach ($documents as $document) {
|
||||
$jenisJaminan = $document->debiture->permohonan->nomor_registrasi ?? 'Uncategorized';
|
||||
$jenisJaminan = $document->permohonan->nomor_registrasi ?? 'Uncategorized';
|
||||
$folderName = $this->sanitizeFolderName($jenisJaminan);
|
||||
|
||||
foreach ($document->detail as $detail) {
|
||||
|
||||
185
app/Http/Controllers/LaporanAdminKreditController.php
Normal file
185
app/Http/Controllers/LaporanAdminKreditController.php
Normal file
@@ -0,0 +1,185 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
use Modules\Lpj\Exports\LaporanAdminKreditExport;
|
||||
use Modules\Lpj\Models\LaporanAdminKredit;
|
||||
use Modules\Lpj\Models\Permohonan;
|
||||
|
||||
class LaporanAdminKreditController extends Controller
|
||||
{
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$permohonan = Permohonan::with([
|
||||
'documents.jenisJaminan',
|
||||
'penilaian._user_penilai',
|
||||
'penilai',
|
||||
'documents.detail.jenisLegalitasJaminan'
|
||||
])->where(['status' => 'done'])->get();
|
||||
foreach ($permohonan as $_permohonan) {
|
||||
$npw = 0;
|
||||
if (isset($_permohonan->penilai->lpj)) {
|
||||
$npw = json_decode($_permohonan->penilai->lpj, true);
|
||||
$npw = $npw['total_nilai_pasar_wajar'] ?? 0;
|
||||
}
|
||||
|
||||
$dataAdk = [
|
||||
'jenis_agunan' => $_permohonan->documents->pluck('jenisJaminan.name')->unique()->implode(', '),
|
||||
'alamat_agunan' => $_permohonan->documents->map(function ($document) {
|
||||
return formatAlamat($document);
|
||||
})->unique()->implode(', '),
|
||||
'nama_pemilik' => $_permohonan->documents->pluck('pemilik.name')->unique()->implode(', '),
|
||||
'tanggal_kunjungan' => $_permohonan->penilaian->tanggal_kunjungan,
|
||||
'nama_penilai' => $_permohonan->penilaian->_user_penilai->userPenilaiTeam->name,
|
||||
'nilai_likuidasi' => $_permohonan->nilai_liquidasi,
|
||||
'nilai_pasar_wajar' => str_replace('.', '', $npw),
|
||||
'bukti_kepemilikan' => $_permohonan->documents->flatMap(function ($document) {
|
||||
return $document->detail->map(function ($detail) {
|
||||
return (!empty($detail->dokumen_nomor) && is_array($detail->dokumen_nomor))
|
||||
? ($detail->jenisLegalitasJaminan->name ?? '') . "\n" . implode(', ', $detail->dokumen_nomor)
|
||||
: null;
|
||||
});
|
||||
})->filter()->unique()->implode(', '),
|
||||
];
|
||||
|
||||
LaporanAdminKredit::updateOrCreate([
|
||||
'debiture_id' => $_permohonan->debiture_id,
|
||||
], $dataAdk);
|
||||
}
|
||||
|
||||
|
||||
$laporans = LaporanAdminKredit::with('debiture')->paginate(10);
|
||||
return view('lpj::laporan_admin_kredit.index', compact('laporans'));
|
||||
}
|
||||
|
||||
public function dataForDatatables(Request $request)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('laporan-admin-kredit.view')) {
|
||||
//abort(403, 'Sorry! You are not allowed to view laporan admin kredit.');
|
||||
}
|
||||
|
||||
// Retrieve data from the database
|
||||
$query = LaporanAdminKredit::query();
|
||||
|
||||
if ($request->has('tanggal_awal') && $request->has('tanggal_akhir')) {
|
||||
$query->whereBetween('tanggal_kunjungan', [$request->tanggal_awal, $request->tanggal_akhir]);
|
||||
}
|
||||
|
||||
// Apply search filter if provided
|
||||
if ($request->has('search') && !empty($request->get('search'))) {
|
||||
$search = $request->get('search');
|
||||
$search_ = json_decode($search);
|
||||
|
||||
if (isset($search_->search)) {
|
||||
$query->where(function ($q) use ($search_) {
|
||||
$q->where('kode_register_t24', 'LIKE', '%' . $search_->search . '%')
|
||||
->orWhere('jenis_agunan', 'LIKE', '%' . $search_->search . '%')
|
||||
->orWhere('nama_pemilik', 'LIKE', '%' . $search_->search . '%')
|
||||
->orWhereHas('debiture', function ($query) use ($search_) {
|
||||
$query->where('name', 'LIKE', '%' . $search_->search . '%');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
if (isset($search_->tanggal_awal) && isset($search_->tanggal_akhir)) {
|
||||
$query->whereBetween('tanggal_kunjungan', [$search_->tanggal_awal, $search_->tanggal_akhir]);
|
||||
}
|
||||
}
|
||||
|
||||
// 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(['debiture.branch'])->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 export()
|
||||
{
|
||||
return Excel::download(new LaporanAdminKreditExport, 'laporan_admin_kredit.xlsx');
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$laporanAdminKredit = LaporanAdminKredit::with('debiture.branch')->find($id);
|
||||
return view('lpj::laporan_admin_kredit.form', compact('laporanAdminKredit'));
|
||||
}
|
||||
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
$request->validate([
|
||||
'kode_register_t24' => 'nullable',
|
||||
'cif' => 'required',
|
||||
]);
|
||||
|
||||
try {
|
||||
$laporanAdminKredit = LaporanAdminKredit::find($id);
|
||||
|
||||
// Update only the editable fields
|
||||
$laporanAdminKredit->update([
|
||||
'kode_register_t24' => $request->kode_register_t24,
|
||||
'updated_by' => Auth::id(),
|
||||
]);
|
||||
|
||||
// Update CIF in the debiture table if needed
|
||||
if ($laporanAdminKredit->debiture) {
|
||||
$laporanAdminKredit->debiture->update([
|
||||
'cif' => $request->cif,
|
||||
'updated_by' => Auth::id(),
|
||||
]);
|
||||
}
|
||||
|
||||
return redirect()
|
||||
->route('laporan-admin-kredit.index')
|
||||
->with('success', 'Laporan Admin Kredit updated successfully');
|
||||
} catch (Exception $e) {
|
||||
return redirect()
|
||||
->route('laporan-admin-kredit.edit', $id)
|
||||
->with('error', 'Failed to update Laporan Admin Kredit');
|
||||
}
|
||||
}
|
||||
}
|
||||
140
app/Http/Controllers/LaporanPembatalanController.php
Normal file
140
app/Http/Controllers/LaporanPembatalanController.php
Normal file
@@ -0,0 +1,140 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
use Modules\Lpj\Exports\LaporanPembatalanExport;
|
||||
use Modules\Lpj\Models\PermohonanPembatalan;
|
||||
|
||||
class LaporanPembatalanController extends Controller
|
||||
{
|
||||
public $user;
|
||||
|
||||
public function index()
|
||||
{
|
||||
return view('lpj::laporan_pembatalan.index');
|
||||
}
|
||||
|
||||
public function export(Request $request)
|
||||
{
|
||||
return Excel::download(new LaporanPembatalanExport($request), 'laporan_pembatalan.xlsx');
|
||||
}
|
||||
|
||||
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.');
|
||||
}
|
||||
|
||||
// Retrieve data from the database
|
||||
$query = PermohonanPembatalan::query();
|
||||
|
||||
|
||||
if (!Auth::user()->hasAnyRole(['administrator'])) {
|
||||
$query = $query->whereHas('permohonan', function ($q) {
|
||||
$q->where('branch_id', Auth::user()->branch_id);
|
||||
});
|
||||
}
|
||||
|
||||
$query = $query->orderBy('created_at', 'desc');
|
||||
|
||||
// Apply search filter if provided
|
||||
if ($request->has('search') && !empty($request->get('search'))) {
|
||||
$search = json_decode($request->get('search'));
|
||||
|
||||
if (isset($search->start_date) || isset($search->end_date)) {
|
||||
$query->whereBetween('created_at', [
|
||||
$search->start_date ?? '1900-01-01',
|
||||
$search->end_date ?? now()->toDateString()
|
||||
]);
|
||||
}
|
||||
|
||||
// Filter by branch if provided
|
||||
if (isset($search->branch_id) && !empty($search->branch_id)) {
|
||||
$query->whereHas('permohonan', function ($q) use ($search) {
|
||||
$q->where('branch_id', $search->branch_id);
|
||||
});
|
||||
}
|
||||
|
||||
if (isset($search->search)) {
|
||||
$query->where(function ($q) use ($search) {
|
||||
$q->whereHas('permohonan', function ($subq) use ($search) {
|
||||
$subq->where('nomor_registrasi', 'LIKE', '%' . $search->search . '%');
|
||||
$subq->orWhereRelation('user', 'name', 'LIKE', '%' . $search->search . '%');
|
||||
$subq->orWhereRelation('branch', 'name', 'LIKE', '%' . $search->search . '%');
|
||||
});
|
||||
$q->orWhere('alasan_pembatalan', 'LIKE', '%' . $search->search . '%');
|
||||
$q->orWhere('status', 'LIKE', '%' . $search->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();
|
||||
$size = $request->get('size', 10);
|
||||
if ($size == 0) {
|
||||
$size = 10;
|
||||
}
|
||||
|
||||
// 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->get();
|
||||
|
||||
$data = $data->map(function ($item) {
|
||||
return [
|
||||
'id' => $item->id,
|
||||
'nomor_registrasi' => $item->permohonan->nomor_registrasi ?? '-',
|
||||
'tanggal_permohonan' => $item->permohonan->tanggal_permohonan ? date('d-m-Y', strtotime($item->permohonan->tanggal_permohonan)) : '-',
|
||||
'tanggal_pembatalan' => date('d-m-Y', strtotime($item->created_at)),
|
||||
'cabang' => $item->permohonan->branch->name ?? '-',
|
||||
'pemohon' => $item->permohonan->user->name ?? '-',
|
||||
'debitur' => $item->permohonan->debiture->name ?? '-',
|
||||
'alasan_pembatalan' => $item->alasan_pembatalan,
|
||||
'status' => $item->status,
|
||||
'diajukan_oleh' => $item->user->name ?? '-',
|
||||
'disetujui_oleh' => $item->authorized_by ? $item->authorizedUser->name : '-',
|
||||
'tanggal_disetujui' => $item->authorized_at ? formatTanggalIndonesia(strtotime($item->authorized_at),1) : '-'
|
||||
];
|
||||
});
|
||||
|
||||
|
||||
// Calculate the page count
|
||||
$pageCount = ceil($totalRecords / $size);
|
||||
|
||||
// Calculate the current page number
|
||||
$currentPage = max(1, $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,
|
||||
]);
|
||||
}
|
||||
}
|
||||
199
app/Http/Controllers/LaporanPenilaiJaminanController.php
Normal file
199
app/Http/Controllers/LaporanPenilaiJaminanController.php
Normal file
@@ -0,0 +1,199 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Modules\Lpj\Models\Permohonan;
|
||||
use Modules\Lpj\Models\StatusPermohonan;
|
||||
use Modules\Lpj\Exports\LaporanPenilaiJaminanExport;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
|
||||
class LaporanPenilaiJaminanController extends Controller
|
||||
{
|
||||
public $user;
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$status_permohonan = StatusPermohonan::all();
|
||||
return view('lpj::laporan-penilai-jaminan.index', compact('status_permohonan'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
return view('lpj::create');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
return view('lpj::laporan-penilai-jaminan.show');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
return view('lpj::edit');
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
public function dataForDatatables(Request $request)
|
||||
{
|
||||
|
||||
$user = auth()->user();
|
||||
|
||||
|
||||
// Check permissions
|
||||
if (is_null($this->user) || !$this->user->can('debitur.view')) {
|
||||
// abort(403, 'Sorry! You are not allowed to view users.');
|
||||
}
|
||||
|
||||
$userRole = $user->roles->pluck('name')->first();
|
||||
$regionId = null;
|
||||
|
||||
// If user is senior-officer, get their regionId
|
||||
if ($userRole === 'senior-officer') {
|
||||
$userTeam = TeamsUsers::with('team')->firstWhere('user_id', $user->id);
|
||||
$regionId = $userTeam?->team->regions_id;
|
||||
}
|
||||
$paramsSearch = null;
|
||||
// dd($startDate);
|
||||
// Retrieve data from the database
|
||||
$query = Permohonan::query();
|
||||
|
||||
// Apply search filter if provided
|
||||
if ($request->has('search') && !empty($request->get('search'))) {
|
||||
$search = $request->get('search');
|
||||
$paramsSearch = json_decode($search);
|
||||
|
||||
$query->where(function ($q) use ($search) {
|
||||
$q->where('nomor_registrasi', 'LIKE', '%' . $search . '%')
|
||||
->orWhere('tanggal_permohonan', 'LIKE', '%' . $search . '%')
|
||||
->orWhereRelation('user', 'name', 'LIKE', '%' . $search . '%')
|
||||
->orWhereRelation('debiture', 'name', 'LIKE', '%' . $search . '%')
|
||||
->orWhereRelation('tujuanPenilaian', 'name', 'LIKE', '%' . $search . '%')
|
||||
->orWhereRelation('branch', 'name', 'LIKE', '%' . $search . '%');
|
||||
|
||||
if (!empty($paramsSearch->tanggal_awal) && !empty($paramsSearch->tanggal_akhir)) {
|
||||
$q->whereBetween('tanggal_permohonan', [$paramsSearch->tanggal_awal, $paramsSearch->tanggal_akhir]);
|
||||
}
|
||||
|
||||
|
||||
$statusKeywords = explode(',', $search);
|
||||
foreach ($statusKeywords as $keyword) {
|
||||
$q->orWhereRelation('penilai', 'type_penilai', 'LIKE', '%' . trim($keyword) . '%');
|
||||
}
|
||||
});
|
||||
}
|
||||
$query->where('status', 'done');
|
||||
|
||||
|
||||
|
||||
// Default sorting if no sort provided
|
||||
if ($request->has('sortOrder') && !empty($request->get('sortOrder'))) {
|
||||
$order = $request->get('sortOrder');
|
||||
$column = $request->get('sortField');
|
||||
$query->orderBy($column, $order);
|
||||
} else {
|
||||
$query->orderBy('nomor_registrasi', 'asc');
|
||||
}
|
||||
|
||||
// Get total count of records before pagination
|
||||
$totalRecords = $query->count();
|
||||
|
||||
// Pagination
|
||||
if ($request->has('page') && $request->has('size')) {
|
||||
$page = (int) $request->get('page', 1);
|
||||
$size = (int) $request->get('size', 10);
|
||||
$offset = ($page - 1) * $size;
|
||||
$query->skip($offset)->take($size);
|
||||
}
|
||||
|
||||
// Get filtered count
|
||||
$filteredRecords = $query->count();
|
||||
|
||||
|
||||
|
||||
$totalRecords = $query->count();
|
||||
|
||||
// Pagination
|
||||
if ($request->has('page') && $request->has('size')) {
|
||||
$page = (int) $request->get('page', 1);
|
||||
$size = (int) $request->get('size', 10);
|
||||
$offset = ($page - 1) * $size;
|
||||
$query->skip($offset)->take($size);
|
||||
}
|
||||
|
||||
// Get filtered count
|
||||
$filteredRecords = $query->count();
|
||||
|
||||
// Get data with necessary relationships
|
||||
$data = $query->with(['user', 'debiture', 'branch', 'tujuanPenilaian', 'penilaian', 'dokumenjaminan.jenisJaminan','nilaiPlafond', 'penilai'])->get();
|
||||
|
||||
// Calculate total pages
|
||||
$pageCount = ceil($totalRecords / $request->get('size', 10));
|
||||
|
||||
|
||||
|
||||
|
||||
// Calculate total pages
|
||||
$pageCount = ceil($totalRecords / $request->get('size', 10));
|
||||
|
||||
return response()->json([
|
||||
'draw' => $request->get('draw'),
|
||||
'recordsTotal' => $totalRecords,
|
||||
'recordsFiltered' => $filteredRecords,
|
||||
'pageCount' => $pageCount,
|
||||
'page' => $request->get('page', 1),
|
||||
'totalCount' => $totalRecords,
|
||||
'data' => $data,
|
||||
]);
|
||||
}
|
||||
|
||||
public function export(Request $request)
|
||||
{
|
||||
$tanggalAwal = $request->input('tanggal_awal');
|
||||
$tanggalAkhir = $request->input('tanggal_akhir');
|
||||
$status = $request->input('status');
|
||||
$selectedIds = $request->input('selected_ids');
|
||||
|
||||
$filename = 'laporan_penilai_jaminan_' . date('YmdHis') . '.xlsx';
|
||||
return Excel::download(
|
||||
new LaporanPenilaiJaminanExport($tanggalAwal, $tanggalAkhir, $status, $selectedIds),
|
||||
$filename
|
||||
);
|
||||
}
|
||||
}
|
||||
124
app/Http/Controllers/LaporanPermohonanController.php
Normal file
124
app/Http/Controllers/LaporanPermohonanController.php
Normal file
@@ -0,0 +1,124 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Modules\Lpj\Models\Permohonan;
|
||||
use Modules\Lpj\Models\StatusPermohonan;
|
||||
use Modules\Lpj\Exports\LaporanPermohonanExport;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class LaporanPermohonanController extends Controller
|
||||
{
|
||||
public $user;
|
||||
public function index()
|
||||
{
|
||||
return view('lpj::laporan_permohonan.index');
|
||||
}
|
||||
|
||||
public function export(Request $request)
|
||||
{
|
||||
return Excel::download(new LaporanPermohonanExport($request), 'laporan_permohonan.xlsx');
|
||||
}
|
||||
|
||||
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.');
|
||||
}
|
||||
|
||||
// Retrieve data from the database
|
||||
$query = Permohonan::query();
|
||||
|
||||
if (!Auth::user()->hasAnyRole(['administrator'])) {
|
||||
$query = $query->where('branch_id', Auth::user()->branch_id);
|
||||
}
|
||||
|
||||
$query = $query->orderBy('nomor_registrasi', 'desc');
|
||||
|
||||
// Apply search filter if provided
|
||||
if ($request->has('search') && !empty($request->get('search'))) {
|
||||
$search = json_decode($request->get('search'));
|
||||
|
||||
if (isset($search->start_date) || isset($search->end_date)) {
|
||||
$query->whereBetween('tanggal_permohonan', [
|
||||
$search->start_date ?? '1900-01-01',
|
||||
$search->end_date ?? now()->toDateString()
|
||||
]);
|
||||
}
|
||||
|
||||
// Filter by status if provided
|
||||
if (isset($search->status) && !empty($search->status)) {
|
||||
$query->where('status', $search->status);
|
||||
}
|
||||
|
||||
// Filter by branch if provided
|
||||
if (isset($search->branch_id) && !empty($search->branch_id)) {
|
||||
$query->where('branch_id', $search->branch_id);
|
||||
}
|
||||
|
||||
if(isset($search->search)) {
|
||||
|
||||
$query->where(function ($q) use ($search) {
|
||||
$q->where('nomor_registrasi', 'LIKE', '%' . $search->search . '%');
|
||||
$q->orWhere('tanggal_permohonan', 'LIKE', '%' . $search->search . '%');
|
||||
$q->orWhereRelation('user', 'name', 'LIKE', '%' . $search->search . '%');
|
||||
$q->orWhereRelation('tujuanPenilaian', 'name', 'LIKE', '%' . $search->search . '%');
|
||||
$q->orWhereRelation('branch', 'name', 'LIKE', '%' . $search->search . '%');
|
||||
$q->orWhereRelation('jenisFasilitasKredit', 'name', 'LIKE', '%' . $search->search . '%');
|
||||
$q->orWhereRelation('jenisPenilaian', 'name', 'LIKE', '%' . $search->search . '%');
|
||||
$q->orWhere('status', 'LIKE', '%' . $search->search . '%');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Apply sorting if provided
|
||||
if ($request->has('sortOrder') && !empty($request->get('sortOrder'))) {
|
||||
$order = $request->get('sortOrder');
|
||||
$column = $request->get('sortField');
|
||||
$query->orderBy($column, $order);
|
||||
}
|
||||
|
||||
// Get the total count of records
|
||||
$totalRecords = $query->count();
|
||||
$size = $request->get('size', 10);
|
||||
if ($size == 0) {
|
||||
$size = 10;
|
||||
}
|
||||
|
||||
// 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(['user', 'debiture', 'branch', 'tujuanPenilaian', 'penilaian','documents','jenisFasilitasKredit', 'jenisPenilaian'])->get();
|
||||
|
||||
// Calculate the page count
|
||||
$pageCount = ceil($totalRecords / $size);
|
||||
|
||||
// Calculate the current page number
|
||||
$currentPage = max(1, $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,
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -61,12 +61,18 @@
|
||||
// Update Permohonan Pembatalan
|
||||
if($request->status=='approved'){
|
||||
$pembatalan->status = 'approved';
|
||||
$pembatalan->authorized_at = now();
|
||||
$pembatalan->authorized_by = auth()->user()->id;
|
||||
$pembatalan->authorized_status = 1;
|
||||
$pembatalan->save();
|
||||
|
||||
$permohonan->status = 'batal';
|
||||
$permohonan->save();
|
||||
} else{
|
||||
$pembatalan->status = 'rejected';
|
||||
$pembatalan->authorized_at = now();
|
||||
$pembatalan->authorized_by = auth()->user()->id;
|
||||
$pembatalan->authorized_status = 3;
|
||||
$pembatalan->save();
|
||||
}
|
||||
|
||||
|
||||
@@ -84,7 +84,6 @@ class PenilaiController extends Controller
|
||||
|
||||
$documentId = $request->query('documentId');
|
||||
$jaminanId = $request->query('jaminanId');
|
||||
$inspeksiId = $request->query('inspeksiId');
|
||||
$permohonan = $this->surveyorController->getPermohonanJaminanId($id, $documentId, $jaminanId);
|
||||
$basicData = $this->surveyorController->getCommonData();
|
||||
$provinces = Province::all();
|
||||
@@ -96,7 +95,6 @@ class PenilaiController extends Controller
|
||||
[
|
||||
'permohonan_id' => $id,
|
||||
'dokument_id' => $documentId,
|
||||
'inspeksi_id' => $inspeksiId,
|
||||
],
|
||||
[
|
||||
'type_penilai' => 'sederhana',
|
||||
@@ -152,7 +150,6 @@ class PenilaiController extends Controller
|
||||
|
||||
$documentId = $request->query('documentId');
|
||||
$jaminanId = $request->query('jaminanId');
|
||||
$inspeksiId = $request->query('inspeksiId');
|
||||
|
||||
$permohonan = $this->surveyorController->getPermohonanJaminanId($id, $documentId, $jaminanId);
|
||||
$basicData = $this->surveyorController->getCommonData();
|
||||
@@ -164,7 +161,6 @@ class PenilaiController extends Controller
|
||||
[
|
||||
'permohonan_id' => $id,
|
||||
'dokument_id' => $documentId,
|
||||
'inspeksi_id' => $inspeksiId,
|
||||
],
|
||||
[
|
||||
'type_penilai' => 'standar',
|
||||
@@ -219,7 +215,6 @@ class PenilaiController extends Controller
|
||||
{
|
||||
$permohonanId = $request->query('permohonanId');
|
||||
$documentId = $request->query('documentId');
|
||||
$inspeksiId = $request->query('inspeksiId');
|
||||
$jaminanId = $request->query('jaminanId');
|
||||
|
||||
$permohonan = $this->surveyorController->getPermohonanJaminanId($permohonanId, $documentId, $jaminanId);
|
||||
@@ -230,7 +225,6 @@ class PenilaiController extends Controller
|
||||
[
|
||||
'permohonan_id' => $permohonanId,
|
||||
'dokument_id' => $documentId,
|
||||
'inspeksi_id' => $inspeksiId,
|
||||
],
|
||||
[
|
||||
'type_penilai' => 'resume',
|
||||
@@ -269,7 +263,6 @@ class PenilaiController extends Controller
|
||||
[
|
||||
'permohonan_id' => $req['permohonanId'],
|
||||
'dokument_id' => $req['documentId'],
|
||||
'inspeksi_id' => $request->inspeksiId,
|
||||
],
|
||||
[
|
||||
'type_penilai' => 'memo',
|
||||
@@ -348,7 +341,6 @@ class PenilaiController extends Controller
|
||||
[
|
||||
'permohonan_id' => $request->permohonan_id,
|
||||
'dokument_id' => $request->dokument_id,
|
||||
'inspeksi_id' => $request->inspeksi_id,
|
||||
]
|
||||
);
|
||||
|
||||
@@ -377,7 +369,6 @@ class PenilaiController extends Controller
|
||||
|
||||
$permohonanId = $request->query('permohonanId');
|
||||
$documentId = $request->query('documentId');
|
||||
$inspeksiId = $request->query('inspeksiId');
|
||||
$jaminanId = $request->query('jaminanId');
|
||||
|
||||
$permohonan = $this->surveyorController->getPermohonanJaminanId($permohonanId, $documentId, $jaminanId);
|
||||
@@ -398,7 +389,6 @@ class PenilaiController extends Controller
|
||||
|
||||
$permohonanId = $request->query('permohonanId');
|
||||
$documentId = $request->query('documentId');
|
||||
$inspeksiId = $request->query('inspeksiId');
|
||||
$jaminanId = $request->query('jaminanId');
|
||||
$provinces = Province::all();
|
||||
$permohonan = $this->surveyorController->getPermohonanJaminanId($permohonanId, $documentId, $jaminanId);
|
||||
@@ -409,7 +399,6 @@ class PenilaiController extends Controller
|
||||
[
|
||||
'permohonan_id' => $permohonanId,
|
||||
'dokument_id' => $documentId,
|
||||
'inspeksi_id' => $inspeksiId,
|
||||
],
|
||||
[
|
||||
'type_penilai' => 'rap',
|
||||
@@ -478,7 +467,6 @@ class PenilaiController extends Controller
|
||||
|
||||
$permohonanId = $request->query('permohonanId');
|
||||
$documentId = $request->query('documentId');
|
||||
$inspeksiId = $request->query('inspeksiId');
|
||||
$jaminanId = $request->query('jaminanId');
|
||||
$provinces = Province::all();
|
||||
$permohonan = $this->surveyorController->getPermohonanJaminanId($permohonanId, $documentId, $jaminanId);
|
||||
@@ -489,7 +477,6 @@ class PenilaiController extends Controller
|
||||
[
|
||||
'permohonan_id' => $permohonanId,
|
||||
'dokument_id' => $documentId,
|
||||
'inspeksi_id' => $inspeksiId,
|
||||
],
|
||||
[
|
||||
'type_penilai' => 'call-report',
|
||||
@@ -576,7 +563,7 @@ class PenilaiController extends Controller
|
||||
if (!Auth::user()->hasRole('administrator')) {
|
||||
$query->whereHas('penilaian.userPenilai', function ($q) {
|
||||
$q
|
||||
->where('role', ['surveyor','penilai'])
|
||||
->whereIn('role', ['surveyor', 'penilai'])
|
||||
->where('user_id', Auth::user()->id);
|
||||
});
|
||||
}
|
||||
@@ -721,7 +708,6 @@ class PenilaiController extends Controller
|
||||
$validatedData = $request->validate([
|
||||
'permohonan_id' => 'required|integer',
|
||||
'document_id' => 'required|integer',
|
||||
'inspeksi_id' => 'required|integer',
|
||||
'kertas_kerja' => 'required|file|mimes:pdf',
|
||||
]);
|
||||
|
||||
@@ -734,7 +720,6 @@ class PenilaiController extends Controller
|
||||
[
|
||||
'permohonan_id' => $validatedData['permohonan_id'],
|
||||
'dokument_id' => $validatedData['document_id'],
|
||||
'inspeksi_id' => $validatedData['inspeksi_id'],
|
||||
],
|
||||
[
|
||||
'kertas_kerja' => $filePath,
|
||||
@@ -761,11 +746,9 @@ class PenilaiController extends Controller
|
||||
{
|
||||
$permohonanId = $request->query('permohonanId');
|
||||
$documentId = $request->query('documentId');
|
||||
$inspeksiId = $request->query('inspeksiId');
|
||||
|
||||
$statusLpj = Penilai::where('permohonan_id', $permohonanId)
|
||||
->where('dokument_id', $documentId)
|
||||
->where('inspeksi_id', $inspeksiId)
|
||||
->first();
|
||||
|
||||
return response()->json(['status' => $statusLpj ? $statusLpj->type : null]);
|
||||
@@ -778,8 +761,7 @@ class PenilaiController extends Controller
|
||||
Penilai::updateOrCreate(
|
||||
[
|
||||
'permohonan_id' => $request->permohonan_id,
|
||||
'dokument_id' => $request->document_id,
|
||||
'inspeksi_id' => $request->inspeksi_id,
|
||||
'dokument_id' => $request->document_i
|
||||
],
|
||||
[
|
||||
'type' => $request->type,
|
||||
@@ -852,6 +834,15 @@ class PenilaiController extends Controller
|
||||
}
|
||||
|
||||
|
||||
// $cekLpj = $this->checkDataLpj($type, $statusLpj);
|
||||
// if ($permohonan->status_bayar === 'sudah_bayar' && $cekLpj) {
|
||||
// return response()->json([
|
||||
// 'success' => false,
|
||||
// 'message' => 'Harap mengisi LPJ terlebih dahulu',
|
||||
// ]);
|
||||
// }
|
||||
|
||||
|
||||
$permohonan->update([
|
||||
'status' => 'proses-laporan',
|
||||
]);
|
||||
@@ -871,14 +862,69 @@ class PenilaiController extends Controller
|
||||
|
||||
public function uploadTempPhoto(Request $request)
|
||||
{
|
||||
$validatedData = $request->validate([
|
||||
'permohonan_id' => 'required|integer',
|
||||
'dokument_id' => 'required|integer',
|
||||
]);
|
||||
|
||||
$memo = Penilai::firstOrNew([
|
||||
'permohonan_id' => $validatedData['permohonan_id'],
|
||||
'dokument_id' => $validatedData['dokument_id'],
|
||||
]);
|
||||
|
||||
$existingData = $memo->exists && $memo->memo ? json_decode($memo->memo, true) : [];
|
||||
$existingData['foto'] = $existingData['foto'] ?? [];
|
||||
|
||||
if ($request->hasFile('file')) {
|
||||
$file = $request->file('file');
|
||||
$filename = time() . '_' . $file->getClientOriginalName();
|
||||
$path = $file->storeAs('temp_photos', $filename, 'public');
|
||||
return response()->json(['success' => true, 'id' => $path]);
|
||||
|
||||
$files = $request->file('file');
|
||||
|
||||
if (!is_array($files)) {
|
||||
$files = [$files];
|
||||
}
|
||||
foreach ($files as $file) {
|
||||
|
||||
$filename = time() . '_' . $file->getClientOriginalName();
|
||||
$path = $file->storeAs('temp_photos', $filename, 'public');
|
||||
$existingData['foto'][] = $path;
|
||||
|
||||
}
|
||||
// Simpan data memo
|
||||
$memo->memo = json_encode($existingData);
|
||||
$memo->save();
|
||||
|
||||
return response()->json(['success' => true, 'data' => $existingData]);
|
||||
}
|
||||
return response()->json(['success' => false], 400);
|
||||
}
|
||||
|
||||
|
||||
public function deleteTempPhoto(Request $request)
|
||||
{
|
||||
$validatedData = $request->validate([
|
||||
'permohonan_id' => 'required|integer',
|
||||
'dokument_id' => 'required|integer',
|
||||
'path' => 'required|string',
|
||||
]);
|
||||
|
||||
$memo = Penilai::firstOrNew([
|
||||
'permohonan_id' => $validatedData['permohonan_id'],
|
||||
'dokument_id' => $validatedData['dokument_id'],
|
||||
]);
|
||||
|
||||
$fotoMemo = json_decode($memo->memo, true);
|
||||
if (isset($fotoMemo['foto']) && is_array($fotoMemo['foto'])) {
|
||||
$fotoMemo['foto'] = array_filter($fotoMemo['foto'], function ($photo) use ($validatedData) {
|
||||
return basename($photo) !== basename($validatedData['path']);
|
||||
});
|
||||
|
||||
$fotoMemo['foto'] = array_values($fotoMemo['foto']);
|
||||
$memo->memo = json_encode($fotoMemo);
|
||||
$memo->save();
|
||||
return response()->json(['success' => true, 'message' => 'Foto berhasil dihapus']);
|
||||
}
|
||||
|
||||
return response()->json(['success' => false], 400);
|
||||
return response()->json(['success' => false, 'message' => 'Foto tidak ditemukan'], 400);
|
||||
}
|
||||
|
||||
public function storeResume(Request $request)
|
||||
@@ -887,7 +933,7 @@ class PenilaiController extends Controller
|
||||
$validatedData = $request->validate([
|
||||
'permohonan_id' => 'required',
|
||||
'dokument_id' => 'required',
|
||||
'inspeksi_id' => 'required',
|
||||
|
||||
'resume' => 'required|array',
|
||||
'fakta_positif' => 'nullable|array',
|
||||
'fakta_negatif' => 'nullable|array',
|
||||
@@ -901,7 +947,7 @@ class PenilaiController extends Controller
|
||||
[
|
||||
'permohonan_id' => $validatedData['permohonan_id'],
|
||||
'dokument_id' => $validatedData['dokument_id'],
|
||||
'inspeksi_id' => $validatedData['inspeksi_id'],
|
||||
|
||||
],
|
||||
[
|
||||
'resume' => json_encode($validatedData['resume']),
|
||||
@@ -970,45 +1016,22 @@ class PenilaiController extends Controller
|
||||
$validatedData = $request->validate([
|
||||
'permohonan_id' => 'required|integer',
|
||||
'document_id' => 'required|integer',
|
||||
'inspeksi_id' => 'required|integer',
|
||||
'memo' => 'required',
|
||||
]);
|
||||
|
||||
$memoData = json_decode($validatedData['memo'], true);
|
||||
$newMemoData = json_decode($validatedData['memo'], true);
|
||||
|
||||
$memo = Penilai::updateOrCreate(
|
||||
$memo = Penilai::firstOrNew(
|
||||
[
|
||||
'permohonan_id' => $validatedData['permohonan_id'],
|
||||
'dokument_id' => $validatedData['document_id'],
|
||||
'inspeksi_id' => $validatedData['inspeksi_id'],
|
||||
],
|
||||
[
|
||||
'memo' => json_encode($memoData),
|
||||
]
|
||||
);
|
||||
|
||||
$existingPhotos = isset($memo->memo) ? json_decode($memo->memo)->foto : [];
|
||||
dd($existingPhotos);
|
||||
// Simpan foto-foto
|
||||
if ($request->hasFile('foto_0')) {
|
||||
$photoUrls = [];
|
||||
$index = 0;
|
||||
while ($request->hasFile("foto_$index")) {
|
||||
$file = $request->file("foto_$index");
|
||||
$fileName = time() . '_' . $file->getClientOriginalName();
|
||||
$filePath = $file->storeAs('public/memo_photos', $fileName);
|
||||
$photoUrls[] = Storage::url($filePath);
|
||||
$index++;
|
||||
}
|
||||
$existingMemoData = isset($memo->memo) ? json_decode($memo->memo, true) : [];
|
||||
$mergedMemoData = array_merge($existingMemoData, $newMemoData);
|
||||
|
||||
$memoData['foto'] = array_merge($existingPhotos, $photoUrls);
|
||||
|
||||
}else{
|
||||
$memoData['foto'] = $existingPhotos;
|
||||
}
|
||||
// Tambahkan URL foto ke data memo
|
||||
$memoData['foto'] = $photoUrls;
|
||||
$memo->memo = json_encode($memoData);
|
||||
$memo->memo = json_encode($mergedMemoData);
|
||||
$memo->save();
|
||||
|
||||
return response()->json([
|
||||
@@ -1031,26 +1054,33 @@ class PenilaiController extends Controller
|
||||
$validatedData = $request->all();
|
||||
$result = $this->inspeksiService->storeInspeksi($validatedData, $request->input('type'), $request);
|
||||
|
||||
$data = [];
|
||||
|
||||
$data = [
|
||||
'luas_tanah' => $request->input('luas_tanah'),
|
||||
'nilai_tanah_1' => $request->input('nilai_tanah_1'),
|
||||
'nilai_tanah_2' => $request->input('nilai_tanah_2'),
|
||||
'luas_bangunan' => $request->input('luas_bangunan'),
|
||||
'nilai_bangunan_1' => $request->input('nilai_bangunan_1'),
|
||||
'nilai_bangunan_2' => $request->input('nilai_bangunan_2'),
|
||||
'sarana_pelengkap_penilai' => $request->input('sarana_pelengkap_penilai'),
|
||||
'nilai_sarana_pelengkap_1' => $request->input('nilai_sarana_pelengkap_1'),
|
||||
'nilai_sarana_pelengkap_2' => $request->input('nilai_sarana_pelengkap_2'),
|
||||
'total_nilai_pasar_wajar' => $request->input('total_nilai_pasar_wajar'),
|
||||
'likuidasi' => $request->input('likuidasi'),
|
||||
'likuidasi_nilai_1' => $request->input('likuidasi_nilai_1'),
|
||||
'likuidasi_nilai_2' => $request->input('likuidasi_nilai_2'),
|
||||
'asuransi_luas_bangunan' => $request->input('asuransi_luas_bangunan'),
|
||||
'asuransi_nilai_1' => $request->input('asuransi_nilai_1'),
|
||||
'asuransi_nilai_2' => $request->input('asuransi_nilai_2'),
|
||||
'keterangan_penilai' => $request->input('keterangan_penilai') ?? [],
|
||||
];
|
||||
$kategoriUnik = ['tanah', 'bangunan', 'apartemen-kantor', 'alat-berat', 'mesin', 'kendaraan', 'pesawat', 'kapal', 'sarana_pelengkap_penilai'];
|
||||
|
||||
foreach ($kategoriUnik as $kategori) {
|
||||
// Dynamically generate keys
|
||||
$luasKey = 'luas_' . $kategori;
|
||||
$nilaiKey1 = 'nilai_' . $kategori . '_1';
|
||||
$nilaiKey2 = 'nilai_' . $kategori . '_2';
|
||||
|
||||
// Collect data if exists
|
||||
if ($request->has($luasKey)) {
|
||||
$data[$luasKey] = $request->input($luasKey);
|
||||
}
|
||||
if ($request->has($nilaiKey1)) {
|
||||
$data[$nilaiKey1] = $request->input($nilaiKey1);
|
||||
}
|
||||
if ($request->has($nilaiKey2)) {
|
||||
$data[$nilaiKey2] = $request->input($nilaiKey2);
|
||||
}
|
||||
}
|
||||
|
||||
$data['total_nilai_pasar_wajar'] = $request->input('total_nilai_pasar_wajar');
|
||||
$data['likuidasi'] = $request->input('likuidasi');
|
||||
$data['likuidasi_nilai_1'] = $request->input('likuidasi_nilai_1');
|
||||
$data['likuidasi_nilai_2'] = $request->input('likuidasi_nilai_2');
|
||||
$data['keterangan_penilai'] = $request->input('keterangan_penilai') ?? [];
|
||||
|
||||
$npwData = [];
|
||||
$npwCounter = 1;
|
||||
@@ -1075,7 +1105,7 @@ class PenilaiController extends Controller
|
||||
[
|
||||
'permohonan_id' => $request->permohonanId,
|
||||
'dokument_id' => $request->documentId,
|
||||
'inspeksi_id' => $request->inspeksiId,
|
||||
|
||||
],
|
||||
[
|
||||
'lpj' => json_encode($data),
|
||||
@@ -1087,7 +1117,7 @@ class PenilaiController extends Controller
|
||||
'message' => 'Berhasil menyimpan LPJ',
|
||||
'data' => $result
|
||||
], 200);
|
||||
}catch (\Throwable $e) {
|
||||
} catch (\Throwable $e) {
|
||||
DB::rollBack();
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
@@ -1129,7 +1159,7 @@ class PenilaiController extends Controller
|
||||
[
|
||||
'permohonan_id' => $request->permohonanId,
|
||||
'dokument_id' => $request->documentId,
|
||||
'inspeksi_id' => $request->inspeksiId,
|
||||
|
||||
],
|
||||
[
|
||||
'rap' => json_encode($data),
|
||||
@@ -1160,7 +1190,6 @@ class PenilaiController extends Controller
|
||||
$validated = $request->validate([
|
||||
'permohonan_id' => 'required|exists:permohonan,id',
|
||||
'dokument_id' => 'required',
|
||||
'inspeksi_id' => 'required',
|
||||
'data' => 'required',
|
||||
'fakta_positif' => 'nullable|array',
|
||||
'fakta_negatif' => 'nullable|array',
|
||||
@@ -1175,7 +1204,6 @@ class PenilaiController extends Controller
|
||||
[
|
||||
'permohonan_id' => $validated['permohonan_id'],
|
||||
'dokument_id' => $validated['dokument_id'],
|
||||
'inspeksi_id' => $validated['inspeksi_id'],
|
||||
],
|
||||
[
|
||||
'call_report' => json_encode($validated['data']),
|
||||
@@ -1389,7 +1417,6 @@ class PenilaiController extends Controller
|
||||
'permohonanId' => $request->query('permohonanId'),
|
||||
'documentId' => $request->query('documentId'),
|
||||
'jaminanId' => $request->query('jaminanId'),
|
||||
'inspeksiId' => $request->query('inspeksiId')
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1397,12 +1424,10 @@ class PenilaiController extends Controller
|
||||
{
|
||||
$permohonanId = $request->query('permohonanId');
|
||||
$documentId = $request->query('documentId');
|
||||
$inspeksiId = $request->query('inspeksiId');
|
||||
|
||||
// Ambil data berdasarkan ID
|
||||
$statusLpj = Penilai::where('permohonan_id', $permohonanId)
|
||||
->where('dokument_id', $documentId)
|
||||
->where('inspeksi_id', $inspeksiId)
|
||||
->first();
|
||||
|
||||
// Jika data tidak ditemukan, kembalikan status null
|
||||
|
||||
@@ -10,6 +10,7 @@ use Illuminate\Support\Facades\DB;
|
||||
use Modules\Lpj\Http\Requests\PenilaianRequest;
|
||||
use Modules\Lpj\Models\Authorization;
|
||||
use Modules\Lpj\Models\JenisPenilaian;
|
||||
use Modules\Lpj\Models\LaporanAdminKredit;
|
||||
use Modules\Lpj\Models\Penilaian;
|
||||
use Modules\Lpj\Models\PenilaianTeam;
|
||||
use Modules\Lpj\Models\Permohonan;
|
||||
@@ -193,6 +194,8 @@ class PenilaianController extends Controller
|
||||
DB::beginTransaction();
|
||||
$penilaian = Penilaian::where('nomor_registrasi', $request->nomor_registrasi)->first();
|
||||
|
||||
$surveyTeam = null;
|
||||
$penilaiTeam = null;
|
||||
$penilaianId = $penilaian->id;
|
||||
|
||||
$penilainTeam = PenilaianTeam::where('penilaian_id', $penilaianId)->get();
|
||||
@@ -204,6 +207,7 @@ class PenilaianController extends Controller
|
||||
'user_id' => $request->surveyor_id,
|
||||
'role' => 'surveyor',
|
||||
]);
|
||||
$surveyTeam = $item->team_id;
|
||||
}
|
||||
|
||||
if ($item->role === 'penilai' && $item->user_id === null) {
|
||||
@@ -211,10 +215,21 @@ class PenilaianController extends Controller
|
||||
'user_id' => $request->penilai_id,
|
||||
'role' => 'penilai',
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
if ($item->role === 'penilai' && $surveyTeam) {
|
||||
$penilaiTeam = $item->team_id;
|
||||
}
|
||||
}
|
||||
|
||||
$permohonan = Permohonan::where('nomor_registrasi', $request->nomor_registrasi);
|
||||
|
||||
if ($surveyTeam && $penilaiTeam) {
|
||||
$permohonan->update([
|
||||
'region_id' => $penilaiTeam,
|
||||
]);
|
||||
}
|
||||
$permohonan->update([
|
||||
'status' => 'assign',
|
||||
]);
|
||||
@@ -473,6 +488,7 @@ class PenilaianController extends Controller
|
||||
} else {
|
||||
$permohonan = Permohonan::find($id);
|
||||
}
|
||||
|
||||
if (!$permohonan) {
|
||||
return response()->json([
|
||||
'message' => 'Data permohonan tidak ditemukan.',
|
||||
@@ -512,6 +528,35 @@ class PenilaianController extends Controller
|
||||
$status = 'done';
|
||||
}
|
||||
|
||||
if ($status == 'done' && $permohonan->status_bayar === 'sudah_bayar' && $permohonan->penilai->type_penilai === 'standar' || $permohonan->penilai->type_penilai === 'sederhana') {
|
||||
$_permohonan = Permohonan::with(['documents.jenisJaminan','penilaian._user_penilai','penilai','documents.detail.jenisLegalitasJaminan'])->find($permohonan->id);
|
||||
|
||||
if (isset($_permohonan->penilai->lpj)) {
|
||||
$npw = json_decode($_permohonan->penilai->lpj, true);
|
||||
$npw = $npw['total_nilai_pasar_wajar'] ?? 0;
|
||||
}
|
||||
|
||||
$dataAdk = [
|
||||
'debiture_id' => $_permohonan->debiture_id,
|
||||
'jenis_agunan' => $_permohonan->documents->pluck('jenisJaminan.name')->unique()->implode(', '),
|
||||
'alamat_agunan' => $_permohonan->documents->map(function ($document) {
|
||||
return formatAlamat($document);
|
||||
})->unique()->implode(', '),
|
||||
'nama_pemilik' => $_permohonan->documents->pluck('pemilik.name')->unique()->implode(', '),
|
||||
'tanggal_kunjungan' => $_permohonan->penilaian->tanggal_kunjungan,
|
||||
'nama_penilai' => $_permohonan->penilaian->_user_penilai->userPenilaiTeam->name,
|
||||
'nilai_likuidasi' => $_permohonan->nilai_liquidasi,
|
||||
'nilai_pasar_wajar' => str_replace('.', '', $npw),
|
||||
'bukti_kepemilikan' => $_permohonan->documents->flatMap(function ($document) {
|
||||
return $document->detail->map(function ($detail) {
|
||||
return $detail->jenisLegalitasJaminan->name ?? null;
|
||||
});
|
||||
})->filter()->unique()->implode(', '),
|
||||
|
||||
];
|
||||
LaporanAdminKredit::create($dataAdk);
|
||||
}
|
||||
|
||||
if ($approvalField) {
|
||||
$this->updatePermohonan($permohonan, $status, $approvalField, $request->keterangan);
|
||||
}
|
||||
@@ -528,7 +573,7 @@ class PenilaianController extends Controller
|
||||
]);
|
||||
} elseif (Auth::user()->roles[0]->name === 'EO Appraisal' || Auth::user()->roles[0]->name === 'administrator' && $authorization->approve_so && $authorization->approve_eo === null) {
|
||||
$status = '2';
|
||||
if (!in_array($permohonan->nilai_plafond_id, [1, 4])) {
|
||||
if (in_array($permohonan->nilai_plafond_id, [1, 2])) {
|
||||
$status = '1';
|
||||
$permohonan->update([
|
||||
'status' => $authorization->request
|
||||
@@ -572,7 +617,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,2])) {
|
||||
$status = '1';
|
||||
$permohonan->update([
|
||||
'status' => $authorization->request
|
||||
@@ -786,7 +831,6 @@ class PenilaianController extends Controller
|
||||
$inspeksi = Inspeksi::where('permohonan_id', $id)->where('dokument_id', $documentId)->first();
|
||||
$lpj = Penilai::where('permohonan_id', $id)
|
||||
->where('dokument_id', $documentId)
|
||||
->where('inspeksi_id', $inspeksi->id)
|
||||
->first();
|
||||
$penilai = $lpj;
|
||||
|
||||
@@ -879,7 +923,7 @@ class PenilaianController extends Controller
|
||||
[
|
||||
'permohonan_id' => $request->permohonanId,
|
||||
'dokument_id' => $request->documentId,
|
||||
'inspeksi_id' => $request->inspeksiId,
|
||||
|
||||
],
|
||||
[
|
||||
'lpj' => json_encode($data),
|
||||
@@ -924,6 +968,8 @@ class PenilaianController extends Controller
|
||||
}
|
||||
|
||||
$status = 'reject-freeze';
|
||||
} elseif ($permohonan->status === 'proses-laporan' && $userRole === 'senior-officer') {
|
||||
$status = 'revisi-laporan';
|
||||
} elseif ($permohonan->status === 'proses-laporan' && $userRole === 'EO Appraisal') {
|
||||
$permohonan->update([
|
||||
'approval_so' => 0,
|
||||
|
||||
@@ -280,6 +280,10 @@ class PermohonanController extends Controller
|
||||
// Retrieve data from the database
|
||||
$query = Permohonan::query()->with('documents')->has('documents', '>', 0)->where('status', '=', 'order');
|
||||
|
||||
if (!Auth::user()->hasAnyRole(['administrator'])) {
|
||||
$query = $query->where('branch_id', Auth::user()->branch_id);
|
||||
}
|
||||
|
||||
// Apply search filter if provided
|
||||
if ($request->has('search') && !empty($request->get('search'))) {
|
||||
$search = $request->get('search');
|
||||
|
||||
@@ -167,6 +167,23 @@ class SurveyorController extends Controller
|
||||
public function store(Request $request)
|
||||
{
|
||||
$validatedData = $request->all();
|
||||
|
||||
$fotoTypes = [
|
||||
'foto_gistaru',
|
||||
'foto_bhumi',
|
||||
'foto_argis_region',
|
||||
'foto_tempat',
|
||||
'foto_sentuh_tanahku',
|
||||
'upload_gs'
|
||||
];
|
||||
|
||||
// Hapus data foto dari $validatedData
|
||||
foreach ($fotoTypes as $fotoType) {
|
||||
if (isset($validatedData[$fotoType])) {
|
||||
unset($validatedData[$fotoType]);
|
||||
}
|
||||
}
|
||||
|
||||
$result = $this->inspeksiService->storeInspeksi($validatedData, $request->input('type'), $request);
|
||||
|
||||
if ($result['success']) {
|
||||
@@ -730,6 +747,7 @@ class SurveyorController extends Controller
|
||||
'lingkungan' => 'validateLingkungan',
|
||||
'fakta' => 'validateFactData',
|
||||
'rap' => 'validateRapData',
|
||||
'apartemen-kantor' => 'validateUnitData',
|
||||
];
|
||||
|
||||
// Ambil data inspeksi
|
||||
@@ -776,7 +794,7 @@ class SurveyorController extends Controller
|
||||
]);
|
||||
|
||||
|
||||
if($permohonan->jenisPenilaian->name=="External") {
|
||||
if ($permohonan->jenisPenilaian->name == "External") {
|
||||
LaporanExternal::updateOrCreate(
|
||||
['permohonan_id' => $permohonan->id],
|
||||
[
|
||||
@@ -903,10 +921,10 @@ class SurveyorController extends Controller
|
||||
'waktu_penilaian' => $validate['waktu_penilaian'],
|
||||
'deskripsi_penilaian' => $validate['deskripsi_penilaian'],
|
||||
]);
|
||||
return response()->json([
|
||||
'success' => true,
|
||||
'message' => 'Berhasil kirim jadwal kunjungan'
|
||||
], 200);
|
||||
return response()->json([
|
||||
'success' => true,
|
||||
'message' => 'Berhasil kirim jadwal kunjungan'
|
||||
], 200);
|
||||
} catch (\Exception $e) {
|
||||
|
||||
return response()->json([
|
||||
@@ -1383,13 +1401,37 @@ class SurveyorController extends Controller
|
||||
|
||||
// dd($request->all());
|
||||
$maxSize = getMaxFileSize('Foto');
|
||||
$validator = $request->validate([
|
||||
$validator = $request->validate(
|
||||
[
|
||||
'permohonan_id' => 'required|exists:permohonan,id',
|
||||
'type' => 'required|string',
|
||||
'type' => 'nullable|string',
|
||||
'dokument_id' => 'required',
|
||||
'name_foto_objek' => 'nullable|string',
|
||||
'nomor_registrasi' => 'required|string',
|
||||
]);
|
||||
'kordinat_lat' => [
|
||||
'nullable',
|
||||
'regex:/^(-?[1-8]?[0-9](\.\d+)?|90(\.0+)?)$/'
|
||||
],
|
||||
'kordinat_long' => [
|
||||
'nullable',
|
||||
'regex:/^(-?(1[0-7][0-9]|[1-9]?[0-9])(\.\d+)?|180(\.0+)?)$/'
|
||||
],
|
||||
'kordinat_lat_pembanding.*' => [
|
||||
'nullable',
|
||||
'regex:/^(-?[1-8]?[0-9](\.\d+)?|90(\.0+)?)$/'
|
||||
],
|
||||
'kordinat_lng_pembanding.*' => [
|
||||
'nullable',
|
||||
'regex:/^(-?(1[0-7][0-9]|[1-9]?[0-9])(\.\d+)?|180(\.0+)?)$/'
|
||||
],
|
||||
],
|
||||
[
|
||||
'kordinat_lat.regex' => 'Format koordinat latitude tidak valid.',
|
||||
'kordinat_long.regex' => 'Format koordinat longitude tidak valid.',
|
||||
'kordinat_lat_pembanding.*.regex' => 'Format koordinat latitude pembanding tidak valid.',
|
||||
'kordinat_lng_pembanding.*.regex' => 'Format koordinat longitude pembanding tidak valid.',
|
||||
]
|
||||
);
|
||||
|
||||
$tanahBangunanTypes = ['KAPAL', 'PESAWAT', 'KENDARAAN', 'ALAT BERAT', 'MESIN'];
|
||||
|
||||
@@ -1551,7 +1593,7 @@ class SurveyorController extends Controller
|
||||
|
||||
// Jika alamat tidak sesuai, override dengan kode dari alamat
|
||||
|
||||
$cekAlamat = $forminspeksi['asset']['alamat']['tidak sesuai'] ?? null;
|
||||
$cekAlamat = $forminspeksi['asset']['alamat']['tidak sesuai'] ?? $forminspeksi['asset']['alamat']['sesuai'] ?? [];
|
||||
|
||||
if ($cekAlamat) {
|
||||
$provinceCode = $cekAlamat['province_code'] ?? $provinceCode;
|
||||
@@ -2003,9 +2045,9 @@ class SurveyorController extends Controller
|
||||
|
||||
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.');
|
||||
}
|
||||
// if (is_null($this->user) || !$this->user->can('debitur.view')) {
|
||||
// abort(403, 'Sorry! You are not allowed to view users.');
|
||||
// }
|
||||
|
||||
$query = Permohonan::query();
|
||||
$query = $query->orderBy('nomor_registrasi', 'desc');
|
||||
@@ -2074,7 +2116,7 @@ class SurveyorController extends Controller
|
||||
|
||||
public function dataForDatatablesData(Request $request, $type)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('jenis_aset.view')) {
|
||||
if (is_null(auth()->user()) || !$this->user->can('jenis_aset.view')) {
|
||||
//abort(403, 'Sorry! You are not allowed to view users.');
|
||||
}
|
||||
|
||||
@@ -2646,10 +2688,27 @@ class SurveyorController extends Controller
|
||||
return redirect()->back()->with('error', 'Silahkan isi terlebih dahulu form inspeksi.');
|
||||
}
|
||||
|
||||
// Pilih template PDF berdasarkan nama inspeksi
|
||||
$templateView = strtolower($inspeksi->name) === 'rap'
|
||||
? 'lpj::surveyor.components.print-out.main'
|
||||
: 'lpj::surveyor.components.print-out.main';
|
||||
$templateView = '';
|
||||
switch (strtolower($inspeksi->name)) {
|
||||
case 'rap':
|
||||
$templateView = 'lpj::surveyor.components.print-out.main';
|
||||
break;
|
||||
case 'mesin':
|
||||
$templateView = 'lpj::surveyor.components.print-out.mesin';
|
||||
break;
|
||||
case 'kendaraan':
|
||||
$templateView = 'lpj::surveyor.components.print-out.kendaraan';
|
||||
break;
|
||||
case 'pesawat':
|
||||
$templateView = 'lpj::surveyor.components.print-out.pesawat';
|
||||
break;
|
||||
case 'alat-berat':
|
||||
$templateView = 'lpj::surveyor.components.print-out.alat-berat';
|
||||
break;
|
||||
default:
|
||||
$templateView = 'lpj::surveyor.components.print-out.main';
|
||||
break;
|
||||
}
|
||||
|
||||
// Generate PDF
|
||||
$pdf = PDF::loadView($templateView, compact('permohonan', 'basicData', 'forminspeksi', 'alamat'));
|
||||
@@ -2776,4 +2835,73 @@ class SurveyorController extends Controller
|
||||
], 500);
|
||||
}
|
||||
}
|
||||
|
||||
public function uploadFileFoto(Request $request, $url)
|
||||
{
|
||||
|
||||
// dd($request->all());
|
||||
$inspeksi = Inspeksi::where('permohonan_id', $request->input('permohonan_id'))
|
||||
->where('dokument_id', $request->input('dokument_id'))
|
||||
->first();
|
||||
|
||||
$fotoTypes = [
|
||||
'foto_gistaru',
|
||||
'foto_bhumi',
|
||||
'foto_argis_region',
|
||||
'foto_tempat',
|
||||
'foto_sentuh_tanahku',
|
||||
'upload_gs'
|
||||
];
|
||||
|
||||
if (!in_array($url, $fotoTypes)) {
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => 'Invalid key for upload'
|
||||
], 400);
|
||||
}
|
||||
|
||||
|
||||
$existingData = $inspeksi ? json_decode($inspeksi->data_form, true) : [];
|
||||
$existingData = $existingData ?? [];
|
||||
|
||||
|
||||
$factData = $existingData;
|
||||
if ($request->hasFile('file')) {
|
||||
$file = $request->file('file');
|
||||
$filePath = $file->store('uploads', 'public');
|
||||
$uploadedPath = str_replace('public/', '', $filePath);
|
||||
|
||||
|
||||
$factData[$url] = $uploadedPath;
|
||||
|
||||
|
||||
$existingData = $factData;
|
||||
if ($inspeksi) {
|
||||
$inspeksi->data_form = json_encode($existingData);
|
||||
$inspeksi->save();
|
||||
} else {
|
||||
Inspeksi::create([
|
||||
'permohonan_id' => $request->input('permohonan_id'),
|
||||
'dokument_id' => $request->input('document_id'),
|
||||
'data_form' => json_encode($existingData),
|
||||
]);
|
||||
}
|
||||
} else {
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => 'No file uploaded for the given key'
|
||||
], 400);
|
||||
}
|
||||
|
||||
return response()->json([
|
||||
'success' => true,
|
||||
'message' => 'Berhasil upload file foto',
|
||||
'data' => [
|
||||
'key' => $url,
|
||||
'path' => $factData[$url] ?? null
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
57
app/Http/Requests/BankDataRequest.php
Normal file
57
app/Http/Requests/BankDataRequest.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class BankDataRequest extends FormRequest
|
||||
{
|
||||
public function authorize()
|
||||
{
|
||||
return true; // Adjust this based on your authorization logic
|
||||
}
|
||||
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'address' => 'nullable|string|max:255',
|
||||
'village_code' => 'nullable|string|max:20',
|
||||
'district_code' => 'nullable|string|max:20',
|
||||
'city_code' => 'nullable|string|max:20',
|
||||
'province_code' => 'nullable|string|max:20',
|
||||
'tahun' => 'nullable|integer',
|
||||
'luas_tanah' => 'nullable|numeric',
|
||||
'luas_bangunan' => 'nullable|numeric',
|
||||
'tahun_bangunan' => 'nullable|integer',
|
||||
'status_nara_sumber' => 'nullable|string|max:50',
|
||||
'harga' => 'nullable|numeric',
|
||||
'harga_diskon' => 'nullable|numeric',
|
||||
'diskon' => 'nullable|numeric',
|
||||
'total' => 'nullable|numeric',
|
||||
'nama_nara_sumber' => 'nullable|string|max:100',
|
||||
'peruntukan' => 'nullable|string|max:100',
|
||||
'penawaran' => 'nullable|string|max:50',
|
||||
'telepon' => 'nullable|string|max:20',
|
||||
'hak_properti' => 'nullable|string|max:50',
|
||||
'kordinat_lat' => 'nullable|numeric',
|
||||
'kordinat_lng' => 'nullable|numeric',
|
||||
'jenis_aset' => 'nullable|string|max:50',
|
||||
'foto_objek' => 'nullable|image|max:2048',
|
||||
'tanggal' => 'nullable|date',
|
||||
'harga_penawaran' => 'nullable|numeric',
|
||||
'nomor_laporan' => 'nullable|string|max:50',
|
||||
'tgl_final_laporan' => 'nullable|date',
|
||||
'nilai_pasar' => 'nullable|numeric',
|
||||
'indikasi_nilai_likuidasi' => 'nullable|numeric',
|
||||
'indikasi_nilai_pasar_tanah' => 'nullable|numeric',
|
||||
'estimasi_harga_tanah' => 'nullable|numeric',
|
||||
'estimasi_harga_bangunan' => 'nullable|numeric',
|
||||
'indikasi_nilai_pasar_bangunan' => 'nullable|numeric',
|
||||
'indikasi_nilai_pasar_sarana_pelengkap' => 'nullable|numeric',
|
||||
'indikasi_nilai_pasar_mesin' => 'nullable|numeric',
|
||||
'indikasi_nilai_pasar_kendaraan_alat_berat' => 'nullable|numeric',
|
||||
'photos' => 'nullable|array',
|
||||
'photos.*' => 'nullable|image|max:2048',
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -63,7 +63,7 @@
|
||||
'authorized_at.date' => 'Tanggal otorisasi harus berupa tanggal yang valid.',
|
||||
'authorized_by.exists' => 'ID pengguna yang mengotorisasi tidak valid.',
|
||||
'status_bayar.required' => 'Status bayar wajib diisi.',
|
||||
'status_bayar.in' => 'Status bayar harus berupa "sudah_bayar" atau "belum_bayar".',
|
||||
'status_bayar.in' => 'Status bayar harus berupa "sudah_bayar", "belum_bayar" atau "tidak bayar".',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
104
app/Models/BankData.php
Normal file
104
app/Models/BankData.php
Normal file
@@ -0,0 +1,104 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
use Modules\Location\Models\City;
|
||||
use Modules\Location\Models\District;
|
||||
use Modules\Location\Models\Province;
|
||||
use Modules\Location\Models\Village;
|
||||
|
||||
class BankData extends Base
|
||||
{
|
||||
|
||||
protected $table = 'bank_data';
|
||||
|
||||
protected $guarded = ['id'];
|
||||
|
||||
protected $casts = [
|
||||
'tahun' => 'integer',
|
||||
'luas_tanah' => 'decimal:2',
|
||||
'luas_bangunan' => 'decimal:2',
|
||||
'tahun_bangunan' => 'integer',
|
||||
'harga' => 'decimal:2',
|
||||
'harga_diskon' => 'decimal:2',
|
||||
'diskon' => 'decimal:2',
|
||||
'total' => 'decimal:2',
|
||||
'kordinat_lat' => 'decimal:8',
|
||||
'kordinat_lng' => 'decimal:8',
|
||||
'harga_penawaran' => 'decimal:2',
|
||||
'tanggal' => 'date',
|
||||
'tgl_final_laporan' => 'date',
|
||||
'nilai_pasar' => 'decimal:2',
|
||||
'indikasi_nilai_likuidasi' => 'decimal:2',
|
||||
'indikasi_nilai_pasar_tanah' => 'decimal:2',
|
||||
'estimasi_harga_tanah' => 'decimal:2',
|
||||
'estimasi_harga_bangunan' => 'decimal:2',
|
||||
'indikasi_nilai_pasar_bangunan' => 'decimal:2',
|
||||
'indikasi_nilai_pasar_sarana_pelengkap' => 'decimal:2',
|
||||
'indikasi_nilai_pasar_mesin' => 'decimal:2',
|
||||
'indikasi_nilai_pasar_kendaraan_alat_berat' => 'decimal:2',
|
||||
'photos' => 'array'
|
||||
];
|
||||
|
||||
// Scope for filtering by asset type
|
||||
public function scopeOfAssetType($query, $assetType)
|
||||
{
|
||||
return $query->where('jenis_aset', $assetType);
|
||||
}
|
||||
|
||||
// Scope for filtering by village
|
||||
public function scopeOfVillage($query, $villageCode)
|
||||
{
|
||||
return $query->where('village_code', $villageCode);
|
||||
}
|
||||
|
||||
// Scope for filtering by district
|
||||
public function scopeOfDistrict($query, $districtCode)
|
||||
{
|
||||
return $query->where('district_code', $districtCode);
|
||||
}
|
||||
|
||||
// Scope for filtering by city
|
||||
public function scopeOfCity($query, $cityCode)
|
||||
{
|
||||
return $query->where('city_code', $cityCode);
|
||||
}
|
||||
|
||||
// Scope for filtering by province
|
||||
public function scopeOfProvince($query, $provinceCode)
|
||||
{
|
||||
return $query->where('province_code', $provinceCode);
|
||||
}
|
||||
|
||||
// Scope for filtering by date
|
||||
public function scopeOfDate($query, $date)
|
||||
{
|
||||
return $query->whereDate('tanggal', $date);
|
||||
}
|
||||
|
||||
// Scope for filtering by date range
|
||||
public function scopeBetweenDates($query, $startDate, $endDate)
|
||||
{
|
||||
return $query->whereBetween('tanggal', [$startDate, $endDate]);
|
||||
}
|
||||
|
||||
public function village()
|
||||
{
|
||||
return $this->belongsTo(Village::class, 'village_code', 'code');
|
||||
}
|
||||
|
||||
public function district()
|
||||
{
|
||||
return $this->belongsTo(District::class, 'district_code', 'code');
|
||||
}
|
||||
|
||||
public function city()
|
||||
{
|
||||
return $this->belongsTo(City::class, 'city_code', 'code');
|
||||
}
|
||||
|
||||
public function province()
|
||||
{
|
||||
return $this->belongsTo(Province::class, 'province_code', 'code');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -61,7 +61,12 @@
|
||||
}
|
||||
|
||||
public function permohonan(){
|
||||
return $this->hasOne(Permohonan::class, 'debiture_id', 'id' );
|
||||
return $this->hasMany(Permohonan::class, 'debiture_id', 'id' );
|
||||
}
|
||||
|
||||
public function laporanAdminKredit(): HasMany
|
||||
{
|
||||
return $this->hasMany(LaporanAdminKredit::class);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
37
app/Models/LaporanAdminKredit.php
Normal file
37
app/Models/LaporanAdminKredit.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class LaporanAdminKredit extends Base
|
||||
{
|
||||
protected $table = 'laporan_admin_kredit';
|
||||
|
||||
protected $fillable = [
|
||||
'debiture_id',
|
||||
'kode_register_t24',
|
||||
'jenis_agunan',
|
||||
'bukti_kepemilikan',
|
||||
'alamat_agunan',
|
||||
'nama_pemilik',
|
||||
'tanggal_kunjungan',
|
||||
'nilai_pasar_wajar',
|
||||
'nilai_likuidasi',
|
||||
'nama_penilai'
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'tanggal_kunjungan' => 'date',
|
||||
'nilai_pasar_wajar' => 'decimal:2',
|
||||
'nilai_likuidasi' => 'decimal:2',
|
||||
];
|
||||
|
||||
/**
|
||||
* Get the debiture that owns the laporan admin kredit.
|
||||
*/
|
||||
public function debiture(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Debiture::class);
|
||||
}
|
||||
}
|
||||
@@ -37,6 +37,12 @@ class Penilaian extends Model
|
||||
return $this->hasMany(PenilaianTeam::class, 'penilaian_id', 'id');
|
||||
}
|
||||
|
||||
public function _user_penilai()
|
||||
{
|
||||
return $this->hasOne(PenilaianTeam::class, 'penilaian_id', 'id')
|
||||
->where('role', 'penilai')
|
||||
->with('userPenilaiTeam');
|
||||
}
|
||||
|
||||
public function permohonan()
|
||||
{
|
||||
|
||||
@@ -114,7 +114,15 @@
|
||||
$status = $permohonan->status;
|
||||
$beforeRequest = $action === 'updated' ? $permohonan->getOriginal() : [];
|
||||
$afterRequest = $permohonan->toArray();
|
||||
$file = $permohonan->dokumen ?? null;
|
||||
|
||||
$file = null;
|
||||
if (request()->hasFile('attachment')) {
|
||||
$file = request()->file('attachment');
|
||||
$fileName = time() . '_' . $file->getClientOriginalName();
|
||||
$filePath = $file->storeAs('permohonan_attachments', $fileName, 'public');
|
||||
|
||||
$file = $filePath;
|
||||
}
|
||||
|
||||
$historyService->createHistory(
|
||||
$permohonan,
|
||||
@@ -240,4 +248,15 @@
|
||||
{
|
||||
return $this->belongsTo(LaporanExternal::class,'id','permohonan_id');
|
||||
}
|
||||
|
||||
|
||||
public function laporan()
|
||||
{
|
||||
return $this->belongsTo(Laporan::class,'id','permohonan_id');
|
||||
}
|
||||
|
||||
public function inspeksi(){
|
||||
return $this->belongsTo(Inspeksi::class, 'permohonan_id');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Modules\Lpj\Models\Permohonan;
|
||||
use Modules\Usermanagement\Models\User;
|
||||
|
||||
class PermohonanPembatalan extends Base
|
||||
@@ -44,7 +43,11 @@
|
||||
return $this->belongsTo(Permohonan::class, 'permohonan_id');
|
||||
}
|
||||
|
||||
public function creator(){
|
||||
public function user(){
|
||||
return $this->belongsTo(User::class, 'created_by');
|
||||
}
|
||||
|
||||
public function authorizedUser(){
|
||||
return $this->belongsTo(User::class, 'authorized_by');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
use Illuminate\Support\Facades\Blade;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Modules\Lpj\Models\BankData;
|
||||
use Modules\Lpj\Services\BankDataService;
|
||||
|
||||
class LpjServiceProvider extends ServiceProvider
|
||||
{
|
||||
@@ -118,6 +120,9 @@
|
||||
{
|
||||
$this->app->register(EventServiceProvider::class);
|
||||
$this->app->register(RouteServiceProvider::class);
|
||||
$this->app->bind(BankDataService::class, function ($app){
|
||||
return new BankDataService($app->make(BankData::class));
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
116
app/Services/BankDataService.php
Normal file
116
app/Services/BankDataService.php
Normal file
@@ -0,0 +1,116 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Services;
|
||||
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
use Modules\Lpj\Models\BankData;
|
||||
|
||||
class BankDataService
|
||||
{
|
||||
protected $bankData;
|
||||
|
||||
public function __construct(BankData $bankData)
|
||||
{
|
||||
$this->bankData = $bankData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all bank data with optional filtering and pagination
|
||||
*
|
||||
* @param array $filters
|
||||
* @param int|null $perPage
|
||||
*
|
||||
* @return Collection|LengthAwarePaginator
|
||||
*/
|
||||
public function getAllBankData(array $filters = [], ?int $perPage = null)
|
||||
{
|
||||
$query = $this->bankData->newQuery();
|
||||
|
||||
// Apply filters
|
||||
if (isset($filters['village_code'])) {
|
||||
$query->ofVillage($filters['village_code']);
|
||||
}
|
||||
if (isset($filters['district_code'])) {
|
||||
$query->ofDistrict($filters['district_code']);
|
||||
}
|
||||
if (isset($filters['city_code'])) {
|
||||
$query->ofCity($filters['city_code']);
|
||||
}
|
||||
if (isset($filters['province_code'])) {
|
||||
$query->ofProvince($filters['province_code']);
|
||||
}
|
||||
if (isset($filters['date'])) {
|
||||
$query->ofDate($filters['date']);
|
||||
}
|
||||
if (isset($filters['start_date']) && isset($filters['end_date'])) {
|
||||
$query->betweenDates($filters['start_date'], $filters['end_date']);
|
||||
}
|
||||
if (isset($filters['year'])) {
|
||||
$query->ofYear($filters['year']);
|
||||
}
|
||||
if (isset($filters['asset_type'])) {
|
||||
$query->ofAssetType($filters['asset_type']);
|
||||
}
|
||||
|
||||
// Add more filters as needed
|
||||
|
||||
return $perPage ? $query->paginate($perPage) : $query->get();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new bank data entry
|
||||
*
|
||||
* @param array $data
|
||||
*
|
||||
* @return BankData
|
||||
*/
|
||||
public function createBankData(array $data)
|
||||
: BankData
|
||||
{
|
||||
return $this->bankData->create($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update an existing bank data entry
|
||||
*
|
||||
* @param int $id
|
||||
* @param array $data
|
||||
*
|
||||
* @return BankData
|
||||
*/
|
||||
public function updateBankData(int $id, array $data)
|
||||
: BankData
|
||||
{
|
||||
$bankData = $this->bankData->findOrFail($id);
|
||||
$bankData->update($data);
|
||||
return $bankData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a bank data entry
|
||||
*
|
||||
* @param int $id
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function deleteBankData(int $id)
|
||||
: bool
|
||||
{
|
||||
$bankData = $this->bankData->findOrFail($id);
|
||||
return $bankData->delete();
|
||||
}
|
||||
|
||||
/**
|
||||
* Find a bank data entry by ID
|
||||
*
|
||||
* @param int $id
|
||||
*
|
||||
* @return BankData|null
|
||||
*/
|
||||
public function findBankData(int $id)
|
||||
: ?BankData
|
||||
{
|
||||
return $this->bankData->find($id);
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,7 @@ class PermohonanHistoryService
|
||||
public function createHistory(Permohonan $permohonan, string $status, ?string $keterangan, array $beforeRequest, array $afterRequest, ?string $filePath = null)
|
||||
{
|
||||
try {
|
||||
|
||||
$history = PermohonanHistory::create([
|
||||
'permohonan_id' => $permohonan->id,
|
||||
'status' => $status,
|
||||
|
||||
@@ -10,44 +10,50 @@ class SaveFormInspesksiService
|
||||
public function storeInspeksi(array $validatedData, string $type, Request $request)
|
||||
{
|
||||
try {
|
||||
$processedData = $this->getActionSpecificRules($validatedData, $type, $request);
|
||||
|
||||
$inspeksi = Inspeksi::where('permohonan_id', $request->input('permohonan_id'))
|
||||
->where('dokument_id', $request->input('dokument_id'))
|
||||
->first();
|
||||
|
||||
if ($inspeksi) {
|
||||
// Jika data sudah ada, merge dengan data yang baru
|
||||
$existingData = json_decode($inspeksi->data_form, true) ?: [];
|
||||
|
||||
if (isset($existingData['signature']) && !isset($processedData['signature'])) {
|
||||
$processedData['signature'] = $existingData['signature'];
|
||||
}
|
||||
|
||||
$mergedData = $this->arrayMergeRecursive($existingData, $processedData);
|
||||
|
||||
// Update record
|
||||
$inspeksi->update([
|
||||
'data_form' => json_encode($mergedData),
|
||||
'name' => $request->input('type')
|
||||
]);
|
||||
|
||||
$responseData = $mergedData;
|
||||
} else {
|
||||
// Jika belum ada data, buat record baru
|
||||
$inspeksi = Inspeksi::create([
|
||||
$inspeksi = Inspeksi::firstOrNew(
|
||||
[
|
||||
'permohonan_id' => $request->input('permohonan_id'),
|
||||
'dokument_id' => $request->input('dokument_id'),
|
||||
'data_form' => json_encode($processedData),
|
||||
'name' => $request->input('type')
|
||||
]);
|
||||
'dokument_id' => $request->input('dokument_id')
|
||||
]
|
||||
);
|
||||
|
||||
$responseData = $processedData;
|
||||
$inspeksi->name = $request->input('type');
|
||||
|
||||
$processedData = $this->getActionSpecificRules($validatedData, $type, $request, $inspeksi);
|
||||
|
||||
// Merge data lama dengan data baru
|
||||
$existingData = json_decode($inspeksi->data_form, true) ?: [];
|
||||
|
||||
$fotoTypes = [
|
||||
'foto_gistaru',
|
||||
'foto_bhumi',
|
||||
'foto_argis_region',
|
||||
'foto_tempat',
|
||||
'foto_sentuh_tanahku',
|
||||
'upload_gs'
|
||||
];
|
||||
|
||||
foreach ($fotoTypes as $fotoType) {
|
||||
if (isset($existingData[$fotoType])) {
|
||||
$processedData[$fotoType] = $existingData[$fotoType];
|
||||
}
|
||||
}
|
||||
|
||||
$mergedData = $this->arrayMergeRecursive($existingData, $processedData);
|
||||
|
||||
if (isset($existingData['signature']) && !isset($processedData['signature'])) {
|
||||
$mergedData['signature'] = $existingData['signature'];
|
||||
}
|
||||
|
||||
$inspeksi->data_form = json_encode($mergedData);
|
||||
$inspeksi->save();
|
||||
|
||||
return [
|
||||
'success' => true,
|
||||
'message' => 'Data berhasil disimpan',
|
||||
];
|
||||
|
||||
|
||||
} catch (\Exception $e) {
|
||||
return [
|
||||
'success' => false,
|
||||
@@ -58,7 +64,7 @@ class SaveFormInspesksiService
|
||||
}
|
||||
|
||||
|
||||
private function getActionSpecificRules($data, $action, $request): array
|
||||
private function getActionSpecificRules($data, $action, $request, $inspeksi): array
|
||||
{
|
||||
$allowedActions = [
|
||||
'apartemen-kantor' => 'getUnitData',
|
||||
@@ -95,7 +101,7 @@ class SaveFormInspesksiService
|
||||
if (isset($allowedActions[$act])) {
|
||||
$method = $allowedActions[$act];
|
||||
|
||||
$actionRules = $this->$method($data, $request);
|
||||
$actionRules = $this->$method($data, $request, $inspeksi);
|
||||
$rules = array_merge($rules, $actionRules);
|
||||
|
||||
// Cek apakah act memerlukan asset description rules
|
||||
@@ -374,7 +380,7 @@ class SaveFormInspesksiService
|
||||
}
|
||||
|
||||
|
||||
private function getFactData($data, $request): array
|
||||
private function getFactData($data, $request, $inspeksi): array
|
||||
{
|
||||
$factData = [
|
||||
'fakta' => [
|
||||
@@ -400,44 +406,16 @@ class SaveFormInspesksiService
|
||||
];
|
||||
|
||||
|
||||
$inspeksi = Inspeksi::where('permohonan_id', $request->input('permohonan_id'))->where('dokument_id', $request->input('dokument_id'))->first();
|
||||
|
||||
|
||||
$fotoTypes = [
|
||||
'foto_gistaru',
|
||||
'foto_bhumi',
|
||||
'foto_argis_region',
|
||||
'foto_tempat',
|
||||
'foto_sentuh_tanahku',
|
||||
'upload_gs'
|
||||
];
|
||||
|
||||
if ($inspeksi) {
|
||||
$dataForm = json_decode($inspeksi->data_form, true);
|
||||
foreach ($fotoTypes as $fotoType) {
|
||||
// Jika ada file baru diupload
|
||||
if ($request->hasFile($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) ?: null;
|
||||
}
|
||||
}
|
||||
|
||||
return $factData;
|
||||
}
|
||||
|
||||
private function getRapData($data, $request): array
|
||||
private function getRapData($data, $request, $inspeksi): array
|
||||
{
|
||||
|
||||
$inspeksi = Inspeksi::where('permohonan_id', $request->input('permohonan_id'))
|
||||
->where('dokument_id', $request->input('dokument_id'))
|
||||
->first();
|
||||
|
||||
$dataForm = json_decode($inspeksi->data_form, true);
|
||||
|
||||
$perizinanData = isset($dataForm['perizinan']) ? $dataForm['perizinan'] : [];
|
||||
@@ -567,9 +545,11 @@ class SaveFormInspesksiService
|
||||
'perumahan_gang' => $data['perumahan_gang'] ?? null,
|
||||
'blok_nomor' => $data['blok_nomor'] ?? null,
|
||||
'bandara' => $data['bandara'] ?? null,
|
||||
'alamat' => [
|
||||
'sesuai' => $alamatData
|
||||
],
|
||||
'asset' => [
|
||||
'alamat' => [
|
||||
'sesuai' => $alamatData
|
||||
],
|
||||
],
|
||||
'jenis_kapal' => $data['jenis_kapal'] ?? null,
|
||||
'jenis_kapal_lainnya' => $data['jenis_kapal_lainnya'] ?? null,
|
||||
'size' => $data['size'] ?? null,
|
||||
@@ -670,9 +650,11 @@ class SaveFormInspesksiService
|
||||
'nama_jalan' => $data['nama_jalan'] ?? null,
|
||||
'perumahan_gang' => $data['perumahan_gang'] ?? null,
|
||||
'blok_nomor' => $data['blok_nomor'] ?? null,
|
||||
'alamat' => [
|
||||
'sesuai' => $alamatData
|
||||
],
|
||||
'asset' => [
|
||||
'alamat' => [
|
||||
'sesuai' => $alamatData
|
||||
],
|
||||
],
|
||||
'masa_stnk' => $data['masa_stnk'] ?? null,
|
||||
'masa_pajak' => $data['masa_pajak'] ?? null,
|
||||
'kendaraan' => $data['kendaraan'] ?? null,
|
||||
@@ -790,8 +772,10 @@ class SaveFormInspesksiService
|
||||
'nama_jalan' => $data['nama_jalan'] ?? null,
|
||||
'perumahan_gang' => $data['perumahan_gang'] ?? null,
|
||||
'blok_nomor' => $data['blok_nomor'] ?? null,
|
||||
'alamat' => [
|
||||
'sesuai' => $alamatData
|
||||
'asset' => [
|
||||
'alamat' => [
|
||||
'sesuai' => $alamatData
|
||||
],
|
||||
],
|
||||
'jenis_model' => $data['jenis_model'] ?? null,
|
||||
'nomor_lambung' => $data['nomor_lambung'] ?? null,
|
||||
@@ -862,9 +846,11 @@ class SaveFormInspesksiService
|
||||
'perumahan_gang' => $data['perumahan_gang'] ?? null,
|
||||
'blok_nomor' => $data['blok_nomor'] ?? null,
|
||||
'bandara' => $data['bandara'] ?? null,
|
||||
'alamat' => [
|
||||
'sesuai' => $alamatData
|
||||
],
|
||||
'asset' => [
|
||||
'alamat' => [
|
||||
'sesuai' => $alamatData
|
||||
],
|
||||
],
|
||||
'jenis_pesawat' => $data['jenis_pesawat'] ?? null,
|
||||
'jenis_pesawat_lainnya' => $data['jenis_pesawat_lainnya'] ?? null,
|
||||
|
||||
@@ -958,14 +944,14 @@ class SaveFormInspesksiService
|
||||
];
|
||||
}
|
||||
|
||||
private function arrayMergeRecursive($arr1, $arr2)
|
||||
private function arrayMergeRecursive(array $arr1, array $arr2): array
|
||||
{
|
||||
foreach ($arr2 as $key => $value) {
|
||||
if ($key === 'signature' && isset($arr1['signature'])) {
|
||||
// Jika key adalah signature, gabungkan secara spesifik
|
||||
$arr1['signature'] = array_merge($arr1['signature'], $value);
|
||||
// Gabungkan 'signature' secara spesifik
|
||||
$arr1['signature'] = array_merge_recursive((array) $arr1['signature'], (array) $value);
|
||||
} elseif (is_array($value) && isset($arr1[$key]) && is_array($arr1[$key])) {
|
||||
// Rekursif untuk key lainnya
|
||||
// Rekursif untuk elemen array
|
||||
$arr1[$key] = $this->arrayMergeRecursive($arr1[$key], $value);
|
||||
} else {
|
||||
// Ganti nilai lama dengan nilai baru
|
||||
@@ -973,12 +959,8 @@ class SaveFormInspesksiService
|
||||
}
|
||||
}
|
||||
|
||||
// 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]);
|
||||
}
|
||||
}
|
||||
// Hapus key lama yang tidak ada di array baru kecuali 'signature'
|
||||
$arr1 = array_intersect_key($arr1, $arr2 + ['signature' => true]);
|
||||
|
||||
return $arr1;
|
||||
}
|
||||
@@ -1002,7 +984,7 @@ class SaveFormInspesksiService
|
||||
throw new Exception("Invalid file upload for {$fileKey}");
|
||||
}
|
||||
} elseif (isset($data[$fileKey]) && $data[$fileKey]) {
|
||||
return $data[$fileKey];
|
||||
return $data[$fileKey] ?? null;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -388,5 +388,47 @@ class SurveyorValidateService
|
||||
}
|
||||
|
||||
|
||||
public function validateUnitData(array $data): array
|
||||
{
|
||||
$invalidFields = [];
|
||||
|
||||
// Validasi action
|
||||
if (empty($data['action'])) {
|
||||
$invalidFields[] = 'Action harus diisi';
|
||||
}
|
||||
|
||||
// Validasi luas_unit
|
||||
if (empty($data['luas_unit'])) {
|
||||
$invalidFields[] = 'Luas unit harus diisi';
|
||||
}
|
||||
|
||||
// Validasi kondisi_unit
|
||||
if (empty($data['kondisi_unit'])) {
|
||||
$invalidFields[] = 'Kondisi unit harus diisi';
|
||||
}
|
||||
|
||||
// Validasi posisi_unit
|
||||
if (empty($data['posisi_unit'])) {
|
||||
$invalidFields[] = 'Posisi unit harus diisi';
|
||||
}
|
||||
|
||||
// Validasi lantai
|
||||
if (empty($data['lantai'])) {
|
||||
$invalidFields[] = 'Lantai harus diisi';
|
||||
}
|
||||
|
||||
// Validasi view
|
||||
if (empty($data['view'])) {
|
||||
$invalidFields[] = 'View harus diisi';
|
||||
}
|
||||
|
||||
// Validasi bentuk_unit
|
||||
if (empty($data['bentuk_unit'])) {
|
||||
$invalidFields[] = 'Bentuk unit harus diisi';
|
||||
}
|
||||
|
||||
return $invalidFields;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Modules\Lpj\Models\Inspeksi;
|
||||
|
||||
return new class () extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('penilai', function (Blueprint $table) {
|
||||
$table->dropForeign(['inspeksi_id']);
|
||||
$table->dropColumn('inspeksi_id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('penilai', function (Blueprint $table) {
|
||||
$table->unsignedBigInteger('inspeksi_id')->nullable();
|
||||
$table->foreign('inspeksi_id')->references('id')->on('inspeksi')->onDelete('cascade');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Modules\Lpj\Models\Debiture;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('laporan_admin_kredit', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignIdFor(Debiture::class)->constrained()->cascadeOnDelete();
|
||||
$table->string('kode_register_t24')->nullable();
|
||||
$table->string('jenis_agunan')->nullable();
|
||||
$table->string('bukti_kepemilikan')->nullable();
|
||||
$table->text('alamat_agunan')->nullable();
|
||||
$table->string('nama_pemilik')->nullable();
|
||||
$table->date('tanggal_kunjungan')->nullable();
|
||||
$table->decimal('nilai_pasar_wajar', 15, 2)->nullable();
|
||||
$table->decimal('nilai_likuidasi', 15, 2)->nullable();
|
||||
$table->string('nama_penilai')->nullable();
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
||||
$table->unsignedBigInteger('created_by')->nullable();
|
||||
$table->unsignedBigInteger('updated_by')->nullable();
|
||||
$table->unsignedBigInteger('deleted_by')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('laporan_admin_kredit');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('bank_data', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->text('address')->nullable();
|
||||
$table->string('village_code')->nullable();
|
||||
$table->string('district_code')->nullable();
|
||||
$table->string('city_code')->nullable();
|
||||
$table->string('province_code')->nullable();
|
||||
$table->integer('tahun')->nullable();
|
||||
$table->decimal('luas_tanah', 15, 2)->nullable();
|
||||
$table->decimal('luas_bangunan', 15, 2)->nullable();
|
||||
$table->integer('tahun_bangunan')->nullable();
|
||||
$table->string('status_nara_sumber')->nullable();
|
||||
$table->decimal('harga', 15, 2)->nullable();
|
||||
$table->decimal('harga_diskon', 15, 2)->nullable();
|
||||
$table->decimal('diskon', 5, 2)->nullable();
|
||||
$table->decimal('total', 15, 2)->nullable();
|
||||
$table->string('nama_nara_sumber')->nullable();
|
||||
$table->string('peruntukan')->nullable();
|
||||
$table->string('penawaran')->nullable();
|
||||
$table->string('telepon')->nullable();
|
||||
$table->string('hak_properti')->nullable();
|
||||
$table->decimal('kordinat_lat', 10, 8)->nullable();
|
||||
$table->decimal('kordinat_lng', 11, 8)->nullable();
|
||||
$table->string('jenis_aset')->nullable();
|
||||
$table->string('foto_objek')->nullable();
|
||||
$table->date('tanggal')->nullable();
|
||||
$table->decimal('harga_penawaran', 15, 2)->nullable();
|
||||
$table->string('nomor_laporan')->nullable();
|
||||
$table->date('tgl_final_laporan')->nullable();
|
||||
$table->decimal('nilai_pasar', 15, 2)->nullable();
|
||||
$table->decimal('indikasi_nilai_likuidasi', 15, 2)->nullable();
|
||||
$table->decimal('indikasi_nilai_pasar_tanah', 15, 2)->nullable();
|
||||
$table->decimal('estimasi_harga_tanah', 15, 2)->nullable();
|
||||
$table->decimal('estimasi_harga_bangunan', 15, 2)->nullable();
|
||||
$table->decimal('indikasi_nilai_pasar_bangunan', 15, 2)->nullable();
|
||||
$table->decimal('indikasi_nilai_pasar_sarana_pelengkap', 15, 2)->nullable();
|
||||
$table->decimal('indikasi_nilai_pasar_mesin', 15, 2)->nullable();
|
||||
$table->decimal('indikasi_nilai_pasar_kendaraan_alat_berat', 15, 2)->nullable();
|
||||
$table->json('photos')->nullable();
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
||||
$table->unsignedBigInteger('created_by')->nullable();
|
||||
$table->unsignedBigInteger('updated_by')->nullable();
|
||||
$table->unsignedBigInteger('deleted_by')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('bank_data');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('permohonan', function (Blueprint $table) {
|
||||
$table->enum('status_bayar',['sudah_bayar','belum_bayar','tidak_bayar'])->default('sudah_bayar')->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('permohonan', function (Blueprint $table) {
|
||||
$table->enum('status_bayar',['sudah_bayar','belum_bayar'])->default('sudah_bayar')->change();
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('bank_data', function (Blueprint $table) {
|
||||
$table->enum('kategori',['data_pembanding','penilaian','input'])->default('data_pembanding');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('bank_data', function (Blueprint $table) {
|
||||
$table->dropColumn('kategori');
|
||||
});
|
||||
}
|
||||
};
|
||||
84
module.json
84
module.json
@@ -12,6 +12,77 @@
|
||||
"app/Helpers/Lpj.php"
|
||||
],
|
||||
"menu": {
|
||||
"laporan": [
|
||||
{
|
||||
"title": "Laporan Permohonan",
|
||||
"path": "laporan-permohonan",
|
||||
"icon": "ki-filled ki-filter-tablet text-lg text-primary",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": [
|
||||
"administrator",
|
||||
"pemohon-ao",
|
||||
"pemohon-eo",
|
||||
"admin",
|
||||
"DD Appraisal",
|
||||
"EO Appraisal",
|
||||
"senior-officer"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Laporan Pembatalan",
|
||||
"path": "laporan-pembatalan",
|
||||
"icon": "ki-filled ki-filter-tablet text-lg text-primary",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": [
|
||||
"administrator",
|
||||
"pemohon-ao",
|
||||
"pemohon-eo",
|
||||
"admin",
|
||||
"DD Appraisal",
|
||||
"EO Appraisal",
|
||||
"senior-officer"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Laporan Admin Kredit",
|
||||
"path": "laporan-admin-kredit",
|
||||
"icon": "ki-filled ki-filter-tablet text-lg text-primary",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": [
|
||||
"adk",
|
||||
"administrator",
|
||||
"pemohon-ao",
|
||||
"pemohon-eo",
|
||||
"admin",
|
||||
"DD Appraisal",
|
||||
"EO Appraisal",
|
||||
"senior-officer"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Laporan Penilai Jaminan",
|
||||
"path": "laporan-penilai-jaminan",
|
||||
"icon": "ki-filled ki-filter-tablet text-lg text-primary",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": [
|
||||
"administrator",
|
||||
"pemohon-ao",
|
||||
"pemohon-eo",
|
||||
"admin",
|
||||
"DD Appraisal",
|
||||
"EO Appraisal",
|
||||
"senior-officer"
|
||||
]
|
||||
}
|
||||
],
|
||||
"otorisator": [
|
||||
{
|
||||
"title": "Otorisasi Permohonan",
|
||||
@@ -27,7 +98,7 @@
|
||||
},
|
||||
{
|
||||
"title": "Otorisasi Pembatalan Permohonan",
|
||||
"path": "otorisator.pembatalan",
|
||||
"path": "pembatalan",
|
||||
"icon": "ki-filled ki-file-deleted text-lg text-info",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
@@ -109,6 +180,17 @@
|
||||
}
|
||||
],
|
||||
"main": [
|
||||
{
|
||||
"title": "Bank Data",
|
||||
"path": "bank-data",
|
||||
"icon": "ki-filled ki-questionnaire-tablet text-lg text-primary",
|
||||
"classes": "",
|
||||
"attributes": [],
|
||||
"permission": "",
|
||||
"roles": [
|
||||
"administrator"
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Permohonan",
|
||||
"path": "permohonan",
|
||||
|
||||
@@ -413,7 +413,7 @@
|
||||
`;
|
||||
} else {
|
||||
subOptionsHtml = `
|
||||
<div>
|
||||
<div class="flex grid gap-2">
|
||||
<select id="subOptionsPenugasan" class="input">
|
||||
<option value="" selected disabled>Pilih Penugasan</option>
|
||||
<option value="surveyor">Surveyor</option>
|
||||
|
||||
587
resources/views/bank-data/index.blade.php
Normal file
587
resources/views/bank-data/index.blade.php
Normal file
@@ -0,0 +1,587 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('bank-data') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="grid grid-cols-1 lg:grid-cols-4 gap-5 lg:gap-7.5 mb-10">
|
||||
<div class="col-span-1">
|
||||
<div class="card border border-agi-100 card-grid min-w-full">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Filter
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body px-5">
|
||||
<form id="filter-form">
|
||||
<div class="grid gap-4 w-full p-5">
|
||||
|
||||
<div>
|
||||
<label for="kategori" class="block text-sm font-medium text-gray-700">Kategori</label>
|
||||
<select id="kategori" name="kategori" class="select tomselect w-full @error('kategori') border-danger bg-danger-light @enderror">
|
||||
<option value="">Semua Kategori</option>
|
||||
<option value="data_pembanding">Data Pembanding</option>
|
||||
<option value="penilaian">Penilaian</option>
|
||||
<option value="input_manual">Input Manual</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label for="jenis_asset" class="block text-sm font-medium text-gray-700">Jenis Asset</label>
|
||||
<select id="jenis_asset" name="jenis_asset" class="select tomselect w-full @error('jenis_asset') border-danger bg-danger-light @enderror">
|
||||
<option value="">Select Asset Type</option>
|
||||
@foreach($jenisJaminan as $jenis)
|
||||
<option value="{{ $jenis->name }}">{{ $jenis->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label for="province_code" class="block text-sm font-medium text-gray-700">Province</label>
|
||||
<select id="province_code" name="province_code" class="select w-full @error('province_code') border-danger bg-danger-light @enderror">
|
||||
<option value="">Select Province</option>
|
||||
@foreach($provinces as $province)
|
||||
<option value="{{ $province->code }}">{{ $province->name }}</option>
|
||||
@endforeach
|
||||
<!-- Add province options here -->
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label for="city_code" class="block text-sm font-medium text-gray-700">City</label>
|
||||
<select id="city_code" name="city_code" class="select w-full @error('city_code') border-danger bg-danger-light @enderror">
|
||||
<option value="">Select City</option>
|
||||
<!-- Add city options here -->
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label for="district_code" class="block text-sm font-medium text-gray-700">District</label>
|
||||
<select id="district_code" name="district_code" class="select w-full @error('district_code') border-danger bg-danger-light @enderror">
|
||||
<option value="">Select District</option>
|
||||
<!-- Add district options here -->
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label for="village_code" class="block text-sm font-medium text-gray-700">Village</label>
|
||||
<select id="village_code" name="village_code" class="select w-full @error('village_code') border-danger bg-danger-light @enderror">
|
||||
<option value="">Select Village</option>
|
||||
<!-- Add village options here -->
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label for="tahun" class="block text-sm font-medium text-gray-700">Tahun</label>
|
||||
<select id="tahun" name="tahun" class="select tomselect w-full @error('tahun') border-danger bg-danger-light @enderror">
|
||||
<option value="">Semua Tahun</option>
|
||||
@for ($year = date('Y'); $year >= 2000; $year--)
|
||||
<option value="{{ $year }}">{{ $year }}</option>
|
||||
@endfor
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label for="start_date" class="block text-sm font-medium text-gray-700">Start Date</label>
|
||||
<input type="date" id="start_date" name="start_date" class="mt-1 block w-full py-2 px-3 border border-gray-300 bg-white rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm">
|
||||
</div>
|
||||
<div>
|
||||
<label for="end_date" class="block text-sm font-medium text-gray-700">End Date</label>
|
||||
<input type="date" id="end_date" name="end_date" class="mt-1 block w-full py-2 px-3 border border-gray-300 bg-white rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm">
|
||||
</div>
|
||||
<div>
|
||||
<button type="submit" class="w-full inline-flex justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
|
||||
Apply Filters
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-span-3">
|
||||
<div class="card border border-agi-100 card-grid min-w-full">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Maps
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body px-5">
|
||||
<div id="map" style="height: 700px; width: 100%;"></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 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false" id="bank-data-table" data-api-url="{{ route('bank-data.datatables') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Daftar Bank Data
|
||||
</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 Bank Data" 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="#"> Export to Excel </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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"/>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="sumber">
|
||||
<span class="sort"> <span class="sort-label"> Sumber </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="jenis_aset">
|
||||
<span class="sort"> <span class="sort-label"> Jenis Aset </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tahun">
|
||||
<span class="sort"> <span class="sort-label"> Tahun </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="luas_tanah">
|
||||
<span class="sort"> <span class="sort-label"> Luas Tanah </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="luas_bangunan">
|
||||
<span class="sort"> <span class="sort-label"> Luas Bangunan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="harga">
|
||||
<span class="sort"> <span class="sort-label"> Harga </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nilai_pasar">
|
||||
<span class="sort"> <span class="sort-label"> Nilai Pasar </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="location">
|
||||
<span class="sort"> <span class="sort-label"> Location </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" 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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="imageModal" class="fixed inset-0 bg-black bg-opacity-50 hidden items-center justify-center z-50">
|
||||
<div class="bg-white p-4 rounded-lg max-w-3xl max-h-[100vh] overflow-auto">
|
||||
<img id="modalImage" src="" alt="Zoomed Image" class="max-w-full h-auto">
|
||||
<button id="closeModal" class="mt-4 px-4 py-2 bg-red-300 text-gray-800 rounded hover:bg-red-400" onclick="closeImageModal()">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDQTNRxyr0w7kXHsO2hmarDTa9-1LyLmS8&callback=initMap" async defer></script>
|
||||
<script>
|
||||
let map;
|
||||
let markers = [];
|
||||
let infoWindows = [];
|
||||
let dataTable;
|
||||
|
||||
function initMap() {
|
||||
map = new google.maps.Map(document.getElementById('map'), {
|
||||
center: {lat: -6.200000, lng: 106.816666}, // Jakarta coordinates
|
||||
zoom: 10
|
||||
});
|
||||
}
|
||||
|
||||
function openImageModal(src) {
|
||||
const modal = document.getElementById('imageModal');
|
||||
const modalImage = document.getElementById('modalImage');
|
||||
modalImage.src = src;
|
||||
modal.classList.remove('hidden');
|
||||
modal.classList.add('flex');
|
||||
}
|
||||
|
||||
function closeImageModal() {
|
||||
const modal = document.getElementById('imageModal');
|
||||
modal.classList.remove('flex');
|
||||
modal.classList.add('hidden');
|
||||
}
|
||||
|
||||
function changeMainPhoto(thumbnail, index) {
|
||||
const mainPhoto = thumbnail.closest('.photo-gallery').querySelector('.main-photo img');
|
||||
mainPhoto.src = thumbnail.src;
|
||||
mainPhoto.alt = thumbnail.alt;
|
||||
}
|
||||
|
||||
function updateMapMarkers(data) {
|
||||
// Clear existing markers
|
||||
markers.forEach(marker => marker.setMap(null));
|
||||
infoWindows.forEach(infoWindow => infoWindow.close());
|
||||
markers = [];
|
||||
infoWindows = [];
|
||||
|
||||
// Add new markers
|
||||
data.forEach(item => {
|
||||
if (item.location) {
|
||||
let lat, lng;
|
||||
|
||||
// Check if item.location is a string containing comma-separated coordinates
|
||||
if (typeof item.location === 'string' && item.location.includes(',')) {
|
||||
[lat, lng] = item.location.split(',').map(coord => parseFloat(coord.trim()));
|
||||
}
|
||||
// Check if item.location is an object with lat and lng properties
|
||||
else if (typeof item.location === 'object' && item.location.lat && item.location.lng) {
|
||||
lat = parseFloat(item.location.lat);
|
||||
lng = parseFloat(item.location.lng);
|
||||
}
|
||||
// Check if item.location is an array with two elements
|
||||
else if (Array.isArray(item.location) && item.location.length === 2) {
|
||||
[lat, lng] = item.location.map(coord => parseFloat(coord));
|
||||
}
|
||||
|
||||
const markerColors = {
|
||||
data_pembanding: 'http://maps.google.com/mapfiles/ms/icons/red-dot.png',
|
||||
penilaian: 'http://maps.google.com/mapfiles/ms/icons/blue-dot.png',
|
||||
input: 'http://maps.google.com/mapfiles/ms/icons/yellow-dot.png'
|
||||
};
|
||||
|
||||
if (lat && lng) {
|
||||
const marker = new google.maps.Marker({
|
||||
position: {lat: lat, lng: lng},
|
||||
map: map,
|
||||
title: item.jenis_aset,
|
||||
icon: markerColors[item.kategori] || 'http://maps.google.com/mapfiles/ms/icons/red-dot.png' // Default to red if category is not recognized
|
||||
});
|
||||
|
||||
// Create info window content
|
||||
const contentString = `
|
||||
<div id='content' style='width: 550px; max-width: 100%;'>
|
||||
<div id='siteNotice'></div>
|
||||
<h2 class='card-title mb-5'>
|
||||
${item.jenis_aset}
|
||||
</h2>
|
||||
<div class="grid gap-3">
|
||||
<div class='flex items-center justify-between flex-wrap gap-1.5'>
|
||||
<div class='flex items-center gap-1.5'>
|
||||
<span class='text-sm font-normal text-gray-900'>
|
||||
Tanggal Penilaian
|
||||
</span>
|
||||
</div>
|
||||
<div class='flex items-center text-sm font-medium text-gray-800 gap-6'>
|
||||
<span class='lg:text-right'>
|
||||
${window.formatTanggalIndonesia(item.tanggal)}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="border-t border-gray-300 border-dashed"></div>
|
||||
<div class='flex items-center justify-between flex-wrap gap-1.5'>
|
||||
<div class='flex items-center gap-1.5'>
|
||||
<span class='text-sm font-normal text-gray-900'>
|
||||
Tahun
|
||||
</span>
|
||||
</div>
|
||||
<div class='flex items-center text-sm font-medium text-gray-800 gap-6'>
|
||||
<span class='lg:text-right'>
|
||||
${item.tahun}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="border-t border-gray-300 border-dashed"></div>
|
||||
<div class='flex items-center justify-between flex-wrap gap-1.5'>
|
||||
<div class='flex items-center gap-1.5'>
|
||||
<span class='text-sm font-normal text-gray-900'>
|
||||
Luas Tanah
|
||||
</span>
|
||||
</div>
|
||||
<div class='flex items-center text-sm font-medium text-gray-800 gap-6'>
|
||||
<span class='lg:text-right'>
|
||||
${item.luas_tanah} m²
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="border-t border-gray-300 border-dashed"></div>
|
||||
<div class='flex items-center justify-between flex-wrap gap-1.5'>
|
||||
<div class='flex items-center gap-1.5'>
|
||||
<span class='text-sm font-normal text-gray-900'>
|
||||
Luas Bangunan
|
||||
</span>
|
||||
</div>
|
||||
<div class='flex items-center text-sm font-medium text-gray-800 gap-6'>
|
||||
<span class='lg:text-right'>
|
||||
${item.luas_bangunan} m²
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="border-t border-gray-300 border-dashed"></div>
|
||||
<div class='flex items-center justify-between flex-wrap gap-1.5'>
|
||||
<div class='flex items-center gap-1.5'>
|
||||
<span class='text-sm font-normal text-gray-900'>
|
||||
Harga
|
||||
</span>
|
||||
</div>
|
||||
<div class='flex items-center text-sm font-medium text-gray-800 gap-6'>
|
||||
<span class='lg:text-right'>
|
||||
${window.formatRupiah(item.harga)}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="border-t border-gray-300 border-dashed"></div>
|
||||
<div class='flex items-center justify-between flex-wrap gap-1.5'>
|
||||
<div class='flex items-center gap-1.5'>
|
||||
<span class='text-sm font-normal text-gray-900'>
|
||||
Nilai Pasar
|
||||
</span>
|
||||
</div>
|
||||
<div class='flex items-center text-sm font-medium text-gray-800 gap-6'>
|
||||
<span class='lg:text-right'>
|
||||
${window.formatRupiah(item.nilai_pasar)}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="border-t border-gray-300 border-dashed"></div>
|
||||
<div class='flex items-start justify-between flex-wrap gap-1.5'>
|
||||
<div class='flex items-start gap-1.5'>
|
||||
<span class='text-sm font-normal text-gray-900'>
|
||||
Location
|
||||
</span>
|
||||
</div>
|
||||
<div class='flex items-center text-sm font-medium text-gray-800 gap-6'>
|
||||
<span class='text-right whitespace-normal break-words'>
|
||||
${item.address.split(' ').reduce((acc, word, index, array) => {
|
||||
if (index > 0 && index % 7 === 0) {
|
||||
acc += '<br>';
|
||||
}
|
||||
acc += word + (index < array.length - 1 ? ' ' : '');
|
||||
return acc;
|
||||
}, '')}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
${item.photos && item.photos.length > 0 ? `
|
||||
<div class="photo-gallery mb-5">
|
||||
<div class="main-photo mb-2">
|
||||
<img src="storage/${item.photos[0]}" alt="${item.jenis_aset}"
|
||||
style="width: 100%; height: auto; object-fit: cover; cursor: pointer;"
|
||||
onclick="openImageModal(this.src)">
|
||||
</div>
|
||||
<div class="thumbnail-container flex gap-2 overflow-x-auto">
|
||||
${item.photos.map((photo, index) => `
|
||||
<img src="storage/${photo}" alt="${item.jenis_aset} ${index + 1}"
|
||||
class="thumbnail cursor-pointer"
|
||||
style="width: 60px; height: 60px; object-fit: cover;"
|
||||
onclick="changeMainPhoto(this, ${index})">
|
||||
`).join('')}
|
||||
</div>
|
||||
</div>
|
||||
` : ''}
|
||||
<div class="border-t border-gray-300 border-dashed"></div>
|
||||
<div class='flex justify-end mt-3'>
|
||||
<button onclick="getDirections(${lat}, ${lng})" class='btn btn-sm btn-primary'>
|
||||
Get Directions
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
// Create info window
|
||||
const infoWindow = new google.maps.InfoWindow({
|
||||
content: contentString
|
||||
});
|
||||
|
||||
// Add click event to marker
|
||||
marker.addListener('click', () => {
|
||||
// Close all open info windows
|
||||
infoWindows.forEach(window => window.close());
|
||||
// Open this marker's info window
|
||||
infoWindow.open(map, marker);
|
||||
});
|
||||
|
||||
markers.push(marker);
|
||||
infoWindows.push(infoWindow);
|
||||
|
||||
} else {
|
||||
console.error('Invalid location format for item:', item);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Adjust map bounds to fit all markers
|
||||
if (markers.length > 0) {
|
||||
const bounds = new google.maps.LatLngBounds();
|
||||
markers.forEach(marker => bounds.extend(marker.getPosition()));
|
||||
map.fitBounds(bounds);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function getDirections(lat, lng) {
|
||||
console.log('Getting directions to:', lat, lng);
|
||||
if (navigator.geolocation) {
|
||||
navigator.geolocation.getCurrentPosition(
|
||||
(position) => {
|
||||
const origin = position.coords.latitude + ',' + position.coords.longitude;
|
||||
const destination = lat + ',' + lng;
|
||||
const url = `https://www.google.com/maps/dir/?api=1&origin=${origin}&destination=${destination}`;
|
||||
window.open(url, '_blank');
|
||||
},
|
||||
() => {
|
||||
alert('Unable to get your current location. Please enable location services.');
|
||||
}
|
||||
);
|
||||
} else {
|
||||
alert('Geolocation is not supported by your browser.');
|
||||
}
|
||||
}
|
||||
|
||||
function initializeDataTable() {
|
||||
const element = document.querySelector('#bank-data-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
sumber: {
|
||||
title: 'Sumber'
|
||||
},
|
||||
jenis_aset: {
|
||||
title: 'Jenis Aset'
|
||||
},
|
||||
tanggal: {
|
||||
title: 'Tanggal',
|
||||
render: (item, data) => {
|
||||
return data.tanggal;
|
||||
},
|
||||
},
|
||||
tahun: {
|
||||
title: 'Tahun',
|
||||
render: (item, data) => {
|
||||
return data.tahun;
|
||||
},
|
||||
},
|
||||
luas_tanah: {
|
||||
title: 'Luas Tanah',
|
||||
render: (item, data) => {
|
||||
return `${data.luas_tanah} m²`;
|
||||
},
|
||||
},
|
||||
luas_bangunan: {
|
||||
title: 'Luas Bangunan',
|
||||
render: (item, data) => {
|
||||
return `${data.luas_bangunan} m²`;
|
||||
},
|
||||
},
|
||||
harga: {
|
||||
title: 'Harga',
|
||||
render: (item, data) => {
|
||||
return window.formatRupiah(data.harga);
|
||||
},
|
||||
},
|
||||
nilai_pasar: {
|
||||
title: 'Nilai Pasar',
|
||||
render: (item, data) => {
|
||||
return window.formatRupiah(data.nilai_pasar);
|
||||
},
|
||||
},
|
||||
location: {
|
||||
title: 'Location'
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
dataTable = new KTDataTable(element, dataTableOptions);
|
||||
dataTable.on('draw', () => {
|
||||
const data = dataTable._data;
|
||||
updateMapMarkers(data);
|
||||
updatePagination(data);
|
||||
})
|
||||
// Custom search functionality
|
||||
searchInput.addEventListener('input', function () {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
});
|
||||
}
|
||||
|
||||
const filterForm = document.getElementById('filter-form');
|
||||
filterForm.addEventListener('submit', function (e) {
|
||||
e.preventDefault();
|
||||
const formData = new FormData(this);
|
||||
const filters = Object.fromEntries(formData.entries());
|
||||
|
||||
// Apply the new search/filter
|
||||
if (filters) {
|
||||
dataTable.search(filters, true);
|
||||
}
|
||||
|
||||
// Reload the table to apply the new filters
|
||||
dataTable.reload();
|
||||
});
|
||||
|
||||
function updatePagination(response) {
|
||||
const paginationInfo = document.querySelector('[data-datatable-info="true"]');
|
||||
|
||||
if (paginationInfo) {
|
||||
if (response.recordsFiltered > 0) {
|
||||
const start = (response.page - 1) * response.pageSize + 1;
|
||||
const end = Math.min(start + response.pageSize - 1, response.recordsFiltered);
|
||||
paginationInfo.textContent = `Showing ${start} to ${end} of ${response.recordsFiltered} entries`;
|
||||
} else {
|
||||
paginationInfo.textContent = 'No entries to show';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function initializeEverything() {
|
||||
initMap();
|
||||
initializeDataTable();
|
||||
|
||||
dataTable.on('draw', () => {
|
||||
console.log("Table redrawn");
|
||||
});
|
||||
}
|
||||
|
||||
// Check if Google Maps API is loaded
|
||||
function checkGoogleMapsLoaded() {
|
||||
if (window.google && window.google.maps) {
|
||||
initializeEverything();
|
||||
} else {
|
||||
setTimeout(checkGoogleMapsLoaded, 100);
|
||||
}
|
||||
}
|
||||
|
||||
// Start checking if Google Maps is loaded
|
||||
checkGoogleMapsLoaded();
|
||||
</script>
|
||||
@endpush
|
||||
@@ -60,7 +60,7 @@
|
||||
$labelNilai = [
|
||||
'bangunan' => 'Luas Bangunan',
|
||||
'tanah' => 'Luas Tanah',
|
||||
'apartement-kantor' => 'Luas Apartemen/Kantor',
|
||||
'apartemen-kantor' => 'Luas Unit',
|
||||
'alat-berat' => 'Luas Alat Berat',
|
||||
'mesin' => 'Luas Mesin',
|
||||
'kendaraan' => 'Luas Kendaraan',
|
||||
@@ -85,41 +85,49 @@
|
||||
$luas =
|
||||
$forminspeksi['tanah']['luas_tanah']['tidak sesuai'] ??
|
||||
($forminspeksi['tanah']['luas_tanah']['sesuai'] ?? null);
|
||||
} else if ($item === 'apartemen-kantor') {
|
||||
$luas = $forminspeksi['luas_unit']['sesuai'] ?? ($forminspeksi['luas_unit']['tidak sesuai'] ?? null);
|
||||
} else {
|
||||
$luas = null;
|
||||
}
|
||||
$luas = old('luas_' . $item, $lpjData['luas_' . $item] ?? $luas);
|
||||
|
||||
$luasKey = 'luas_' . $item;
|
||||
$nilaiKey1 = 'nilai_' . $item . '_1';
|
||||
$nilaiKey2 = 'nilai_' . $item . '_2';
|
||||
@endphp
|
||||
@if (isset($labelNilai[$item]))
|
||||
<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 max-w-56">
|
||||
{{ $labelNilai[$item] }}
|
||||
</label>
|
||||
<input type="text" id="luas_{{ $item }}" class="input w-full"
|
||||
name="luas_{{ $item }}" value="{{ $luas }}"
|
||||
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" id="nilai_{{ $item }}_1" class="w-full currency"
|
||||
name="nilai_{{ $item }}_1"
|
||||
value="{{ old('nilai_' . $item . '_1', $lpjData['nilai_' . $item . '_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 id="nilai_{{ $item }}_2" type="text"
|
||||
class="w-full currency-format" name="nilai_{{ $item }}_2"
|
||||
value="{{ old('nilai_' . $item . '_2', $lpjData['nilai_' . $item . '_2'] ?? null) }}">
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@if (isset($labelNilai[$item]))
|
||||
<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 max-w-56">
|
||||
{{ $labelNilai[$item] }}
|
||||
</label>
|
||||
<input type="text" id="{{ $luasKey }}" class="input w-full"
|
||||
name="{{ $luasKey }}"
|
||||
value="{{ old($luasKey, $lpjData[$luasKey] ?? 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" id="{{ $nilaiKey1 }}" class="w-full currency"
|
||||
name="{{ $nilaiKey1 }}"
|
||||
value="{{ old($nilaiKey1, $lpjData[$nilaiKey1] ?? 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 id="{{ $nilaiKey2 }}" type="text"
|
||||
class="w-full currency-format"
|
||||
name="{{ $nilaiKey2 }}"
|
||||
value="{{ old($nilaiKey2, $lpjData[$nilaiKey2] ?? null) }}">
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
<div>
|
||||
@@ -234,7 +242,7 @@
|
||||
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
const datas = @json($forminspeksi);
|
||||
const datas = @json($lpjData);
|
||||
console.log(datas);
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
@@ -458,7 +466,10 @@
|
||||
// Get all kategori unik elements dynamically
|
||||
const kategoriItems = document.querySelectorAll('[id^="luas_"]');
|
||||
|
||||
|
||||
|
||||
kategoriItems.forEach(item => {
|
||||
console.log(item);
|
||||
|
||||
const kategori = item.id.replace('luas_', '');
|
||||
const luasInput = document.getElementById(`luas_${kategori}`);
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
</div>
|
||||
|
||||
@push('scripts')
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.3.0/pdfobject.min.js"></script>
|
||||
<script src="{{ asset('vendor/pdfobject.min.js') }}"></script>
|
||||
<script>
|
||||
let currentFileUrl = '';
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
@else
|
||||
{{ $item }}
|
||||
@if ($key == 'luas_bangunan' || $key == 'luas_tanah')
|
||||
<sup>m2</sup>
|
||||
<span>m²</span>
|
||||
@endif
|
||||
@endif
|
||||
</td>
|
||||
|
||||
@@ -7,22 +7,22 @@
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56 gap-1">
|
||||
Cabang
|
||||
<span class="text-danger">
|
||||
*
|
||||
</span>
|
||||
<span class="text-danger">*</span>
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select class="input tomselect w-full @error('branch_id') border-danger bg-danger-light @enderror" name="branch_id" id="branch_id">
|
||||
<option value="">Pilih Cabang</option>
|
||||
@foreach($branches as $branch)
|
||||
@if(isset($debitur))
|
||||
<option value="{{ $branch->id }}" {{ $branch->id == $debitur->branch_id ? 'selected' : '' }}>{{ $branch->name }}</option>
|
||||
@else
|
||||
<option value="{{ $branch->id }}">{{ $branch->name }}</option>
|
||||
@endif
|
||||
|
||||
@endforeach
|
||||
</select>
|
||||
@if(auth()->user()->hasRole('administrator'))
|
||||
<select class="input tomselect w-full @error('branch_id') border-danger bg-danger-light @enderror" name="branch_id" id="branch_id">
|
||||
<option value="">Pilih Cabang</option>
|
||||
@foreach($branches as $branch)
|
||||
<option value="{{ $branch->id }}" {{ (isset($debitur) && $branch->id == $debitur->branch_id) || (old('branch_id') == $branch->id) ? 'selected' : '' }}>
|
||||
{{ $branch->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@else
|
||||
<input type="hidden" name="branch_id" value="{{ auth()->user()->branch_id }}">
|
||||
<input type="text" class="input w-full" value="{{ auth()->user()->branch->name }}" readonly>
|
||||
@endif
|
||||
@error('branch_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
|
||||
@@ -20,7 +20,9 @@
|
||||
<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('debitur.export') }}"> Export to Excel </a>
|
||||
<a class="btn btn-sm btn-primary" href="{{ route('debitur.create') }}"> Tambah Debitur </a>
|
||||
@if(auth()->user()->hasAnyRole(['administrator', 'pemohon-ao']))
|
||||
<a class="btn btn-sm btn-primary" href="{{ route('debitur.create') }}"> Tambah Debitur </a>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -90,6 +92,10 @@
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
const userRoles = @json(auth()->user()->roles->pluck('name'));
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
window.addEventListener('DOMContentLoaded', function () {
|
||||
|
||||
@@ -118,8 +124,7 @@
|
||||
window.location.reload();
|
||||
});
|
||||
}).catch((error) => {
|
||||
console.error('Error:', error);
|
||||
Swal.fire('Error!', 'An error occurred while deleting the file.', 'error');
|
||||
Swal.fire('Error!', error.responseJSON.message, 'error');
|
||||
});
|
||||
}
|
||||
})
|
||||
@@ -177,14 +182,36 @@
|
||||
actions: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
return `<div class="flex flex-nowrap justify-center">
|
||||
let actionHtml = `<div class="flex flex-nowrap justify-center">`;
|
||||
|
||||
// Fungsi helper untuk memeriksa peran
|
||||
const hasRole = (roles) => roles.some(role => userRoles.includes(role));
|
||||
|
||||
// Fungsi helper untuk memeriksa status permohonan
|
||||
const hasValidStatus = (permohonan) => ['order', 'revisi'].includes(permohonan.status);
|
||||
|
||||
// Periksa apakah permohonan ada dan merupakan array
|
||||
const permohonanArray = Array.isArray(data.permohonan) ? data.permohonan : [];
|
||||
|
||||
// Periksa apakah ada setidaknya satu permohonan dengan status yang valid
|
||||
const hasAnyValidPermohonan = permohonanArray.some(hasValidStatus);
|
||||
|
||||
if (hasRole(['administrator']) && hasAnyValidPermohonan || data.permohonan.length < 1) {
|
||||
actionHtml += `
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-info" href="/debitur/${data.id}/edit">
|
||||
<i class="ki-outline ki-notepad-edit"></i>
|
||||
</a>
|
||||
<a onclick="deleteData(${data.id})" class="delete btn btn-sm btn-icon btn-clear btn-danger">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</a>
|
||||
</div>`;
|
||||
</a>`;
|
||||
}
|
||||
|
||||
if (hasRole(['administrator', 'pemohon-ao']) && data.permohonan.length < 1) {
|
||||
actionHtml += `
|
||||
<a onclick="deleteData(${data.id})" class="delete btn btn-sm btn-icon btn-clear btn-danger">
|
||||
<i class="ki-outline ki-trash"></i>
|
||||
</a>`;
|
||||
}
|
||||
|
||||
actionHtml += `</div>`;
|
||||
return actionHtml;
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
430
resources/views/laporan-penilai-jaminan/index.blade.php
Normal file
430
resources/views/laporan-penilai-jaminan/index.blade.php
Normal file
@@ -0,0 +1,430 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('laporan-penilai-jaminan') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
@push('styles')
|
||||
<style>
|
||||
.dropdown {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.dropdowns-content {
|
||||
display: none;
|
||||
position: absolute;
|
||||
background-color: white;
|
||||
min-width: 224px;
|
||||
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
|
||||
z-index: 1;
|
||||
margin-top: 0;
|
||||
/* Hilangkan jarak antara tombol dan dropdown */
|
||||
}
|
||||
|
||||
.dropdown:hover .dropdowns-content {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* Tambahkan hover untuk elemen dropdown agar tidak hilang */
|
||||
.dropdowns-content:hover {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.dropdowns-content a {
|
||||
color: black;
|
||||
padding: 12px 16px;
|
||||
text-decoration: none;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.dropdowns-content a:hover {
|
||||
background-color: #f1f1f1;
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10"
|
||||
data-datatable-state-save="false" id="laporan-penilai-jaminan-table"
|
||||
data-api-url="{{ route('laporan-penilai-jaminan.datatables') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Daftar Laporan Penilai Jaminan
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
<div class="flex">
|
||||
<label class="input">
|
||||
Start Date
|
||||
<input placeholder="Tanggal Awal" id="tanggal_awal" type="date">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<label class="input">
|
||||
End Date
|
||||
<input placeholder="Tanggal Akhir" id="tanggal_akhir" type="date">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<button class="btn btn-primary" id="filter_tanggal">Filter</button>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<label class="input "> <i class="ki-filled ki-magnifier"> </i>
|
||||
<input placeholder="Search Laporan" id="search" type="text" value="">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<!-- Custom dropdown for status filter -->
|
||||
<div class="dropdown" data-dropdown="true" data-dropdown-trigger="click">
|
||||
<button class="dropdowns-toggle btn btn-light inline-flex justify-between w-full items-center">
|
||||
Pilih Type Laporan
|
||||
<i class="ki-outline ki-down dropdown-open:hidden">
|
||||
</i>
|
||||
<i class="ki-outline ki-up hidden dropdown-open:block">
|
||||
</i>
|
||||
</button>
|
||||
<div
|
||||
class="dropdowns-content w-full max-w-56 py-2 absolute mt-2 origin-top-right z-50 bg-white rounded-md shadow-lg ring-1 ring-black ring-opacity-5">
|
||||
<div class="menu menu-default flex flex-col w-full">
|
||||
<!-- Checkbox untuk All Status -->
|
||||
<div class="menu-item">
|
||||
<label class="menu-link flex items-center px-4 py-2 text-sm text-gray-700">
|
||||
<input id="select-all" type="checkbox"
|
||||
class="form-checkbox h-4 w-4 text-blue-600">
|
||||
<span class="ml-2">All Status</span>
|
||||
</label>
|
||||
</div>
|
||||
<!-- Dinamis Status dari Backend -->
|
||||
@php
|
||||
$status_laporan = [
|
||||
'Standar',
|
||||
'Sederhana',
|
||||
'Memo',
|
||||
'Resume',
|
||||
'Call Report',
|
||||
'RAP',
|
||||
];
|
||||
@endphp
|
||||
@foreach ($status_laporan as $item)
|
||||
<div class="menu-item">
|
||||
<label class="menu-link flex items-center px-4 py-2 text-sm text-gray-700">
|
||||
<input type="checkbox"
|
||||
class="form-checkbox status-checkbox h-4 w-4 text-blue-600"
|
||||
value="{{ strtolower($item) }}">
|
||||
<span class="ml-2">{{ $item }}</span>
|
||||
</label>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2.5">
|
||||
<div class="h-[24px] border border-r-gray-200"></div>
|
||||
<button class="btn btn-light" id="export-button">
|
||||
Export Excel
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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" />
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nomor_registrasi">
|
||||
<span class="sort"><span class="sort-label">Nomor Registrasi</span>
|
||||
<span class="sort-icon"></span>
|
||||
</span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="user_id">
|
||||
<span class="sort"><span class="sort-label">User Pemohon</span>
|
||||
<span class="sort-icon"></span>
|
||||
</span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="debitur_id">
|
||||
<span class="sort"><span class="sort-label">Debitur</span>
|
||||
<span class="sort-icon"></span>
|
||||
</span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tujuan_penilaian_id">
|
||||
<span class="sort"><span class="sort-label">Tujuan Penilaian</span>
|
||||
<span class="sort-icon"></span>
|
||||
</span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tujuan_penilaian_id">
|
||||
<span class="sort"><span class="sort-label">Jenis Jaminan</span>
|
||||
<span class="sort-icon"></span>
|
||||
</span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="laporan">
|
||||
<span class="sort"><span class="sort-label">Laporan</span>
|
||||
<span class="sort-icon"></span>
|
||||
</span>
|
||||
</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div
|
||||
class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" 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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Form tersembunyi untuk export -->
|
||||
<form id="export-form" action="{{ route('laporan-penilai-jaminan.export') }}" method="GET" class="hidden">
|
||||
<input type="hidden" name="tanggal_awal" id="export_tanggal_awal">
|
||||
<input type="hidden" name="tanggal_akhir" id="export_tanggal_akhir">
|
||||
<input type="hidden" name="status" id="export_status">
|
||||
<input type="hidden" name="selected_ids" id="export_selected_ids">
|
||||
<input type="hidden" name="export_type" id="export_type" value="all">
|
||||
</form>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="module">
|
||||
const element = document.querySelector('#laporan-penilai-jaminan-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
const tanggalAwalInput = document.getElementById('tanggal_awal');
|
||||
const tanggalAkhirInput = document.getElementById('tanggal_akhir');
|
||||
const filterTanggalButton = document.getElementById('filter_tanggal');
|
||||
const selectAllCheckbox = document.getElementById('select-all');
|
||||
const statusCheckboxes = document.querySelectorAll('.status-checkbox');
|
||||
|
||||
// Export elements
|
||||
const exportForm = document.getElementById('export-form');
|
||||
const exportButton = document.getElementById('export-button');
|
||||
const exportTanggalAwal = document.getElementById('export_tanggal_awal');
|
||||
const exportTanggalAkhir = document.getElementById('export_tanggal_akhir');
|
||||
const exportStatus = document.getElementById('export_status');
|
||||
const exportSelectedIds = document.getElementById('export_selected_ids');
|
||||
const exportType = document.getElementById('export_type');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
params: {
|
||||
startDate: '',
|
||||
endDate: '',
|
||||
},
|
||||
order: [{
|
||||
column: 'nomor_registrasi',
|
||||
dir: 'asc'
|
||||
}],
|
||||
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
nomor_registrasi: {
|
||||
title: 'Nomor Registrasi',
|
||||
},
|
||||
|
||||
user_id: {
|
||||
title: 'User Pemohon',
|
||||
render: (item, data) => {
|
||||
return data.user && data.user.name ? `${data.user.name}` : '-';
|
||||
},
|
||||
},
|
||||
debitur_id: {
|
||||
title: 'Debitur',
|
||||
render: (item, data) => {
|
||||
return data.debiture && data.debiture.name ? `${data.debiture.name}` : '-';
|
||||
},
|
||||
},
|
||||
tujuan_penilaian_id: {
|
||||
title: 'Tujuan Penilaian',
|
||||
render: (item, data) => {
|
||||
return data.tujuan_penilaian && data.tujuan_penilaian.name ?
|
||||
`${data.tujuan_penilaian.name}` : '-';
|
||||
},
|
||||
},
|
||||
jenis_jaminan_id: {
|
||||
title: 'Jenis Jaminan',
|
||||
render: (item, data) => {
|
||||
const jenisJaminan = data.dokumenjaminan.map(d => d.jenis_jaminan.name).join(', ');
|
||||
return jenisJaminan || '-';
|
||||
}
|
||||
},
|
||||
laporan: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
let badgeClass = '';
|
||||
|
||||
const statusLaporan = data.penilai?.type_penilai || '-';
|
||||
|
||||
switch (statusLaporan.toLowerCase()) {
|
||||
case 'standar':
|
||||
badgeClass = 'badge badge-pill badge-outline badge-warning';
|
||||
break;
|
||||
case 'sederhana':
|
||||
badgeClass = 'badge badge-pill badge-outline badge-info';
|
||||
break;
|
||||
case 'memo':
|
||||
badgeClass = 'badge badge-pill badge-outline badge-success';
|
||||
break;
|
||||
case 'resume':
|
||||
badgeClass = 'badge badge-pill badge-outline badge-primary';
|
||||
break;
|
||||
case 'call-report':
|
||||
badgeClass = 'badge badge-pill badge-outline badge-dark';
|
||||
break;
|
||||
default:
|
||||
badgeClass = 'badge badge-pill badge-outline';
|
||||
}
|
||||
|
||||
return `<span class="badge ${badgeClass}">${statusLaporan}</span>`;
|
||||
},
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
|
||||
// Search functionality
|
||||
searchInput.addEventListener('input', function() {
|
||||
const searchValue = this.value.trim();
|
||||
dataTable.search(searchValue, true);
|
||||
});
|
||||
|
||||
// Filter by date range
|
||||
filterTanggalButton.addEventListener('click', function() {
|
||||
applyDateFilter();
|
||||
});
|
||||
|
||||
function applyDateFilter() {
|
||||
const tanggalAwal = tanggalAwalInput.value;
|
||||
const tanggalAkhir = tanggalAkhirInput.value;
|
||||
|
||||
let filters = {};
|
||||
if (searchInput.value) {
|
||||
filters.search = searchInput.value;
|
||||
}
|
||||
|
||||
if (tanggalAwal) {
|
||||
filters.tanggal_awal = tanggalAwal
|
||||
}
|
||||
|
||||
if (tanggalAkhir) {
|
||||
filters.tanggal_akhir = tanggalAkhir
|
||||
}
|
||||
|
||||
dataTable.search(filters);
|
||||
}
|
||||
|
||||
// Status filter functionality
|
||||
statusCheckboxes.forEach(checkbox => {
|
||||
checkbox.addEventListener('change', applyStatusFilter);
|
||||
});
|
||||
|
||||
// Select All functionality
|
||||
selectAllCheckbox.addEventListener('change', function() {
|
||||
const isChecked = this.checked;
|
||||
statusCheckboxes.forEach(checkbox => {
|
||||
checkbox.checked = isChecked;
|
||||
});
|
||||
applyStatusFilter();
|
||||
});
|
||||
|
||||
function applyStatusFilter() {
|
||||
const selectedStatuses = Array.from(statusCheckboxes)
|
||||
.filter(checkbox => checkbox.checked)
|
||||
.map(checkbox => checkbox.value);
|
||||
|
||||
if (selectedStatuses.length === 0) {
|
||||
dataTable.search('');
|
||||
console.log(selectedStatuses);
|
||||
} else {
|
||||
dataTable.search(selectedStatuses.join(','), true);
|
||||
console.log(selectedStatuses);
|
||||
}
|
||||
|
||||
dataTable.reload();
|
||||
|
||||
// Update "Select All" checkbox state
|
||||
const allChecked = Array.from(statusCheckboxes).every(cb => cb.checked);
|
||||
selectAllCheckbox.checked = allChecked;
|
||||
}
|
||||
|
||||
// Single export button functionality
|
||||
exportButton.addEventListener('click', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
// Check if any rows are selected
|
||||
const selectedIds = getSelectedRowIds();
|
||||
|
||||
// Determine export type based on context
|
||||
if (selectedIds.length > 0) {
|
||||
// If rows are selected, export those
|
||||
exportData({
|
||||
selected_ids: selectedIds,
|
||||
export_type: 'selected'
|
||||
});
|
||||
} else if (tanggalAwalInput.value && tanggalAkhirInput.value || getSelectedStatuses().length > 0) {
|
||||
// If filters are applied but no rows selected, export filtered data
|
||||
exportData({
|
||||
tanggal_awal: tanggalAwalInput.value,
|
||||
tanggal_akhir: tanggalAkhirInput.value,
|
||||
status: getSelectedStatuses(),
|
||||
export_type: 'filtered'
|
||||
});
|
||||
} else {
|
||||
// If no selection and no filters, export all
|
||||
exportData({
|
||||
export_type: 'all'
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function exportData(filters = {}) {
|
||||
// Set filter values in the hidden form
|
||||
exportTanggalAwal.value = filters.tanggal_awal || '';
|
||||
exportTanggalAkhir.value = filters.tanggal_akhir || '';
|
||||
exportStatus.value = filters.status ? filters.status.join(',') : '';
|
||||
exportSelectedIds.value = filters.selected_ids ? filters.selected_ids.join(',') : '';
|
||||
exportType.value = filters.export_type || 'all';
|
||||
|
||||
// Submit the form
|
||||
exportForm.submit();
|
||||
}
|
||||
|
||||
function getSelectedStatuses() {
|
||||
return Array.from(statusCheckboxes)
|
||||
.filter(checkbox => checkbox.checked)
|
||||
.map(checkbox => checkbox.value);
|
||||
}
|
||||
|
||||
function getSelectedRowIds() {
|
||||
const checkboxes = document.querySelectorAll('[data-datatable-row-check="true"]:checked');
|
||||
return Array.from(checkboxes).map(checkbox => checkbox.value);
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
@@ -254,7 +254,7 @@
|
||||
</a>`;
|
||||
}
|
||||
|
||||
if(data.status_bayar=="sudah_bayar" && data.nilai_liquidasi >0) {
|
||||
if((data.status_bayar=="sudah_bayar" || data.status_bayar=="tidak_bayar") && data.nilai_liquidasi >0) {
|
||||
if(data.penilai.type_penilai=='resume' && !data.penilai.resume){
|
||||
laporanButton = `
|
||||
<a href="{{ route('penilai.print-out') }}?permohonanId=${data.id}&documentId=${dokumenID}&inspeksiId=${inspeksiId}&jaminanId=${jenisJaminanID}&statusLpj=0&type=${type}" class="btn btn-sm btn-primary">
|
||||
|
||||
92
resources/views/laporan_admin_kredit/form.blade.php
Normal file
92
resources/views/laporan_admin_kredit/form.blade.php
Normal file
@@ -0,0 +1,92 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('laporan-admin-kredit-edit', $laporanAdminKredit) }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card border border-agi-100">
|
||||
<div class="card-header bg-agi-50 py-5">
|
||||
<h3 class="card-title">
|
||||
Edit Laporan Admin Kredit
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="{{ route('laporan-admin-kredit.update', $laporanAdminKredit->id) }}" method="POST" class="grid gap-5">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-5">
|
||||
<!-- Editable Fields -->
|
||||
<div class="form-group">
|
||||
<label for="kode_register_t24" class="form-label">Kode Register T24</label>
|
||||
<input type="text" name="kode_register_t24" id="kode_register_t24" class="input" value="{{ $laporanAdminKredit->kode_register_t24 }}" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="cif" class="form-label">CIF</label>
|
||||
<input type="text" name="cif" id="cif" class="input" value="{{ $laporanAdminKredit->debiture ? $laporanAdminKredit->debiture->cif : '' }}" required>
|
||||
</div>
|
||||
|
||||
<!-- Read-only Information Fields -->
|
||||
<div class="form-group">
|
||||
<label class="form-label">Nama Debitur</label>
|
||||
<div class="input bg-gray-100">{{ $laporanAdminKredit->debiture ? $laporanAdminKredit->debiture->name : '' }}</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-label">Cabang</label>
|
||||
<div class="input bg-gray-100">{{ $laporanAdminKredit->debiture ? $laporanAdminKredit->debiture->branch->name : '' }}</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-label">Jenis Agunan</label>
|
||||
<div class="input bg-gray-100">{{ $laporanAdminKredit->jenis_agunan }}</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-label">Bukti Kepemilikan</label>
|
||||
<div class="input bg-gray-100">{{ $laporanAdminKredit->bukti_kepemilikan }}</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-label">Alamat Agunan</label>
|
||||
<div class="textarea bg-gray-100 h-auto min-h-[70px] p-3">{{ $laporanAdminKredit->alamat_agunan }}</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-label">Nama Pemilik</label>
|
||||
<div class="input bg-gray-100">{{ $laporanAdminKredit->nama_pemilik }}</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-label">Tanggal Kunjungan</label>
|
||||
<div class="input bg-gray-100">{{ \Carbon\Carbon::parse($laporanAdminKredit->tanggal_kunjungan)->format('d-m-Y') }}</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-label">Nilai Pasar Wajar</label>
|
||||
<div class="input bg-gray-100">{{ number_format($laporanAdminKredit->nilai_pasar_wajar, 0, ',', '.') }}</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-label">Nilai Likuidasi</label>
|
||||
<div class="input bg-gray-100">{{ number_format($laporanAdminKredit->nilai_likuidasi, 0, ',', '.') }}</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-label">Nama Penilai</label>
|
||||
<div class="input bg-gray-100">{{ $laporanAdminKredit->nama_penilai }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end gap-3">
|
||||
<a href="{{ route('laporan-admin-kredit.index') }}" class="btn btn-light">Cancel</a>
|
||||
<button type="submit" class="btn btn-primary">Update</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
241
resources/views/laporan_admin_kredit/index.blade.php
Normal file
241
resources/views/laporan_admin_kredit/index.blade.php
Normal file
@@ -0,0 +1,241 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{ Breadcrumbs::render('laporan-admin-kredit') }}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false" id="laporan-admin-kredit-table" data-api-url="{{ route('laporan-admin-kredit.datatables') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Daftar Laporan Admin Kredit
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
<div class="flex">
|
||||
<label class="input input-sm">
|
||||
<input placeholder="Tanggal Awal" id="tanggal_awal" type="date">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<label class="input input-sm">
|
||||
<input placeholder="Tanggal Akhir" id="tanggal_akhir" type="date">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<button class="btn btn-sm btn-primary" id="filter_tanggal">Filter</button>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
|
||||
<input placeholder="Search Laporan" 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('laporan-admin-kredit.export') }}"> Export to Excel </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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"/>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="cif">
|
||||
<span class="sort"> <span class="sort-label"> CIF </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="kode_register_t24">
|
||||
<span class="sort"> <span class="sort-label"> Kode Register T24 </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nama_debitur">
|
||||
<span class="sort"> <span class="sort-label"> Nama Debitur </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="cabang">
|
||||
<span class="sort"> <span class="sort-label"> Cabang </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="jenis_agunan">
|
||||
<span class="sort"> <span class="sort-label"> Jenis Agunan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="bukti_kepemilikan">
|
||||
<span class="sort"> <span class="sort-label"> Bukti Kepemilikan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="alamat_agunan">
|
||||
<span class="sort"> <span class="sort-label"> Alamat Agunan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nama_pemilik">
|
||||
<span class="sort"> <span class="sort-label"> Nama Pemilik </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_kunjungan">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Kunjungan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nilai_pasar_wajar">
|
||||
<span class="sort"> <span class="sort-label"> Nilai Pasar Wajar </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nilai_likuidasi">
|
||||
<span class="sort"> <span class="sort-label"> Nilai Likuidasi </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nama_penilai">
|
||||
<span class="sort"> <span class="sort-label"> Nama Penilai </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[100px]" data-datatable-column="actions">
|
||||
<span class="sort"> <span class="sort-label"> Actions </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" 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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="module">
|
||||
const element = document.querySelector('#laporan-admin-kredit-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
const tanggalAwalInput = document.getElementById('tanggal_awal');
|
||||
const tanggalAkhirInput = document.getElementById('tanggal_akhir');
|
||||
const filterTanggalButton = document.getElementById('filter_tanggal');
|
||||
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
cif: {
|
||||
title: 'CIF',
|
||||
render: (item, data) => {
|
||||
return data.debiture ? data.debiture.cif : '';
|
||||
},
|
||||
},
|
||||
kode_register_t24: {
|
||||
title: 'Kode Register T24',
|
||||
},
|
||||
nama_debitur: {
|
||||
title: 'Nama Debitur',
|
||||
render: (item, data) => {
|
||||
return data.debiture ? data.debiture.name : '';
|
||||
},
|
||||
},
|
||||
cabang: {
|
||||
title: 'Cabang',
|
||||
render: (item, data) => {
|
||||
return data.debiture ? data.debiture.branch.name : '';
|
||||
},
|
||||
},
|
||||
jenis_agunan: {
|
||||
title: 'Jenis Agunan',
|
||||
},
|
||||
bukti_kepemilikan: {
|
||||
title: 'Bukti Kepemilikan',
|
||||
},
|
||||
alamat_agunan: {
|
||||
title: 'Alamat Agunan',
|
||||
},
|
||||
nama_pemilik: {
|
||||
title: 'Nama Pemilik',
|
||||
},
|
||||
tanggal_kunjungan: {
|
||||
title: 'Tanggal Kunjungan',
|
||||
render: (item, data) => {
|
||||
return window.formatTanggalIndonesia(data.tanggal_kunjungan);
|
||||
},
|
||||
},
|
||||
nilai_pasar_wajar: {
|
||||
title: 'Nilai Pasar Wajar',
|
||||
render: (item, data) => {
|
||||
return window.formatRupiah(data.nilai_pasar_wajar);
|
||||
},
|
||||
},
|
||||
nilai_likuidasi: {
|
||||
title: 'Nilai Likuidasi',
|
||||
render: (item, data) => {
|
||||
return window.formatRupiah(data.nilai_likuidasi);
|
||||
},
|
||||
},
|
||||
nama_penilai: {
|
||||
title: 'Nama Penilai',
|
||||
},
|
||||
actions: {
|
||||
title: 'Action',
|
||||
render: (item, data) => {
|
||||
return `<div class="flex flex-nowrap justify-center">
|
||||
<a href="laporan-admin-kredit/${data.id}/edit" class="btn btn-sm btn-outline btn-info">
|
||||
<i class="ki-filled ki-pencil"></i>
|
||||
</a>
|
||||
</div>`;
|
||||
},
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
|
||||
// Function to apply all filters
|
||||
function applyFilters() {
|
||||
let filters = {};
|
||||
const tanggalAwal = tanggalAwalInput.value;
|
||||
const tanggalAkhir = tanggalAkhirInput.value;
|
||||
|
||||
console.table(tanggalAwal, tanggalAkhir);
|
||||
|
||||
if (searchInput.value) {
|
||||
filters.search = searchInput.value;
|
||||
}
|
||||
|
||||
if (tanggalAwal) {
|
||||
filters.tanggal_awal = tanggalAwal
|
||||
}
|
||||
|
||||
if (tanggalAkhir) {
|
||||
filters.tanggal_akhir = tanggalAkhir
|
||||
}
|
||||
|
||||
dataTable.search(filters);
|
||||
}
|
||||
|
||||
// Add event listeners for all inputs
|
||||
searchInput.addEventListener('input', applyFilters);
|
||||
filterTanggalButton.addEventListener('click', applyFilters);
|
||||
</script>
|
||||
@endpush
|
||||
283
resources/views/laporan_pembatalan/index.blade.php
Normal file
283
resources/views/laporan_pembatalan/index.blade.php
Normal file
@@ -0,0 +1,283 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{-- {{ Breadcrumbs::render('laporan-pembatalan') }}--}}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false" id="laporan-pembatalan-table" data-api-url="{{ route('laporan-pembatalan.data') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Laporan Pembatalan
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
<div class="flex">
|
||||
<label class="input input-sm">
|
||||
<input placeholder="Tanggal Awal" id="start_date" type="date">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<label class="input input-sm">
|
||||
<input placeholder="Tanggal Akhir" id="end_date" type="date">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<select class="select select-sm" id="branch_filter">
|
||||
<option value="">Semua Cabang</option>
|
||||
@foreach(\Modules\Basicdata\Models\Branch::where('status', 1)->get() as $branch)
|
||||
<option value="{{ $branch->id }}">{{ $branch->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="flex">
|
||||
<button class="btn btn-sm btn-primary" id="filter_tanggal">Filter</button>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
|
||||
<input placeholder="Search Pembatalan" 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('laporan-pembatalan.export') }}" id="export-btn"> Export to Excel </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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"/>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nomor_registrasi">
|
||||
<span class="sort"> <span class="sort-label"> Nomor Registrasi </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_permohonan">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Permohonan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_pembatalan">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Pembatalan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="cabang">
|
||||
<span class="sort"> <span class="sort-label"> Cabang </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="pemohon">
|
||||
<span class="sort"> <span class="sort-label"> Pemohon </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="debitur">
|
||||
<span class="sort"> <span class="sort-label"> Debitur </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="alasan_pembatalan">
|
||||
<span class="sort"> <span class="sort-label"> Alasan Pembatalan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="status">
|
||||
<span class="sort"> <span class="sort-label"> Status </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="diajukan_oleh">
|
||||
<span class="sort"> <span class="sort-label"> Diajukan Oleh </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="disetujui_oleh">
|
||||
<span class="sort"> <span class="sort-label"> Disetujui Oleh </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_disetujui">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Disetujui </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" 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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="module">
|
||||
const element = document.querySelector('#laporan-pembatalan-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
const startDateInput = document.getElementById('start_date');
|
||||
const endDateInput = document.getElementById('end_date');
|
||||
const statusFilter = document.getElementById('status_filter');
|
||||
const branchFilter = document.getElementById('branch_filter');
|
||||
const filterTanggalButton = document.getElementById('filter_tanggal');
|
||||
const exportBtn = document.getElementById('export-btn');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
nomor_registrasi: {
|
||||
title: 'Nomor Registrasi',
|
||||
},
|
||||
tanggal_permohonan: {
|
||||
title: 'Tanggal Permohonan',
|
||||
},
|
||||
tanggal_pembatalan: {
|
||||
title: 'Tanggal Pembatalan',
|
||||
},
|
||||
cabang: {
|
||||
title: 'Cabang',
|
||||
},
|
||||
pemohon: {
|
||||
title: 'Pemohon',
|
||||
},
|
||||
debitur: {
|
||||
title: 'Debitur',
|
||||
},
|
||||
alasan_pembatalan: {
|
||||
title: 'Alasan Pembatalan',
|
||||
},
|
||||
status: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
let statusClass = '';
|
||||
let statusText = '';
|
||||
|
||||
switch (data.status) {
|
||||
case 'batal':
|
||||
statusClass = 'badge-danger';
|
||||
statusText = 'Batal';
|
||||
break;
|
||||
default:
|
||||
statusClass = 'badge-secondary';
|
||||
statusText = data.status;
|
||||
}
|
||||
|
||||
return `<span class="badge ${statusClass}">${statusText}</span>`;
|
||||
},
|
||||
},
|
||||
diajukan_oleh: {
|
||||
title: 'Diajukan Oleh',
|
||||
},
|
||||
disetujui_oleh: {
|
||||
title: 'Disetujui Oleh',
|
||||
},
|
||||
tanggal_disetujui: {
|
||||
title: 'Tanggal Disetujui',
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
|
||||
// Function to apply all filters
|
||||
function applyFilters() {
|
||||
let filters = {};
|
||||
const startDate = startDateInput.value;
|
||||
const endDate = endDateInput.value;
|
||||
const branch = branchFilter.value;
|
||||
|
||||
if (searchInput.value) {
|
||||
filters.search = searchInput.value;
|
||||
}
|
||||
|
||||
if (startDate) {
|
||||
filters.start_date = startDate;
|
||||
}
|
||||
|
||||
if (endDate) {
|
||||
filters.end_date = endDate;
|
||||
}
|
||||
|
||||
if (status) {
|
||||
filters.status = status;
|
||||
}
|
||||
|
||||
if (branch) {
|
||||
filters.branch_id = branch;
|
||||
}
|
||||
|
||||
dataTable.search(filters);
|
||||
}
|
||||
|
||||
// Update export URL with filters
|
||||
function updateExportUrl() {
|
||||
let url = new URL(exportBtn.href);
|
||||
|
||||
if (startDateInput.value) {
|
||||
url.searchParams.set('start_date', startDateInput.value);
|
||||
} else {
|
||||
url.searchParams.delete('start_date');
|
||||
}
|
||||
|
||||
if (endDateInput.value) {
|
||||
url.searchParams.set('end_date', endDateInput.value);
|
||||
} else {
|
||||
url.searchParams.delete('end_date');
|
||||
}
|
||||
|
||||
if (branchFilter.value) {
|
||||
url.searchParams.set('branch_id', branchFilter.value);
|
||||
} else {
|
||||
url.searchParams.delete('branch_id');
|
||||
}
|
||||
|
||||
if (searchInput.value) {
|
||||
url.searchParams.set('search', searchInput.value);
|
||||
} else {
|
||||
url.searchParams.delete('search');
|
||||
}
|
||||
|
||||
exportBtn.href = url.toString();
|
||||
}
|
||||
|
||||
// Add event listeners for all inputs
|
||||
searchInput.addEventListener('input', () => {
|
||||
applyFilters();
|
||||
updateExportUrl();
|
||||
});
|
||||
|
||||
|
||||
branchFilter.addEventListener('change', () => {
|
||||
applyFilters();
|
||||
updateExportUrl();
|
||||
});
|
||||
|
||||
filterTanggalButton.addEventListener('click', () => {
|
||||
applyFilters();
|
||||
updateExportUrl();
|
||||
});
|
||||
|
||||
// Initial update of export URL
|
||||
updateExportUrl();
|
||||
</script>
|
||||
@endpush
|
||||
298
resources/views/laporan_permohonan/index.blade.php
Normal file
298
resources/views/laporan_permohonan/index.blade.php
Normal file
@@ -0,0 +1,298 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('breadcrumbs')
|
||||
{{-- {{ Breadcrumbs::render('laporan-permohonan') }}--}}
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
<div class="card border border-agi-100 card-grid min-w-full" data-datatable="false" data-datatable-page-size="10" data-datatable-state-save="false" id="laporan-permohonan-table" data-api-url="{{ route('laporan-permohonan.data') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Laporan Permohonan
|
||||
</h3>
|
||||
<div class="flex flex-wrap gap-2 lg:gap-5">
|
||||
<div class="flex">
|
||||
<label class="input input-sm">
|
||||
<input placeholder="Tanggal Awal" id="start_date" type="date">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<label class="input input-sm">
|
||||
<input placeholder="Tanggal Akhir" id="end_date" type="date">
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<select class="select select-sm" id="branch_filter">
|
||||
<option value="">Semua Cabang</option>
|
||||
@foreach(\Modules\Basicdata\Models\Branch::where('status', 1)->get() as $branch)
|
||||
<option value="{{ $branch->id }}">{{ $branch->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<select class="select select-sm" id="status_filter">
|
||||
<option value="">Semua Status</option>
|
||||
@foreach(\Modules\Lpj\Models\StatusPermohonan::where('status', 1)->get() as $status)
|
||||
<option value="{{ $status->slug }}">{{ $status->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="flex">
|
||||
<button class="btn btn-sm btn-primary" id="filter_tanggal">Filter</button>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<label class="input input-sm"> <i class="ki-filled ki-magnifier"> </i>
|
||||
<input placeholder="Search Permohonan" 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('laporan-permohonan.export') }}" id="export-btn"> Export to Excel </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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"/>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nomor_registrasi">
|
||||
<span class="sort"> <span class="sort-label"> Nomor Registrasi </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_permohonan">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Permohonan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="branch">
|
||||
<span class="sort"> <span class="sort-label"> Cabang </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tujuan_penilaian">
|
||||
<span class="sort"> <span class="sort-label"> Tujuan Penilaian </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="jenis_fasilitas_kredit">
|
||||
<span class="sort"> <span class="sort-label"> Jenis Fasilitas Kredit </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="jenis_penilaian">
|
||||
<span class="sort"> <span class="sort-label"> Jenis Penilaian </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="user">
|
||||
<span class="sort"> <span class="sort-label"> Pemohon </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="status">
|
||||
<span class="sort"> <span class="sort-label"> Status </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer justify-center md:justify-between flex-col md:flex-row gap-3 text-gray-600 text-2sm font-medium">
|
||||
<div class="flex items-center gap-2">
|
||||
Show
|
||||
<select class="select select-sm w-16" 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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="module">
|
||||
const element = document.querySelector('#laporan-permohonan-table');
|
||||
const searchInput = document.getElementById('search');
|
||||
const startDateInput = document.getElementById('start_date');
|
||||
const endDateInput = document.getElementById('end_date');
|
||||
const statusFilter = document.getElementById('status_filter');
|
||||
const branchFilter = document.getElementById('branch_filter');
|
||||
const filterTanggalButton = document.getElementById('filter_tanggal');
|
||||
const exportBtn = document.getElementById('export-btn');
|
||||
|
||||
const apiUrl = element.getAttribute('data-api-url');
|
||||
const dataTableOptions = {
|
||||
apiEndpoint: apiUrl,
|
||||
pageSize: 5,
|
||||
columns: {
|
||||
select: {
|
||||
render: (item, data, context) => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.className = 'checkbox checkbox-sm';
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = data.id.toString();
|
||||
checkbox.setAttribute('data-datatable-row-check', 'true');
|
||||
return checkbox.outerHTML.trim();
|
||||
},
|
||||
},
|
||||
nomor_registrasi: {
|
||||
title: 'Nomor Registrasi',
|
||||
},
|
||||
tanggal_permohonan: {
|
||||
title: 'Tanggal Permohonan',
|
||||
render: (item, data) => {
|
||||
return window.formatTanggalIndonesia(data.tanggal_permohonan);
|
||||
},
|
||||
},
|
||||
branch: {
|
||||
title: 'Cabang',
|
||||
render: (item, data) => {
|
||||
return data.branch ? data.branch.name : '';
|
||||
},
|
||||
},
|
||||
tujuan_penilaian: {
|
||||
title: 'Tujuan Penilaian',
|
||||
render: (item, data) => {
|
||||
console.log(data);
|
||||
return data.tujuan_penilaian ? data.tujuan_penilaian.name : '';
|
||||
},
|
||||
},
|
||||
jenis_fasilitas_kredit: {
|
||||
title: 'Jenis Fasilitas Kredit',
|
||||
render: (item, data) => {
|
||||
return data.jenis_fasilitas_kredit ? data.jenis_fasilitas_kredit.name : '';
|
||||
},
|
||||
},
|
||||
jenis_penilaian: {
|
||||
title: 'Jenis Penilaian',
|
||||
render: (item, data) => {
|
||||
return data.jenis_penilaian ? data.jenis_penilaian.name : '';
|
||||
},
|
||||
},
|
||||
user: {
|
||||
title: 'Pemohon',
|
||||
render: (item, data) => {
|
||||
return data.user ? data.user.name : '';
|
||||
},
|
||||
},
|
||||
status: {
|
||||
title: 'Status',
|
||||
render: (item, data) => {
|
||||
let statusClass = '';
|
||||
let statusText = '';
|
||||
|
||||
switch (data.status) {
|
||||
case 'pending':
|
||||
statusClass = 'badge-warning';
|
||||
statusText = 'Pending';
|
||||
break;
|
||||
case 'approved':
|
||||
statusClass = 'badge-success';
|
||||
statusText = 'Approved';
|
||||
break;
|
||||
case 'rejected':
|
||||
statusClass = 'badge-danger';
|
||||
statusText = 'Rejected';
|
||||
break;
|
||||
default:
|
||||
statusClass = 'badge-secondary';
|
||||
statusText = data.status;
|
||||
}
|
||||
|
||||
return `<span class="badge ${statusClass}">${statusText}</span>`;
|
||||
},
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
let dataTable = new KTDataTable(element, dataTableOptions);
|
||||
|
||||
// Function to apply all filters
|
||||
function applyFilters() {
|
||||
let filters = {};
|
||||
const startDate = startDateInput.value;
|
||||
const endDate = endDateInput.value;
|
||||
const status = statusFilter.value;
|
||||
const branch = branchFilter.value;
|
||||
|
||||
if (searchInput.value) {
|
||||
filters.search = searchInput.value;
|
||||
}
|
||||
|
||||
if (startDate) {
|
||||
filters.start_date = startDate;
|
||||
}
|
||||
|
||||
if (endDate) {
|
||||
filters.end_date = endDate;
|
||||
}
|
||||
|
||||
if (status) {
|
||||
filters.status = status;
|
||||
}
|
||||
|
||||
if (branch) {
|
||||
filters.branch_id = branch;
|
||||
}
|
||||
|
||||
dataTable.search(filters);
|
||||
}
|
||||
|
||||
// Update export URL with filters
|
||||
function updateExportUrl() {
|
||||
let url = new URL(exportBtn.href);
|
||||
|
||||
if (startDateInput.value) {
|
||||
url.searchParams.set('start_date', startDateInput.value);
|
||||
} else {
|
||||
url.searchParams.delete('start_date');
|
||||
}
|
||||
|
||||
if (endDateInput.value) {
|
||||
url.searchParams.set('end_date', endDateInput.value);
|
||||
} else {
|
||||
url.searchParams.delete('end_date');
|
||||
}
|
||||
|
||||
if (statusFilter.value) {
|
||||
url.searchParams.set('status', statusFilter.value);
|
||||
} else {
|
||||
url.searchParams.delete('status');
|
||||
}
|
||||
|
||||
if (branchFilter.value) {
|
||||
url.searchParams.set('branch_id', branchFilter.value);
|
||||
} else {
|
||||
url.searchParams.delete('branch_id');
|
||||
}
|
||||
|
||||
if (searchInput.value) {
|
||||
url.searchParams.set('search', searchInput.value);
|
||||
} else {
|
||||
url.searchParams.delete('search');
|
||||
}
|
||||
|
||||
exportBtn.href = url.toString();
|
||||
}
|
||||
|
||||
// Add event listeners for all inputs
|
||||
searchInput.addEventListener('input', () => {
|
||||
applyFilters();
|
||||
updateExportUrl();
|
||||
});
|
||||
|
||||
filterTanggalButton.addEventListener('click', () => {
|
||||
applyFilters();
|
||||
updateExportUrl();
|
||||
});
|
||||
|
||||
// Initial update of export URL
|
||||
updateExportUrl();
|
||||
</script>
|
||||
@endpush
|
||||
@@ -18,7 +18,7 @@
|
||||
@endphp
|
||||
<td style="width: 25%; padding: 2px; vertical-align: top;">Luas Unit</td>
|
||||
<td style="width: 1%; padding: 2px; vertical-align: top;">:</td>
|
||||
<td style="width: 74%; padding: 2px; vertical-align: top;">{{ $luas ?? '' }}</td>
|
||||
<td style="width: 74%; padding: 2px; vertical-align: top;">{{ $luas ?? '' }} <span>m²</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 25%; padding: 2px; vertical-align: top;">Bentuk Unit</td>
|
||||
@@ -22,7 +22,7 @@
|
||||
: '-');
|
||||
@endphp
|
||||
|
||||
{{ $output }} <sup>m2</sup>
|
||||
{{ $output }} <span>m²</span>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
@endphp
|
||||
<td style="width: 25%; padding: 2px; vertical-align: top;">Luas Tanah</td>
|
||||
<td style=" width:1%; padding: 2px; vertical-align: top;">:</td>
|
||||
<td style="width: 74%; padding: 2px; vertical-align: top;">{{ $luas ?? '' }}</td>
|
||||
<td style="width: 74%; padding: 2px; vertical-align: top;">{{ $luas ?? '' }} <span>m²</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
@php
|
||||
|
||||
@@ -512,7 +512,7 @@
|
||||
@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">
|
||||
href="{{ route('penilai.lampiran') }}?permohonanId={{ request('permohonanId') }}&documentId={{ request('documentId') }}&jaminanId={{ request('jaminanId') }}&statusLpj=1">
|
||||
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')]) }}"
|
||||
@@ -520,7 +520,7 @@
|
||||
<i class="ki-filled ki-printer"></i>Cetak Hasil Inspeksi
|
||||
</a>
|
||||
<a class="btn btn-primary"
|
||||
onclick="checkLaporan('{{ $permohonan->id }}', '{{ request('documentId') }}', '{{ request('inspeksiId') }}', {{ request('jaminanId') }}, )">
|
||||
onclick="checkLaporan('{{ $permohonan->id }}', '{{ request('documentId') }}',{{ request('jaminanId') }}, )">
|
||||
<i class="ki-filled ki-printer"></i> Cetak Laporan
|
||||
</a>
|
||||
@endif
|
||||
@@ -589,7 +589,6 @@
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
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())
|
||||
@@ -609,7 +608,7 @@
|
||||
.map(input => input.value)
|
||||
.join(',') || "";
|
||||
const requestUrl =
|
||||
`{{ route('penilai.storeCallReport') }}?permohonan_id=${permohonanId}&inspeksi_id=${inspeksiId}&dokument_id=${documentId}`;
|
||||
`{{ route('penilai.storeCallReport') }}?permohonan_id=${permohonanId}&dokument_id=${documentId}`;
|
||||
|
||||
|
||||
const jsonData = formatJson(formElement);
|
||||
@@ -619,7 +618,7 @@
|
||||
data: JSON.stringify({
|
||||
permohonan_id: permohonanId,
|
||||
dokument_id: documentId,
|
||||
inspeksi_id: inspeksiId,
|
||||
|
||||
data: jsonData,
|
||||
fakta_positif: faktaPositif,
|
||||
fakta_negatif: faktaNegatif,
|
||||
|
||||
@@ -47,14 +47,17 @@
|
||||
];
|
||||
// Memindahkan foto_tempat ke depan jika ada
|
||||
if (($key = array_search('upload_gs', $fotoTypes)) !== false) {
|
||||
unset($fotoTypes[$key]);
|
||||
array_unshift($fotoTypes, 'upload_gs');
|
||||
}
|
||||
// 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]));
|
||||
});
|
||||
unset($fotoTypes[$key]);
|
||||
array_unshift($fotoTypes, 'upload_gs');
|
||||
}
|
||||
|
||||
// Filter fotoTypes untuk memastikan hanya yang memiliki imagePath valid
|
||||
$validPhotoTypes = array_filter($fotoTypes, function ($type) use ($forminspeksi) {
|
||||
// Check if value is a string (not an array) and file exists
|
||||
return isset($forminspeksi[$type]) &&
|
||||
is_string($forminspeksi[$type]) &&
|
||||
file_exists(storage_path('app/public/' . $forminspeksi[$type]));
|
||||
});
|
||||
@endphp
|
||||
|
||||
<table width="100%" border="0">
|
||||
|
||||
@@ -138,12 +138,12 @@
|
||||
</td>
|
||||
<td style="text-align: right;">
|
||||
<p style="margin: 0; padding:0; font-size:10px;">
|
||||
Tanggal: {{ \Carbon\Carbon::parse($permohonan->penilaian->updated_at)->format('d-m-Y') }}
|
||||
Tanggal: {{ \Carbon\Carbon::parse(date('Y-m-d'))->format('d-m-Y') }}
|
||||
</p>
|
||||
<p style="margin: 0; padding:0; font-size:10px;">
|
||||
Waktu: {{ \Carbon\Carbon::parse($permohonan->penilaian->updated_at)->format('H:i') }}
|
||||
Waktu: {{ \Carbon\Carbon::parse(date('H:i:s'))->format('H:i:s') }}
|
||||
</p>
|
||||
<p style="margin: 0; padding:0; font-size:10px;">User: {{ $penilaiUser->name }}</p>
|
||||
<p style="margin: 0; padding:0; font-size:10px;">User: {{ Auth::user()->name }}</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
@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">
|
||||
href="{{ route('penilai.lampiran') }}?permohonanId={{ $permohonan->id }}&documentId={{ request('documentId') }}&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"
|
||||
@@ -60,7 +60,7 @@
|
||||
<i class="ki-filled ki-printer"></i> Cetak Hasil Inspeksi
|
||||
</a>
|
||||
<a class="btn btn-success"
|
||||
onclick="checkLaporan('{{ $permohonan->id }}', '{{ request('documentId') }}', '{{ request('inspeksiId') }}', {{ request('jaminanId') }}, )">
|
||||
onclick="checkLaporan('{{ $permohonan->id }}', '{{ request('documentId') }}', {{ request('jaminanId') }}, )">
|
||||
<i class="ki-filled ki-printer"></i> Cetak Laporan
|
||||
</a>
|
||||
@endif
|
||||
|
||||
@@ -184,9 +184,10 @@
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="tanggal_survey" class="form-label max-w-56">Tanggal Survey</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="date" id="tanggal_survey" name="tanggal_survey"
|
||||
<input type="date-time" id="tanggal_survey" name="tanggal_survey"
|
||||
class="input w-full" placeholder="Masukkan Tanggal Survey"
|
||||
value="{{ $memo->lokasi->tanggal_survey ?? old('tanggal_survey') }}">
|
||||
value="{{ $permohonan->penilaian->updated_at ?? old('tanggal_survey') }}"
|
||||
@readonly(true)>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -315,14 +316,15 @@
|
||||
|
||||
<div class="flex card-footer justify-end gap-5">
|
||||
@if (Auth::user()->hasAnyRole(['senior-officer', 'surveyor', 'administrator']))
|
||||
<a class="btn btn-primary" onclick="saveMemo()" {{ $permohonan->status == 'proses-paparan' || $permohonan->status == 'proses-laporan' && Auth::user()->hasAnyRole(['surveyor']) ? 'disabled' : '' }}>
|
||||
<i class="ki-filled ki-save-2"></i>
|
||||
Simpan
|
||||
</a>
|
||||
<a class="btn btn-primary" onclick="saveMemo()"
|
||||
{{ $permohonan->status == 'proses-paparan' || ($permohonan->status == 'proses-laporan' && Auth::user()->hasAnyRole(['surveyor'])) ? 'disabled' : '' }}>
|
||||
<i class="ki-filled ki-save-2"></i>
|
||||
Simpan
|
||||
</a>
|
||||
@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">
|
||||
href="{{ route('penilai.lampiran') }}?permohonanId={{ request('permohonanId') }}&documentId={{ request('documentId') }}&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')]) }}"
|
||||
@@ -330,7 +332,7 @@
|
||||
<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') }}, )">
|
||||
onclick="checkLaporan('{{ $permohonan->id }}', '{{ request('documentId') }}', {{ request('jaminanId') }}, )">
|
||||
<i class="ki-filled ki-printer"></i> Cetak Laporan
|
||||
</a>
|
||||
@endif
|
||||
@@ -347,11 +349,13 @@
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
myDropzone = new Dropzone("#dropzone-upload", {
|
||||
url: "{{ route('penilai.uploadTempPhoto') }}", // Temporary upload route
|
||||
url: "{{ route('penilai.uploadTempPhoto') }}?permohonan_id={{ $permohonan->id }}&dokument_id={{ request('documentId') }}", // Temporary upload route
|
||||
paramName: "file",
|
||||
maxFilesize: 5, // MB
|
||||
acceptedFiles: "image/*",
|
||||
addRemoveLinks: true,
|
||||
uploadMultiple: false,
|
||||
parallelUploads: 1,
|
||||
autoProcessQueue: true,
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
},
|
||||
@@ -370,134 +374,175 @@
|
||||
const existingPhotosContainer = document.getElementById('existing-photos');
|
||||
if (!existingPhotosContainer) return;
|
||||
|
||||
@if(isset($memo) && isset($memo->foto))
|
||||
let existingPhotos;
|
||||
try {
|
||||
existingPhotos = @json($memo->foto);
|
||||
} catch (e) {
|
||||
console.error('Error parsing existing photos:', e);
|
||||
return;
|
||||
}
|
||||
@if (isset($memo) && isset($memo->foto))
|
||||
let existingPhotos;
|
||||
try {
|
||||
existingPhotos = @json($memo->foto);
|
||||
} catch (e) {
|
||||
console.error('Error parsing existing photos:', e);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Array.isArray(existingPhotos)) {
|
||||
existingPhotos.forEach(function(photoPath) {
|
||||
if (typeof photoPath === 'string') {
|
||||
const photoDiv = document.createElement('div');
|
||||
photoDiv.className = 'col-md-3 mb-3';
|
||||
if (Array.isArray(existingPhotos)) {
|
||||
const BASE_URL = "{{ asset('storage/') }}";
|
||||
existingPhotos.forEach(function(photoPath) {
|
||||
if (typeof photoPath === 'string') {
|
||||
const photoDiv = document.createElement('div');
|
||||
photoDiv.className = 'col-md-3 mb-3';
|
||||
|
||||
const img = document.createElement('img');
|
||||
img.src = photoPath;
|
||||
img.className = 'img-fluid';
|
||||
img.style.maxHeight = '150px';
|
||||
const img = document.createElement('img');
|
||||
img.src = BASE_URL + '/' + photoPath;
|
||||
img.className = 'img-fluid';
|
||||
img.style.maxHeight = '150px';
|
||||
const deleteButton = document.createElement('button');
|
||||
|
||||
photoDiv.appendChild(img);
|
||||
existingPhotosContainer.appendChild(photoDiv);
|
||||
deleteButton.className = 'btn btn-danger btn-sm mt-2';
|
||||
deleteButton.textContent = 'Hapus';
|
||||
deleteButton.type = 'button';
|
||||
deleteButton.onclick = function() {
|
||||
handleDeletePhoto(photoPath, photoDiv);
|
||||
};
|
||||
|
||||
if (myDropzone) {
|
||||
let mockFile = { name: photoPath.split('/').pop(), size: 12345 };
|
||||
myDropzone.emit("addedfile", mockFile);
|
||||
myDropzone.emit("thumbnail", mockFile, photoPath);
|
||||
myDropzone.emit("complete", mockFile);
|
||||
mockFile.previewElement.classList.add("dz-success");
|
||||
mockFile.previewElement.classList.add("dz-complete");
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
console.error('Existing photos is not an array:', existingPhotos);
|
||||
}
|
||||
@endif
|
||||
}
|
||||
photoDiv.appendChild(img);
|
||||
photoDiv.appendChild(deleteButton);
|
||||
existingPhotosContainer.appendChild(photoDiv);
|
||||
|
||||
function saveMemo() {
|
||||
const form = document.getElementById('form-memo');
|
||||
const formData = new FormData(form);
|
||||
|
||||
const jsonData = {
|
||||
kepada: formData.get('kepada'),
|
||||
dari: formData.get('dari'),
|
||||
nomor_memo: formData.get('nomor_memo'),
|
||||
tanggal: formData.get('tanggal'),
|
||||
perihal: formData.get('perihal'),
|
||||
jenis_asset_tidak_sesuai: formData.get('jenis_asset_tidak_sesuai'),
|
||||
lokasi: {
|
||||
lokasi: formData.get('lokasi') || '',
|
||||
address: formData.get('address') || '',
|
||||
province_code: formData.get('province_code') || '',
|
||||
city_code: formData.get('city_code') || '',
|
||||
district_code: formData.get('district_code') || '',
|
||||
village_code: formData.get('village_code') || '',
|
||||
tanggal_survey: formData.get('tanggal_survey') || '',
|
||||
penilai: formData.get('penilai') || '',
|
||||
},
|
||||
terlampir: (formData.getAll('terlampir[]') || []),
|
||||
hasil_survey: (formData.getAll('hasil_survey[]') || []),
|
||||
kesimpulan_saran: (formData.getAll('kesimpulan_saran[]') || []),
|
||||
};
|
||||
|
||||
showLoadingSwal('Mengirim data ke server...');
|
||||
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const permohonanId = urlParams.get('permohonanId');
|
||||
const documentId = urlParams.get('documentId');
|
||||
const inspeksiId = urlParams.get('inspeksiId');
|
||||
|
||||
// Create a new FormData object to send both JSON and files
|
||||
const sendFormData = new FormData();
|
||||
sendFormData.append('permohonan_id', permohonanId);
|
||||
sendFormData.append('document_id', documentId);
|
||||
sendFormData.append('inspeksi_id', inspeksiId);
|
||||
sendFormData.append('memo', JSON.stringify(jsonData));
|
||||
|
||||
// Append all files from Dropzone
|
||||
myDropzone.getAcceptedFiles().forEach((file, index) => {
|
||||
sendFormData.append(`foto_${index}`, file);
|
||||
});
|
||||
|
||||
const requestUrl = `{{ route('penilai.storeMemoWithPhotos') }}`;
|
||||
|
||||
$.ajax({
|
||||
url: requestUrl,
|
||||
type: 'POST',
|
||||
data: sendFormData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
},
|
||||
success: function(response) {
|
||||
hideLoadingSwal();
|
||||
if (response.success) {
|
||||
Swal.fire({
|
||||
title: 'Berhasil!',
|
||||
text: response.message,
|
||||
icon: 'success',
|
||||
confirmButtonText: 'OK'
|
||||
}).then((response) => {
|
||||
if (response.isConfirmed) {
|
||||
// window.location.reload();
|
||||
if (myDropzone) {
|
||||
let mockFile = {
|
||||
name: photoPath.split('/').pop(),
|
||||
size: 12345
|
||||
};
|
||||
myDropzone.emit("addedfile", mockFile);
|
||||
myDropzone.emit("thumbnail", mockFile, photoPath);
|
||||
myDropzone.emit("complete", mockFile);
|
||||
mockFile.previewElement.classList.add("dz-success");
|
||||
mockFile.previewElement.classList.add("dz-complete");
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
console.error('Existing photos is not an array:', existingPhotos);
|
||||
}
|
||||
@endif
|
||||
}
|
||||
|
||||
function handleDeletePhoto(photoPath, photoDiv) {
|
||||
const BASE_URL = "{{ asset('storage/') }}";
|
||||
Swal.fire({
|
||||
title: 'Hapus Foto?',
|
||||
text: "Foto ini akan dihapus secara permanen!",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Ya, hapus!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: "{{ route('penilai.deleteTempPhoto') }}",
|
||||
method: 'DELETE',
|
||||
data: {
|
||||
path: photoPath,
|
||||
permohonan_id: {{ $permohonan->id ?? 0 }},
|
||||
dokument_id: '{{ request('documentId') ?? '' }}',
|
||||
},
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
},
|
||||
success: function() {
|
||||
Swal.fire('Dihapus!', 'Foto berhasil dihapus.', 'success');
|
||||
photoDiv.remove();
|
||||
},
|
||||
error: function() {
|
||||
Swal.fire('Gagal!', 'Foto gagal dihapus.', 'error');
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
function saveMemo() {
|
||||
const form = document.getElementById('form-memo');
|
||||
const formData = new FormData(form);
|
||||
|
||||
const jsonData = {
|
||||
kepada: formData.get('kepada'),
|
||||
dari: formData.get('dari'),
|
||||
nomor_memo: formData.get('nomor_memo'),
|
||||
tanggal: formData.get('tanggal'),
|
||||
perihal: formData.get('perihal'),
|
||||
jenis_asset_tidak_sesuai: formData.get('jenis_asset_tidak_sesuai'),
|
||||
lokasi: {
|
||||
lokasi: formData.get('lokasi') || '',
|
||||
address: formData.get('address') || '',
|
||||
province_code: formData.get('province_code') || '',
|
||||
city_code: formData.get('city_code') || '',
|
||||
district_code: formData.get('district_code') || '',
|
||||
village_code: formData.get('village_code') || '',
|
||||
tanggal_survey: formData.get('tanggal_survey') || '',
|
||||
penilai: formData.get('penilai') || '',
|
||||
},
|
||||
terlampir: (formData.getAll('terlampir[]') || []),
|
||||
hasil_survey: (formData.getAll('hasil_survey[]') || []),
|
||||
kesimpulan_saran: (formData.getAll('kesimpulan_saran[]') || []),
|
||||
};
|
||||
|
||||
showLoadingSwal('Mengirim data ke server...');
|
||||
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const permohonanId = urlParams.get('permohonanId');
|
||||
const documentId = urlParams.get('documentId');
|
||||
|
||||
// Create a new FormData object to send both JSON and files
|
||||
const sendFormData = new FormData();
|
||||
sendFormData.append('permohonan_id', permohonanId);
|
||||
sendFormData.append('document_id', documentId);
|
||||
sendFormData.append('memo', JSON.stringify(jsonData));
|
||||
|
||||
const requestUrl = `{{ route('penilai.storeMemoWithPhotos') }}`;
|
||||
|
||||
$.ajax({
|
||||
url: requestUrl,
|
||||
type: 'POST',
|
||||
data: sendFormData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
},
|
||||
success: function(response) {
|
||||
hideLoadingSwal();
|
||||
if (response.success) {
|
||||
Swal.fire({
|
||||
title: 'Berhasil!',
|
||||
text: response.message,
|
||||
icon: 'success',
|
||||
confirmButtonText: 'OK'
|
||||
}).then((response) => {
|
||||
if (response.isConfirmed) {
|
||||
window.location.reload();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
Swal.fire({
|
||||
title: 'Error!',
|
||||
text: response.message || 'Terjadi kesalahan',
|
||||
icon: 'error',
|
||||
confirmButtonText: 'OK'
|
||||
});
|
||||
}
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
hideLoadingSwal();
|
||||
Swal.fire({
|
||||
title: 'Error!',
|
||||
text: response.message || 'Terjadi kesalahan',
|
||||
text: 'Terjadi kesalahan saat mengirim data',
|
||||
icon: 'error',
|
||||
confirmButtonText: 'OK'
|
||||
});
|
||||
}
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
hideLoadingSwal();
|
||||
Swal.fire({
|
||||
title: 'Error!',
|
||||
text: 'Terjadi kesalahan saat mengirim data',
|
||||
icon: 'error',
|
||||
confirmButtonText: 'OK'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
@@ -66,9 +66,9 @@
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
Menindak lanjuti permintann penilaian jaminan dari {{ $permohonan->user->name }} AO Cabang
|
||||
Menindak lanjuti permintan penilaian jaminan dari {{ $permohonan->user->name }} AO Cabang
|
||||
{{ $permohonan->debiture->branch->name ?? '' }}
|
||||
tanggal {{ formatTanggalIndonesia($memo['tanggal']) ?? '' }}, dapat di sampaikan sebagai berikut:
|
||||
tanggal {{ formatTanggalIndonesia($permohonan->created_at) ?? '' }}, dapat di sampaikan sebagai berikut:
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -139,7 +139,7 @@
|
||||
<td style="width: 25%; padding: 2px;">Tanggal Kunjungan</td>
|
||||
<td style="width: 1%; padding: 2px;">:</td>
|
||||
<td style="width: 79%; padding: 2px;">
|
||||
{{ formatTanggalIndonesia($permohonan->penilaian->tanggal_kunjungan) }}</td>
|
||||
{{ formatTanggalIndonesia($permohonan->penilaian->updated_at) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 25%; padding: 2px;">Surveyor</td>
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
$data = '';
|
||||
foreach ($permohonan->documents as $dokumen) {
|
||||
$data .= $dokumen->jenisJaminan->name . ', ';
|
||||
$jenisAset = $dokumen->jenisJaminan->name;
|
||||
}
|
||||
$data = rtrim($data, ', ');
|
||||
@endphp
|
||||
@@ -204,17 +205,16 @@
|
||||
<tr>
|
||||
@php
|
||||
|
||||
$cekHub =
|
||||
isset($forminspeksi['asset']['hub_cadeb']) &&
|
||||
$forminspeksi['asset']['hub_cadeb'] === 'sesuai'
|
||||
? 'sesuai'
|
||||
: 'tidak sesuai';
|
||||
$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=" padding: 2px; vertical-align: top;">Hubungan Pemilik Jaminan dengan Debitu</td>
|
||||
$hubCadeb = $cekHub === 'sesuai'
|
||||
? ($forminspeksi['asset']['hub_cadeb']['sesuai'] ?? null)
|
||||
: ($forminspeksi['asset']['hub_cadeb']['tidak sesuai'] ?? null);
|
||||
@endphp
|
||||
<td style=" padding: 2px; vertical-align: top;">Hubungan Pemilik Jaminan dengan Debitur</td>
|
||||
<td style=" padding: 2px; vertical-align: top;">:</td>
|
||||
<td style=" padding: 2px; vertical-align: top;">{{ $hubCadeb ?? '' }}</td>
|
||||
</tr>
|
||||
@@ -270,7 +270,7 @@
|
||||
@endphp
|
||||
<td style="padding: 2px; vertical-align: top;">Luas Tanah</td>
|
||||
<td style="padding: 2px; vertical-align: top;">:</td>
|
||||
<td style="padding: 2px; vertical-align: top;">{{ $luas ?? '' }} <sup>m2</sup></td>
|
||||
<td style="padding: 2px; vertical-align: top;">{{ $luas ?? '' }} <span>m²</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding: 2px; vertical-align: top;">Bentuk Tanah</td>
|
||||
@@ -373,7 +373,7 @@
|
||||
: '-');
|
||||
@endphp
|
||||
|
||||
{{ $output }} <sup>m2</sup>
|
||||
{{ $output }} <span>m²</span>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
@@ -482,15 +482,15 @@
|
||||
<table>
|
||||
<tr>
|
||||
@php
|
||||
$cekLuas = isset($forminspeksi['luas_unit']['tidak sesuai'])
|
||||
? 'tidak sesuai'
|
||||
: 'sesuai';
|
||||
$cekLuas = isset($forminspeksi['luas_unit']['tidak sesuai'])
|
||||
? 'tidak sesuai'
|
||||
: 'sesuai';
|
||||
|
||||
$luas = $forminspeksi['luas_unit'][$cekLuas] ?? null;
|
||||
@endphp
|
||||
$luas = $forminspeksi['luas_unit'][$cekLuas] ?? null;
|
||||
@endphp
|
||||
<td style="padding: 2px; vertical-align: top;">Luas Unit</td>
|
||||
<td style="padding: 2px; vertical-align: top;">:</td>
|
||||
<td style="padding: 2px; vertical-align: top;">{{ $luas ?? '' }}</td>
|
||||
<td style="padding: 2px; vertical-align: top;">{{ $luas ?? '' }} m<sup>2</sup> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding: 2px; vertical-align: top;">Bentuk Unit</td>
|
||||
@@ -723,13 +723,17 @@
|
||||
$labelNilai = [
|
||||
'bangunan' => 'Luas Bangunan',
|
||||
'tanah' => 'Luas Tanah',
|
||||
'apartement-kantor' => 'Luas Apartemen/Kantor',
|
||||
'apartemen-kantor' => 'Luas Unit',
|
||||
'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]))
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
$dokument = null;
|
||||
foreach ($permohonan->documents as $dokumen) {
|
||||
$data .= $dokumen->jenisJaminan->name . ', ';
|
||||
$jenisAset = $dokumen->jenisJaminan->name;
|
||||
$dokument = $dokumen;
|
||||
}
|
||||
$data = rtrim($data, ', ');
|
||||
@@ -184,9 +185,10 @@
|
||||
? 'sesuai'
|
||||
: 'tidak sesuai';
|
||||
|
||||
$hubCadeb = isset($forminspeksi['asset']['hub_cadeb'][$cekHub])
|
||||
? $forminspeksi['asset']['hub_cadeb']['tidak sesuai']
|
||||
: $forminspeksi['asset']['hub_cadeb']['sesuai'];
|
||||
|
||||
$hubCadeb = $cekHub === 'sesuai'
|
||||
? ($forminspeksi['asset']['hub_cadeb']['sesuai'] ?? null)
|
||||
: ($forminspeksi['asset']['hub_cadeb']['tidak sesuai'] ?? null);
|
||||
@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>
|
||||
@@ -202,8 +204,8 @@
|
||||
: 'tidak sesuai';
|
||||
|
||||
$hubCadeb = isset($forminspeksi['asset']['hub_cadeb_penghuni'][$cekHub])
|
||||
? $forminspeksi['asset']['hub_cadeb_penghuni']['tidak sesuai']
|
||||
: $forminspeksi['asset']['hub_cadeb_penghuni']['sesuai'];
|
||||
? ($forminspeksi['asset']['hub_cadeb_penghuni']['tidak sesuai'] ?? null)
|
||||
: ($forminspeksi['asset']['hub_cadeb_penghuni']['sesuai'] ?? null);
|
||||
@endphp
|
||||
<td style=" padding: 2px; vertical-align: top;">Hubungan Penghuni Jaminan dengan Debitur</td>
|
||||
<td style=" padding: 2px; vertical-align: top;">:</td>
|
||||
@@ -261,7 +263,7 @@
|
||||
$labelNilai = [
|
||||
'bangunan' => 'Luas Bangunan',
|
||||
'tanah' => 'Luas Tanah',
|
||||
'apartement-kantor' => 'Luas Apartemen/Kantor',
|
||||
'apartemen-kantor' => 'Luas Unit',
|
||||
'alat-berat' => 'Luas Alat Berat',
|
||||
'mesin' => 'Luas Mesin',
|
||||
'kendaraan' => 'Luas Kendaraan',
|
||||
@@ -269,10 +271,10 @@
|
||||
'kapal' => 'Luas Kapal',
|
||||
];
|
||||
|
||||
// if (strcasecmp($jenisAset, 'RUKO/RUKAN') === 0) {
|
||||
// $labelNilai['bangunan'] = 'Luas Unit';
|
||||
// unset($labelNilai['tanah']);
|
||||
// }
|
||||
if (strcasecmp($jenisAset, 'RUKO/RUKAN') === 0) {
|
||||
$labelNilai['bangunan'] = 'Luas Unit';
|
||||
unset($labelNilai['tanah']);
|
||||
}
|
||||
|
||||
@endphp
|
||||
@foreach ($labelNilai as $key => $label)
|
||||
|
||||
@@ -40,10 +40,10 @@
|
||||
@if ($key == 'luas_tanah' || $key == 'luas_bangunan')
|
||||
{{ $data[$key] ?? '-' }} m²
|
||||
@elseif($key == 'harga' || $key == 'total')
|
||||
{{ formatRupiah($data[$key]) ?? 0 }}
|
||||
{{ isset($data[$key]) ? formatRupiah($data[$key]) : 0 }}
|
||||
|
||||
@elseif($key == 'tanggal')
|
||||
{{ formatTanggalIndonesia($data[$key]) ?? '-' }}
|
||||
{{ isset($data[$key]) ? formatTanggalIndonesia($data[$key]) : '-' }}
|
||||
@elseif($key == 'telepon')
|
||||
{{ isset($data['telepon']) ? ubahNomorHp($data['telepon']) : '-' }}
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
@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">
|
||||
href="{{ route('penilai.lampiran') }}?permohonanId={{ request('permohonanId') }}&documentId={{ request('documentId') }}&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"
|
||||
@@ -85,7 +85,7 @@
|
||||
<i class="ki-filled ki-printer"></i> Cetak Hasil Inspeksi
|
||||
</a>
|
||||
<a class="btn btn-success"
|
||||
onclick="checkLaporan('{{ $permohonan->id }}', '{{ request('documentId') }}', '{{ request('inspeksiId') }}', {{ request('jaminanId') }}, )">
|
||||
onclick="checkLaporan('{{ $permohonan->id }}', '{{ request('documentId') }}', {{ request('jaminanId') }}, )">
|
||||
<i class="ki-filled ki-printer"></i> Cetak Laporan
|
||||
</a>
|
||||
@endif
|
||||
@@ -228,9 +228,9 @@
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const permohonanId = {{ $permohonan->id }};
|
||||
const documentId = urlParams.get('documentId');
|
||||
const inspeksiId = urlParams.get('inspeksiId');
|
||||
|
||||
const requestUrl =
|
||||
`{{ route('penilai.storeRap') }}?permohonanId=${permohonanId}&inspeksiId=${inspeksiId}&documentId=${documentId}`;
|
||||
`{{ route('penilai.storeRap') }}?permohonanId=${permohonanId}&documentId=${documentId}`;
|
||||
$.ajax({
|
||||
url: requestUrl,
|
||||
type: 'POST',
|
||||
|
||||
@@ -431,7 +431,7 @@
|
||||
|
||||
@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">
|
||||
href="{{ route('penilai.lampiran') }}?permohonanId={{ request('permohonanId') }}&documentId={{ request('documentId') }}&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')]) }}"
|
||||
@@ -439,7 +439,7 @@
|
||||
<i class="ki-filled ki-printer"></i>Cetak Hasil Inspeksi
|
||||
</a>
|
||||
<a class="btn btn-success"
|
||||
onclick="checkLaporan('{{ $permohonan->id }}', '{{ request('documentId') }}', '{{ request('inspeksiId') }}', {{ request('jaminanId') }}, )">
|
||||
onclick="checkLaporan('{{ $permohonan->id }}', '{{ request('documentId') }}', {{ request('jaminanId') }}, )">
|
||||
<i class="ki-filled ki-printer"></i> Cetak Laporan
|
||||
</a>
|
||||
@endif
|
||||
@@ -551,7 +551,6 @@
|
||||
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 !== '');
|
||||
@@ -580,7 +579,6 @@
|
||||
data: JSON.stringify({
|
||||
permohonan_id: permohonanId,
|
||||
dokument_id: documentId,
|
||||
inspeksi_id: inspeksiId,
|
||||
resume: jsonData,
|
||||
fakta_positif: faktaPositif,
|
||||
fakta_negatif: faktaNegatif,
|
||||
|
||||
@@ -237,7 +237,7 @@
|
||||
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' || data
|
||||
.status === 'revisi-paparan' || data.status === 'unfreeze-sla') {
|
||||
.status === 'revisi-paparan' || data.status === 'unfreeze-sla' || data.status === 'reject-freeze') {
|
||||
return `
|
||||
<div class="flex flex-nowrap justify-center gap-1.5">
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-info" href="penilai/${data.id}/show">
|
||||
@@ -250,15 +250,20 @@
|
||||
<i class="ki-filled ki-arrow-circle-right"></i>
|
||||
</button>
|
||||
</div>`;
|
||||
} else if (data.status === 'freeze' || data.status === 'request-freeze') {
|
||||
} else if (data.status === 'request-freeze') {
|
||||
return `
|
||||
<div class="flex flex-nowrap justify-center">
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-warning" onclick="showLoadingSwal('Masih dalam proses pengajuan freeze...')">
|
||||
<i class="ki-filled ki-watch"></i>
|
||||
</a>
|
||||
</div>`;
|
||||
} else
|
||||
{
|
||||
}else if(data.status === 'freeze'){
|
||||
return ` <div class="flex flex-nowrap justify-center gap-1.5">
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-info" href="penilai/${data.id}/show">
|
||||
<i class="ki-outline ki-eye"></i>
|
||||
</a>
|
||||
</div>`
|
||||
} else{
|
||||
return `<div class="flex flex-nowrap justify-center">
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-success" onclick="showLoadingSwal('Masih Menunggu proses ...')">
|
||||
<i class="ki-filled ki-watch"></i>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
@section('content')
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
@if (Auth::user()->hasAnyRole(['senior-officer']))
|
||||
@if (Auth::user()->hasAnyRole(['senior-officer', 'administrator','DD Appraisal', 'EO Appraisal']) && Request::is('penilai/lampiran'))
|
||||
@include('lpj::component.detail-jaminan', [
|
||||
'backLink' => 'otorisator.view-laporan',
|
||||
'queryParams' => [
|
||||
|
||||
@@ -211,10 +211,6 @@
|
||||
|
||||
</div>
|
||||
@php
|
||||
$inspeksiId = null;
|
||||
foreach ($dokumen->inspeksi as $item) {
|
||||
$inspeksiId = $item->id;
|
||||
}
|
||||
|
||||
$jaminanId = $dokumen->id;
|
||||
$currentInspeksi = $inspeksiData[$jaminanId] ?? null;
|
||||
@@ -224,16 +220,17 @@
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full card-footer mt-2 ">
|
||||
<div class="flex gap-5">
|
||||
<a class="btn btn-primary"
|
||||
href="{{ route('penilai.lampiran') }}?permohonanId={{ $permohonan->id }}&documentId={{ $dokumen->id }}&inspeksiId={{ $inspeksiId }}&jaminanId={{ $dokumen->jenis_jaminan_id }}">
|
||||
href="{{ route('penilai.lampiran') }}?permohonanId={{ $permohonan->id }}&documentId={{ $dokumen->id }}&jaminanId={{ $dokumen->jenis_jaminan_id }}">
|
||||
Lampiran Foto dan Dokumen
|
||||
</a>
|
||||
@if ($permohonan->status != 'freeze')
|
||||
@if (strtolower($permohonan->tujuanPenilaian->name) != 'rap')
|
||||
<a class="btn btn-primary" data-modal-toggle="#modal_2">
|
||||
Kertas Kerja
|
||||
</a>
|
||||
@endif
|
||||
<a class="btn btn-primary"
|
||||
onclick="paparan({{ $permohonan->id }}, {{ $dokumen->id }}, {{ $inspeksiId }}, {{ $dokumen->jenis_jaminan_id }})">
|
||||
onclick="paparan({{ $permohonan->id }}, {{ $dokumen->id }}, {{ $dokumen->jenis_jaminan_id }})">
|
||||
Paparan
|
||||
</a>
|
||||
|
||||
@@ -248,7 +245,7 @@
|
||||
@if (strtolower($permohonan->tujuanPenilaian->name) == 'rap')
|
||||
<div class="menu-item">
|
||||
<a class="menu-link"
|
||||
onclick="rap('{{ $permohonan->id }}', '{{ $dokumen->id }}', '{{ $inspeksiId }}', {{ $dokumen->jenis_jaminan_id }})">
|
||||
onclick="rap('{{ $permohonan->id }}', '{{ $dokumen->id }}', {{ $dokumen->jenis_jaminan_id }})">
|
||||
<span class="menu-icon">
|
||||
<i class="ki-outline ki-message-programming">
|
||||
</i>
|
||||
@@ -264,7 +261,7 @@
|
||||
{{-- existing di --}}
|
||||
<div class="menu-item">
|
||||
<a class="menu-link"
|
||||
onclick="memo('{{ $permohonan->id }}', '{{ $dokumen->id }}', '{{ $inspeksiId }}', {{ $dokumen->jenis_jaminan_id }})">
|
||||
onclick="memo('{{ $permohonan->id }}', '{{ $dokumen->id }}', {{ $dokumen->jenis_jaminan_id }})">
|
||||
<span class="menu-icon">
|
||||
<i class="ki-outline ki-badge">
|
||||
</i>
|
||||
@@ -278,7 +275,7 @@
|
||||
@if ($permohonan->status_bayar === 'belum_bayar')
|
||||
<div class="menu-item">
|
||||
<a class="menu-link"
|
||||
onclick="resume('{{ $permohonan->id }}', '{{ $dokumen->id }}', '{{ $inspeksiId }}', {{ $dokumen->jenis_jaminan_id }})">
|
||||
onclick="resume('{{ $permohonan->id }}', '{{ $dokumen->id }}', {{ $dokumen->jenis_jaminan_id }})">
|
||||
<span class="menu-icon">
|
||||
<i class="ki-outline ki-profile-circle">
|
||||
</i>
|
||||
@@ -294,7 +291,7 @@
|
||||
|
||||
<div class="menu-item">
|
||||
<a class="menu-link"
|
||||
onclick="seletSederhanaStandart('{{ $permohonan->id }}', '{{ $dokumen->id }}', '{{ $inspeksiId }}', {{ $dokumen->jenis_jaminan_id }}, '{{ $permohonan->jenisFasilitasKredit->name }}', '{{ $permohonan->status_bayar }}')">
|
||||
onclick="seletSederhanaStandart('{{ $permohonan->id }}', '{{ $dokumen->id }}', {{ $dokumen->jenis_jaminan_id }}, '{{ $permohonan->jenisFasilitasKredit->name }}', '{{ $permohonan->status_bayar }}')">
|
||||
<span class="menu-icon">
|
||||
<i class="ki-outline ki-setting-2"></i>
|
||||
</span>
|
||||
@@ -304,7 +301,7 @@
|
||||
@endif
|
||||
<div class="menu-item">
|
||||
<a class="menu-link"
|
||||
onclick="callReport('{{ $permohonan->id }}', '{{ $dokumen->id }}', '{{ $inspeksiId }}', {{ $dokumen->jenis_jaminan_id }})">
|
||||
onclick="callReport('{{ $permohonan->id }}', '{{ $dokumen->id }}', {{ $dokumen->jenis_jaminan_id }})">
|
||||
<span class="menu-icon">
|
||||
<i class="ki-outline ki-profile-circle">
|
||||
</i>
|
||||
@@ -362,6 +359,7 @@
|
||||
</div>
|
||||
@endif
|
||||
@endif
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end gap-5">
|
||||
@@ -372,13 +370,13 @@
|
||||
</a>
|
||||
|
||||
<a class="btn btn-outline btn-info "
|
||||
onclick="checkLaporan('{{ $permohonan->id }}', '{{ $dokumen->id }}', '{{ $inspeksiId }}', {{ $dokumen->jenis_jaminan_id }}, 1 )">
|
||||
onclick="checkLaporan('{{ $permohonan->id }}', '{{ $dokumen->id }}', {{ $dokumen->jenis_jaminan_id }}, 1 )">
|
||||
<i class="ki-filled ki-eye"></i>
|
||||
Lihat Laporan
|
||||
</a>
|
||||
|
||||
<a class="btn btn-success"
|
||||
onclick="checkLaporan('{{ $permohonan->id }}', '{{ $dokumen->id }}', '{{ $inspeksiId }}', {{ $dokumen->jenis_jaminan_id }}, 0 )">
|
||||
onclick="checkLaporan('{{ $permohonan->id }}', '{{ $dokumen->id }}', {{ $dokumen->jenis_jaminan_id }}, 0 )">
|
||||
<i class="ki-filled ki-printer"></i>
|
||||
Cetak Laporan
|
||||
</a>
|
||||
@@ -386,6 +384,7 @@
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@if ($permohonan->status != 'freeze')
|
||||
<div class="flex justify-start gap-5">
|
||||
<a class="btn btn-success" onclick="savePenilai()">
|
||||
<i class="ki-filled ki-paper-plane"></i>
|
||||
@@ -399,6 +398,7 @@
|
||||
REVISI
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
</div>
|
||||
@@ -420,7 +420,7 @@
|
||||
<div class="modal-body grid gap-5">
|
||||
@php
|
||||
$jenisJaminanId = null;
|
||||
$inspeksiId = null;
|
||||
|
||||
$documentId = null;
|
||||
$firstDocument = $permohonan->documents->first(); // Ambil dokumen pertama
|
||||
|
||||
@@ -428,9 +428,7 @@
|
||||
$documentId = $firstDocument->id;
|
||||
|
||||
// Ambil ID inspeksi pertama (jika ada)
|
||||
if ($firstDocument->inspeksi->isNotEmpty()) {
|
||||
$inspeksiId = $firstDocument->inspeksi->first()->id;
|
||||
}
|
||||
|
||||
|
||||
// Ambil jenis jaminan jika ada
|
||||
if ($firstDocument->jenisjaminan) {
|
||||
@@ -438,7 +436,7 @@
|
||||
}
|
||||
} else {
|
||||
$documentId = 'Tidak ada dokumen';
|
||||
$inspeksiId = 'Tidak ada inspeksi';
|
||||
|
||||
$jenisJaminanId = 'Tidak ada jenis jaminan';
|
||||
}
|
||||
|
||||
@@ -449,7 +447,7 @@
|
||||
<div class="flex justify-center items-center gap-2">
|
||||
<input type="file" id="kertas_kerja" class="file-input">
|
||||
<button type="button" class="btn btn-outline btn-success"
|
||||
onclick="uploadKertasKerja({{ $permohonan->id }}, '{{ $documentId }}', '{{ $inspeksiId }}', '{{ $jenisJaminanId }}')">Upload
|
||||
onclick="uploadKertasKerja({{ $permohonan->id }}, '{{ $documentId }}', '{{ $jenisJaminanId }}')">Upload
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -472,7 +470,7 @@
|
||||
@include('lpj::component.pdfviewer')
|
||||
|
||||
<script>
|
||||
function seletSederhanaStandart(permohonanId, documentId, inspeksiId, jaminanId, fasilitasKredit, statusBayar) {
|
||||
function seletSederhanaStandart(permohonanId, documentId, jaminanId, fasilitasKredit, statusBayar) {
|
||||
if (statusBayar === 'belum_bayar') {
|
||||
Swal.fire({
|
||||
title: 'Jenis LPJ Ditentukan',
|
||||
@@ -481,12 +479,12 @@
|
||||
confirmButtonText: 'Lanjutkan',
|
||||
confirmButtonColor: '#3085d6',
|
||||
}).then(() => {
|
||||
resume(permohonanId, documentId, inspeksiId, jaminanId)
|
||||
resume(permohonanId, documentId, jaminanId)
|
||||
});
|
||||
|
||||
} else {
|
||||
fetch(
|
||||
`{{ url('/penilai/check-status-lpj') }}?permohonanId=${permohonanId}&documentId=${documentId}&inspeksiId=${inspeksiId}`
|
||||
`{{ url('/penilai/check-status-lpj') }}?permohonanId=${permohonanId}&documentId=${documentId}`
|
||||
)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
@@ -495,11 +493,11 @@
|
||||
if (data.status === 'standar') {
|
||||
showLoadingSwal('Tunggu ...');
|
||||
window.location.href =
|
||||
`{{ route('penilai.standar', $permohonan->id) }}?documentId=${documentId}&inspeksiId=${inspeksiId}&jaminanId=${jaminanId}`;
|
||||
`{{ route('penilai.standar', $permohonan->id) }}?documentId=${documentId}&jaminanId=${jaminanId}`;
|
||||
} else if (data.status === 'sederhana') {
|
||||
showLoadingSwal('Tunggu ...');
|
||||
window.location.href =
|
||||
`{{ route('penilai.sederhana', $permohonan->id) }}?documentId=${documentId}&inspeksiId=${inspeksiId}&jaminanId=${jaminanId}`;
|
||||
`{{ route('penilai.sederhana', $permohonan->id) }}?documentId=${documentId}&jaminanId=${jaminanId}`;
|
||||
}
|
||||
} else {
|
||||
if (fasilitasKredit.toUpperCase() === 'KPR KERJASAMA') {
|
||||
@@ -510,7 +508,7 @@
|
||||
confirmButtonText: 'Lanjutkan',
|
||||
confirmButtonColor: '#3085d6',
|
||||
}).then(() => {
|
||||
saveStatusLpj(permohonanId, documentId, inspeksiId, 'sederhana', jaminanId);
|
||||
saveStatusLpj(permohonanId, documentId, 'sederhana', jaminanId);
|
||||
});
|
||||
} else {
|
||||
Swal.fire({
|
||||
@@ -525,10 +523,10 @@
|
||||
denyButtonColor: '#d33',
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
saveStatusLpj(permohonanId, documentId, inspeksiId, 'standar',
|
||||
saveStatusLpj(permohonanId, documentId, 'standar',
|
||||
jaminanId);
|
||||
} else if (result.isDenied) {
|
||||
saveStatusLpj(permohonanId, documentId, inspeksiId, 'sederhana',
|
||||
saveStatusLpj(permohonanId, documentId, 'sederhana',
|
||||
jaminanId);
|
||||
}
|
||||
});
|
||||
@@ -541,7 +539,7 @@
|
||||
|
||||
}
|
||||
|
||||
function saveStatusLpj(permohonanId, documentId, inspeksiId, type, jaminanId) {
|
||||
function saveStatusLpj(permohonanId, documentId, type, jaminanId) {
|
||||
fetch(`{{ url('/penilai/save-status-lpj') }}`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
@@ -551,7 +549,6 @@
|
||||
body: JSON.stringify({
|
||||
permohonan_id: permohonanId,
|
||||
document_id: documentId,
|
||||
inspeksi_id: inspeksiId,
|
||||
type: type,
|
||||
}),
|
||||
}).then(response => response.json())
|
||||
@@ -559,17 +556,17 @@
|
||||
if (data.success) {
|
||||
if (type === 'standar') {
|
||||
window.location.href =
|
||||
`{{ route('penilai.standar', $permohonan->id) }}?documentId=${documentId}&inspeksiId=${inspeksiId}&jaminanId=${jaminanId}`;
|
||||
`{{ route('penilai.standar', $permohonan->id) }}?documentId=${documentId}&jaminanId=${jaminanId}`;
|
||||
} else if (type === 'sederhana') {
|
||||
window.location.href =
|
||||
`{{ route('penilai.sederhana', $permohonan->id) }}?documentId=${documentId}&inspeksiId=${inspeksiId}&jaminanId=${jaminanId}`;
|
||||
`{{ route('penilai.sederhana', $permohonan->id) }}?documentId=${documentId}&jaminanId=${jaminanId}`;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function uploadKertasKerja(permohonanId, documentId, inspeksiId, jaminanId) {
|
||||
function uploadKertasKerja(permohonanId, documentId, jaminanId) {
|
||||
const kertasKerjaInput = document.getElementById('kertas_kerja');
|
||||
if (!kertasKerjaInput.files.length) {
|
||||
Swal.fire({
|
||||
@@ -585,7 +582,6 @@
|
||||
const formData = new FormData();
|
||||
formData.append('permohonan_id', permohonanId);
|
||||
formData.append('document_id', documentId);
|
||||
formData.append('inspeksi_id', inspeksiId);
|
||||
formData.append('jenis_jaminan_id', jaminanId);
|
||||
formData.append('kertas_kerja', kertasKerja);
|
||||
|
||||
@@ -629,26 +625,26 @@
|
||||
});
|
||||
}
|
||||
|
||||
function resume(permohonanId, documentId, inspeksiId, jaminanId) {
|
||||
function resume(permohonanId, documentId, jaminanId) {
|
||||
showLoadingSwal('Tunggu ...');
|
||||
window.location.href =
|
||||
`{{ route('penilai.resume') }}?permohonanId=${permohonanId}&documentId=${documentId}&inspeksiId=${inspeksiId}&jaminanId=${jaminanId}`;
|
||||
`{{ route('penilai.resume') }}?permohonanId=${permohonanId}&documentId=${documentId}&jaminanId=${jaminanId}`;
|
||||
}
|
||||
|
||||
function memo(permohonanId, documentId, inspeksiId, jaminanId) {
|
||||
function memo(permohonanId, documentId, jaminanId) {
|
||||
showLoadingSwal('Tunggu ...');
|
||||
window.location.href =
|
||||
`{{ route('penilai.memo') }}?permohonanId=${permohonanId}&documentId=${documentId}&inspeksiId=${inspeksiId}&jaminanId=${jaminanId}`;
|
||||
`{{ route('penilai.memo') }}?permohonanId=${permohonanId}&documentId=${documentId}&jaminanId=${jaminanId}`;
|
||||
}
|
||||
|
||||
function rap(permohonanId, documentId, inspeksiId, jaminanId) {
|
||||
function rap(permohonanId, documentId, jaminanId) {
|
||||
showLoadingSwal('Tunggu ...');
|
||||
window.location.href =
|
||||
`{{ route('penilai.rap') }}?permohonanId=${permohonanId}&documentId=${documentId}&inspeksiId=${inspeksiId}&jaminanId=${jaminanId}`;
|
||||
`{{ route('penilai.rap') }}?permohonanId=${permohonanId}&documentId=${documentId}&jaminanId=${jaminanId}`;
|
||||
}
|
||||
|
||||
|
||||
function paparan(permohonanId, documentId, inspeksiId, jaminanId) {
|
||||
function paparan(permohonanId, documentId, jaminanId) {
|
||||
Swal.fire({
|
||||
title: 'Apakah Kamu yakin ingin melakukan paparan',
|
||||
icon: 'warning',
|
||||
@@ -659,15 +655,15 @@
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
window.location.href =
|
||||
`/penilai/${permohonanId}/edit?document_id=${documentId}&inspeksi_id=${inspeksiId}&jaminanId=${jaminanId}`;
|
||||
`/penilai/${permohonanId}/edit?document_id=${documentId}&jaminanId=${jaminanId}`;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function callReport(permohonanId, documentId, inspeksiId, jaminanId) {
|
||||
function callReport(permohonanId, documentId, jaminanId) {
|
||||
showLoadingSwal('Tunggu ...');
|
||||
window.location.href =
|
||||
`{{ route('penilai.call-report') }}?permohonanId=${permohonanId}&documentId=${documentId}&inspeksiId=${inspeksiId}&jaminanId=${jaminanId}`;
|
||||
`{{ route('penilai.call-report') }}?permohonanId=${permohonanId}&documentId=${documentId}&jaminanId=${jaminanId}`;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -45,9 +45,9 @@
|
||||
Tim Penilai yang di tunjuk
|
||||
</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input class="input" type="hidden" name="teams_id" value="{{ $regionName->id }}">
|
||||
<input class="input" type="hidden" name="teams_id" value="{{ $regionName->id ?? '' }}">
|
||||
<input class="input @error('teams_id') border-danger bg-danger-light @enderror"
|
||||
type="text" value="{{ $regionName->name }}" readonly>
|
||||
type="text" value="{{ $regionName->name ?? '' }}" readonly>
|
||||
@error('teams_id')
|
||||
<em class="alert text-danger text-sm">{{ $message }}</em>
|
||||
@enderror
|
||||
|
||||
@@ -58,12 +58,6 @@
|
||||
|
||||
|
||||
</div>
|
||||
@php
|
||||
$inspeksiId = null;
|
||||
foreach ($dokumen->inspeksi as $item) {
|
||||
$inspeksiId = $item->id;
|
||||
}
|
||||
@endphp
|
||||
|
||||
|
||||
</div>
|
||||
@@ -153,13 +147,11 @@
|
||||
<div>
|
||||
<div class="flex gap-2.5">
|
||||
@php
|
||||
$inspeksiId = null;
|
||||
|
||||
$documentId = null;
|
||||
$jenisJaminanId = null;
|
||||
foreach ($permohonan->documents as $item) {
|
||||
foreach ($item->inspeksi as $key => $value) {
|
||||
$inspeksiId = $value->id;
|
||||
}
|
||||
|
||||
$documentId = $item->id;
|
||||
$jenisJaminanId = $item->jenis_jaminan_id;
|
||||
}
|
||||
@@ -167,10 +159,10 @@
|
||||
|
||||
@if ($dataHeader == 'pelaporan')
|
||||
<a class="btn btn-success"
|
||||
href="{{ route('otorisator.view-laporan') }}?permohonanId={{ $permohonan->id }}&documentId={{ $documentId }}&inspeksiId={{ $inspeksiId }}&jaminanId={{ $jenisJaminanId }}&statusLpj={{ true }}">
|
||||
href="{{ route('otorisator.view-laporan') }}?permohonanId={{ $permohonan->id }}&documentId={{ $documentId }}&jaminanId={{ $jenisJaminanId }}&statusLpj={{ true }}">
|
||||
Lihat Laporan
|
||||
</a>
|
||||
@if (Auth::user()->hasAnyRole(['administrator', 'senior-officer']) && $permohonan->approval_so == null)
|
||||
@if (Auth::user()->hasAnyRole(['administrator', 'senior-officer']) && $permohonan->approval_so == 0)
|
||||
<button onclick="otorisatorData({{ $permohonan->id }})" type="button" class="btn btn-primary">
|
||||
<i class="ki-filled ki-double-check"></i>
|
||||
Otorisator {{ $header ?? '' }}
|
||||
@@ -179,8 +171,8 @@
|
||||
|
||||
@if (Auth::user()->hasAnyRole(['administrator', 'EO Appraisal']) &&
|
||||
$permohonan->approval_so &&
|
||||
$permohonan->approval_eo == null &&
|
||||
in_array($permohonan->nilai_plafond_id, [1, 2]))
|
||||
$permohonan->approval_eo == 0 &&
|
||||
in_array($permohonan->nilai_plafond_id, [1, 2, 4]))
|
||||
<button onclick="otorisatorData({{ $permohonan->id }})" type="button" class="btn btn-primary">
|
||||
<i class="ki-filled ki-double-check"></i>
|
||||
Otorisator {{ $header ?? '' }}
|
||||
@@ -189,8 +181,8 @@
|
||||
|
||||
@if (Auth::user()->hasAnyRole(['administrator', 'DD Appraisal']) &&
|
||||
$permohonan->approval_eo &&
|
||||
$permohonan->approval_dd == null &&
|
||||
in_array($permohonan->nilai_plafond_id, [1, 2, 4]))
|
||||
$permohonan->approval_dd == 0 &&
|
||||
in_array($permohonan->nilai_plafond_id, [4]))
|
||||
<button onclick="otorisatorData({{ $permohonan->id }})" type="button" class="btn btn-primary">
|
||||
<i class="ki-filled ki-double-check"></i>
|
||||
Otorisator {{ $header ?? '' }}
|
||||
@@ -211,7 +203,7 @@
|
||||
|
||||
|
||||
<a class="btn btn-success"
|
||||
href="{{ route('otorisator.view-laporan') }}?permohonanId={{ $permohonan->id }}&documentId={{ $documentId }}&inspeksiId={{ $inspeksiId }}&jaminanId={{ $jenisJaminanId }}&statusLpj={{ true }}">
|
||||
href="{{ route('otorisator.view-laporan') }}?permohonanId={{ $permohonan->id }}&documentId={{ $documentId }}&jaminanId={{ $jenisJaminanId }}&statusLpj={{ true }}">
|
||||
Lihat resume
|
||||
</a>
|
||||
|
||||
@@ -224,7 +216,7 @@
|
||||
</button>
|
||||
@endif
|
||||
|
||||
@if (Auth::user()->hasAnyRole(['administrator', 'EO Appraisal']) && $authorization->approve_so && $authorization->approve_eo == null)
|
||||
@if (Auth::user()->hasAnyRole(['administrator', 'EO Appraisal']) && $authorization->approve_so && $authorization->approve_eo == null && in_array($permohonan->nilai_plafond_id, [1, 2,4]))
|
||||
<button onclick="otorisatorData({{ $authorization->id }},'EO')" type="button"
|
||||
class="btn btn-primary">
|
||||
<i class="ki-filled ki-double-check"></i>
|
||||
@@ -232,7 +224,7 @@
|
||||
</button>
|
||||
@endif
|
||||
|
||||
@if (Auth::user()->hasAnyRole(['administrator', 'DD Appraisal']) && $authorization->approve_eo && $authorization->approve_dd == null)
|
||||
@if (Auth::user()->hasAnyRole(['administrator', 'DD Appraisal']) && $authorization->approve_eo && $authorization->approve_dd == null && in_array($permohonan->nilai_plafond_id, [4]))
|
||||
<button onclick="otorisatorData({{ $authorization->id }},'DD')" type="button"
|
||||
class="btn btn-primary">
|
||||
<i class="ki-filled ki-double-check"></i>
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
|
||||
|
||||
form.addEventListener('submit', function(event) {
|
||||
if (event.submitter === revisiBtn && keterangan.value.trim() === '') {
|
||||
if (event.submitter === revisiBtn && keterangan.value === '') {
|
||||
event.preventDefault();
|
||||
keteranganMessage.textContent = 'Catatan harus diisi.';
|
||||
} else {
|
||||
|
||||
@@ -57,7 +57,8 @@
|
||||
'nilai_plafond_id' => ['label' => 'Nilai Plafond', 'type' => 'select', 'options' => $plafond],
|
||||
'status_bayar' => ['label' => 'Status Bayar', 'type' => 'select', 'options' => [
|
||||
'sudah_bayar' => 'Sudah Bayar',
|
||||
'belum_bayar' => 'Belum Bayar'
|
||||
'belum_bayar' => 'Belum Bayar',
|
||||
'tidak_bayar' => 'Tidak Bayar'
|
||||
]],
|
||||
'nilai_njop' => ['label' => 'Nilai NJOP', 'type' => 'text'],
|
||||
];
|
||||
@@ -130,8 +131,12 @@
|
||||
const nilaiPlafondValue = nilaiPlafondSelect.value;
|
||||
console.log('Tujuan Penilaian:', tujuanPenilaianValue, 'Nilai Plafond:', nilaiPlafondValue);
|
||||
|
||||
if (tujuanPenilaianValue === '2' && (nilaiPlafondValue === '2' || nilaiPlafondValue === '3')) {
|
||||
statusBayarTomSelect.setValue('sudah_bayar');
|
||||
const hideAndSetTidakBayar = (tujuanPenilaianValue === '2' || tujuanPenilaianValue === '4') &&
|
||||
['1', '2', '3'].includes(nilaiPlafondValue);
|
||||
|
||||
|
||||
if (hideAndSetTidakBayar) {
|
||||
statusBayarTomSelect.setValue('tidak_bayar');
|
||||
statusBayarWrapper.style.display = 'none';
|
||||
} else {
|
||||
@if(isset($permohonan))
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||
|
||||
<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('permohonan.datatables') }}">
|
||||
data-datatable-state-save="false" id="permohonan-table" data-api-url="{{ route('permohonan.datatables') }}">
|
||||
<div class="card-header bg-agi-50 py-5 flex-wrap">
|
||||
<h3 class="card-title">
|
||||
Daftar Permohonan
|
||||
@@ -22,53 +22,55 @@
|
||||
<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>
|
||||
<a class="btn btn-sm btn-primary" href="{{ route('permohonan.create') }}"> Tambah Permohonan </a>
|
||||
@if(auth()->user()->hasAnyRole(['administrator', 'pemohon-ao']))
|
||||
<a class="btn btn-sm btn-primary" href="{{ route('permohonan.create') }}"> Tambah Permohonan </a>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<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">
|
||||
data-datatable-table="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox" />
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nomor_registrasi">
|
||||
<tr>
|
||||
<th class="w-14">
|
||||
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="nomor_registrasi">
|
||||
<span class="sort"> <span class="sort-label"> Nomor Registrasi </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_permohonan">
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tanggal_permohonan">
|
||||
<span class="sort"> <span class="sort-label"> Tanggal Permohonan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="user_id">
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="user_id">
|
||||
<span class="sort"> <span class="sort-label"> User Pemohon </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="branch_id">
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="branch_id">
|
||||
<span class="sort"> <span class="sort-label"> Cabang Pemohon </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="debitur_id">
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="debitur_id">
|
||||
<span class="sort"> <span class="sort-label"> Debitur </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tujuan_penilaian_id">
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="tujuan_penilaian_id">
|
||||
<span class="sort"> <span class="sort-label"> Tujuan Penilaian </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px] text-center" data-datatable-column="status">
|
||||
</th>
|
||||
<th class="min-w-[150px] text-center" data-datatable-column="status">
|
||||
<span class="sort"> <span class="sort-label"> Status </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="keterangan">
|
||||
</th>
|
||||
<th class="min-w-[150px]" data-datatable-column="keterangan">
|
||||
<span class="sort"> <span class="sort-label"> Keterangan </span>
|
||||
<span class="sort-icon"> </span> </span>
|
||||
</th>
|
||||
<th class="min-w-[50px] text-right" data-datatable-column="actions">Action</th>
|
||||
</tr>
|
||||
</th>
|
||||
<th class="min-w-[50px] text-right" data-datatable-column="actions">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
@@ -90,6 +92,10 @@
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
const userRoles = @json(auth()->user()->roles->pluck('name'));
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
function deleteData(data, noReg, debitur) {
|
||||
Swal.fire({
|
||||
@@ -198,11 +204,11 @@
|
||||
},
|
||||
keterangan: {
|
||||
title: 'Keterangan',
|
||||
render : (item, data) => {
|
||||
render: (item, data) => {
|
||||
|
||||
let keterangan = data.keterangan ?? ""
|
||||
if(data.registrasi_catatan){
|
||||
if(keterangan) keterangan += "\n";
|
||||
if (data.registrasi_catatan) {
|
||||
if (keterangan) keterangan += "\n";
|
||||
keterangan += data.registrasi_catatan;
|
||||
}
|
||||
|
||||
@@ -213,6 +219,7 @@
|
||||
title: 'Actions',
|
||||
render: (item, data) => {
|
||||
let actionHtml = `<div class="flex flex-nowrap justify-end gap-1.5">`;
|
||||
const hasRole = (roles) => roles.some(role => userRoles.includes(role));
|
||||
|
||||
if (data.status === 'proses-survey' || data.status == 'rejected-reschedule') {
|
||||
actionHtml += `
|
||||
@@ -255,16 +262,17 @@ title="Approve Jadwal Kunjungan No Reg ${data.nomor_registrasi}"
|
||||
`;
|
||||
}
|
||||
|
||||
actionHtml += `
|
||||
if (data.status !== 'done' && data.status !== 'batal' && hasRole(['administrator', 'pemohon-ao'])) {
|
||||
actionHtml += `
|
||||
<a class="btn btn-sm btn-outline btn-info" href="permohonan/${data.id}/edit" title="Edit Permohonan">
|
||||
<i class="ki-outline ki-notepad-edit"></i>
|
||||
</a>`;
|
||||
if (data.status !== 'batal') {
|
||||
}
|
||||
if (data.status === 'order' && hasRole(['administrator', 'pemohon-ao'])) {
|
||||
actionHtml += `
|
||||
<a onclick="deleteData(${data.id}, '${data.nomor_registrasi}','${data.debiture?.name}')" class="delete btn btn-sm btn-outline btn-danger" title="Batalkan Permohonan">
|
||||
<i class="ki-outline ki-cross-square"></i>
|
||||
</a>`;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -278,7 +286,7 @@ title="Approve Jadwal Kunjungan No Reg ${data.nomor_registrasi}"
|
||||
|
||||
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);
|
||||
|
||||
@@ -323,7 +331,7 @@ title="Approve Jadwal Kunjungan No Reg ${data.nomor_registrasi}"
|
||||
cache: false,
|
||||
data: input_data,
|
||||
dataType: "json",
|
||||
success: function(response) {
|
||||
success: function (response) {
|
||||
console.log(response);
|
||||
if ('success' == response.status) {
|
||||
swal.fire('Sukses Menyetujui!', response.message, 'success').then(
|
||||
@@ -335,7 +343,7 @@ title="Approve Jadwal Kunjungan No Reg ${data.nomor_registrasi}"
|
||||
}
|
||||
|
||||
},
|
||||
error: function(response, textStatus, errorThrown) {
|
||||
error: function (response, textStatus, errorThrown) {
|
||||
// var errors = response.responseJSON.errors;
|
||||
// console.log(errors);
|
||||
console.log(response);
|
||||
@@ -413,7 +421,7 @@ title="Approve Jadwal Kunjungan No Reg ${data.nomor_registrasi}"
|
||||
cache: false,
|
||||
data: data,
|
||||
dataType: "json",
|
||||
success: function(response) {
|
||||
success: function (response) {
|
||||
if (response.status === 'success') {
|
||||
Swal.fire('Sukses Reschedule!', response.message,
|
||||
'success').then(() => {
|
||||
@@ -423,7 +431,7 @@ title="Approve Jadwal Kunjungan No Reg ${data.nomor_registrasi}"
|
||||
Swal.fire('Error!', response.message, 'error');
|
||||
}
|
||||
},
|
||||
error: function(response) {
|
||||
error: function (response) {
|
||||
console.log(response);
|
||||
}
|
||||
});
|
||||
@@ -527,17 +535,17 @@ title="Approve Jadwal Kunjungan No Reg ${data.nomor_registrasi}"
|
||||
cache: false,
|
||||
data: data,
|
||||
dataType: "json",
|
||||
success: function(response) {
|
||||
success: function (response) {
|
||||
if (response.status === 'success') {
|
||||
Swal.fire('Sukses Reschedule!', response.message, 'success').then(
|
||||
() => {
|
||||
location.reload();
|
||||
});
|
||||
() => {
|
||||
location.reload();
|
||||
});
|
||||
} else {
|
||||
Swal.fire('Error!', response.message, 'error');
|
||||
}
|
||||
},
|
||||
error: function(response) {
|
||||
error: function (response) {
|
||||
const errorMessage = response.responseJSON?.message ||
|
||||
'Terjadi kesalahan saat memproses data.';
|
||||
Swal.fire('Error!', errorMessage, 'error');
|
||||
|
||||
@@ -142,7 +142,6 @@
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
<script type="text/javascript">
|
||||
function deleteData(data) {
|
||||
Swal.fire({
|
||||
|
||||
@@ -148,91 +148,91 @@
|
||||
'label' => 'Nomor Lambung',
|
||||
'name' => 'nomor_lambung',
|
||||
'index' => 0,
|
||||
'value' => old('nomor_lambung', $forminspeksi['nomor_lambung']),
|
||||
'value' => old('nomor_lambung', $forminspeksi['nomor_lambung'] ?? ''),
|
||||
],
|
||||
[
|
||||
'label' => 'Model Unit',
|
||||
'name' => 'model_unit',
|
||||
'index' => 1,
|
||||
'value' => old('model_unit', $forminspeksi['model_unit']),
|
||||
'value' => old('model_unit', $forminspeksi['model_unit'] ?? ''),
|
||||
],
|
||||
[
|
||||
'label' => 'Tahun Pembuatan',
|
||||
'name' => 'tahun_pembuatan',
|
||||
'index' => 2,
|
||||
'value' => old('tahun_pembuatan', $forminspeksi['tahun_pembuatan']),
|
||||
'value' => old('tahun_pembuatan', $forminspeksi['tahun_pembuatan'] ?? ''),
|
||||
],
|
||||
[
|
||||
'label' => 'Merk',
|
||||
'name' => 'merk',
|
||||
'index' => 3,
|
||||
'value' => old('merk', $forminspeksi['merk']),
|
||||
'value' => old('merk', $forminspeksi['merk'] ?? ''),
|
||||
],
|
||||
[
|
||||
'label' => 'Negara Pembuat',
|
||||
'name' => 'negara_pembuat',
|
||||
'index' => 4,
|
||||
'value' => old('negara_pembuat', $forminspeksi['negara_pembuat']),
|
||||
'value' => old('negara_pembuat', $forminspeksi['negara_pembuat'] ?? ''),
|
||||
],
|
||||
[
|
||||
'label' => 'Tahun Pembelian',
|
||||
'name' => 'tahun_pembelian',
|
||||
'index' => 5,
|
||||
'value' => old('tahun_pembelian', $forminspeksi['tahun_pembelian']),
|
||||
'value' => old('tahun_pembelian', $forminspeksi['tahun_pembelian'] ?? ''),
|
||||
],
|
||||
[
|
||||
'label' => 'Nomor Faktur/Invoice',
|
||||
'name' => 'nomor_faktur',
|
||||
'index' => 6,
|
||||
'value' => old('nomor_faktur', $forminspeksi['nomor_faktur']),
|
||||
'value' => old('nomor_faktur', $forminspeksi['nomor_faktur'] ?? '' ),
|
||||
],
|
||||
[
|
||||
'label' => 'Nomor Kontrak Pembelian',
|
||||
'name' => 'nomor_kontrak',
|
||||
'index' => 7,
|
||||
'value' => old('nomor_kontrak', $forminspeksi['nomor_kontrak']),
|
||||
'value' => old('nomor_kontrak', $forminspeksi['nomor_kontrak'] ?? ''),
|
||||
],
|
||||
[
|
||||
'label' => 'Nama Pemilik',
|
||||
'name' => 'nama_pemilik',
|
||||
'index' => 8,
|
||||
'value' => old('nama_pemilik', $forminspeksi['nama_pemilik']),
|
||||
'value' => old('nama_pemilik', $forminspeksi['nama_pemilik'] ?? ''),
|
||||
],
|
||||
[
|
||||
'label' => 'Alamaat Pemilik',
|
||||
'name' => 'alamat_pemilik',
|
||||
'index' => 9,
|
||||
'value' => old('alamat_pemilik', $forminspeksi['alamat_pemilik']),
|
||||
'value' => old('alamat_pemilik', $forminspeksi['alamat_pemilik'] ?? ''),
|
||||
],
|
||||
[
|
||||
'label' => 'Nomor Asuransi',
|
||||
'name' => 'nomor_asuransi',
|
||||
'index' => 10,
|
||||
'value' => old('nomor_asuransi', $forminspeksi['nomor_asuransi']),
|
||||
'value' => old('nomor_asuransi', $forminspeksi['nomor_asuransi'] ?? ''),
|
||||
],
|
||||
[
|
||||
'label' => 'Nomor Rangka',
|
||||
'name' => 'nomor_rangka',
|
||||
'index' => 11,
|
||||
'value' => old('nomor_rangka', $forminspeksi['nomor_rangka']),
|
||||
'value' => old('nomor_rangka', $forminspeksi['nomor_rangka'] ?? ''),
|
||||
],
|
||||
[
|
||||
'label' => 'Nomor Mesin',
|
||||
'name' => 'nomor_mesin',
|
||||
'index' => 12,
|
||||
'value' => old('nomor_mesin', $forminspeksi['nomor_mesin']),
|
||||
'value' => old('nomor_mesin', $forminspeksi['nomor_mesin'] ?? ''),
|
||||
],
|
||||
[
|
||||
'label' => 'Hour Meters',
|
||||
'name' => 'hour_mesters',
|
||||
'index' => 13,
|
||||
'value' => old('hour_mesters', $forminspeksi['hour_mesters']),
|
||||
'value' => old('hour_mesters', $forminspeksi['hour_mesters'] ?? ''),
|
||||
],
|
||||
[
|
||||
'label' => 'Overhaul Mesin',
|
||||
'name' => 'overhaul_mesin',
|
||||
'index' => 14,
|
||||
'value' => old('overhaul_mesin', $forminspeksi['overhaul_mesin']),
|
||||
'value' => old('overhaul_mesin', $forminspeksi['overhaul_mesin'] ?? ""),
|
||||
],
|
||||
];
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
$total_luas_unit = 0;
|
||||
$jenis_legalitas_jaminan_id = 0;
|
||||
if (isset($item->detail)) {
|
||||
$total_luas_unit = calculateTotalLuas($item->detail, 'luas_tanah', 1, 27, 3);
|
||||
$total_luas_unit = calculateTotalLuas($item->detail, 'luas_bangunan', 1, 27, 3);
|
||||
}
|
||||
@endphp
|
||||
<input type="hidden" id="jenis_legalistas_jaminan_unit_id" name="jenis_legalistas_jaminan_unit_id"
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<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">
|
||||
@@ -29,9 +29,12 @@
|
||||
@php
|
||||
$dokumentName = $dokumen->jenisJaminan->name;
|
||||
$formKategori = json_decode($dokumen->jenisJaminan->form_kategori, true);
|
||||
$kategoriArray = is_array($formKategori) ? $formKategori : [$formKategori];
|
||||
$kategoriUnik = array_unique($kategoriArray);
|
||||
@endphp
|
||||
<input type="hidden" name="action"
|
||||
value="{{ is_array($formKategori) ? implode(',', $formKategori) : $formKategori }}">
|
||||
<input type="hidden" name="type" value="{{ implode(',', $kategoriUnik) }}">
|
||||
@if (!in_array(strtoupper($dokumentName), $tanahBangunanTypes))
|
||||
@include('lpj::surveyor.components.pembanding-tanah-bangunan-unit')
|
||||
@else
|
||||
@@ -721,10 +724,11 @@
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
hideLoadingSwal();
|
||||
console.error('Error:', error);
|
||||
const response = JSON.parse(xhr.responseText);
|
||||
console.error('Error:', response.message);
|
||||
Swal.fire({
|
||||
title: 'Error!',
|
||||
text: 'Terjadi kesalahan pada server',
|
||||
text: response.message || 'Terjadi kesalahan',
|
||||
icon: 'error',
|
||||
confirmButtonText: 'OK'
|
||||
});
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
<div class="flex flex-wrap gap-4">
|
||||
<div class="flex w-full items-center justify-center gap-4">
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">Total Luas</span>
|
||||
<span class="form-label"> Luas</span>
|
||||
</label>
|
||||
<input type="text" name="luas_denah[]"
|
||||
class="input w-full number-format"
|
||||
@@ -151,7 +151,7 @@
|
||||
<div class="flex flex-wrap gap-4">
|
||||
<div class="flex w-full items-center justify-center gap-4">
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">Total Luas</span>
|
||||
<span class="form-label"> Luas</span>
|
||||
</label>
|
||||
<input type="text" name="luas_denah[]" class="input w-full number-format"
|
||||
onkeyup="formatNumber(this)">
|
||||
@@ -164,6 +164,17 @@
|
||||
</div>
|
||||
|
||||
|
||||
<div class="w-full p-4">
|
||||
<div class="flex flex-wrap gap-4">
|
||||
<div class="flex w-full items-center justify-center gap-4">
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">Total Luas</span>
|
||||
</label>
|
||||
<input type="text" name="total_luas" id="totalLuas" class="input w-full number-format" readonly>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end gap-2" style="margin-right: 20px; margin-top: 20px">
|
||||
<button type="button" class="btn btn-success" id="saveButton" onclick="submitDenah()">
|
||||
<span id="saveButtonText">Save</span>
|
||||
@@ -229,6 +240,32 @@
|
||||
});
|
||||
});
|
||||
|
||||
function calculateTotalLuas() {
|
||||
let totalLuas = 0;
|
||||
|
||||
const luasInputs = document.querySelectorAll('input[name="luas_denah[]"]');
|
||||
luasInputs.forEach(input => {
|
||||
const value = parseFloat(input.value.replace(/[^0-9.]/g, ''));
|
||||
if (!isNaN(value)) {
|
||||
totalLuas += value;
|
||||
}
|
||||
});
|
||||
|
||||
const totalLuasInput = document.getElementById('totalLuas');
|
||||
totalLuasInput.value = totalLuas ? `${totalLuas.toLocaleString()} m²` : '';
|
||||
}
|
||||
|
||||
// Tambahkan event listener untuk setiap input luas_denah[]
|
||||
document.addEventListener('input', function (e) {
|
||||
if (e.target && e.target.name === 'luas_denah[]') {
|
||||
calculateTotalLuas();
|
||||
}
|
||||
});
|
||||
|
||||
// Jalankan hitung ulang saat halaman dimuat (jika ada nilai default)
|
||||
document.addEventListener('DOMContentLoaded', calculateTotalLuas);
|
||||
|
||||
|
||||
function createDenahElement(index) {
|
||||
const denahItem = document.createElement('div');
|
||||
denahItem.className = 'denah-item grid gap-5 mb-5 border p-4 rounded';
|
||||
@@ -267,7 +304,7 @@
|
||||
<div class="flex flex-wrap gap-4">
|
||||
<div class="flex w-full items-center justify-center gap-4">
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">Total Luas</span>
|
||||
<span class="form-label"> Luas</span>
|
||||
</label>
|
||||
<input type="text" name="luas_denah[]"
|
||||
class="input w-full number-format"
|
||||
|
||||
@@ -286,6 +286,8 @@
|
||||
// Track files that are already on the server
|
||||
const existingFiles = new Set();
|
||||
|
||||
addCameraOption(dropzoneElement, paramName);
|
||||
|
||||
myDropzone = new Dropzone(selector, {
|
||||
url: "{{ route('surveyor.storeFoto') }}",
|
||||
paramName: paramName,
|
||||
@@ -392,6 +394,133 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function addCameraOption(dropzoneElement, paramName) {
|
||||
if (dropzoneElement.querySelector('.upload-options')) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Create the upload options container
|
||||
const uploadOptionsContainer = document.createElement('div');
|
||||
uploadOptionsContainer.className = 'upload-options';
|
||||
uploadOptionsContainer.style.cssText = `
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-top: 10px;
|
||||
gap: 20px;
|
||||
`;
|
||||
|
||||
// Create camera button
|
||||
const cameraButton = document.createElement('button');
|
||||
cameraButton.type = 'button';
|
||||
cameraButton.className = 'camera-button';
|
||||
cameraButton.innerHTML = '<i class="ki-duotone ki-camera fs-2"></i> Kamera';
|
||||
cameraButton.style.cssText = `
|
||||
padding: 8px 16px;
|
||||
background-color: #f5f8fa;
|
||||
border: 1px solid #e4e6ef;
|
||||
border-radius: 6px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
cursor: pointer;
|
||||
`;
|
||||
|
||||
// Create file button
|
||||
const fileButton = document.createElement('button');
|
||||
fileButton.type = 'button';
|
||||
fileButton.className = 'file-button';
|
||||
fileButton.innerHTML = '<i class="ki-duotone ki-folder fs-2"></i> File';
|
||||
fileButton.style.cssText = `
|
||||
padding: 8px 16px;
|
||||
background-color: #f5f8fa;
|
||||
border: 1px solid #e4e6ef;
|
||||
border-radius: 6px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
cursor: pointer;
|
||||
`;
|
||||
|
||||
|
||||
const cameraInput = document.createElement('input');
|
||||
cameraInput.type = 'file';
|
||||
cameraInput.id = 'camera-input-' + paramName;
|
||||
cameraInput.accept = 'image/*';
|
||||
cameraInput.capture = 'environment';
|
||||
cameraInput.style.display = 'none';
|
||||
|
||||
|
||||
const fileInput = document.createElement('input');
|
||||
fileInput.type = 'file';
|
||||
fileInput.id = 'file-input-' + paramName;
|
||||
fileInput.accept = 'image/*';
|
||||
fileInput.style.display = 'none';
|
||||
|
||||
// Add event listeners - use only one instance per button
|
||||
cameraButton.addEventListener('click', function(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
cameraInput.click();
|
||||
}, false);
|
||||
|
||||
fileButton.addEventListener('click', function(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
fileInput.click();
|
||||
}, false);
|
||||
|
||||
// Handle file selection for camera - clear input after use
|
||||
cameraInput.addEventListener('change', function() {
|
||||
if (this.files && this.files.length > 0) {
|
||||
handleFileSelection(this.files, myDropzone);
|
||||
|
||||
this.value = '';
|
||||
}
|
||||
}, false);
|
||||
|
||||
// Handle file selection for gallery - clear input after use
|
||||
fileInput.addEventListener('change', function() {
|
||||
if (this.files && this.files.length > 0) {
|
||||
handleFileSelection(this.files, myDropzone);
|
||||
|
||||
this.value = '';
|
||||
}
|
||||
}, false);
|
||||
|
||||
// Append elements
|
||||
uploadOptionsContainer.appendChild(cameraButton);
|
||||
uploadOptionsContainer.appendChild(fileButton);
|
||||
document.body.appendChild(cameraInput);
|
||||
document.body.appendChild(fileInput);
|
||||
|
||||
// Find the message element in dropzone and insert the options after it
|
||||
const dzMessage = dropzoneElement.querySelector('.dz-message');
|
||||
if (dzMessage) {
|
||||
dzMessage.appendChild(uploadOptionsContainer);
|
||||
} else {
|
||||
dropzoneElement.appendChild(uploadOptionsContainer);
|
||||
}
|
||||
|
||||
|
||||
if (dzMessage) {
|
||||
dzMessage.style.cssText += `
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
`;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function handleFileSelection(files, dropzone) {
|
||||
if (!dropzone) return;
|
||||
|
||||
Array.from(files).forEach(file => {
|
||||
dropzone.addFile(file);
|
||||
});
|
||||
}
|
||||
|
||||
function loadExistingPhotos(dropzone, paramName, existingFilesSet) {
|
||||
showLoadingOverlay();
|
||||
|
||||
@@ -529,6 +658,12 @@
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// Check if device is mobile
|
||||
function isMobileDevice() {
|
||||
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
||||
}
|
||||
|
||||
// Inisialisasi Dropzone untuk elemen awal dengan pengecekan
|
||||
function safeInitDropzone(selector, paramName) {
|
||||
setTimeout(() => {
|
||||
|
||||
@@ -21,12 +21,12 @@
|
||||
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'))
|
||||
@elseif (Auth::user()->hasAnyRole(['administrator', 'surveyor', 'penilai']))
|
||||
@if (Request::is('surveyor/inspeksi/*/create') && request()->has('dokument') && request()->has('jenis_jaminan'))
|
||||
<a href="{{ route('surveyor.show', $permohonan->id) }}" class="btn btn-xs btn-info">
|
||||
<i class="ki-filled ki-exit-left"></i> Back
|
||||
</a>
|
||||
@else
|
||||
@elseif (Request::is('penilai/*/*'))
|
||||
<a href="{{ route('penilai.show', $permohonan->id) }}" class="btn btn-xs btn-info">
|
||||
<i class="ki-filled ki-exit-left"></i> Back
|
||||
</a>
|
||||
@@ -316,9 +316,9 @@
|
||||
@php
|
||||
$hubCadebPemilik = $dokumen->pemilik->hubungan_pemilik->name ?? 'N/A';
|
||||
@endphp
|
||||
<p>
|
||||
<label class="form-label">
|
||||
{{ $hubCadebPemilik }}
|
||||
</p>
|
||||
</label>
|
||||
|
||||
<input type="hidden" name="hub_cadeb_sesuai" value="{{ $hubCadebPemilik }}"
|
||||
id="">
|
||||
|
||||
@@ -125,12 +125,12 @@
|
||||
<input id="inputGistaru" type="file" name="upload_gs"
|
||||
class="file-input file-input-bordered w-full"
|
||||
accept=".jpg,.jpeg,.png,.gif,.bmp,.tiff,.tif,.webp,.svg"
|
||||
onchange="previewImage(this, 'upload-gs-preview')">
|
||||
onchange="uploadFile(this, 'upload-gs-preview', 'upload_gs')">
|
||||
|
||||
<img id="upload-gs-preview"
|
||||
src="{{ asset('storage/' . (isset($forminspeksi['upload_gs']) ? $forminspeksi['upload_gs'] : '')) }}"
|
||||
src="{{ isset($forminspeksi['upload_gs']) && is_string($forminspeksi['upload_gs']) && !empty($forminspeksi['upload_gs']) ? asset('storage/' . $forminspeksi['upload_gs']) : '' }}"
|
||||
alt="Foto Gs" class="mt-2 max-w-full h-auto"
|
||||
style="{{ isset($forminspeksi['upload_gs']) ? '' : 'display: none;' }} max-width: 30rem;" />
|
||||
style="{{ isset($forminspeksi['upload_gs']) && is_string($forminspeksi['upload_gs']) && !empty($forminspeksi['upload_gs']) ? '' : 'display: none;' }} max-width: 30rem;" />
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -146,12 +146,13 @@
|
||||
<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')">
|
||||
onchange="uploadFile(this, 'sentuh_tanahku-preview', 'foto_sentuh_tanahku')"
|
||||
>
|
||||
|
||||
<img id="sentuh_tanahku-preview"
|
||||
src="{{ asset('storage/' . (isset($forminspeksi['foto_sentuh_tanahku']) ? $forminspeksi['foto_sentuh_tanahku'] : '')) }}"
|
||||
src="{{ isset($forminspeksi['foto_sentuh_tanahku']) && is_string($forminspeksi['foto_sentuh_tanahku']) && !empty($forminspeksi['foto_sentuh_tanahku']) ? asset('storage/' . $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;" />
|
||||
style="{{ isset($forminspeksi['foto_sentuh_tanahku']) && is_string($forminspeksi['foto_sentuh_tanahku']) && !empty($forminspeksi['foto_sentuh_tanahku']) ? '' : 'display: none;' }} max-width: 30rem;"/>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -169,12 +170,12 @@
|
||||
<input id="inputGistaru" type="file" name="foto_gistaru"
|
||||
class="file-input file-input-bordered w-full"
|
||||
accept=".jpg,.jpeg,.png,.gif,.bmp,.tiff,.tif,.webp,.svg"
|
||||
onchange="previewImage(this, 'gistaru-preview')">
|
||||
onchange="uploadFile(this, 'gistaru-preview', 'foto_gistaru')">
|
||||
|
||||
<img id="gistaru-preview"
|
||||
src="{{ asset('storage/' . (isset($forminspeksi['foto_gistaru']) ? $forminspeksi['foto_gistaru'] : '')) }}"
|
||||
src="{{ isset($forminspeksi['foto_gistaru']) && is_string($forminspeksi['foto_gistaru']) && !empty($forminspeksi['foto_gistaru']) ? asset('storage/' . $forminspeksi['foto_gistaru']) : '' }}"
|
||||
alt="Foto Bhumi" class="mt-2 max-w-full h-auto"
|
||||
style="{{ isset($forminspeksi['foto_gistaru']) ? '' : 'display: none;' }} max-width: 30rem;" />
|
||||
style="{{ isset($forminspeksi['foto_gistaru']) && is_string($forminspeksi['foto_gistaru']) && !empty($forminspeksi['foto_gistaru']) ? '' : 'display: none;' }} max-width: 30rem;" />
|
||||
|
||||
|
||||
</div>
|
||||
@@ -197,11 +198,16 @@
|
||||
<input id="inputBhumi" type="file" name="foto_bhumi"
|
||||
class="file-input file-input-bordered w-full "
|
||||
accept=".jpg,.jpeg,.png,.gif,.bmp,.tiff,.tif,.webp,.svg"
|
||||
onchange="previewImage(this, 'bhumi-preview')">
|
||||
onchange="uploadFile(this, 'bhumi-preview', 'foto_bhumi')">
|
||||
@php
|
||||
$bhumiPath = isset($forminspeksi['foto_bhumi']) && is_string($forminspeksi['foto_bhumi']) && !empty($forminspeksi['foto_bhumi'])
|
||||
? asset('storage/' . $forminspeksi['foto_bhumi'])
|
||||
: '';
|
||||
@endphp
|
||||
<img id="bhumi-preview"
|
||||
src="{{ asset('storage/' . (isset($forminspeksi['foto_bhumi']) ? $forminspeksi['foto_bhumi'] : '')) }}"
|
||||
src="{{ $bhumiPath }}"
|
||||
alt="Foto Bhumi" class="mt-2 max-w-full h-auto"
|
||||
style="{{ isset($forminspeksi['foto_bhumi']) ? ' ' : 'display: none;' }} max-width: 30rem;" />
|
||||
style="{{ $bhumiPath ? '' : 'display: none;' }} max-width: 30rem;" />
|
||||
</div>
|
||||
<a href="https://bhumi.atrbpn.go.id/peta" type="button" class="btn btn-light" target="_blank">
|
||||
<i class="ki-filled ki-map"></i> Bhumi
|
||||
@@ -210,97 +216,192 @@
|
||||
</div>
|
||||
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">Blad Tata Ruang Perdaerah</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="inputArgisRegion" type="file" name="foto_argis_region"
|
||||
class="file-input file-input-bordered w-full"
|
||||
accept=".jpg,.jpeg,.png,.gif,.bmp,.tiff,.tif,.webp,.svg"
|
||||
onchange="previewImage(this, 'argis-region-preview')">
|
||||
<img id="argis-region-preview"
|
||||
src="{{ asset('storage/' . (isset($forminspeksi['foto_argis_region']) ? $forminspeksi['foto_argis_region'] : '')) }}"
|
||||
alt="Foto Argis Region" class="mt-2 max-w-full h-auto"
|
||||
style="{{ isset($forminspeksi['foto_argis_region']) ? '' : 'display: none;' }} max-width: 30rem;">
|
||||
</div>
|
||||
<
|
||||
</div>
|
||||
</div>
|
||||
</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">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label class="form-label max-w-56">
|
||||
<span class="form-label">Blad Tata Ruang Perdaerah</span>
|
||||
</label>
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input id="foto_tempat" type="file" name="foto_tempat"
|
||||
class="file-input file-input-bordered w-full"
|
||||
accept=".jpg,.jpeg,.png,.gif,.bmp,.tiff,.tif,.webp,.svg"
|
||||
onchange="previewImage(this, 'foto_tempat-preview')">
|
||||
<button type="button" id="btnCamera" class="btn btn-light" data-modal-toggle="#cameraModal">
|
||||
<i class="ki-outline ki-abstract-33"></i> Camera
|
||||
</button>
|
||||
<input class="name_rute" type="hidden" name="name_rute" value="rute">
|
||||
<div class="w-full">
|
||||
<input id="inputArgisRegion" type="file" name="foto_argis_region"
|
||||
class="file-input file-input-bordered w-full"
|
||||
accept=".jpg,.jpeg,.png,.gif,.bmp,.tiff,.tif,.webp,.svg"
|
||||
onchange="uploadFile(this, 'argis-region-preview', 'foto_argis_region')">
|
||||
@php
|
||||
$argisRegionPath = isset($forminspeksi['foto_argis_region']) && is_string($forminspeksi['foto_argis_region']) && !empty($forminspeksi['foto_argis_region'])
|
||||
? asset('storage/' . $forminspeksi['foto_argis_region'])
|
||||
: '';
|
||||
@endphp
|
||||
|
||||
<img id="argis-region-preview"
|
||||
src="{{ $argisRegionPath }}"
|
||||
alt="Foto Argis Region" class="mt-2 max-w-full h-auto"
|
||||
style="{{ $argisRegionPath ? '' : 'display: none;' }} max-width: 30rem;">
|
||||
</div>
|
||||
< </div>
|
||||
</div>
|
||||
@php
|
||||
$fotoTempat = $forminspeksi['foto_tempat'] ?? null;
|
||||
$fotoSrc = '';
|
||||
|
||||
if (is_array($fotoTempat)) {
|
||||
$fotoSrc = asset('storage/' . $fotoTempat[0]);
|
||||
} elseif (!empty($fotoTempat)) {
|
||||
$fotoSrc = asset('storage/' . $fotoTempat);
|
||||
}
|
||||
@endphp
|
||||
|
||||
<img id="foto_tempat-preview" src="{{ $fotoSrc ?: '' }}"
|
||||
alt="Foto Tempat" class="mt-2 max-w-full h-auto"
|
||||
style="max-width: 30rem; {{ $fotoSrc ? '' : 'display: none;' }}">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- Upload Photo Button -->
|
||||
|
||||
<!-- Notes Section -->
|
||||
<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">
|
||||
<div class="input-group w-full flex gap-2">
|
||||
<input id="foto_tempat" type="file" name="foto_tempat"
|
||||
class="file-input file-input-bordered w-full"
|
||||
accept=".jpg,.jpeg,.png,.gif,.bmp,.tiff,.tif,.webp,.svg"
|
||||
onchange="uploadFile(this, 'foto_tempat-preview', 'foto_tempat')">
|
||||
<button type="button" id="btnCamera" class="btn btn-light"
|
||||
data-modal-toggle="#cameraModal">
|
||||
<i class="ki-outline ki-abstract-33"></i> Camera
|
||||
</button>
|
||||
</div>
|
||||
@php
|
||||
$fotoTempat = isset($forminspeksi['foto_tempat']) && is_string($forminspeksi['foto_tempat']) && !empty($forminspeksi['foto_tempat'])
|
||||
? asset('storage/' . $forminspeksi['foto_tempat'])
|
||||
: '';
|
||||
@endphp
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5" style="margin-top: 20px">
|
||||
<img id="foto_tempat-preview" src="{{ $fotoTempat ?: '' }}" alt="Foto Tempat"
|
||||
class="mt-2 max-w-full h-auto"
|
||||
style="max-width: 30rem; {{ $fotoTempat ? '' : 'display: none;' }}">
|
||||
|
||||
<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>
|
||||
</div>
|
||||
|
||||
<!-- Notes Section -->
|
||||
|
||||
<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">{{ old("keterangan.$index", $item) }}</textarea>
|
||||
<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>
|
||||
@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
|
||||
@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>
|
||||
<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>
|
||||
|
||||
@include('lpj::surveyor.components.modal-kamera')
|
||||
@include('lpj::surveyor.components.modal-kamera')
|
||||
|
||||
@push('scripts')
|
||||
@include('lpj::surveyor.js.camera-editor')
|
||||
@endpush
|
||||
@push('scripts')
|
||||
<script stype="text/javascript">
|
||||
function uploadFile(inputElement, previewElement, url) {
|
||||
// Ambil file dari elemen input
|
||||
const file = inputElement.files[0];
|
||||
|
||||
|
||||
if (!file) {
|
||||
Swal.fire({
|
||||
icon: 'warning',
|
||||
title: 'Tidak ada file yang dipilih.',
|
||||
toast: true,
|
||||
position: 'top-end',
|
||||
showConfirmButton: false,
|
||||
timer: 1500
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (inputElement.files && file) {
|
||||
var reader = new FileReader();
|
||||
reader.onload = function(e) {
|
||||
$('#' + previewElement).attr('src', e.target.result).show();
|
||||
}
|
||||
reader.readAsDataURL(inputElement.files[0]);
|
||||
} else {
|
||||
$('#' + previewElement).hide();
|
||||
}
|
||||
|
||||
// Buat FormData untuk mengirim file
|
||||
const formData = new FormData();
|
||||
|
||||
const dokument = "{{ request('dokument') }}";
|
||||
const permohonan = "{{ $permohonan->id }}";
|
||||
formData.append('file', file);
|
||||
formData.append('dokument_id', dokument);
|
||||
formData.append('permohonan_id', permohonan);
|
||||
|
||||
$.ajax({
|
||||
url: '/surveyor/upload-file-foto/' + url,
|
||||
type: 'POST',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
},
|
||||
data: formData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(response) {
|
||||
|
||||
|
||||
if (response.success) {
|
||||
// Tampilkan pesan sukses
|
||||
Swal.fire({
|
||||
icon: 'success',
|
||||
title: response.message || 'File berhasil diunggah!',
|
||||
toast: true,
|
||||
position: 'top-end',
|
||||
showConfirmButton: false,
|
||||
timer: 1500
|
||||
});
|
||||
|
||||
// Perbarui elemen preview
|
||||
$(previewElement).attr('src', response.data.path).show();
|
||||
$(inputElement).data('file-name', response.data.file_name);
|
||||
} else {
|
||||
// Tampilkan pesan kesalahan dari server
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: response.message || 'Gagal mengunggah file!',
|
||||
toast: true,
|
||||
position: 'top-end',
|
||||
showConfirmButton: false,
|
||||
timer: 1500
|
||||
});
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
|
||||
|
||||
// Tampilkan pesan kesalahan
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: xhr.responseJSON?.message || 'Terjadi kesalahan saat mengunggah file.',
|
||||
toast: true,
|
||||
position: 'top-end',
|
||||
showConfirmButton: false,
|
||||
timer: 1500
|
||||
});
|
||||
console.error(`Error: ${error}`);
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@include('lpj::surveyor.js.camera-editor')
|
||||
@endpush
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script src="https://cdn.jsdelivr.net/npm/signature_pad@4.1.7/dist/signature_pad.umd.min.js"></script>
|
||||
<script src="{{ asset('vendor/signature.pad.js') }}"></script>
|
||||
<script type="text/javascript">
|
||||
const datas = @json($forminspeksi);
|
||||
console.log(datas);
|
||||
@@ -517,6 +517,19 @@
|
||||
showLoadingSwal('Mengirim data ke server...');
|
||||
const form = document.querySelector('form');
|
||||
const formData = new FormData(form);
|
||||
|
||||
const fotoFields = [
|
||||
'foto_gistaru',
|
||||
'foto_bhumi',
|
||||
'foto_argis_region',
|
||||
'foto_tempat',
|
||||
'foto_sentuh_tanahku',
|
||||
'upload_gs'
|
||||
];
|
||||
|
||||
fotoFields.forEach((field) => {
|
||||
formData.delete(field);
|
||||
});
|
||||
$.ajax({
|
||||
url: '{{ route('surveyor.store') }}',
|
||||
type: 'POST',
|
||||
|
||||
@@ -53,25 +53,21 @@
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="province_code" class="form-label max-w-56">Provinsi</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select id="province_code" name="province_code" class="input w-full">
|
||||
<select id="province_code" name="province_code" class="input w-full" onchange="getCity(this.value)">
|
||||
|
||||
<option value="">Pilih Provinsi</option>
|
||||
@foreach ($provinces as $item)
|
||||
<option value="{{ $item->code }}" {{ ($forminspeksi['alamat']['sesuai']['province_code'] ?? '') == $item->code ? 'selected' : '' }}>{{ $item->name }}</option>
|
||||
<option value="{{ $item->code }}" {{ ($cekAlamat['province_code'] ?? '') == $item->code ? 'selected' : '' }}>{{ $item->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="city_code" class="form-label max-w-56">Kota/Kabupaten</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select id="city_code" name="city_code" class="select w-full">
|
||||
<select id="city_code" name="city_code" class="select w-full" onchange="getDistrict(this.value)">
|
||||
<option value="">Pilih Kota/Kabupaten</option>
|
||||
@if(isset($cities))
|
||||
@foreach ($cities as $item)
|
||||
<option value="{{ $item->code }}" {{ ($forminspeksi['alamat']['sesuai']['city_code'] ?? '') == $item->code ? 'selected' : '' }}>{{ $item->name }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -79,13 +75,9 @@
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label for="district_code" class="form-label max-w-56">Kecamatan</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select id="district_code" name="district_code" class="select w-full">
|
||||
<select id="district_code" name="district_code" class="select w-full" onchange="getVillage(this.value)">
|
||||
<option value="">Pilih Kecamatan</option>
|
||||
@if(isset($districts))
|
||||
@foreach ($districts as $item)
|
||||
<option value="{{ $item->code }}" {{ ($forminspeksi['alamat']['sesuai']['district_code'] ?? '') == $item->code ? 'selected' : '' }}>{{ $item->name }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -95,11 +87,7 @@
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<select id="village_code" name="village_code" class="select w-full">
|
||||
<option value="">Pilih Kelurahan</option>
|
||||
@if(isset($villages))
|
||||
@foreach ($villages as $item)
|
||||
<option value="{{ $item->code }}" {{ ($forminspeksi['alamat']['sesuai']['village_code'] ?? '') == $item->code ? 'selected' : '' }}>{{ $item->name }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
</a>
|
||||
@else
|
||||
<a href="{{ route('surveyor.show', ['id' => $permohonan->id]) }}" class="btn btn-xs btn-info">
|
||||
<i class="ki-filled ki-exit-left"></i> Kembali
|
||||
<i class="ki-filled ki-exit-left"></i> Back
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
@@ -136,11 +136,11 @@
|
||||
<td class="px-4 py-2">Tahun</td>
|
||||
<td class="px-4 py-2">
|
||||
|
||||
<input type="text" name="tahun" class="input number-format"
|
||||
<input type="text" name="tahun" class="input "
|
||||
value="{{ $inspectionData['tahun'] ?? '' }}">
|
||||
</td>
|
||||
<td class="px-4 py-2">
|
||||
<input type="text" name="tahun_pembanding[]" class="input number-format">
|
||||
<input type="text" name="tahun_pembanding[]" class="input ">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -372,13 +372,13 @@
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="px-4 py-2">Harga</td>
|
||||
<td class="px-4 py-2">Harga Penawaran/ Transaksi(Rp)</td>
|
||||
<td class="px-4 py-2">
|
||||
<input type="text" name="harga" class="input currency"
|
||||
value="{{ $inspectionData['harga'] ?? '' }}">
|
||||
<input type="text" name="harga" class="input currency-format"
|
||||
value="{{ $inspectionData['asset']['harga'] ?? '' }}">
|
||||
</td>
|
||||
<td class="px-4 py-2">
|
||||
<input type="text" name="harga_pembanding[]" class="input currency">
|
||||
<input type="text" name="harga_pembanding[]" class="input currency-format">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -386,7 +386,7 @@
|
||||
<td class="px-4 py-2">
|
||||
<div class="input">
|
||||
<input type="text" name="diskon" class=" currency"
|
||||
value="{{ $inspectionData['diskon'] ?? '' }}">
|
||||
value="{{ $inspectionData['asset']['diskon'] ?? '' }}">
|
||||
<span class="btn btn-icon">
|
||||
<i class="ki-outline ki-percentage"></i>
|
||||
</span>
|
||||
@@ -404,7 +404,7 @@
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="display: none;">
|
||||
{{-- <tr style="display: none;">
|
||||
<td class="px-4 py-2">Total</td>
|
||||
<td class="px-4 py-2">
|
||||
<input type="text" name="total" class="input currency"
|
||||
@@ -413,16 +413,15 @@
|
||||
<td class="px-4 py-2">
|
||||
<input type="text" name="total_pembanding[]" class="input currency-format">
|
||||
</td>
|
||||
</tr>
|
||||
</tr> --}}
|
||||
<tr>
|
||||
<td class="px-4 py-2">Harga Setelah Diskon</td>
|
||||
<td class="px-4 py-2">
|
||||
<input type="text" name="harga_diskon" class="input currency-format" readonly
|
||||
value="{{ $inspectionData['harga_diskon'] ?? '' }}">
|
||||
<input type="text" name="total" class="input currency-format" readonly
|
||||
value="{{ $inspectionData['asset']['total'] ?? '' }}">
|
||||
</td>
|
||||
<td class="px-4 py-2">
|
||||
<input type="text" name="harga_diskon_pembanding[]" readonly
|
||||
class="input currency-format">
|
||||
<input type="text" name="total_pembanding[]" readonly class="input currency-format">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
@@ -267,17 +267,17 @@
|
||||
<td class="px-4 py-2">
|
||||
<div class="grid grid-cols-2 gap-2">
|
||||
<input type="text" name="kordinat_lat" class="input" placeholder="Latitude"
|
||||
value="{{ $inspectionData['asset']['kordinat_lat'] ?? '' }}">
|
||||
value="{{ $inspectionData['asset']['kordinat_lat'] ?? '' }}" pattern="^-?((1[0-7]\d|\d{1,2})(\.\d+)?|180(\.0+)?)$">
|
||||
<input type="text" name="kordinat_lng" class="input" placeholder="Longitude"
|
||||
value="{{ $inspectionData['asset']['kordinat_lng'] ?? '' }}">
|
||||
value="{{ $inspectionData['asset']['kordinat_lng'] ?? '' }}" pattern="^-?((1[0-7]\d|\d{1,2})(\.\d+)?|180(\.0+)?)$">
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-4 py-2">
|
||||
<div class="grid grid-cols-2 gap-2">
|
||||
<input type="text" name="kordinat_lat_pembanding[]" class="input"
|
||||
placeholder="Latitude">
|
||||
placeholder="Latitude" pattern="^-?((1[0-7]\d|\d{1,2})(\.\d+)?|180(\.0+)?)$">
|
||||
<input type="text" name="kordinat_lng_pembanding[]" class="input"
|
||||
placeholder="Longitude">
|
||||
placeholder="Longitude" pattern="^-?((1[0-7]\d|\d{1,2})(\.\d+)?|180(\.0+)?)$">
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -0,0 +1,524 @@
|
||||
@include('lpj::surveyor.components.print-out.header')
|
||||
|
||||
<div style="border: 1px solid #000;">
|
||||
<table
|
||||
style="width: 100%; border-top: none; border-bottom: 1px solid #000; border-collapse: collapse; border-left: none; border-right: none;">
|
||||
|
||||
<tr>
|
||||
<td style="text-align: center; margin-top: 5px; ">
|
||||
<h2 style=" text-transform: uppercase; text-align: center; margin: 0;">
|
||||
Tujuan Penilaian
|
||||
</h2>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table style="width: 100%;">
|
||||
<tr>
|
||||
<td style="vertical-align: top;">
|
||||
<table>
|
||||
<tr>
|
||||
|
||||
<td style="width: 25%; padding: 2px;">Tujuan Penilai</td>
|
||||
<td style="width: 1%; padding: 2px;">:</td>
|
||||
<td style="vertical-align: top; padding: 2px;">
|
||||
{{ $permohonan->tujuanPenilaian->name ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 25%; padding: 2px; vertical-align: top;">Cabang/Pemohon</td>
|
||||
<td style="width: 1%; vertical-align: top;">:</td>
|
||||
<td style="vertical-align: top; vertical-align: top;">
|
||||
{{ $permohonan->debiture->branch->name ?? '' }} / {{ $permohonan->user->name ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
|
||||
<td style="vertical-align: top;">
|
||||
<table>
|
||||
<tr>
|
||||
<td style="width: 25%; padding: 2px; vertical-align: top;">Tanggal Dibuat</td>
|
||||
<td style="width: 1%; vertical-align: top;">:</td>
|
||||
<td style="vertical-align: top; vertical-align: top;">
|
||||
{{ formatTanggalIndonesia($permohonan->created_at) }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
<td style="width: 25%; padding: 2px;">
|
||||
Tanggal Survey</td>
|
||||
<td style="width: 1%; padding: 2px;">:</td>
|
||||
<td style="vertical-align: top; padding: 2px;">
|
||||
{{ formatTanggalIndonesia($permohonan->penilaian->tanggal_kunjungan) }}</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table
|
||||
style="width: 100%; border-top: 1px solid #000; border-bottom: 1px solid #000; border-collapse: collapse; border-left: none; border-right: none;">
|
||||
|
||||
<tr>
|
||||
<td style="text-align: center; margin-top: 5px; ">
|
||||
<h2 style=" text-transform: uppercase; text-align: center; margin: 0;">
|
||||
Identitas Debitur
|
||||
</h2>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px; vertical-align: top;">Nama</td>
|
||||
<td style="width: 1%; vertical-align: top;">:</td>
|
||||
<td style="vertical-align: top; width: 79%;">{{ $permohonan->debiture->name ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px; vertical-align: top;">Nama Wakil</td>
|
||||
<td style="width: 1%; padding: 2px; vertical-align: top;">:</td>
|
||||
<td style="vertical-align: top; padding: 2px;">
|
||||
{{ $forminspeksi['nama_wakil'] ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px; vertical-align: top;">Hubungan Calon debitur</td>
|
||||
<td style="width: 1%; padding: 2px; vertical-align: top;">:</td>
|
||||
<td style="vertical-align: top; padding: 2px;">
|
||||
{{ $forminspeksi['hub_calon_debitur'] ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table
|
||||
style="width: 100%; border-top: 1px solid #000; border-bottom: 1px solid #000; border-collapse: collapse; border-left: none; border-right: none;">
|
||||
|
||||
<tr>
|
||||
<td style="text-align: center; margin-top: 5px; ">
|
||||
<h2 style=" text-transform: uppercase; text-align: center; margin: 0;">
|
||||
Lokasi Jaminan
|
||||
</h2>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table style="width: 100%">
|
||||
|
||||
|
||||
<tr>
|
||||
<td width="20%">Nama Jalan</td>
|
||||
<td style="width: 1%; vertical-align: top;">:</td>
|
||||
<td> {{ $forminspeksi['nama_jalan'] ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="20%">Perumahan/Gang</td>
|
||||
<td style="width: 1%; vertical-align: top;">:</td>
|
||||
<td> {{ $forminspeksi['perumahan_gang'] ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="20%">Blok/Nomor</td>
|
||||
<td style="width: 1%; vertical-align: top;">:</td>
|
||||
<td> {{ $forminspeksi['blok_nomor'] ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>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>Kotamadya</td>
|
||||
<td style="width: 1%; vertical-align: top;">:</td>
|
||||
<td> {{ $alamat['city_code'] ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Propinsi</td>
|
||||
<td style="width: 1%; vertical-align: top;">:</td>
|
||||
<td>{{ $alamat['province_code'] ?? '' }}</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
<div>
|
||||
<table
|
||||
style="width: 100%; border-top: 1px solid #000; border-bottom: 1px solid #000; border-collapse: collapse; border-left: none; border-right: none;">
|
||||
<tr>
|
||||
<td style="text-align: center; margin-top: 5px; ">
|
||||
<h2 style=" text-transform: uppercase; text-align: center; margin: 0;">
|
||||
Data data jaminan
|
||||
</h2>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table style="width: 100%;">
|
||||
<tr>
|
||||
<td style="vertical-align: top; width: 25%;">Model</td>
|
||||
<td width="1%" style="vertical-align: top;">:</td>
|
||||
<td width="100%" style="vertical-align: top;">
|
||||
<table style="width: 100%;">
|
||||
@if (isset($basicData['modelAlatBerat']))
|
||||
@foreach ($basicData['modelAlatBerat'] as $item)
|
||||
<tr>
|
||||
<td width="40%">
|
||||
<label class="form-label max-w-56 gap-2.5">
|
||||
<input class="checkbox" name="kendaraan[]" type="checkbox"
|
||||
value="{{ $item->name }}"
|
||||
{{ in_array($item->name, old('jenis_model', [])) ||
|
||||
(isset($forminspeksi['jenis_model']) &&
|
||||
is_array($forminspeksi['jenis_model']) &&
|
||||
in_array($item->name, $forminspeksi['jenis_model']))
|
||||
? 'checked'
|
||||
: '' }} />
|
||||
{{ $item->name }}
|
||||
</label>
|
||||
</td>
|
||||
<td width="1%"></td>
|
||||
<td width="100%">
|
||||
<p>{{ old('kendaraan_input.' . $loop->index, $forminspeksi['kendaraan_input'][$loop->index] ?? '') }}
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@php
|
||||
$inputDataJaminan = [
|
||||
[
|
||||
'label' => 'Nomor Lambung',
|
||||
'name' => 'nomor_lambung',
|
||||
'index' => 0,
|
||||
'value' => old('nomor_lambung', $forminspeksi['nomor_lambung'] ?? ''),
|
||||
],
|
||||
[
|
||||
'label' => 'Model Unit',
|
||||
'name' => 'model_unit',
|
||||
'index' => 1,
|
||||
'value' => old('model_unit', $forminspeksi['model_unit'] ?? ''),
|
||||
],
|
||||
[
|
||||
'label' => 'Tahun Pembuatan',
|
||||
'name' => 'tahun_pembuatan',
|
||||
'index' => 2,
|
||||
'value' => old('tahun_pembuatan', $forminspeksi['tahun_pembuatan'] ?? ''),
|
||||
],
|
||||
[
|
||||
'label' => 'Merk',
|
||||
'name' => 'merk',
|
||||
'index' => 3,
|
||||
'value' => old('merk', $forminspeksi['merk'] ?? ''),
|
||||
],
|
||||
[
|
||||
'label' => 'Negara Pembuat',
|
||||
'name' => 'negara_pembuat',
|
||||
'index' => 4,
|
||||
'value' => old('negara_pembuat', $forminspeksi['negara_pembuat'] ?? ''),
|
||||
],
|
||||
[
|
||||
'label' => 'Tahun Pembelian',
|
||||
'name' => 'tahun_pembelian',
|
||||
'index' => 5,
|
||||
'value' => old('tahun_pembelian', $forminspeksi['tahun_pembelian'] ?? ''),
|
||||
],
|
||||
[
|
||||
'label' => 'Nomor Faktur/Invoice',
|
||||
'name' => 'nomor_faktur',
|
||||
'index' => 6,
|
||||
'value' => old('nomor_faktur', $forminspeksi['nomor_faktur'] ?? ''),
|
||||
],
|
||||
[
|
||||
'label' => 'Nomor Kontrak Pembelian',
|
||||
'name' => 'nomor_kontrak',
|
||||
'index' => 7,
|
||||
'value' => old('nomor_kontrak', $forminspeksi['nomor_kontrak'] ?? ''),
|
||||
],
|
||||
[
|
||||
'label' => 'Nama Pemilik',
|
||||
'name' => 'nama_pemilik',
|
||||
'index' => 8,
|
||||
'value' => old('nama_pemilik', $forminspeksi['nama_pemilik'] ?? ''),
|
||||
],
|
||||
[
|
||||
'label' => 'Alamaat Pemilik',
|
||||
'name' => 'alamat_pemilik',
|
||||
'index' => 9,
|
||||
'value' => old('alamat_pemilik', $forminspeksi['alamat_pemilik'] ?? ''),
|
||||
],
|
||||
[
|
||||
'label' => 'Nomor Asuransi',
|
||||
'name' => 'nomor_asuransi',
|
||||
'index' => 10,
|
||||
'value' => old('nomor_asuransi', $forminspeksi['nomor_asuransi'] ?? ''),
|
||||
],
|
||||
[
|
||||
'label' => 'Nomor Rangka',
|
||||
'name' => 'nomor_rangka',
|
||||
'index' => 11,
|
||||
'value' => old('nomor_rangka', $forminspeksi['nomor_rangka'] ?? ''),
|
||||
],
|
||||
[
|
||||
'label' => 'Nomor Mesin',
|
||||
'name' => 'nomor_mesin',
|
||||
'index' => 12,
|
||||
'value' => old('nomor_mesin', $forminspeksi['nomor_mesin'] ?? ''),
|
||||
],
|
||||
[
|
||||
'label' => 'Hour Meters',
|
||||
'name' => 'hour_mesters',
|
||||
'index' => 13,
|
||||
'value' => old('hour_mesters', $forminspeksi['hour_mesters'] ?? ''),
|
||||
],
|
||||
[
|
||||
'label' => 'Overhaul Mesin',
|
||||
'name' => 'overhaul_mesin',
|
||||
'index' => 14,
|
||||
'value' => old('overhaul_mesin', $forminspeksi['overhaul_mesin'] ?? ''),
|
||||
],
|
||||
];
|
||||
|
||||
@endphp
|
||||
|
||||
@foreach ($inputDataJaminan as $item)
|
||||
<tr>
|
||||
<td width="20%" style="vertical-align: top;">{{ $item['label'] }}</td>
|
||||
<td width="1%" style="vertical-align: top;">:</td>
|
||||
<td width="100%" style="vertical-align: top;">
|
||||
{{ $item['value'] ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<table
|
||||
style="width: 100%; border-top: 1px solid #000; border-bottom: 1px solid #000; border-collapse: collapse; border-left: none; border-right: none;">
|
||||
<tr>
|
||||
<td style="text-align: center; margin-top: 5px; ">
|
||||
<h2 style=" text-transform: uppercase; text-align: center; margin: 0;">
|
||||
Kondisi Fisik Objek
|
||||
</h2>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table style="width: 100%;">
|
||||
|
||||
|
||||
@php
|
||||
$kondisiObjeck = [
|
||||
[
|
||||
'label' => 'Mesin dan Panel Instrument',
|
||||
'value' => ['Terawat', 'Cukup Terawat', 'Tidak Terawat'],
|
||||
'name' => 'mesin_panel',
|
||||
'index' => 0,
|
||||
],
|
||||
[
|
||||
'label' => 'Fungsi mesin dan panel instrument',
|
||||
'value' => ['Berfungsi', 'Rusak'],
|
||||
'name' => 'fungsi_panel',
|
||||
'index' => 1,
|
||||
],
|
||||
[
|
||||
'label' => 'Interior (jok, dll)',
|
||||
'value' => ['Terawat', 'Cukup Terawat', 'Tidak Terawat'],
|
||||
'name' => 'interior',
|
||||
'index' => 2,
|
||||
],
|
||||
[
|
||||
'label' => 'Rangka dan Karoseri',
|
||||
'value' => ['Terawat', 'Cukup Terawat', 'Tidak Terawat'],
|
||||
'name' => 'rangka_Karoseri',
|
||||
'index' => 3,
|
||||
],
|
||||
[
|
||||
'label' => 'Ban',
|
||||
'value' => ['Standard', 'Tidak Standard'],
|
||||
'name' => 'ban',
|
||||
'index' => 4,
|
||||
],
|
||||
[
|
||||
'label' => 'Velg',
|
||||
'value' => ['Standard', 'Tidak Standard'],
|
||||
'name' => 'velg',
|
||||
'index' => 5,
|
||||
],
|
||||
[
|
||||
'label' => 'Air Conditioner',
|
||||
'value' => ['Ada', 'Tidak Ada'],
|
||||
'name' => 'air_conditioner',
|
||||
'index' => 6,
|
||||
],
|
||||
[
|
||||
'label' => 'Aksesoris Tambahan lainnya',
|
||||
'value' => ['Ada', 'Tidak Ada'],
|
||||
'name' => 'aksesoris',
|
||||
'index' => 7,
|
||||
],
|
||||
[
|
||||
'label' => 'LCD',
|
||||
'value' => ['Ada', 'Tidak Ada'],
|
||||
'name' => 'lcd',
|
||||
'index' => 8,
|
||||
],
|
||||
[
|
||||
'label' => 'Perlengkapan Keamanan',
|
||||
'value' => ['Ada', 'Tidak Ada'],
|
||||
'name' => 'perlengkapan',
|
||||
'index' => 9,
|
||||
],
|
||||
[
|
||||
'label' => 'Asuransi',
|
||||
'value' => ['Ada', 'Tidak Ada'],
|
||||
'name' => 'asuransi',
|
||||
'index' => 10,
|
||||
],
|
||||
];
|
||||
|
||||
@endphp
|
||||
|
||||
|
||||
@foreach ($kondisiObjeck as $item)
|
||||
<tr>
|
||||
<td style="vertical-align: top; width: 25%;">{{ $item['label'] }}</td>
|
||||
<td width="1%" style="vertical-align: top;">:</td>
|
||||
<td style="vertical-align: top;">
|
||||
<table style="width: 100%; border-collapse: collapse;">
|
||||
@foreach ($item['value'] as $value)
|
||||
<tr>
|
||||
<td>
|
||||
<label class="form-label max-w-56 gap-2.5" style="width: 500px">
|
||||
<input class="checkbox" name="{{ $item['name'] }}[]" type="checkbox"
|
||||
value="{{ $value }}"
|
||||
{{ in_array($value, old($item['name'], $forminspeksi[$item['name']] ?? [])) ? 'checked' : '' }} />
|
||||
{{ $value }}
|
||||
@if ($forminspeksi[$item['name'] . '_input'][$loop->index] != null)
|
||||
-
|
||||
{{ old($item['name'] . '_input' . $loop->index, $forminspeksi[$item['name'] . '_input'][$loop->index] ?? '') }}
|
||||
@endif
|
||||
</label>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
<tr>
|
||||
<td style="vertical-align: top;">Perusahaan Asuransi</td>
|
||||
<td width="1%" style="vertical-align: top;">:</td>
|
||||
<td width="100%" style="vertical-align: top;">{{ $forminspeksi['perusahaan_asuransi'] ?? '' }}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="vertical-align: top;">Tahun Berakhir</td>
|
||||
<td width="1%" style="vertical-align: top;">:</td>
|
||||
<td width="100%" style="vertical-align: top;">
|
||||
{{ isset($forminspeksi['tahun_berakhir']) ? formatTanggalIndonesia($forminspeksi['tahun_berakhir']) : '' }}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<div>
|
||||
<table
|
||||
style="width: 100%; border-top: 1px solid #000; border-bottom: 1px solid #000; border-collapse: collapse; border-left: none; border-right: none;">
|
||||
|
||||
|
||||
<tr>
|
||||
<td style="text-align: center; margin-top: 5px;">
|
||||
<h2 style=" text-transform: uppercase; text-align: center; margin: 0;">
|
||||
ANalisa Fakta
|
||||
</h2>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<td width="25%" style="vertical-align: top;">Faktor Positif</td>
|
||||
<td width="1%" style="vertical-align: top;">:</td>
|
||||
<td width="100%" style="vertical-align: top;">
|
||||
@isset($forminspeksi['fakta_positif'])
|
||||
<table style="width: 100%; border-collapse: collapse;">
|
||||
@foreach ($forminspeksi['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;">Faktor Negatif</td>
|
||||
<td width="1%" style="vertical-align: top;">:</td>
|
||||
<td width="100%" style="vertical-align: top;">
|
||||
@php
|
||||
$faktaNegatif = $forminspeksi['fakta_negatif'] ?? [];
|
||||
$faktaNegatifFiltered = is_array($faktaNegatif)
|
||||
? array_filter($faktaNegatif, function ($item) {
|
||||
return !empty(trim($item));
|
||||
})
|
||||
: [];
|
||||
@endphp
|
||||
|
||||
@if (!empty($faktaNegatifFiltered))
|
||||
<table style="width: 100%; border-collapse: collapse;">
|
||||
@foreach ($faktaNegatifFiltered as $key => $item)
|
||||
<tr>
|
||||
<td>{!! nl2br(e($item)) !!}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
@else
|
||||
<p>Tidak ada faktor negatif yang teridentifikasi.</p>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
<td width="20%" style="vertical-align: top;">Catatan yang perlu di perhatikan</td>
|
||||
<td width="1%" style="vertical-align: top;">:</td>
|
||||
<td width="100%" style="vertical-align: top;">
|
||||
@php
|
||||
$faktaNegatif = $forminspeksi['catatan'] ?? [];
|
||||
$faktaNegatifFiltered = is_array($faktaNegatif)
|
||||
? array_filter($faktaNegatif, function ($item) {
|
||||
return !empty(trim($item));
|
||||
})
|
||||
: [];
|
||||
@endphp
|
||||
|
||||
@if (!empty($faktaNegatifFiltered))
|
||||
<table style="width: 100%; border-collapse: collapse;">
|
||||
@foreach ($faktaNegatifFiltered as $key => $item)
|
||||
<tr>
|
||||
<td>{!! nl2br(e($item)) !!}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
@else
|
||||
<p>Tidak ada faktor negatif yang teridentifikasi.</p>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@include('lpj::surveyor.components.print-out.footer')
|
||||
130
resources/views/surveyor/components/print-out/footer.blade.php
Normal file
130
resources/views/surveyor/components/print-out/footer.blade.php
Normal file
@@ -0,0 +1,130 @@
|
||||
<div class="no-break">
|
||||
<table style="width: 100%; border-collapse: collapse;">
|
||||
<tr>
|
||||
<td style="border: 1px solid #000;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
Jakarta {{ formatTanggalIndonesia($permohonan->penilaian->waktu_penilaian) }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
TTD
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table style="width: 100%; border-collapse: collapse; text-align: center;">
|
||||
<tr>
|
||||
@if (isset($forminspeksi['signature']['penilai']['image']) && !empty($forminspeksi['signature']['penilai']['image']))
|
||||
@php
|
||||
$imagePath = $forminspeksi['signature']['penilai']['image'];
|
||||
|
||||
$isBase64 = str_starts_with($imagePath, 'data:image');
|
||||
|
||||
if (!$isBase64) {
|
||||
$relativePath = str_replace(url('storage') . '/', '', $imagePath);
|
||||
$absolutePath = storage_path('app/public/' . $relativePath);
|
||||
} else {
|
||||
$absolutePath = $imagePath;
|
||||
}
|
||||
|
||||
@endphp
|
||||
<td style="width: 100px;">
|
||||
<img style="width: 100px;" src="{{ $absolutePath }}" alt="">
|
||||
</td>
|
||||
@endif
|
||||
|
||||
@if (isset($forminspeksi['signature']['cabang']))
|
||||
@php
|
||||
$imagePath = $forminspeksi['signature']['cabang']['image'];
|
||||
|
||||
$isBase64 = str_starts_with($imagePath, 'data:image');
|
||||
|
||||
if (!$isBase64) {
|
||||
$relativePath = str_replace(url('storage') . '/', '', $imagePath);
|
||||
$absolutePath = storage_path('app/public/' . $relativePath);
|
||||
} else {
|
||||
$absolutePath = $imagePath;
|
||||
}
|
||||
|
||||
@endphp
|
||||
<td style="width: 100px;">
|
||||
<img style="width: 100px;" src="{{ $absolutePath }}" alt="">
|
||||
</td>
|
||||
@endif
|
||||
|
||||
|
||||
@if (isset($forminspeksi['signature']['debitur']))
|
||||
<td style="width: 100px;">
|
||||
<img style="width: 100px;" src="{{ $forminspeksi['signature']['debitur']['image'] }}"
|
||||
alt="Debitur/Perwakilan">
|
||||
</td>
|
||||
@endif
|
||||
|
||||
<!-- K.J.P.P -->
|
||||
@if (isset($forminspeksi['signature']['kjjp']))
|
||||
<td style="width: 100px;">
|
||||
<img style="width: 100px;" src="{{ $forminspeksi['signature']['kjjp']['image'] }}"
|
||||
alt="KJPP">
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
@if (isset($forminspeksi['signature']['penilai']['name']))
|
||||
<td style=" text-align: center">
|
||||
<span>{{ ucwords(strtolower($forminspeksi['signature']['penilai']['name'])) }}</span>
|
||||
<br />
|
||||
<span>{{ ucwords(strtolower('PENILAI')) }}</span>
|
||||
</td>
|
||||
@endif
|
||||
@if (isset($forminspeksi['signature']['cabang']['name']))
|
||||
<td style=" text-align: center">
|
||||
<span>{{ ucwords(strtolower($forminspeksi['signature']['cabang']['name'])) }}</span>
|
||||
<br />
|
||||
<span>{{ ucwords(strtolower('CABANG')) }}</span>
|
||||
</td>
|
||||
@endif
|
||||
@if (isset($forminspeksi['signature']['debitur']['name']))
|
||||
<td style=" text-align: center">
|
||||
<span>{{ ucwords(strtolower($forminspeksi['signature']['debitur']['name'])) }}</span>
|
||||
<br />
|
||||
<span>{{ ucwords(strtolower('DEBITUR/PERWAKILAN')) }}</span>
|
||||
</td>
|
||||
@endif
|
||||
@if (isset($forminspeksi['signature']['kjjp']['name']))
|
||||
<td style=" text-align: center">
|
||||
<span>{{ ucwords(strtolower($forminspeksi['signature']['kjjp']['name'])) }}</span>
|
||||
<br />
|
||||
<span>{{ strtoupper('K.J.P.P') }}</span>
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<footer id="footer">
|
||||
Cabang : {{ $permohonan->debiture->branch->name ?? '' }}
|
||||
</footer>
|
||||
<script type="text/php">
|
||||
if (isset($pdf)) {
|
||||
$pdf->page_script('
|
||||
$font = $fontMetrics->get_font("Arial, Helvetica, sans-serif", "normal");
|
||||
$size = 10;
|
||||
$pageText = $PAGE_NUM;
|
||||
$y = 800;
|
||||
$x = 550;
|
||||
$pdf->text($x, $y, $pageText, $font, $size);
|
||||
');
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
208
resources/views/surveyor/components/print-out/header.blade.php
Normal file
208
resources/views/surveyor/components/print-out/header.blade.php
Normal file
@@ -0,0 +1,208 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>Hasil Inspeksi</title>
|
||||
<style>
|
||||
* {
|
||||
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
|
||||
/** Define the header rules **/
|
||||
@page {
|
||||
margin-top: 100px;
|
||||
margin-bottom: 50px;
|
||||
|
||||
}
|
||||
|
||||
#header {
|
||||
position: fixed;
|
||||
top: -80px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 50px;
|
||||
text-align: center;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
.header-logo {
|
||||
position: absolute;
|
||||
left: 20px;
|
||||
top: 10px;
|
||||
max-height: 80px;
|
||||
max-width: 150px;
|
||||
}
|
||||
|
||||
.header-title {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
#footer {
|
||||
position: fixed;
|
||||
bottom: -50px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 50px;
|
||||
text-align: center;
|
||||
border-top: 1px solid #ddd;
|
||||
padding-top: 10px;
|
||||
font-size: 9px;
|
||||
}
|
||||
|
||||
.page-number:after {
|
||||
content: counter(page) " dari " counter(pages);
|
||||
}
|
||||
|
||||
.content {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.page-break {
|
||||
page-break-after: always;
|
||||
}
|
||||
|
||||
#footer {
|
||||
position: fixed;
|
||||
bottom: -50px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 50px;
|
||||
text-align: left;
|
||||
border-top: 1px solid #ddd;
|
||||
padding-top: 10px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
body {
|
||||
margin-top: 3cm;
|
||||
margin-bottom: 120px;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.border {
|
||||
border: 1px solid #000;
|
||||
}
|
||||
|
||||
.no-break {
|
||||
page-break-inside: avoid;
|
||||
page-break-before: auto;
|
||||
page-break-after: auto;
|
||||
}
|
||||
|
||||
.custom-table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.custom-table td {
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.custom-table td:first-child {
|
||||
font-weight: bold;
|
||||
width: 30%;
|
||||
/* Sesuaikan lebar kolom keterangan */
|
||||
}
|
||||
|
||||
table.checkbox-list {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
td.checkbox-item {
|
||||
width: 33.33%;
|
||||
vertical-align: top;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
label.checkbox-label {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
label.checkbox-label input[type="checkbox"] {
|
||||
margin-right: 6px;
|
||||
transform: scale(1.3);
|
||||
/* Memperkecil ukuran checkbox */
|
||||
}
|
||||
|
||||
@media print {
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
}
|
||||
tr {
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
td, th {
|
||||
border: 1px solid #000;
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
@php
|
||||
$data = '';
|
||||
$dokument = null;
|
||||
foreach ($permohonan->documents as $dokumen) {
|
||||
$data .= $dokumen->jenisJaminan->name . ', ';
|
||||
$dokument = $dokumen;
|
||||
}
|
||||
$data = rtrim($data, ', ');
|
||||
|
||||
$senior_officer = null;
|
||||
if ($permohonan->debiture && $permohonan->documents) {
|
||||
foreach ($permohonan->documents as $dokumen) {
|
||||
$penilai = $permohonan->penilaian->userPenilai->where('role', 'penilai')->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 ($user && $user->hasRole('senior-officer')) {
|
||||
$senior_officer = $user;
|
||||
break 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@endphp
|
||||
|
||||
<body style="width: 90%; margin: auto">
|
||||
<header id="header">
|
||||
<table style="width: 100%; border: none;">
|
||||
<tr>
|
||||
<td style="width: 20%; text-align: left;" class="header-left">
|
||||
@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>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</header>
|
||||
@@ -67,19 +67,21 @@
|
||||
}
|
||||
// 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]) && !empty($forminspeksi[$type]) && is_string($forminspeksi[$type]);
|
||||
});
|
||||
@endphp
|
||||
@foreach ($validPhotoTypes as $type)
|
||||
@php
|
||||
$imagePath = $forminspeksi[$type] ?? null;
|
||||
$imageUrl = is_string($imagePath) ? asset('storage/' . $imagePath) : null;
|
||||
|
||||
@endphp
|
||||
@if ($imagePath && file_exists(storage_path('app/public/' . $imagePath)))
|
||||
<tr>
|
||||
<td style="20%"> {{ $customLabels[$type] ?? '' }}</td>
|
||||
<td width="1%" style="vertical-align: top;"></td>
|
||||
<td style="width: 79%">
|
||||
<img src="{{ storage_path('app/public/' . $imagePath) }}" alt="{{ $imagePath }}"
|
||||
<img src="{{ storage_path('app/public/' . $imagePath) }}" alt="{{ $imageUrl }}"
|
||||
style="max-height: 400px; height: auto; max-width: 100%;">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -0,0 +1,713 @@
|
||||
@include('lpj::surveyor.components.print-out.header')
|
||||
|
||||
<div style="border: 1px solid #000;">
|
||||
<table
|
||||
style="width: 100%; border-top: none; border-bottom: 1px solid #000; border-collapse: collapse; border-left: none; border-right: none;">
|
||||
|
||||
<tr>
|
||||
<td style="text-align: center; margin-top: 5px; ">
|
||||
<h2 style=" text-transform: uppercase; text-align: center; margin: 0;">
|
||||
Tujuan Penilaian
|
||||
</h2>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table style="width: 100%;">
|
||||
<tr>
|
||||
<td style="vertical-align: top;">
|
||||
<table>
|
||||
<tr>
|
||||
|
||||
<td style="width: 25%; padding: 2px;">Tujuan Penilai</td>
|
||||
<td style="width: 1%; padding: 2px;">:</td>
|
||||
<td style="vertical-align: top; padding: 2px;">
|
||||
{{ $permohonan->tujuanPenilaian->name ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 25%; padding: 2px; vertical-align: top;">Cabang/Pemohon</td>
|
||||
<td style="width: 1%; vertical-align: top;">:</td>
|
||||
<td style="vertical-align: top; vertical-align: top;">
|
||||
{{ $permohonan->debiture->branch->name ?? '' }} / {{ $permohonan->user->name ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
|
||||
<td style="vertical-align: top;">
|
||||
<table>
|
||||
<tr>
|
||||
<td style="width: 25%; padding: 2px; vertical-align: top;">Tanggal Dibuat</td>
|
||||
<td style="width: 1%; vertical-align: top;">:</td>
|
||||
<td style="vertical-align: top; vertical-align: top;">
|
||||
{{ formatTanggalIndonesia($permohonan->created_at) }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
<td style="width: 25%; padding: 2px;">
|
||||
Tanggal Survey</td>
|
||||
<td style="width: 1%; padding: 2px;">:</td>
|
||||
<td style="vertical-align: top; padding: 2px;">
|
||||
{{ formatTanggalIndonesia($permohonan->penilaian->tanggal_kunjungan) }}</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table
|
||||
style="width: 100%; border-top: 1px solid #000; border-bottom: 1px solid #000; border-collapse: collapse; border-left: none; border-right: none;">
|
||||
|
||||
<tr>
|
||||
<td style="text-align: center; margin-top: 5px; ">
|
||||
<h2 style=" text-transform: uppercase; text-align: center; margin: 0;">
|
||||
Identitas Debitur
|
||||
</h2>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px; vertical-align: top;">Nama</td>
|
||||
<td style="width: 1%; vertical-align: top;">:</td>
|
||||
<td style="vertical-align: top; width: 79%;">{{ $permohonan->debiture->name ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px;">Nama Wakil</td>
|
||||
<td style="width: 1%; padding: 2px;">:</td>
|
||||
<td style="vertical-align: top; padding: 2px;">
|
||||
@if (isset($forminspeksi['asset']['debitur_perwakilan']) && !empty($forminspeksi['asset']['debitur_perwakilan']))
|
||||
@foreach ($forminspeksi['asset']['debitur_perwakilan'] as $key => $item)
|
||||
{{ $item }}
|
||||
@endforeach
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 20%; padding: 2px;">Hubungan Calon debitur</td>
|
||||
<td style="width: 1%; padding: 2px;">:</td>
|
||||
<td style="vertical-align: top; padding: 2px;">
|
||||
@if (isset($forminspeksi['asset']['debitur_perwakilan']) && !empty($forminspeksi['asset']['debitur_perwakilan']))
|
||||
@foreach ($forminspeksi['asset']['debitur_perwakilan'] as $key => $item)
|
||||
{{ $item }}
|
||||
@endforeach
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table
|
||||
style="width: 100%; border-top: 1px solid #000; border-bottom: 1px solid #000; border-collapse: collapse; border-left: none; border-right: none;">
|
||||
|
||||
<tr>
|
||||
<td style="text-align: center; margin-top: 5px; ">
|
||||
<h2 style=" text-transform: uppercase; text-align: center; margin: 0;">
|
||||
Lokasi Jaminan
|
||||
</h2>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table style="width: 100%">
|
||||
|
||||
|
||||
<tr>
|
||||
<td width="20%">Terletak di</td>
|
||||
<td style="width: 1%; vertical-align: top;">:</td>
|
||||
<td> {{ $alamat['address'] ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>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>Kotamadya</td>
|
||||
<td style="width: 1%; vertical-align: top;">:</td>
|
||||
<td> {{ $alamat['city_code'] ?? '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Propinsi</td>
|
||||
<td style="width: 1%; vertical-align: top;">:</td>
|
||||
<td>{{ $alamat['province_code'] ?? '' }}</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
<div class="no-break" style="border-bottom: 1px solid #000;">
|
||||
<table
|
||||
style="width: 100%; border-top: 1px solid #000; border-bottom: 1px solid #000; border-collapse: collapse; border-left: none; border-right: none;">
|
||||
|
||||
<tr>
|
||||
<td style="text-align: center; margin-top: 5px; ">
|
||||
<h2 style=" text-transform: uppercase; text-align: center; margin: 0;">
|
||||
STATUS KEPEMILIKAN, HUBUNGAN DAN PENGHUNI
|
||||
</h2>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table>
|
||||
@include('lpj::component.print-out-dokument')
|
||||
|
||||
<tr>
|
||||
@php
|
||||
// Ambil nilai sesuai dan tidak sesuai
|
||||
$hubCadebSesuai = $forminspeksi['asset']['hub_cadeb']['sesuai'] ?? null;
|
||||
$hubCadebTidakSesuai = $forminspeksi['asset']['hub_cadeb']['tidak sesuai'] ?? null;
|
||||
@endphp
|
||||
<td style="vertical-align: top;">Hubungan Pemilik Jaminan dengan Debitur</td>
|
||||
<td style="width:1%; padding: 2px; vertical-align: top;">:</td>
|
||||
<td>
|
||||
<div style="margin-bottom: 10px;">
|
||||
<label>
|
||||
<input type="radio" name="hubCadebStatus" value="sesuai"
|
||||
{{ $hubCadebSesuai ? 'checked' : '' }}> Sesuai
|
||||
</label>
|
||||
<label style="margin-left: 20px;">
|
||||
<input type="radio" name="hubCadebStatus" value="tidak sesuai"
|
||||
{{ $hubCadebTidakSesuai ? 'checked' : '' }}> Tidak Sesuai
|
||||
</label>
|
||||
</div>
|
||||
|
||||
@if (!empty($basicData['hubCadeb']))
|
||||
<table>
|
||||
<tr>
|
||||
@php $count = 0; @endphp
|
||||
@foreach ($basicData['hubCadeb'] as $item)
|
||||
<td>
|
||||
<label>
|
||||
<input type="checkbox"
|
||||
{{ isset($item->name) && ($hubCadebSesuai === $item->name || $hubCadebTidakSesuai === $item->name) ? 'checked' : '' }}>
|
||||
{{ $item->name ?? '' }}
|
||||
</label>
|
||||
</td>
|
||||
@php $count++; @endphp
|
||||
|
||||
@if ($count % 3 === 0)
|
||||
</tr>
|
||||
<tr>
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
@if ($count % 3 !== 0)
|
||||
@for ($i = 0; $i < 3 - ($count % 3); $i++)
|
||||
<td></td>
|
||||
@endfor
|
||||
@endif
|
||||
</tr>
|
||||
</table>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
@php
|
||||
$statusKey = isset($forminspeksi['asset']['hub_cadeb_penghuni']['sesuai']) ? 'sesuai' : 'tidak sesuai';
|
||||
$selectedData = $forminspeksi['asset']['hub_cadeb_penghuni'][$statusKey] ?? null;
|
||||
@endphp
|
||||
|
||||
<td style="vertical-align: top; width: 20%; padding: 2px;">Hubungan Penghuni Jaminan dengan Debitur</td>
|
||||
<td style="width:1%; padding: 2px; vertical-align: top;">:</td>
|
||||
<td style="vertical-align: top;">
|
||||
@if (isset($selectedData))
|
||||
{{ $selectedData ?? '' }}
|
||||
</td>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<table
|
||||
style="width: 100%; border-top: 1px solid #000; border-bottom: 1px solid #000; border-collapse: collapse; border-left: none; border-right: none;">
|
||||
<tr>
|
||||
<td style="text-align: center; margin-top: 5px; ">
|
||||
<h2 style=" text-transform: uppercase; text-align: center; margin: 0;">
|
||||
Kondisi Fisik Objek
|
||||
</h2>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table style="width: 100%;">
|
||||
<tr>
|
||||
<td style="vertical-align: top; width: 25%;">Kendaraan</td>
|
||||
<td width="1%" style="vertical-align: top;">:</td>
|
||||
<td width="100%" style="vertical-align: top;">
|
||||
<table style="width: 100%;">
|
||||
@if (isset($basicData['jenisKendaraan']))
|
||||
@foreach ($basicData['jenisKendaraan'] as $item)
|
||||
<tr>
|
||||
<td width="40%">
|
||||
<label class="form-label max-w-56 gap-2.5">
|
||||
<input class="checkbox" name="kendaraan[]" type="checkbox"
|
||||
value="{{ $item->name }}"
|
||||
{{ in_array($item->name, old('kendaraan', $forminspeksi['kendaraan'] ?? [])) ? 'checked' : '' }} />
|
||||
{{ $item->name }}
|
||||
</label>
|
||||
</td>
|
||||
<td width="1%"></td>
|
||||
<td width="100%">
|
||||
<p>{{ old('kendaraan_input.' . $loop->index, $forminspeksi['kendaraan_input'][$loop->index] ?? '') }}</p>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="vertical-align: top;">Kondisi</td>
|
||||
<td width="1%" style="vertical-align: top;">:</td>
|
||||
<td width="100%" style="vertical-align: top;"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="vertical-align: top;">Nomor Polisi</td>
|
||||
<td width="1%" style="vertical-align: top;">:</td>
|
||||
<td width="100%" style="vertical-align: top;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<label>
|
||||
<input type="radio" name="luas_bangunan_radio" value="sesuai" >
|
||||
Sesuai
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label>
|
||||
<input type="radio" name="luas_bangunan_radio" value="tidak sesuai" >
|
||||
Tidak Sesuai
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="vertical-align: top;">Merek</td>
|
||||
<td width="1%" style="vertical-align: top;">:</td>
|
||||
<td width="100%" style="vertical-align: top;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<label>
|
||||
<input type="radio" name="luas_bangunan_radio" value="sesuai" >
|
||||
Sesuai
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label>
|
||||
<input type="radio" name="luas_bangunan_radio" value="tidak sesuai" >
|
||||
Tidak Sesuai
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="vertical-align: top;">Warana</td>
|
||||
<td width="1%" style="vertical-align: top;">:</td>
|
||||
<td width="100%" style="vertical-align: top;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<label>
|
||||
<input type="radio" name="luas_bangunan_radio" value="sesuai" >
|
||||
Sesuai
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label>
|
||||
<input type="radio" name="luas_bangunan_radio" value="tidak sesuai" >
|
||||
Tidak Sesuai
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="vertical-align: top;">Nomor Rangka</td>
|
||||
<td width="1%" style="vertical-align: top;">:</td>
|
||||
<td width="100%" style="vertical-align: top;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<label>
|
||||
<input type="radio" name="luas_bangunan_radio" value="sesuai" >
|
||||
Sesuai
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label>
|
||||
<input type="radio" name="luas_bangunan_radio" value="tidak sesuai" >
|
||||
Tidak Sesuai
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="vertical-align: top;">Nomor Mesin</td>
|
||||
<td width="1%" style="vertical-align: top;">:</td>
|
||||
<td width="100%" style="vertical-align: top;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<label>
|
||||
<input type="radio" name="luas_bangunan_radio" value="sesuai" >
|
||||
Sesuai
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label>
|
||||
<input type="radio" name="luas_bangunan_radio" value="tidak sesuai" >
|
||||
Tidak Sesuai
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="vertical-align: top;">Posisi Kilometer</td>
|
||||
<td width="1%" style="vertical-align: top;">:</td>
|
||||
<td width="100%" style="vertical-align: top;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<label>
|
||||
<input type="radio" name="luas_bangunan_radio" value="sesuai" >
|
||||
Sesuai
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label>
|
||||
<input type="radio" name="luas_bangunan_radio" value="tidak sesuai" >
|
||||
Tidak Sesuai
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
@php
|
||||
$inputDataJaminan = [
|
||||
[
|
||||
'label' => 'Transmisi',
|
||||
'value' => ['Otomatis', 'Manual'],
|
||||
'name' => 'transmisi',
|
||||
'index' => 0,
|
||||
],
|
||||
[
|
||||
'label' => 'Mesin dan panel Instrument',
|
||||
'value' => ['Terawat', 'Cukup Terawat', 'Tidak Terawat'],
|
||||
'name' => 'mesin_panel_instrument',
|
||||
'index' => 1,
|
||||
],
|
||||
[
|
||||
'label' => 'Fungsi Mesin dan panel Instument',
|
||||
'value' => ['Berfungsi', 'Rusak'],
|
||||
'name' => 'fungsi_mesin_panel_instrument',
|
||||
'index' => 2,
|
||||
],
|
||||
[
|
||||
'label' => 'Interior',
|
||||
'value' => ['Terawat', 'Cukup Terawat', 'Tidak Terawat'],
|
||||
'name' => 'interior',
|
||||
'index' => 3,
|
||||
],
|
||||
[
|
||||
'label' => 'Jumlah pintu',
|
||||
'value' => ['Dua Pintu', 'Empat Pintu', 'Lain-Lain'],
|
||||
'name' => 'jumlah_pintu',
|
||||
'index' => 4,
|
||||
],
|
||||
[
|
||||
'label' => 'Rangka dan karoseri',
|
||||
'value' => ['Terawat', 'Cukup Terawat', 'Tidak Terawat'],
|
||||
'name' => 'rangka_karoseri',
|
||||
'index' => 5,
|
||||
],
|
||||
[
|
||||
'label' => 'Ban',
|
||||
'value' => ['Standard', 'Tidak Standard'],
|
||||
'name' => 'ban',
|
||||
'index' => 6,
|
||||
],
|
||||
[
|
||||
'label' => 'Velg',
|
||||
'value' => ['Standard', 'Tidak Standard'],
|
||||
'name' => 'velg',
|
||||
'index' => 7,
|
||||
],
|
||||
[
|
||||
'label' => 'Bamper Depan',
|
||||
'value' => ['Terawat', 'Cukup Terawat', 'Tidak Terawat'],
|
||||
'name' => 'bamper_depan',
|
||||
'index' => 8,
|
||||
],
|
||||
[
|
||||
'label' => 'Bamper Belakang',
|
||||
'value' => ['Terawat', 'Cukup Terawat', 'Tidak Terawat'],
|
||||
'name' => 'bamper_belakang',
|
||||
'index' => 9,
|
||||
],
|
||||
[
|
||||
'label' => 'Lampu depan',
|
||||
'value' => ['Terawat', 'Cukup Terawat', 'Tidak Terawat'],
|
||||
'name' => 'lampu_depan',
|
||||
'index' => 10,
|
||||
],
|
||||
[
|
||||
'label' => 'Lampu belakang',
|
||||
'value' => ['Terawat', 'Cukup Terawat', 'Tidak Terawat'],
|
||||
'name' => 'lampu_belakang',
|
||||
'index' => 11,
|
||||
],
|
||||
[
|
||||
'label' => 'Kaca kendaraan',
|
||||
'value' => ['Terawat', 'Cukup Terawat', 'Tidak Terawat'],
|
||||
'name' => 'kaca_kendaraan',
|
||||
'index' => 12,
|
||||
],
|
||||
[
|
||||
'label' => 'Air Conditioner',
|
||||
'value' => ['Ada', 'Tidak Ada'],
|
||||
'name' => 'air_conditioner',
|
||||
'index' => 13,
|
||||
],
|
||||
[
|
||||
'label' => 'Tape/Radio/CD dan perlengkapan (Equalizer, Booster, dll)',
|
||||
'value' => ['Ada', 'Tidak Ada'],
|
||||
'name' => 'tape_radio_cd',
|
||||
'index' => 14,
|
||||
],
|
||||
[
|
||||
'label' => 'Sensor parkir',
|
||||
'value' => ['Ada', 'Tidak Ada'],
|
||||
'name' => 'sensor_parkir',
|
||||
'index' => 15,
|
||||
],
|
||||
[
|
||||
'label' => 'Sensor Camera (360), Recorder',
|
||||
'value' => ['Ada', 'Tidak Ada'],
|
||||
'name' => 'sensor_camera_recorder',
|
||||
'index' => 16,
|
||||
],
|
||||
[
|
||||
'label' => 'Lcd',
|
||||
'value' => ['Ada', 'Tidak Ada'],
|
||||
'name' => 'lcd',
|
||||
'index' => 17,
|
||||
],
|
||||
[
|
||||
'label' => 'Sabuk Keselamatan',
|
||||
'value' => ['Ada', 'Tidak Ada'],
|
||||
'name' => 'sabuk_keselamatan',
|
||||
'index' => 18,
|
||||
],
|
||||
[
|
||||
'label' => 'Airbag',
|
||||
'value' => ['Ada', 'Tidak Ada'],
|
||||
'name' => 'airbag',
|
||||
'index' => 19,
|
||||
],
|
||||
[
|
||||
'label' => 'Asuransi',
|
||||
'value' => ['Ada', 'Tidak Ada'],
|
||||
'name' => 'asuransi',
|
||||
'index' => 20,
|
||||
],
|
||||
];
|
||||
@endphp
|
||||
|
||||
|
||||
@foreach ($inputDataJaminan as $item)
|
||||
<tr>
|
||||
<td style="vertical-align: top; width: 25%;">{{ $item['label'] }}</td>
|
||||
<td width="1%" style="vertical-align: top;">:</td>
|
||||
<td style="vertical-align: top;">
|
||||
<table style="width: 100%; border-collapse: collapse;">
|
||||
@foreach ($item['value'] as $value)
|
||||
<tr>
|
||||
<td>
|
||||
<label class="form-label max-w-56 gap-2.5" style="width: 500px">
|
||||
<input class="checkbox" name="{{ $item['name'] }}[]" type="checkbox"
|
||||
value="{{ $value }}"
|
||||
{{ in_array($value, old($item['name'], $forminspeksi[$item['name']] ?? [])) ? 'checked' : '' }} />
|
||||
{{ $value }}
|
||||
@if ($forminspeksi[$item['name'] . '_input'][$loop->index] != null)
|
||||
-
|
||||
{{ old($item['name'] . '_input' . $loop->index, $forminspeksi[$item['name'] . '_input'][$loop->index] ?? '') }}
|
||||
@endif
|
||||
</label>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
<tr>
|
||||
<td style="vertical-align: top;">Perusahaan Asuransi</td>
|
||||
<td width="1%" style="vertical-align: top;">:</td>
|
||||
<td width="100%" style="vertical-align: top;">{{ $forminspeksi['perusahaan_asuransi'] ?? '' }}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="vertical-align: top;">Tahun Berakhir</td>
|
||||
<td width="1%" style="vertical-align: top;">:</td>
|
||||
<td width="100%" style="vertical-align: top;">
|
||||
{{ isset($forminspeksi['tahun_berakhir']) ? formatTanggalIndonesia($forminspeksi['tahun_berakhir']) : '' }}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<div>
|
||||
<table
|
||||
style="width: 100%; border-top: 1px solid #000; border-bottom: 1px solid #000; border-collapse: collapse; border-left: none; border-right: none;">
|
||||
|
||||
|
||||
<tr>
|
||||
<td style="text-align: center; margin-top: 5px;">
|
||||
<h2 style=" text-transform: uppercase; text-align: center; margin: 0;">
|
||||
ANalisa Fakta
|
||||
</h2>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table style="width: 100%">
|
||||
<tr>
|
||||
<td width="25%" style="vertical-align: top;">Faktor Positif</td>
|
||||
<td width="1%" style="vertical-align: top;">:</td>
|
||||
<td width="100%" style="vertical-align: top;">
|
||||
@isset($forminspeksi['fakta_positif'])
|
||||
<table style="width: 100%; border-collapse: collapse;">
|
||||
@foreach ($forminspeksi['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;">Faktor Negatif</td>
|
||||
<td width="1%" style="vertical-align: top;">:</td>
|
||||
<td width="100%" style="vertical-align: top;">
|
||||
@php
|
||||
$faktaNegatif = $forminspeksi['fakta_negatif'] ?? [];
|
||||
$faktaNegatifFiltered = is_array($faktaNegatif)
|
||||
? array_filter($faktaNegatif, function ($item) {
|
||||
return !empty(trim($item));
|
||||
})
|
||||
: [];
|
||||
@endphp
|
||||
|
||||
@if (!empty($faktaNegatifFiltered))
|
||||
<table style="width: 100%; border-collapse: collapse;">
|
||||
@foreach ($faktaNegatifFiltered as $key => $item)
|
||||
<tr>
|
||||
<td>{!! nl2br(e($item)) !!}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
@else
|
||||
<p>Tidak ada faktor negatif yang teridentifikasi.</p>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td width="25%" style="vertical-align: top;">Analisa Makro</td>
|
||||
<td width="1%" style="vertical-align: top;">:</td>
|
||||
<td width="100%" style="vertical-align: top;">
|
||||
@php
|
||||
$faktaNegatif = $forminspeksi['analisa_makro'] ?? [];
|
||||
$faktaNegatifFiltered = is_array($faktaNegatif)
|
||||
? array_filter($faktaNegatif, function ($item) {
|
||||
return !empty(trim($item));
|
||||
})
|
||||
: [];
|
||||
@endphp
|
||||
|
||||
@if (!empty($faktaNegatifFiltered))
|
||||
<table style="width: 100%; border-collapse: collapse;">
|
||||
@foreach ($faktaNegatifFiltered as $key => $item)
|
||||
<tr>
|
||||
<td>{!! nl2br(e($item)) !!}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
@else
|
||||
<p>Tidak ada faktor negatif yang teridentifikasi.</p>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td width="20%" style="vertical-align: top;">Kesimpulan</td>
|
||||
<td width="1%" style="vertical-align: top;">:</td>
|
||||
<td width="100%" style="vertical-align: top;">
|
||||
@php
|
||||
$faktaNegatif = $forminspeksi['catatan'] ?? [];
|
||||
$faktaNegatifFiltered = is_array($faktaNegatif)
|
||||
? array_filter($faktaNegatif, function ($item) {
|
||||
return !empty(trim($item));
|
||||
})
|
||||
: [];
|
||||
@endphp
|
||||
|
||||
@if (!empty($faktaNegatifFiltered))
|
||||
<table style="width: 100%; border-collapse: collapse;">
|
||||
@foreach ($faktaNegatifFiltered as $key => $item)
|
||||
<tr>
|
||||
<td>{!! nl2br(e($item)) !!}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
@else
|
||||
<p>Tidak ada faktor negatif yang teridentifikasi.</p>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@include('lpj::surveyor.components.print-out.footer')
|
||||
1087
resources/views/surveyor/components/print-out/mesin.blade.php
Normal file
1087
resources/views/surveyor/components/print-out/mesin.blade.php
Normal file
File diff suppressed because it is too large
Load Diff
1097
resources/views/surveyor/components/print-out/pesawat.blade.php
Normal file
1097
resources/views/surveyor/components/print-out/pesawat.blade.php
Normal file
File diff suppressed because it is too large
Load Diff
@@ -101,10 +101,7 @@
|
||||
@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 approveReschedule(penilaianId, permohonanId, noReg, debitur, reschedule_date, reschedule_note) {
|
||||
Swal.fire({
|
||||
title: 'Konfirmasi',
|
||||
@@ -613,8 +610,7 @@
|
||||
</button>
|
||||
`;
|
||||
} else {
|
||||
if (data.penilaian.waktu_penilaian == null ||
|
||||
(data.penilaian.waktu_penilaian && data.penilaian.authorized_status == null)) {
|
||||
if (!data.penilaian.waktu_penilaian) {
|
||||
actionHtml += `
|
||||
<a class="btn btn-sm btn-icon btn-clear btn-primary"
|
||||
onclick="prosesJadwalSurvey(${data.penilaian.id})"
|
||||
@@ -629,7 +625,7 @@
|
||||
`;
|
||||
}
|
||||
} else if (data.status === 'approved-reschedule' || data.status ===
|
||||
'rejected-reschedule') {
|
||||
'rejected-reschedule' || data.status === 'request-jadwal') {
|
||||
actionHtml += `
|
||||
<span class="badge badge-xs badge-outline badge-warning text-4xs">Menunggu Pemohon</span>
|
||||
`;
|
||||
|
||||
@@ -673,46 +673,64 @@ Breadcrumbs::for('noc', function (BreadcrumbTrail $trail) {
|
||||
$trail->push('NOC', route('noc.index'));
|
||||
});
|
||||
|
||||
Breadcrumbs::for('noc.edit', function (BreadcrumbTrail $trail) {
|
||||
$trail->parent('noc');
|
||||
$trail->push('Proses NOC');
|
||||
Breadcrumbs::for('noc.edit', function (BreadcrumbTrail $trail) {
|
||||
$trail->parent('noc');
|
||||
$trail->push('Proses NOC');
|
||||
});
|
||||
|
||||
Breadcrumbs::for('laporan-external', function (BreadcrumbTrail $trail) {
|
||||
$trail->push('Laporan External', route('laporan-external.index'));
|
||||
});
|
||||
|
||||
Breadcrumbs::for('laporan-external.show', function (BreadcrumbTrail $trail) {
|
||||
$trail->parent('laporan-external');
|
||||
$trail->push('Show Laporan External');
|
||||
});
|
||||
|
||||
|
||||
Breadcrumbs::for('laporan-external.create', function (BreadcrumbTrail $trail) {
|
||||
$trail->parent('laporan-external');
|
||||
$trail->push('Tambah Laporan External', route('laporan-external.create'));
|
||||
});
|
||||
|
||||
|
||||
Breadcrumbs::for('laporan-external.edit', function (BreadcrumbTrail $trail) {
|
||||
$trail->parent('laporan-external');
|
||||
$trail->push('Data Laporan External');
|
||||
});
|
||||
|
||||
Breadcrumbs::for('basicdata.jenis-lampiran', function (BreadcrumbTrail $trail) {
|
||||
$trail->parent('basicdata');
|
||||
$trail->push('Jenis Lampiran', route('basicdata.jenis-lampiran.index'));
|
||||
});
|
||||
|
||||
Breadcrumbs::for('basicdata.jenis-lampiran.create', function (BreadcrumbTrail $trail) {
|
||||
$trail->parent('basicdata.jenis-lampiran');
|
||||
$trail->push('Tambah Jenis Lampiran', route('basicdata.jenis-lampiran.create'));
|
||||
});
|
||||
|
||||
Breadcrumbs::for('basicdata.jenis-lampiran.edit', function (BreadcrumbTrail $trail, $id) {
|
||||
$trail->parent('basicdata.jenis-lampiran');
|
||||
$trail->push('Edit Jenis Lampiran', route('basicdata.jenis-lampiran.edit', $id));
|
||||
});
|
||||
|
||||
// Laporan Admin Kredit
|
||||
Breadcrumbs::for('laporan-admin-kredit', function ($trail) {
|
||||
$trail->push('Laporan Admin Kredit', route('laporan-admin-kredit.index'));
|
||||
});
|
||||
|
||||
// Laporan Admin Kredit Edit
|
||||
Breadcrumbs::for('laporan-admin-kredit-edit', function (BreadcrumbTrail $trail, $laporanAdminKredit) {
|
||||
$trail->parent('laporan-admin-kredit');
|
||||
$trail->push('Edit', route('laporan-admin-kredit.edit', $laporanAdminKredit->id));
|
||||
});
|
||||
|
||||
Breadcrumbs::for('laporan-external', function (BreadcrumbTrail $trail) {
|
||||
$trail->push('Laporan External', route('laporan-external.index'));
|
||||
});
|
||||
|
||||
Breadcrumbs::for('laporan-external.show', function (BreadcrumbTrail $trail) {
|
||||
$trail->parent('laporan-external');
|
||||
$trail->push('Show Laporan External');
|
||||
});
|
||||
|
||||
|
||||
Breadcrumbs::for('laporan-external.create', function (BreadcrumbTrail $trail) {
|
||||
$trail->parent('laporan-external');
|
||||
$trail->push('Tambah Laporan External', route('laporan-external.create'));
|
||||
});
|
||||
|
||||
|
||||
Breadcrumbs::for('laporan-external.edit', function (BreadcrumbTrail $trail) {
|
||||
$trail->parent('laporan-external');
|
||||
$trail->push('Data Laporan External');
|
||||
});
|
||||
|
||||
Breadcrumbs::for('basicdata.jenis-lampiran', function (BreadcrumbTrail $trail) {
|
||||
$trail->parent('basicdata');
|
||||
$trail->push('Jenis Lampiran', route('basicdata.jenis-lampiran.index'));
|
||||
});
|
||||
|
||||
Breadcrumbs::for('basicdata.jenis-lampiran.create', function (BreadcrumbTrail $trail) {
|
||||
$trail->parent('basicdata.jenis-lampiran');
|
||||
$trail->push('Tambah Jenis Lampiran', route('basicdata.jenis-lampiran.create'));
|
||||
});
|
||||
|
||||
Breadcrumbs::for('basicdata.jenis-lampiran.edit', function (BreadcrumbTrail $trail, $id) {
|
||||
$trail->parent('basicdata.jenis-lampiran');
|
||||
$trail->push('Edit Jenis Lampiran', route('basicdata.jenis-lampiran.edit', $id));
|
||||
});
|
||||
Breadcrumbs::for('bank-data', function ($trail) {
|
||||
$trail->push('Bank Data', route('bank-data.index'));
|
||||
});
|
||||
Breadcrumbs::for('laporan-penilai-jaminan', function ($trail) {
|
||||
$trail->push('Laporan Penilai Jaminan', route('laporan-penilai-jaminan.index'));
|
||||
});
|
||||
|
||||
// add andy
|
||||
require __DIR__ . '/breadcrumbs_registrasi.php';
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Modules\Lpj\Http\Controllers\ActivityController;
|
||||
use Modules\Lpj\Http\Controllers\ArahMataAnginController;
|
||||
use Modules\Lpj\Http\Controllers\BankDataController;
|
||||
use Modules\Lpj\Http\Controllers\CustomFieldController;
|
||||
use Modules\Lpj\Http\Controllers\DebitureController;
|
||||
use Modules\Lpj\Http\Controllers\DokumenJaminanController;
|
||||
@@ -12,14 +13,17 @@ use Modules\Lpj\Http\Controllers\IjinUsahaController;
|
||||
use Modules\Lpj\Http\Controllers\JenisDokumenController;
|
||||
use Modules\Lpj\Http\Controllers\JenisFasilitasKreditController;
|
||||
use Modules\Lpj\Http\Controllers\JenisJaminanController;
|
||||
use Modules\Lpj\Http\Controllers\JenisLampiranController;
|
||||
use Modules\Lpj\Http\Controllers\JenisLaporanController;
|
||||
use Modules\Lpj\Http\Controllers\JenisLampiranController;
|
||||
use Modules\Lpj\Http\Controllers\JenisLaporanController;
|
||||
use Modules\Lpj\Http\Controllers\JenisLegalitasJaminanController;
|
||||
use Modules\Lpj\Http\Controllers\JenisPenilaianController;
|
||||
use Modules\Lpj\Http\Controllers\KJPPController;
|
||||
use Modules\Lpj\Http\Controllers\LampiranDokumenController;
|
||||
use Modules\Lpj\Http\Controllers\LaporanController;
|
||||
use Modules\Lpj\Http\Controllers\LaporanExternalController;
|
||||
use Modules\Lpj\Http\Controllers\LampiranDokumenController;
|
||||
use Modules\Lpj\Http\Controllers\LaporanAdminKreditController;
|
||||
use Modules\Lpj\Http\Controllers\LaporanController;
|
||||
use Modules\Lpj\Http\Controllers\LaporanExternalController;
|
||||
use Modules\Lpj\Http\Controllers\LaporanPembatalanController;
|
||||
use Modules\Lpj\Http\Controllers\LaporanPermohonanController;
|
||||
use Modules\Lpj\Http\Controllers\NilaiPlafondController;
|
||||
use Modules\Lpj\Http\Controllers\NocController;
|
||||
use Modules\Lpj\Http\Controllers\PembatalanController;
|
||||
@@ -37,6 +41,7 @@ use Modules\Lpj\Http\Controllers\TeamsController;
|
||||
use Modules\Lpj\Http\Controllers\TenderController;
|
||||
use Modules\Lpj\Http\Controllers\TujuanPenilaianController;
|
||||
use Modules\Lpj\Http\Controllers\TujuanPenilaianKJPPController;
|
||||
use Modules\Lpj\Http\Controllers\LaporanPenilaiJaminanController;
|
||||
|
||||
// use Modules\Lpj\Http\Controllers\ActivityController;
|
||||
|
||||
@@ -596,6 +601,8 @@ Route::middleware(['auth'])->group(function () {
|
||||
Route::put('store-proses-survey/{id}', [SurveyorController::class, 'storeProsesSurvey'])->name('storeProsesSurvey');
|
||||
Route::post('save-edited-image/', [SurveyorController::class, 'saveEditedImage'])->name('saveEditedImage');
|
||||
|
||||
Route::post('upload-file-foto/{url}', [SurveyorController::class, 'uploadFileFoto'])->name('uploadFileFoto');
|
||||
|
||||
});
|
||||
|
||||
Route::name('penilai.')->prefix('penilai')->group(function () {
|
||||
@@ -629,6 +636,7 @@ Route::middleware(['auth'])->group(function () {
|
||||
Route::post('storeMemo', [PenilaiController::class, 'storeMemo'])->name('storeMemo');
|
||||
Route::post('store-memo-with-photos', [PenilaiController::class, 'storeMemoWithPhotos'])->name('storeMemoWithPhotos');
|
||||
Route::post('upload-temp-photo', [PenilaiController::class, 'uploadTempPhoto'])->name('uploadTempPhoto');
|
||||
Route::delete('delete-temp-photo', [PenilaiController::class, 'deleteTempPhoto'])->name('deleteTempPhoto');
|
||||
|
||||
Route::post('storeRap', [PenilaiController::class, 'storeRap'])->name('storeRap');
|
||||
Route::post('storeLpjSederhanadanStandard', [PenilaiController::class, 'storeLpjSederhanadanStandard'])->name('storeLpjSederhanadanStandard');
|
||||
@@ -658,6 +666,39 @@ Route::middleware(['auth'])->group(function () {
|
||||
Route::delete('lampiran/{lampiran}', [LampiranDokumenController::class, 'delete'])->name('lampiran.delete');
|
||||
|
||||
|
||||
Route::name('laporan-admin-kredit.')->prefix('laporan-admin-kredit')->group(function () {
|
||||
Route::get('/', [LaporanAdminKreditController::class, 'index'])->name('index');
|
||||
Route::get('datatables', [LaporanAdminKreditController::class, 'dataForDatatables'])->name('datatables');
|
||||
Route::get('export', [LaporanAdminKreditController::class, 'export'])->name('export');
|
||||
|
||||
Route::get('{id}/edit', [LaporanAdminKreditController::class,'edit'])->name('edit');
|
||||
Route::put('{id}', [LaporanAdminKreditController::class,'update'])->name('update');
|
||||
});
|
||||
|
||||
Route::name('bank-data.')->prefix('bank-data')->group(function () {
|
||||
Route::get('datatables', [BankDataController::class, 'dataForDatatables'])->name('datatables');
|
||||
});
|
||||
|
||||
Route::resource('bank-data', BankDataController::class);
|
||||
|
||||
Route::name('laporan-penilai-jaminan.')->prefix('laporan-penilai-jaminan')->group(function () {
|
||||
Route::get('/', [LaporanPenilaiJaminanController::class, 'index'])->name('index');
|
||||
Route::get('datatables', [LaporanPenilaiJaminanController::class, 'dataForDatatables'])->name('datatables');
|
||||
Route::get('export', [LaporanPenilaiJaminanController::class, 'export'])->name('export');
|
||||
});
|
||||
|
||||
Route::prefix('laporan-permohonan')->name('laporan-permohonan.')->group(function() {
|
||||
Route::get('datatables', [LaporanPermohonanController::class, 'dataForDatatables'])->name('data');
|
||||
Route::get('export', [LaporanPermohonanController::class, 'export'])->name('export');
|
||||
Route::get('/', [LaporanPermohonanController::class, 'index'])->name('index');
|
||||
});
|
||||
|
||||
// Laporan Pembatalan routes
|
||||
Route::prefix('laporan-pembatalan')->name('laporan-pembatalan.')->group(function () {
|
||||
Route::get('/', [LaporanPembatalanController::class, 'index'])->name('index');
|
||||
Route::get('/data', [LaporanPembatalanController::class, 'dataForDatatables'])->name('data');
|
||||
Route::get('/export', [LaporanPembatalanController::class, 'export'])->name('export');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user