Merge branch 'staging' into feature/senior-officer

This commit is contained in:
majid
2024-09-19 11:24:33 +07:00
24 changed files with 1873 additions and 756 deletions

View File

@@ -1,5 +1,6 @@
<form action="{{ isset($debitur->id) ? route('debitur.update', $debitur->id) : route('debitur.store') }}" method="POST" class="grid gap-5">
@if(isset($debitur->id))
<input type="hidden" name="id" value="{{ $debitur->id }}">
@method('PUT')
@endif
@csrf
@@ -29,7 +30,7 @@
CIF
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('cif') border-danger bg-danger-light @enderror" type="number" name="cif" value="{{ $debitur->cif ?? '' }}">
<input class="input @error('cif') border-danger bg-danger-light @enderror" type="number" name="cif" value="{{ $debitur->cif ?? '0000000000' }}">
@error('cif')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror

View File

@@ -59,7 +59,7 @@
@if(isset($document->id))
<input type="hidden" name="jenis_jaminan_id" value="{{ $document->jenis_jaminan_id }}">
@endif
<select onchange="getLegalitasJaminan()" {{ isset($document->id) ? "disabled" : "" }} class="input tomselect w-full @error('branch_id') border-danger bg-danger-light @enderror" name="jenis_jaminan_id" id="jenis_jaminan_id">
<select onchange="getLegalitasJaminan()" class="input tomselect w-full @error('branch_id') border-danger bg-danger-light @enderror" name="jenis_jaminan_id" id="jenis_jaminan_id">
<option value="">Pilih Jenis Jaminan</option>
@foreach($jenisJaminan as $row)
@if(isset($document))

View File

@@ -6,21 +6,25 @@
@section('content')
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
<div class="card pb-2.5">
<div class="card-header" id="basic_settings">
<div class="card-title flex flex-row gap-1.5">
@if(request()->get('permohonan_id'))
<a href="{{ route('permohonan.edit',['permohonan'=>request()->get('permohonan_id')]) }}" class="btn btn-xs {{ request()->routeIs('permohonan.edit') ? 'btn-outline btn-primary' : 'btn-light' }}">Data Permohonan</a>
@endif
<a href="{{ route('debitur.edit',array_merge(request()->query(),['debitur'=>$debitur->id])) }}" class="btn btn-xs {{ request()->routeIs('debitur.edit') ? 'btn-outline btn-primary' : 'btn-light' }}">Data Debitur</a>
<a href="{{ route('debitur.jaminan.index',array_merge(request()->query(),['id'=>$debitur->id])) }}" class="btn btn-xs {{ request()->routeIs('debitur.jaminan.index') ? 'btn-outline btn-primary' : 'btn-light' }}">Dokumen Jaminan</a>
<a href="{{ route('debitur.pemilik.index',array_merge(request()->query(),['id'=>$debitur->id])) }}" class="btn btn-xs {{ request()->routeIs('debitur.pemilik.index') ? 'btn-outline btn-primary' : 'btn-light' }}">Pemilk Jaminan</a>
</div>
<div class="flex items-center gap-2">
@if(isset($debitur->id))
@if(isset($debitur->id) && request()->get('permohonan_id') == null)
<a class="btn btn-sm btn-primary" href="{{ route('permohonan.create.debitur', $debitur->id) }}"> Buat Permohonan </a>
@endif
@if(request()->get('from') == 'permohonan')
<a href="{{ route('permohonan.create') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
@elseif(request()->get('permohonan_id'))
<a href="{{ route('permohonan.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
@else
<a href="{{ route('debitur.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
@endif

View File

@@ -71,21 +71,31 @@
Nama Lengkap
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('name') border-danger bg-danger-light @enderror" type="text " id="name" name="name" value="{{ $pemilik->name ?? '' }}" placeholder="Nama Pemilik Jaminan">
@error('name')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
<div class="flex flex-col lg:flex-row gap-2 w-full">
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('name') border-danger bg-danger-light @enderror" type="text " id="name" name="name" value="{{ $pemilik->name ?? '' }}" placeholder="Nama Pemilik Jaminan">
@error('name')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('nomor_id') border-danger bg-danger-light @enderror" type="number" name="nomor_id" value="{{ $debitur->nomor_id ?? '' }}" placeholder="Nomor ID/KTP">
@error('nomor_id')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
</div>
</div>
<div id="nama_sertifikat">
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Nomor ID/KTP
&nbsp;
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('nomor_id') border-danger bg-danger-light @enderror" type="number" name="nomor_id" value="{{ $debitur->nomor_id ?? '' }}">
@error('nomor_id')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
<button type="button" id="tambah_sertifikat" class="btn btn-primary btn-xs">Tambah Nama di Sertifikat</button>
</div>
</div>
@@ -242,3 +252,43 @@
</div>
</div>
@endsection
@push('scripts')
<script>
document.getElementById('tambah_sertifikat').addEventListener('click', function() {
const namaSertifikatDiv = document.getElementById('nama_sertifikat');
const newDiv = document.createElement('div');
newDiv.innerHTML = `
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 mb-5">
<label class="form-label max-w-56">
Nama Lengkap
</label>
<div class="flex flex-wrap items-baseline w-full">
<div class="flex flex-col lg:flex-row gap-2 w-full">
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('name') border-danger bg-danger-light @enderror" type="text" id="name" name="name" value="{{ $pemilik->name ?? '' }}" placeholder="Nama Pemilik Jaminan">
@error('name')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('nomor_id') border-danger bg-danger-light @enderror" type="number" name="nomor_id" value="{{ $debitur->nomor_id ?? '' }}" placeholder="Nomor ID/KTP">
@error('nomor_id')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
<button type="button" class="btn btn-danger btn-xs delete-button">Hapus</button>
</div>
</div>
</div>
`;
namaSertifikatDiv.appendChild(newDiv);
// Event listener untuk tombol hapus
newDiv.querySelector('.delete-button').addEventListener('click', function() {
namaSertifikatDiv.removeChild(newDiv);
});
});
</script>
@endpush

View File

@@ -18,7 +18,229 @@
@section('content')
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
<div class="card">
<div class="card-header" id="advanced_settings_appearance">
<h3 class="card-title">
Data Permohonan
</h3>
</div>
<div class="card-body lg:py-7.5 grid grid-cols-3">
<div class="mb-5">
<h3 class="text-md font-medium text-gray-900">
Nomor Register Permohonan:
</h3>
<span class="text-2sm text-gray-700">
{{ $permohonan->nomor_registrasi }}
</span>
</div>
<div class="mb-5">
<h3 class="text-md font-medium text-gray-900">
Pemohon:
</h3>
<span class="text-2sm text-gray-700">
{{ $permohonan->user->nik }} | {{ $permohonan->user->name }} | {{ $permohonan->user->branch->name }}
</span>
</div>
<div class="mb-5">
<h3 class="text-md font-medium text-gray-900">
Tujan Permohonan:
</h3>
<span class="text-2sm text-gray-700">
{{ $permohonan->tujuanPenilaian->name }}
</span>
</div>
</div>
</div>
<div class="card min-w-full">
<div class="card-header">
<h3 class="card-title">
Detail Debutur
</h3>
</div>
<div class="card-table scrollable-x-auto pb-3">
<div class="grid grid-cols-1 xl:grid-cols-2 gap-5 lg:gap-7.5">
<div class="col-span-1">
<table class="table align-middle text-sm text-gray-500">
<tr>
<td class="py-2 text-gray-600 font-normal">
Name
</td>
<td class="py-2 text-gray-800 font-normaltext-sm">
{{ $permohonan->debiture->name ?? "" }}
</td>
</tr>
<tr>
<td class="py-3">
Email
</td>
<td class="py-3 text-gray-700 text-2sm font-normal">
{{ $permohonan->debiture->email ?? "" }}
</td>
</tr>
<tr>
<td class="py-3">
Phone
</td>
<td class="py-3 text-gray-700 text-2sm font-normal">
{{ $permohonan->debiture->phone ?? "" }}
</td>
</tr>
<tr>
<td class="py-3 text-gray-600 font-normal">
Address
</td>
<td class="py-3 text-gray-700 text-sm font-normal">
{{ $permohonan->debiture->address ?? "" }}
</td>
</tr>
<tr>
<td class="py-3 text-gray-600 font-normal">
&nbsp;
</td>
<td class="py-3 text-gray-700 text-sm font-normal">
{{ $permohonan->debiture->village->name ?? "" }}, {{ $permohonan->debiture->district->name ?? "" }}, {{ $permohonan->debiture->city->name ?? "" }}, {{ $permohonan->debiture->province->name ?? "" }} - {{ $permohonan->debiture->village->postal_code ?? "" }}
</td>
</tr>
</table>
</div>
<div class="col-span-1">
<table class="table align-middle text-sm text-gray-500">
<tr>
<td class="py-3 text-gray-600 font-normal">
Cabang
</td>
<td class="py-2 text-gray-800 font-normaltext-sm">
{{ $permohonan->debiture->branch->name ?? "" }}
</td>
</tr>
<tr>
<td class="py-3 text-gray-600 font-normal">
CIF
</td>
<td class="py-2 text-gray-800 font-normaltext-sm">
{{ $permohonan->debiture->cif ?? "" }}
</td>
</tr>
<tr>
<td class="py-3 text-gray-600 font-normal">
Nomor Rekening
</td>
<td class="py-3 text-gray-700 text-sm font-normal">
{{ $permohonan->debiture->nomor_rekening ?? "" }}
</td>
</tr>
<tr>
<td class="py-3">
NPWP
</td>
<td class="py-3 text-gray-700 text-2sm font-normal">
{{ $permohonan->debiture->npwp ?? "" }}
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
<div class="card min-w-full">
<div class="card-header">
<h3 class="card-title">
Data Jaminan
</h3>
</div>
<div data-accordion="true">
@foreach($permohonan->debiture->documents as $dokumen)
<div class="accordion-item [&:not(:last-child)]:border-b border-b-gray-200" data-accordion-item="true" id="accordion_1_item_1">
<button class="accordion-toggle py-4 group mx-8" data-accordion-toggle="#accordion_1_content_1">
<span class="text-base text-gray-900 font-medium">
Jaminan {{ $loop->index + 1 }}
</span>
<i class="ki-outline ki-plus text-gray-600 text-2sm accordion-active:hidden block">
</i>
<i class="ki-outline ki-minus text-gray-600 text-2sm accordion-active:block hidden">
</i>
</button>
<div class="accordion-content hidden" id="accordion_1_content_1">
<div class="card-body lg:py-7.5 grid grid-cols-2">
<div class="mb-5">
<h3 class="text-md font-medium text-gray-900">
Pemilik Jaminan:
</h3>
<span class="text-2sm text-gray-700">
{{ $dokumen->pemilik->name?? "" }}
</span>
</div>
<div class="mb-5">
<h3 class="text-md font-medium text-gray-900">
Jenis Jaminan:
</h3>
<span class="text-2sm text-gray-700">
{{ $dokumen->jenisJaminan->name?? "" }}
</span>
</div>
<div class="mb-5">
<h3 class="text-md font-medium text-gray-900">
Hubungan Pemilik Jaminan:
</h3>
<span class="text-2sm text-gray-700">
{{ $dokumen->pemilik->hubungan_pemilik->name?? "" }}
</span>
</div>
<div class="mb-5">
<h3 class="text-md font-medium text-gray-900">
Alamat Pemilik Jaminan:
</h3>
<span class="text-2sm text-gray-700">
{{ $dokumen->pemilik->address ?? ""}},
<br> {{ $dokumen->pemilik->village->name ?? "" }}, {{ $dokumen->pemilik->district->name ?? "" }}, {{ $dokumen->pemilik->city->name ?? "" }}, {{ $dokumen->pemilik->province->name ?? "" }} - {{ $dokumen->pemilik->village->postal_code ?? "" }}
</span>
</div>
</div>
<div class="card-table scrollable-x-auto pb-3">
<table class="table align-middle text-sm text-gray-500">
@foreach($dokumen->detail as $detail)
<tr>
<td class="py-2 text-gray-600 font-normal max-w-[100px]">
{{ $loop->index + 1 }}. {{ $detail->jenisLegalitasJaminan->name }}
</td>
<td class="py-2 text-gray-800 font-normaltext-sm">
{{ $detail->name ?? "" }}
</td>
</tr>
<tr>
<td class="py-3 max-w-[100px]">
Dokumen Jaminan
</td>
<td class="py-3 text-gray-700 text-2sm font-normal">
@if(isset($detail->dokumen_jaminan))
<a href="{{ route('debitur.jaminan.download',['id'=>$permohonan->debiture->id,'dokumen'=>$detail->id]) }}" class="badge badge-sm badge-outline mt-2">{{ basename($detail->dokumen_jaminan) }}
<i class="ki-filled ki-cloud-download"></i></a>
@endif
</td>
</tr>
<tr>
<td class="py-3 max-w-[100px]">
Keterangan
</td>
<td class="py-3 text-gray-700 text-2sm font-normal">
{{ $detail->keterangan ?? "" }}
</td>
</tr>
@endforeach
</table>
</div>
</div>
</div>
@endforeach
</div>
</div>
<div class="card pb-2.5">
<div class="card-header" id="basic_settings">
<h3 class="card-title">
@@ -34,12 +256,8 @@
<form
action="{{ isset($penilaian->permohonan_id) ? route('penilaian.update', $permohonan) : route('penilaian.store') }}"
method="POST" class="">
@if (isset($penilaian->permohonan_id))
@method('PUT')
<input type="hidden" name="permohonan_id" value="{{ $permohonan->id }}">
@else
<input type="number" name="permohonan_id" value="{{ $permohonan->id }}">
@endif
@csrf
<div class="pl-1 lg:pl-5 xl:pl-5 grid gap-2.5 p-5">
@@ -47,11 +265,13 @@
<label class="form-label max-w-56">
Penilai yang Dilakukan oleh
</label>
<input type="hidden" name="permohonan_id" value="{{ $penilaian->permohonan_id ?? $permohonan->id }}">
<div class="flex flex-wrap items-baseline w-full">
<select
class="input tomselect w-full @error('jenis_penilaian_id') border-danger bg-danger-light @enderror"
name="jenis_penilaian_id" id="jenis_penilaian_id">
<option value="">Jenis Penilaian</option>
@foreach ($jenisPenilaian as $item)
@if (isset($penilaian->permohonan_id))
<option value="{{ $item->id }}"

View File

@@ -0,0 +1,191 @@
@extends('layouts.main')
@section('breadcrumbs')
{{ Breadcrumbs::render(request()->route()->getName()) }}
@endsection
@section('content')
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
<div class="card card-grid min-w-full" data-datatable="false" data-datatable-page-size="5" data-datatable-state-save="false" id="permohonan-table" data-api-url="{{ route('authorization.datatables') }}">
<div class="card-header py-5 flex-wrap">
<h3 class="card-title">
Daftar Permohonan
</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 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('permohonan.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="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="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">
<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">
<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="status">
<span class="sort"> <span class="sort-label"> Status </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[50px] text-center" data-datatable-column="actions">Action</th>
</tr>
</thead>
</table>
</div>
<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 src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script type="text/javascript">
function deleteData(data) {
Swal.fire({
title: 'Are you sure?',
text: "You won't be able to revert this!",
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, delete it!'
}).then((result) => {
if (result.isConfirmed) {
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': '{{ csrf_token() }}'
}
});
$.ajax(`permohonan/${data}`, {
type: 'DELETE'
}).then((response) => {
swal.fire('Deleted!', 'User has been deleted.', 'success').then(() => {
window.location.reload();
});
}).catch((error) => {
console.error('Error:', error);
Swal.fire('Error!', 'An error occurred while deleting the file.', 'error');
});
}
})
}
</script>
<script type="module">
const element = document.querySelector('#permohonan-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();
},
},
nomor_registrasi: {
title: 'Nomor Registrasi',
},
tanggal_permohonan: {
title: 'Tanggal Permohonan'
},
user_id: {
title: 'User Pemohon',
render: (item, data) => {
return `${data.user.name}`;
},
},
branch_id: {
title: 'Cabang Pemohon',
render: (item, data) => {
return `${data.branch.name}`;
},
},
debitur_id: {
title: 'Debitur',
render: (item, data) => {
return `${data.debiture.name}`;
},
},
tujuan_penilaian_id: {
title: 'Tujuan Penilaian',
render: (item, data) => {
return `${data.tujuan_penilaian.name}`;
},
},
status: {
title: 'Status'
},
actions: {
title: 'Status',
render: (item, data) => {
return `<div class="flex flex-nowrap justify-center">
<a class="btn btn-sm btn-icon btn-clear btn-warning " href="authorization/${data.id}/edit">
<i class="ki-outline ki-eye"></i>
</a>
</div>`;
},
}
},
};
let dataTable = new KTDataTable(element, dataTableOptions);
// Custom search functionality
searchInput.addEventListener('input', function () {
const searchValue = this.value.trim();
dataTable.search(searchValue, true);
});
</script>
@endpush

View File

@@ -0,0 +1,257 @@
@extends('layouts.main')
@section('breadcrumbs')
{{ Breadcrumbs::render(request()->route()->getName()) }}
@endsection
@section('content')
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
<div class="card">
<div class="card-header" id="advanced_settings_appearance">
<h3 class="card-title">
Data Permohonan
</h3>
</div>
<div class="card-body lg:py-7.5 grid grid-cols-3">
<div class="mb-5">
<h3 class="text-md font-medium text-gray-900">
Nomor Register Permohonan:
</h3>
<span class="text-2sm text-gray-700">
{{ $permohonan->nomor_registrasi }}
</span>
</div>
<div class="mb-5">
<h3 class="text-md font-medium text-gray-900">
Pemohon:
</h3>
<span class="text-2sm text-gray-700">
{{ $permohonan->user->nik }} | {{ $permohonan->user->name }} | {{ $permohonan->user->branch->name }}
</span>
</div>
<div class="mb-5">
<h3 class="text-md font-medium text-gray-900">
Tujan Permohonan:
</h3>
<span class="text-2sm text-gray-700">
{{ $permohonan->tujuanPenilaian->name }}
</span>
</div>
</div>
</div>
<div class="card min-w-full">
<div class="card-header">
<h3 class="card-title">
Detail Debutur
</h3>
</div>
<div class="card-table scrollable-x-auto pb-3">
<div class="grid grid-cols-1 xl:grid-cols-2 gap-5 lg:gap-7.5">
<div class="col-span-1">
<table class="table align-middle text-sm text-gray-500">
<tr>
<td class="py-2 text-gray-600 font-normal">
Name
</td>
<td class="py-2 text-gray-800 font-normaltext-sm">
{{ $permohonan->debiture->name ?? "" }}
</td>
</tr>
<tr>
<td class="py-3">
Email
</td>
<td class="py-3 text-gray-700 text-2sm font-normal">
{{ $permohonan->debiture->email ?? "" }}
</td>
</tr>
<tr>
<td class="py-3">
Phone
</td>
<td class="py-3 text-gray-700 text-2sm font-normal">
{{ $permohonan->debiture->phone ?? "" }}
</td>
</tr>
<tr>
<td class="py-3 text-gray-600 font-normal">
Address
</td>
<td class="py-3 text-gray-700 text-sm font-normal">
{{ $permohonan->debiture->address ?? "" }}
</td>
</tr>
<tr>
<td class="py-3 text-gray-600 font-normal">
&nbsp;
</td>
<td class="py-3 text-gray-700 text-sm font-normal">
{{ $permohonan->debiture->village->name ?? "" }}, {{ $permohonan->debiture->district->name ?? "" }}, {{ $permohonan->debiture->city->name ?? "" }}, {{ $permohonan->debiture->province->name ?? "" }} - {{ $permohonan->debiture->village->postal_code ?? "" }}
</td>
</tr>
</table>
</div>
<div class="col-span-1">
<table class="table align-middle text-sm text-gray-500">
<tr>
<td class="py-3 text-gray-600 font-normal">
Cabang
</td>
<td class="py-2 text-gray-800 font-normaltext-sm">
{{ $permohonan->debiture->branch->name ?? "" }}
</td>
</tr>
<tr>
<td class="py-3 text-gray-600 font-normal">
CIF
</td>
<td class="py-2 text-gray-800 font-normaltext-sm">
{{ $permohonan->debiture->cif ?? "" }}
</td>
</tr>
<tr>
<td class="py-3 text-gray-600 font-normal">
Nomor Rekening
</td>
<td class="py-3 text-gray-700 text-sm font-normal">
{{ $permohonan->debiture->nomor_rekening ?? "" }}
</td>
</tr>
<tr>
<td class="py-3">
NPWP
</td>
<td class="py-3 text-gray-700 text-2sm font-normal">
{{ $permohonan->debiture->npwp ?? "" }}
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
<div class="card min-w-full">
<div class="card-header">
<h3 class="card-title">
Data Jaminan
</h3>
</div>
<div data-accordion="true">
@foreach($permohonan->debiture->documents as $dokumen)
<div class="accordion-item [&:not(:last-child)]:border-b border-b-gray-200" data-accordion-item="true" id="accordion_1_item_1">
<button class="accordion-toggle py-4 group mx-8" data-accordion-toggle="#accordion_1_content_1">
<span class="text-base text-gray-900 font-medium">
Jaminan {{ $loop->index + 1 }}
</span>
<i class="ki-outline ki-plus text-gray-600 text-2sm accordion-active:hidden block">
</i>
<i class="ki-outline ki-minus text-gray-600 text-2sm accordion-active:block hidden">
</i>
</button>
<div class="accordion-content hidden" id="accordion_1_content_1">
<div class="card-body lg:py-7.5 grid grid-cols-2">
<div class="mb-5">
<h3 class="text-md font-medium text-gray-900">
Pemilik Jaminan:
</h3>
<span class="text-2sm text-gray-700">
{{ $dokumen->pemilik->name?? "" }}
</span>
</div>
<div class="mb-5">
<h3 class="text-md font-medium text-gray-900">
Jenis Jaminan:
</h3>
<span class="text-2sm text-gray-700">
{{ $dokumen->jenisJaminan->name?? "" }}
</span>
</div>
<div class="mb-5">
<h3 class="text-md font-medium text-gray-900">
Hubungan Pemilik Jaminan:
</h3>
<span class="text-2sm text-gray-700">
{{ $dokumen->pemilik->hubungan_pemilik->name?? "" }}
</span>
</div>
<div class="mb-5">
<h3 class="text-md font-medium text-gray-900">
Alamat Pemilik Jaminan:
</h3>
<span class="text-2sm text-gray-700">
{{ $dokumen->pemilik->address ?? ""}},
<br> {{ $dokumen->pemilik->village->name ?? "" }}, {{ $dokumen->pemilik->district->name ?? "" }}, {{ $dokumen->pemilik->city->name ?? "" }}, {{ $dokumen->pemilik->province->name ?? "" }} - {{ $dokumen->pemilik->village->postal_code ?? "" }}
</span>
</div>
</div>
<div class="card-table scrollable-x-auto pb-3">
<table class="table align-middle text-sm text-gray-500">
@foreach($dokumen->detail as $detail)
<tr>
<td class="py-2 text-gray-600 font-normal max-w-[100px]">
{{ $loop->index + 1 }}. {{ $detail->jenisLegalitasJaminan->name }}
</td>
<td class="py-2 text-gray-800 font-normaltext-sm">
{{ $detail->name ?? "" }}
</td>
</tr>
<tr>
<td class="py-3 max-w-[100px]">
Dokumen Jaminan
</td>
<td class="py-3 text-gray-700 text-2sm font-normal">
@if(isset($detail->dokumen_jaminan))
<a href="{{ route('debitur.jaminan.download',['id'=>$permohonan->debiture->id,'dokumen'=>$detail->id]) }}" class="badge badge-sm badge-outline mt-2">{{ basename($detail->dokumen_jaminan) }}
<i class="ki-filled ki-cloud-download"></i></a>
@endif
</td>
</tr>
<tr>
<td class="py-3 max-w-[100px]">
Keterangan
</td>
<td class="py-3 text-gray-700 text-2sm font-normal">
{{ $detail->keterangan ?? "" }}
</td>
</tr>
@endforeach
</table>
</div>
</div>
</div>
@endforeach
</div>
</div>
<div class="card">
<form action="{{ route('authorization.update', $permohonan->id) }}" method="POST">
<input type="hidden" name="_method" value="PUT">
@csrf
<div class="card-body lg:py-7.5">
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Catatan
</label>
<div class="flex flex-wrap items-baseline w-full">
<textarea class="textarea" rows="3" type="number" id="address" name="address"></textarea>
</div>
</div>
</div>
<div class="card-footer flex justify-end">
<button type="submit" name="status" value="register" class="btn btn-success">
Approve
</button>
<button type="submit" name="status" value="revisi" class="btn btn-warning ml-3">
Revisi
</button>
</div>
</form>
</div>
</div>
@endsection

View File

@@ -5,97 +5,320 @@
@endsection
@section('content')
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
@if(isset($permohonan))
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
<div class="card pb-2.5">
<div class="card-header" id="basic_settings">
<div class="card-title flex flex-row gap-1.5">
<a href="{{ route('permohonan.edit',array_merge(request()->query(),['permohonan'=>$permohonan->id])) }}" class="btn btn-xs {{ request()->routeIs('permohonan.edit') ? 'btn-outline btn-primary' : 'btn-light' }}">Data Permohonan</a>
<a href="{{ route('debitur.edit',array_merge(request()->query(),['debitur'=>$debitur->id,'permohonan_id' => $permohonan->id])) }}" class="btn btn-xs {{ request()->routeIs('debitur.edit') ? 'btn-outline btn-primary' : 'btn-light' }}">Data Debitur</a>
<a href="{{ route('debitur.jaminan.index',array_merge(request()->query(),['id'=>$debitur->id,'permohonan_id' => $permohonan->id])) }}" class="btn btn-xs {{ request()->routeIs('debitur.jaminan.index') ? 'btn-outline btn-primary' : 'btn-light' }}">Dokumen Jaminan</a>
<a href="{{ route('debitur.pemilik.index',array_merge(request()->query(),['id'=>$debitur->id,'permohonan_id' => $permohonan->id])) }}" class="btn btn-xs {{ request()->routeIs('debitur.pemilik.index') ? 'btn-outline btn-primary' : 'btn-light' }}">Pemilk Jaminan</a>
</div>
<div class="flex items-center gap-2">
@if(isset($debitur->id) && !isset($permohonan->id))
<a class="btn btn-sm btn-primary" href="{{ route('permohonan.create.debitur', $debitur->id) }}"> Buat Permohonan </a>
@endif
<div class="card pb-2.5">
<div class="card-header" id="basic_settings">
<h3 class="card-title">
{{ isset($permohonan->id) ? 'Edit' : 'Tambah' }} Permohonan
</h3>
<div class="flex items-center gap-2">
<a href="{{ route('permohonan.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
@if(request()->get('from') == 'permohonan')
<a href="{{ route('permohonan.create') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
@elseif($permohonan->id)
<a href="{{ route('permohonan.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
@else
<a href="{{ route('debitur.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
@endif
</div>
</div>
<div class="card-body">
@if(request()->routeIs('permohonan.edit', $permohonan))
<form action="{{ isset($permohonan->id) ? route('permohonan.update', $permohonan) : route('permohonan.store') }}" method="POST" class="grid gap-5" enctype="multipart/form-data">
@if(isset($permohonan->id))
@method('PUT')
@endif
@csrf
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Debitur
</label>
<div class="flex flex-wrap items-baseline w-full">
<input type="hidden" name="debiture_id" value="{{ $debitur->id }}">
<p class="text-base text-bold">{{ $debitur->name }}</p>
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Tujuan Penilaian
</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="tujuan_penilaian_id" id="tujuan_penilaian_id">
<option value="">Pilih Tujuan Penilaian</option>
@if(isset($tujuanPenilaian))
@foreach($tujuanPenilaian as $row)
@if(isset($permohonan))
<option value="{{ $row->id }}" {{ isset($permohonan->tujuan_penilaian_id) && $permohonan->tujuan_penilaian_id == $row->id?'selected' : '' }}>
{{ $row->name }}
</option>
@else
<option value="{{ $row->id }}">
{{ $row->name }}
</option>
@endif
@endforeach
@endif
</select>
@error('tujuan_penilaian_id')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Fasilitas Kredit
</label>
<div class="flex flex-wrap items-baseline w-full">
<select class="input tomselect w-full @error('jenis_fasilitas_kredit_id') border-danger bg-danger-light @enderror" name="jenis_fasilitas_kredit_id" id="jenis_fasilitas_kredit_id">
<option value="">Pilih Fasilitas Kredit</option>
@if(isset($fasilitasKredit))
@foreach($fasilitasKredit as $row)
@if(isset($permohonan))
<option value="{{ $row->id }}" {{ isset($permohonan->jenis_fasilitas_kredit_id) && $permohonan->jenis_fasilitas_kredit_id == $row->id ?'selected' : '' }}>
{{ $row->name }}
</option>
@else
<option value="{{ $row->id }}">
{{ $row->name }}
</option>
@endif
@endforeach
@endif
</select>
@error('status')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Nilai Plafond
</label>
<div class="flex flex-wrap items-baseline w-full">
<select class="input tomselect w-full @error('nilai_plafond_id') border-danger bg-danger-light @enderror" name="nilai_plafond_id" id="nilai_plafond_id">
<option value="">Pilih Nilai Flafond</option>
@if(isset($plafond))
@foreach($plafond as $row)
@if(isset($permohonan))
<option value="{{ $row->id }}" {{ isset($permohonan->nilai_plafond_id) && $permohonan->nilai_plafond_id == $row->id ?'selected' : '' }}>
{{ $row->name }}
</option>
@else
<option value="{{ $row->id }}">
{{ $row->name }}
</option>
@endif
@endforeach
@endif
</select>
@error('status')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Status Permohonan
</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="status" id="status">
<option value="">Pilih Status Permohonan</option>
@if(isset($status))
@foreach($status as $row)
@if(isset($permohonan))
<option value="{{ $row->slug }}" {{ isset($permohonan->status) && $permohonan->status == $row->slug ?'selected' : '' }}>
{{ $row->name }}
</option>
@else
<option value="{{ $row->slug }}">
{{ $row->name }}
</option>
@endif
@endforeach
@endif
</select>
@error('status')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex justify-end">
<button type="submit" class="btn btn-primary">
Save
</button>
</div>
</form>
@elseif(request()->routeIs('debitur.edit', $debitur))
@include('lpj::debitur.components.debitur')
@elseif(request()->routeIs('debitur.pemilik.index', $debitur))
@include('lpj::debitur.components.pemilik')
@else
@include('lpj::debitur.components.jaminan')
@endif
</div>
</div>
<div class="card-body">
<form action="{{ isset($permohonan->id) ? route('permohonan.update', $permohonan) : route('permohonan.store') }}" method="POST" class="grid gap-5" enctype="multipart/form-data">
@if(isset($permohonan->id))
@method('PUT')
@endif
@csrf
</div>
@else
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Debitur
</label>
<div class="flex flex-wrap items-baseline w-full">
<input type="hidden" name="debiture_id" value="{{ $debitur->id }}">
<p class="text-base text-bold">{{ $debitur->name }}</p>
</div>
<div class="card pb-2.5">
<div class="card-header" id="basic_settings">
<h3 class="card-title">
{{ isset($permohonan->id) ? 'Edit' : 'Tambah' }} Permohonan
</h3>
<div class="flex items-center gap-2">
<a href="{{ route('permohonan.index') }}" class="btn btn-xs btn-info"><i class="ki-filled ki-exit-left"></i> Back</a>
</div>
</div>
<div class="card-body">
<form action="{{ isset($permohonan->id) ? route('permohonan.update', $permohonan) : route('permohonan.store') }}" method="POST" class="grid gap-5" enctype="multipart/form-data">
@if(isset($permohonan->id))
@method('PUT')
@endif
@csrf
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Tujuan Penilaian
</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="tujuan_penilaian_id" id="tujuan_penilaian_id">
<option value="">Pilih Tujuan Penilaian</option>
@if(isset($tujuanPenilaian))
@foreach($tujuanPenilaian as $row)
@if(isset($permohonan))
<option value="{{ $row->id }}" {{ isset($permohonan->tujuan_penilaian_id) && $permohonan->tujuan_penilaian_id == $row->id?'selected' : '' }}>
{{ $row->name }}
</option>
@else
<option value="{{ $row->id }}">
{{ $row->name }}
</option>
@endif
@endforeach
@endif
</select>
@error('tujuan_penilaian_id')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Debitur
</label>
<div class="flex flex-wrap items-baseline w-full">
<input type="hidden" name="debiture_id" value="{{ $debitur->id }}">
<p class="text-base text-bold">{{ $debitur->name }}</p>
</div>
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Status Permohonan
</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="status" id="status">
<option value="">Pilih Status Permohonan</option>
@if(isset($status))
@foreach($status as $row)
@if(isset($permohonan))
<option value="{{ $row->slug }}" {{ isset($permohonan->status) && $permohonan->status == $row->slug ?'selected' : '' }}>
{{ $row->name }}
</option>
@else
<option value="{{ $row->slug }}">
{{ $row->name }}
</option>
@endif
@endforeach
@endif
</select>
@error('status')
<em class="alert text-danger text-sm">{{ $message }}</em>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Tujuan Penilaian
</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="tujuan_penilaian_id" id="tujuan_penilaian_id">
<option value="">Pilih Tujuan Penilaian</option>
@if(isset($tujuanPenilaian))
@foreach($tujuanPenilaian as $row)
@if(isset($permohonan))
<option value="{{ $row->id }}" {{ isset($permohonan->tujuan_penilaian_id) && $permohonan->tujuan_penilaian_id == $row->id?'selected' : '' }}>
{{ $row->name }}
</option>
@else
<option value="{{ $row->id }}">
{{ $row->name }}
</option>
@endif
@endforeach
@endif
</select>
@error('tujuan_penilaian_id')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Fasilitas Kredit
</label>
<div class="flex flex-wrap items-baseline w-full">
<select class="input tomselect w-full @error('jenis_fasilitas_kredit_id') border-danger bg-danger-light @enderror" name="jenis_fasilitas_kredit_id" id="jenis_fasilitas_kredit_id">
<option value="">Pilih Fasilitas Kredit</option>
@if(isset($fasilitasKredit))
@foreach($fasilitasKredit as $row)
@if(isset($permohonan))
<option value="{{ $row->id }}" {{ isset($permohonan->jenis_fasilitas_kredit_id) && $permohonan->jenis_fasilitas_kredit_id == $row->id ?'selected' : '' }}>
{{ $row->name }}
</option>
@else
<option value="{{ $row->id }}">
{{ $row->name }}
</option>
@endif
@endforeach
@endif
</select>
@error('status')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Nilai Plafond
</label>
<div class="flex flex-wrap items-baseline w-full">
<select class="input tomselect w-full @error('nilai_plafond_id') border-danger bg-danger-light @enderror" name="nilai_plafond_id" id="nilai_plafond_id">
<option value="">Pilih Nilai Flafond</option>
@if(isset($plafond))
@foreach($plafond as $row)
@if(isset($permohonan))
<option value="{{ $row->id }}" {{ isset($permohonan->nilai_plafond_id) && $permohonan->nilai_plafond_id == $row->id ?'selected' : '' }}>
{{ $row->name }}
</option>
@else
<option value="{{ $row->id }}">
{{ $row->name }}
</option>
@endif
@endforeach
@endif
</select>
@error('status')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Status Permohonan
</label>
<div class="flex flex-wrap items-baseline w-full">
<select class="input tomselect w-full @error('status') border-danger bg-danger-light @enderror" name="status" id="status">
<option value="">Pilih Status Permohonan</option>
@if(isset($status))
@foreach($status as $row)
@if(isset($permohonan))
<option value="{{ $row->slug }}" {{ isset($permohonan->status) && $permohonan->status == $row->slug ?'selected' : '' }}>
{{ $row->name }}
</option>
@else
<option value="{{ $row->slug }}">
{{ $row->name }}
</option>
@endif
@endforeach
@endif
</select>
@error('status')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex justify-end">
<button type="submit" class="btn btn-primary">
Save
</button>
</div>
</form>
<div class="flex justify-end">
<button type="submit" class="btn btn-primary">
Save
</button>
</div>
</form>
</div>
</div>
</div>
</div>
@endif
@endsection

View File

@@ -32,10 +32,6 @@
<th class="w-14">
<input class="checkbox checkbox-sm" data-datatable-check="true" type="checkbox"/>
</th>
<th class="min-w-[250px]" data-datatable-column="code">
<span class="sort"> <span class="sort-label"> Code </span>
<span class="sort-icon"> </span> </span>
</th>
<th class="min-w-[250px]" data-datatable-column="name">
<span class="sort"> <span class="sort-label"> Status Permohonan </span>
<span class="sort-icon"> </span> </span>