Merge branch 'feature/senior-officer' of https://git.putrakuningan.com/daengdeni/lpj into feature/senior-officer

This commit is contained in:
majid
2024-12-29 06:12:02 +07:00
14 changed files with 484 additions and 252 deletions

42
Jenkinsfile vendored Normal file
View File

@@ -0,0 +1,42 @@
pipeline {
agent any
environment {
PHP_VERSION = '8.1'
COMPOSER_HOME = "${WORKSPACE}/.composer"
DASHBOARD = '/var/www/lpj'
WORKDIR = '/var/www/lpj/Modules/Lpj'
GIT_SSH_COMMAND = 'ssh -i ~/.ssh/for_gitea -o StrictHostKeyChecking=no'
}
stages {
stage('Checkout') {
steps {
dir("${env.DASHBOARD}") {
sh "composer update daengdeni/lpj-module:dev-staging"
}
}
}
stage('Build Assets') {
steps {
dir("${env.DASHBOARD}") {
sh "npm install"
sh "npm run build"
}
}
}
}
post {
always {
cleanWs()
}
success {
echo 'The pipeline has succeeded!'
}
failure {
echo 'The pipeline has failed.'
}
}
}

View File

@@ -146,7 +146,6 @@
$debitur = Debiture::find($id); $debitur = Debiture::find($id);
$validate = $request->validated(); $validate = $request->validated();
if ($validate) { if ($validate) {
try { try {
DB::beginTransaction(); DB::beginTransaction();

View File

@@ -137,6 +137,7 @@ class PenilaiController extends Controller
$resume = Penilai::where('permohonan_id', $permohonanId)->where('dokument_id', $documentId)->first(); $resume = Penilai::where('permohonan_id', $permohonanId)->where('dokument_id', $documentId)->first();
$lpjData = null; $lpjData = null;
$resumeData = null;
if ($resume) { if ($resume) {
$resumeData = json_decode($resume->resume, true); $resumeData = json_decode($resume->resume, true);
} }
@@ -153,21 +154,31 @@ class PenilaiController extends Controller
$permohonan = $this->surveyorController->getPermohonanJaminanId($permohonanId, $documentId, $jaminanId); $permohonan = $this->surveyorController->getPermohonanJaminanId($permohonanId, $documentId, $jaminanId);
$inspeksi = Inspeksi::where('permohonan_id', $permohonanId)->where('dokument_id', $documentId)->first(); $inspeksi = Inspeksi::where('permohonan_id', $permohonanId)->where('dokument_id', $documentId)->first();
$penilai = Penilai::where('permohonan_id', $permohonanId)->where('dokument_id', $documentId)->first();
$provinces = Province::all(); $provinces = Province::all();
$basicData = $this->surveyorController->getCommonData(); $basicData = $this->surveyorController->getCommonData();
$formFoto = null; $formFoto = $formPeta = $cities = $districts = $villages= null;
$formPeta = null;
if ($inspeksi) { if ($inspeksi) {
$formFoto = json_decode($inspeksi->foto_form, true); $formFoto = json_decode($inspeksi->foto_form, true);
$formPeta = json_decode($inspeksi->data_form, true); $formPeta = json_decode($inspeksi->data_form, true);
$memo = json_decode($penilai->memo);
if(isset($memo->province_code)){
$cities = City::where('province_id', $memo->province_code)->get();
}
if(isset($memo->city_code)){
$districts = District::where('city_id', $memo->city_code)->get();
}
if(isset($memo->district_code)) {
$villages = Village::where('district_id', $memo->district_code)->get();
}
} }
return view('lpj::penilai.components.memo', compact('permohonan', 'formFoto', 'formPeta', 'provinces', 'basicData')); return view('lpj::penilai.components.memo', compact('permohonan', 'formFoto', 'formPeta', 'provinces', 'basicData','memo','cities', 'districts', 'villages'));
} }

View File

@@ -14,6 +14,7 @@
{ {
$rules = [ $rules = [
'debiture_id' => 'required|exists:debitures,id', 'debiture_id' => 'required|exists:debitures,id',
'permohonan_id' => 'required|exists:permohonan,id',
'pemilik_jaminan_id' => 'required', 'pemilik_jaminan_id' => 'required',
'jenis_jaminan_id' => 'required', 'jenis_jaminan_id' => 'required',
'province_code' => 'nullable|exists:provinces,code', 'province_code' => 'nullable|exists:provinces,code',

View File

@@ -199,19 +199,28 @@
}, },
user_id: { user_id: {
title: 'User Pemohon', title: 'User Pemohon',
render: (item, data) => `${data.user.name}`, render: (item, data) => {
return data.user && data.user.name ? `${data.user.name}` : '-';
}, },
},
branch_id: { branch_id: {
title: 'Cabang Pemohon', title: 'Cabang Pemohon',
render: (item, data) => `${data.branch.name}`, render: (item, data) => {
return data.branch && data.branch.name ? `${data.branch.name}` : '-';
},
}, },
debitur_id: { debitur_id: {
title: 'Debitur', title: 'Debitur',
render: (item, data) => `${data.debiture.name}`, render: (item, data) => {
return data.debiture && data.debiture.name ? `${data.debiture.name}` : '-';
},
}, },
tujuan_penilaian_id: { tujuan_penilaian_id: {
title: 'Tujuan Penilaian', title: 'Tujuan Penilaian',
render: (item, data) => `${data.tujuan_penilaian.name}`, render: (item, data) => {
return data.tujuan_penilaian && data.tujuan_penilaian.name ? `${data.tujuan_penilaian.name}` : '-';
},
}, },
status: { status: {
title: 'Status', title: 'Status',

View File

@@ -1,12 +1,15 @@
<form action="{{ isset($debitur->id) ? route('debitur.update', $debitur->id) : route('debitur.store') }}" method="POST" class="grid gap-5"> <form action="{{ isset($debitur->id) ? route('debitur.update', $debitur->id) : route('debitur.store') }}" method="POST" id="debitur-form" class="grid gap-5">
@if(isset($debitur->id)) @if(isset($debitur->id))
<input type="hidden" name="id" value="{{ $debitur->id }}"> <input type="hidden" name="id" value="{{ $debitur->id }}">
@method('PUT') @method('PUT')
@endif @endif
@csrf @csrf
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5"> <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56"> <label class="form-label max-w-56 gap-1">
Cabang Cabang
<span class="text-danger">
*
</span>
</label> </label>
<div class="flex flex-wrap items-baseline w-full"> <div class="flex flex-wrap items-baseline w-full">
<select class="input tomselect w-full @error('branch_id') border-danger bg-danger-light @enderror" name="branch_id" id="branch_id"> <select class="input tomselect w-full @error('branch_id') border-danger bg-danger-light @enderror" name="branch_id" id="branch_id">
@@ -26,11 +29,14 @@
</div> </div>
</div> </div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5"> <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56"> <label class="form-label max-w-56 gap-1">
CIF CIF
<span class="text-danger">
*
</span>
</label> </label>
<div class="flex flex-wrap items-baseline w-full"> <div class="flex flex-wrap items-baseline w-full">
<input class="input @error('cif') border-danger bg-danger-light @enderror" type="number" name="cif" value="{{ $debitur->cif ?? '0000000000' }}"> <input class="input @error('cif') border-danger bg-danger-light @enderror" type="number" id="cif" name="cif" value="{{ $debitur->cif ?? '0000000000' }}">
@error('cif') @error('cif')
<em class="alert text-danger text-sm">{{ $message }}</em> <em class="alert text-danger text-sm">{{ $message }}</em>
@enderror @enderror
@@ -48,11 +54,14 @@
</div> </div>
</div> </div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5"> <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56"> <label class="form-label max-w-56 gap-1">
Nama Debitur Nama Debitur
<span class="text-danger">
*
</span>
</label> </label>
<div class="flex flex-wrap items-baseline w-full"> <div class="flex flex-wrap items-baseline w-full">
<input class="input @error('name') border-danger bg-danger-light @enderror" type="text" name="name" value="{{ $debitur->name ?? '' }}"> <input required class="input @error('name') border-danger bg-danger-light @enderror" type="text" name="name" value="{{ $debitur->name ?? '' }}">
@error('name') @error('name')
<em class="alert text-danger text-sm">{{ $message }}</em> <em class="alert text-danger text-sm">{{ $message }}</em>
@enderror @enderror
@@ -92,13 +101,16 @@
</div> </div>
</div> </div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5"> <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56"> <label class="form-label max-w-56 gap-1">
Address Address
<span class="text-danger">
*
</span>
</label> </label>
<div class="flex flex-wrap items-baseline w-full"> <div class="flex flex-wrap items-baseline w-full">
<div class="flex flex-col lg:flex-row gap-2 w-full"> <div class="flex flex-col lg:flex-row gap-2 w-full">
<div class="flex flex-wrap items-baseline w-full"> <div class="flex flex-wrap items-baseline w-full">
<select id="province_code" name="province_code" class="select w-full @error('province_code') border-danger bg-danger-light @enderror"> <select required id="province_code" name="province_code" class="select w-full @error('province_code') border-danger bg-danger-light @enderror">
<option value="">Select Province</option> <option value="">Select Province</option>
@foreach($provinces as $province) @foreach($provinces as $province)
@if(isset($debitur)) @if(isset($debitur))
@@ -117,7 +129,7 @@
@enderror @enderror
</div> </div>
<div class="flex flex-wrap items-baseline w-full"> <div class="flex flex-wrap items-baseline w-full">
<select id="city_code" name="city_code" class="select w-full @error('city_code') border-danger bg-danger-light @enderror"> <select required id="city_code" name="city_code" class="select w-full @error('city_code') border-danger bg-danger-light @enderror">
<option value="">Select City</option> <option value="">Select City</option>
@if(isset($cities)) @if(isset($cities))
@foreach($cities as $city) @foreach($cities as $city)
@@ -141,7 +153,7 @@
</div> </div>
<div class="flex flex-col lg:flex-row gap-2 w-full mt-2 lg:mt-5"> <div class="flex flex-col lg:flex-row gap-2 w-full mt-2 lg:mt-5">
<div class="flex flex-wrap items-baseline w-full"> <div class="flex flex-wrap items-baseline w-full">
<select id="district_code" name="district_code" class="select w-full @error('district_code') border-danger bg-danger-light @enderror"> <select required id="district_code" name="district_code" class="select w-full @error('district_code') border-danger bg-danger-light @enderror">
<option value="">Select District</option> <option value="">Select District</option>
@if(isset($districts)) @if(isset($districts))
@foreach($districts as $district) @foreach($districts as $district)
@@ -163,7 +175,7 @@
@enderror @enderror
</div> </div>
<div class="flex flex-wrap items-baseline w-full"> <div class="flex flex-wrap items-baseline w-full">
<select id="village_code" name="village_code" class="select w-full @error('district_code') border-danger bg-danger-light @enderror"> <select required id="village_code" name="village_code" class="select w-full @error('district_code') border-danger bg-danger-light @enderror">
<option value="">Select Village</option> <option value="">Select Village</option>
@if(isset($villages)) @if(isset($villages))
@foreach($villages as $village) @foreach($villages as $village)
@@ -185,14 +197,14 @@
@enderror @enderror
</div> </div>
<div class="flex flex-wrap items-baseline w-full"> <div class="flex flex-wrap items-baseline w-full">
<input class="input @error('postal_code') border-danger bg-danger-light @enderror" type="number" id="postal_code" name="postal_code" value="{{ $debitur->postal_code ?? '' }}" placeholder="Postal Code"> <input required class="input @error('postal_code') border-danger bg-danger-light @enderror" type="number" id="postal_code" name="postal_code" value="{{ $debitur->postal_code ?? '' }}" placeholder="Postal Code">
@error('postal_code') @error('postal_code')
<em class="alert text-danger text-sm">{{ $message }}</em> <em class="alert text-danger text-sm">{{ $message }}</em>
@enderror @enderror
</div> </div>
</div> </div>
<div class="flex flex-row w-full mt-2 lg:mt-5"> <div class="flex flex-row w-full mt-2 lg:mt-5">
<textarea class="textarea @error('address') border-danger bg-danger-light @enderror" rows="3" type="number" id="address" name="address">{{ $debitur->address ?? '' }}</textarea> <textarea required class="textarea @error('address') border-danger bg-danger-light @enderror" rows="3" id="address" name="address" placeholder="Alamat Lengkap">{{ $debitur->address ?? '' }}</textarea>
@error('address') @error('address')
<em class="alert text-danger text-sm">{{ $message }}</em> <em class="alert text-danger text-sm">{{ $message }}</em>
@enderror @enderror
@@ -200,8 +212,135 @@
</div> </div>
</div> </div>
<div class="flex justify-end"> <div class="flex justify-end">
<button type="submit" class="btn btn-primary"> <button type="submit" class="btn btn-primary" id="submit">
Save Save
</button> </button>
</div> </div>
</form> </form>
@push('scripts')
<script>
document.addEventListener('DOMContentLoaded', function () {
const form = document.getElementById('debitur-form');
const nameInput = form.querySelector('input[name="name"]');
const provinceSelect = form.querySelector('#province_code');
const citySelect = form.querySelector('#city_code');
const districtSelect = form.querySelector('#district_code');
const villageSelect = form.querySelector('#village_code');
const postalCodeInput = form.querySelector('#postal_code');
const addressTextarea = form.querySelector('#address');
const branchSelect = document.getElementById('branch_id');
const cifInput = document.getElementById('cif');
const submitButton = document.getElementById('submit');
function validateField(field, errorMessage) {
const value = field.value.trim();
if (value.length === 0) {
field.classList.add('border-danger', 'bg-danger-light');
const existingError = field.parentElement.querySelector('.alert.text-danger');
if (!existingError) {
const em = document.createElement('em');
em.className = 'alert text-danger text-sm';
em.textContent = errorMessage;
field.parentElement.appendChild(em);
}
return false;
} else {
field.classList.remove('border-danger', 'bg-danger-light');
const existingError = field.parentElement.querySelector('.alert.text-danger');
if (existingError) {
existingError.remove();
}
return true;
}
}
function validateBranch() {
return validateField(branchSelect, 'Cabang is required');
}
function validateCIF() {
return validateField(cifInput, 'CIF is required');
}
function validateName() {
return validateField(nameInput, 'Nama Debitur is required');
}
function validateProvince() {
return validateField(provinceSelect, 'Province is required');
}
function validateCity() {
return validateField(citySelect, 'City is required');
}
function validateDistrict() {
return validateField(districtSelect, 'District is required');
}
function validateVillage() {
return validateField(villageSelect, 'Village is required');
}
function validatePostalCode() {
return validateField(postalCodeInput, 'Postal Code is required');
}
function validateAddress() {
return validateField(addressTextarea, 'Address is required');
}
nameInput.addEventListener('blur', validateName);
nameInput.addEventListener('input', validateName);
provinceSelect.addEventListener('change', validateProvince);
citySelect.addEventListener('change', validateCity);
districtSelect.addEventListener('change', validateDistrict);
villageSelect.addEventListener('change', validateVillage);
postalCodeInput.addEventListener('blur', validatePostalCode);
postalCodeInput.addEventListener('input', validatePostalCode);
addressTextarea.addEventListener('blur', validateAddress);
addressTextarea.addEventListener('input', validateAddress);
branchSelect.addEventListener('change', validateVillage);
cifInput.addEventListener('blur', validateCIF);
cifInput.addEventListener('input', validateName);
function validateAllFields() {
const isValid =
validateBranch() &&
validateCIF() &&
validateName() &&
validateProvince() &&
validateCity() &&
validateDistrict() &&
validateVillage() &&
validatePostalCode() &&
validateAddress();
return isValid;
}
form.addEventListener('submit', function (event) {
const isValid =
validateBranch() &&
validateCIF() &&
validateName() &&
validateProvince() &&
validateCity() &&
validateDistrict() &&
validateVillage() &&
validatePostalCode() &&
validateAddress();
if (!isValid) {
event.preventDefault();
}
});
submitButton.addEventListener('click', function (event) {
if (!validateAllFields()) {
event.preventDefault();
}
});
});
</script>
@endpush

View File

@@ -3,7 +3,7 @@
@method('PUT') @method('PUT')
@endif @endif
@csrf @csrf
<input type="hidden" name="permohonan_id" value="{{ $document->id ?? request()->get('permohonan_id') }}">
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5"> <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56"> <label class="form-label max-w-56">
Debitur Debitur
@@ -509,7 +509,7 @@
${index + 1}. ${item.name} ${index + 1}. ${item.name}
</label> </label>
<input type="hidden" name="jenis_legalitas_jaminan_id[]" value="${item.jenis_legalitas_jaminan_id}"> <input type="hidden" name="jenis_legalitas_jaminan_id[]" value="${item.jenis_legalitas_jaminan_id}">
${item.is_existing ? `<input type="hidden" name="detail_dokumen_jaminan_id[]" value="${item.id}">` : ''} ${item.is_existing ? `<input type="hidden" name="detail_dokumen_jaminan_id[]" value="${item.id}">` : ""}
</div> </div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5"> <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
@@ -517,7 +517,7 @@
Nomor Nomor
</label> </label>
<div class="flex flex-wrap items-baseline w-full"> <div class="flex flex-wrap items-baseline w-full">
<input class="input" type="text" name="name[]" value="${item.name || ''}" placeholder="Nomor"> <input class="input" type="text" name="name[]" value="${item.name || ""}" placeholder="Nomor">
</div> </div>
</div> </div>
@@ -527,7 +527,7 @@
</label> </label>
<div class="flex flex-wrap items-baseline w-full" id="file-container-${index}"> <div class="flex flex-wrap items-baseline w-full" id="file-container-${index}">
<div class="flex flex-col w-full gap-2"> <div class="flex flex-col w-full gap-2">
${item.dokumen_jaminan ? renderExistingFiles(item.dokumen_jaminan, debiturId, item.id, item.dokumen_nomor) : ''} ${item.dokumen_jaminan ? renderExistingFiles(item.dokumen_jaminan, debiturId, item.id, item.dokumen_nomor) : ""}
</div> </div>
<div class="flex items-center gap-2 my-2 w-full"> <div class="flex items-center gap-2 my-2 w-full">
<input class="flex-1 input" type="text" name="dokumen_nomor[${index}][]" placeholder="Nomor Dokumen"> <input class="flex-1 input" type="text" name="dokumen_nomor[${index}][]" placeholder="Nomor Dokumen">
@@ -546,26 +546,26 @@
${getCustomFieldInput(item.custom_field_type, item.custom_field, item.details)} ${getCustomFieldInput(item.custom_field_type, item.custom_field, item.details)}
</div> </div>
</div> </div>
` : ''} ` : ""}
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5"> <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56"> <label class="form-label max-w-56">
Keterangan Keterangan
</label> </label>
<div class="flex flex-wrap items-baseline w-full"> <div class="flex flex-wrap items-baseline w-full">
<textarea class="textarea" rows="3" name="keterangan[]">${item.keterangan || ''}</textarea> <textarea class="textarea" rows="3" name="keterangan[]">${item.keterangan || ""}</textarea>
</div> </div>
</div> </div>
`; `;
}); });
}) })
.catch(error => console.error('Error:', error)); .catch(error => console.error("Error:", error));
} }
function addFileInput(index) { function addFileInput(index) {
const container = document.getElementById(`file-container-${index}`); const container = document.getElementById(`file-container-${index}`);
const newInput = document.createElement('div'); const newInput = document.createElement("div");
newInput.className = 'flex items-center gap-2 mb-2 w-full'; newInput.className = "flex items-center gap-2 mb-2 w-full";
newInput.innerHTML = ` newInput.innerHTML = `
<input class="flex-1 input" type="text" name="dokumen_nomor[${index}][]" placeholder="Nomor Dokumen"> <input class="flex-1 input" type="text" name="dokumen_nomor[${index}][]" placeholder="Nomor Dokumen">
<input class="flex-1 file-input" type="file" name="dokumen_jaminan[${index}][]" accept=".pdf,image/*"> <input class="flex-1 file-input" type="file" name="dokumen_jaminan[${index}][]" accept=".pdf,image/*">
@@ -575,60 +575,60 @@
} }
function removeFileInput(button) { function removeFileInput(button) {
button.closest('.flex.items-center.gap-2.mb-2').remove(); button.closest(".flex.items-center.gap-2.mb-2").remove();
} }
function renderExistingFiles(dokumenJaminan, debiturId, itemId, dokumenNomor) { function renderExistingFiles(dokumenJaminan, debiturId, itemId, dokumenNomor) {
if (typeof dokumenJaminan === 'string' && typeof dokumenNomor === 'string') { if (typeof dokumenJaminan === "string" && typeof dokumenNomor === "string") {
return ` return `
<div class="flex w-full lg:w-[30%]"> <div class="flex w-full lg:w-[30%]">
<span class="flex-1 mt-2 text-info text-sm">Nomor Dokumen : ${dokumenNomor}</span> <span class="flex-1 mt-2 text-info text-sm">Nomor Dokumen : ${dokumenNomor}</span>
<a href="/debitur/${debiturId}/jaminan/download?dokumen=${itemId}" class="flex-none badge badge-sm badge-outline mt-2"> <a href="/debitur/${debiturId}/jaminan/download?dokumen=${itemId}" class="flex-none badge badge-sm badge-outline mt-2">
${dokumenJaminan.split('/').pop()} ${dokumenJaminan.split("/").pop()}
<i class="ki-filled ki-cloud-download"></i> <i class="ki-filled ki-cloud-download"></i>
</a> </a>
</div> </div>
`; `;
} else if (typeof dokumenJaminan === 'string' && dokumenNomor === null) { } else if (typeof dokumenJaminan === "string" && dokumenNomor === null) {
return ` return `
<div class="flex w-full lg:w-[30%]"> <div class="flex w-full lg:w-[30%]">
<span class="flex-1 mt-2 text-info text-sm">Nomor Dokumen : --</span> <span class="flex-1 mt-2 text-info text-sm">Nomor Dokumen : --</span>
<a href="/debitur/${debiturId}/jaminan/download?dokumen=${itemId}" class="flex-none badge badge-sm badge-outline mt-2"> <a href="/debitur/${debiturId}/jaminan/download?dokumen=${itemId}" class="flex-none badge badge-sm badge-outline mt-2">
${dokumenJaminan.split('/').pop()} ${dokumenJaminan.split("/").pop()}
<i class="ki-filled ki-cloud-download"></i> <i class="ki-filled ki-cloud-download"></i>
</a> </a>
</div> </div>
`; `;
} else if (Array.isArray(dokumenJaminan) && Array.isArray(dokumenNomor)) { } else if (Array.isArray(dokumenJaminan) && Array.isArray(dokumenNomor)) {
return dokumenJaminan.map((file, index) => `<div class="flex w-full lg:w-[30%]"> return dokumenJaminan.map((file, index) => `<div class="flex w-full lg:w-[30%]">
<span class="flex-1 mt-2 text-info text-sm">Nomor Dokumen : ${dokumenNomor[index] || 'N/A'}</span> <span class="flex-1 mt-2 text-info text-sm">Nomor Dokumen : ${dokumenNomor[index] || "N/A"}</span>
<a href="/debitur/${debiturId}/jaminan/download?dokumen=${itemId}&file=${file}" class="flex-none badge badge-sm badge-outline mt-2 mr-2"> <a href="/debitur/${debiturId}/jaminan/download?dokumen=${itemId}&file=${file}" class="flex-none badge badge-sm badge-outline mt-2 mr-2">
${file.split('/').pop()} ${file.split("/").pop()}
<i class="ki-filled ki-cloud-download"></i> <i class="ki-filled ki-cloud-download"></i>
</a></div> </a></div>
`).join(''); `).join("");
} else if (Array.isArray(dokumenJaminan) && typeof dokumenNomor === 'string') { } else if (Array.isArray(dokumenJaminan) && typeof dokumenNomor === "string") {
return dokumenJaminan.map((file, index) => `<div class="flex w-full lg:w-[30%]"> return dokumenJaminan.map((file, index) => `<div class="flex w-full lg:w-[30%]">
<span class="flex-1 mt-2 text-info text-sm">Nomor Dokumen : ${dokumenNomor} || 'N/A'}</span> <span class="flex-1 mt-2 text-info text-sm">Nomor Dokumen : ${dokumenNomor} || 'N/A'}</span>
<a href="/debitur/${debiturId}/jaminan/download?dokumen=${itemId}&file=${file}" class="flex-none badge badge-sm badge-outline mt-2 mr-2"> <a href="/debitur/${debiturId}/jaminan/download?dokumen=${itemId}&file=${file}" class="flex-none badge badge-sm badge-outline mt-2 mr-2">
${file.split('/').pop()} ${file.split("/").pop()}
<i class="ki-filled ki-cloud-download"></i> <i class="ki-filled ki-cloud-download"></i>
</a></div> </a></div>
`).join(''); `).join("");
} else if (Array.isArray(dokumenJaminan) && dokumenNomor === 'null') { } else if (Array.isArray(dokumenJaminan) && dokumenNomor === "null") {
return dokumenJaminan.map((file, index) => `<div class="flex w-full lg:w-[30%]"> return dokumenJaminan.map((file, index) => `<div class="flex w-full lg:w-[30%]">
<span class="flex-1 mt-2 text-info text-sm">Nomor Dokumen : ${dokumenNomor} || 'N/A'}</span> <span class="flex-1 mt-2 text-info text-sm">Nomor Dokumen : ${dokumenNomor} || 'N/A'}</span>
<a href="/debitur/${debiturId}/jaminan/download?dokumen=${itemId}&file=${file}" class="flex-none badge badge-sm badge-outline mt-2 mr-2"> <a href="/debitur/${debiturId}/jaminan/download?dokumen=${itemId}&file=${file}" class="flex-none badge badge-sm badge-outline mt-2 mr-2">
${file.split('/').pop()} ${file.split("/").pop()}
<i class="ki-filled ki-cloud-download"></i> <i class="ki-filled ki-cloud-download"></i>
</a></div> </a></div>
`).join(''); `).join("");
} }
return dokumenNomor; return dokumenNomor;
} }
function getCustomFieldInput(type, fieldName, value) { function getCustomFieldInput(type, fieldName, value) {
value = value ? JSON.parse(value)[fieldName] || '' : ''; value = value ? JSON.parse(value)[fieldName] || "" : "";
switch (type) { switch (type) {
case "text": case "text":
return `<input class="input" type="text" name="custom_field[][${fieldName}]" value="${value}">`; return `<input class="input" type="text" name="custom_field[][${fieldName}]" value="${value}">`;

View File

@@ -28,7 +28,7 @@
<i class="ki-outline ki-cloud-download"></i> <i class="ki-outline ki-cloud-download"></i>
</a> </a>
@endif @endif
<a href="{{ route('debitur.jaminan.edit',['id' => $debitur->id,'jaminan' => $document->id]) }}" class="btn btn-sm btn-icon btn-outline btn-info"> <a href="{{ route('debitur.jaminan.edit',array_merge(request()->query(),['id' => $debitur->id,'jaminan' => $document->id])) }}" class="btn btn-sm btn-icon btn-outline btn-info">
<i class="ki-outline ki-notepad-edit"></i> <i class="ki-outline ki-notepad-edit"></i>
</a> </a>
<a onclick="deleteData({{ $document->id }})" class="delete btn btn-sm btn-icon btn-outline btn-danger"> <a onclick="deleteData({{ $document->id }})" class="delete btn btn-sm btn-icon btn-outline btn-danger">
@@ -39,6 +39,16 @@
</div> </div>
<div class="grid"> <div class="grid">
<div class="flex items-center justify-between flex-wrap mb-3.5 gap-2"> <div class="flex items-center justify-between flex-wrap mb-3.5 gap-2">
<span class="text-2xs text-gray-600 uppercase">
Nomor Permohonan
</span>
<p class="text-2xs text-gray-600 text-right max-w-[250px] font-bold">
{{ $document->permohonan->nomor_registrasi ?? "-" }}
</p>
</div>
<div class="border-t border-gray-300 border-dashed">
</div>
<div class="flex items-center justify-between flex-wrap my-2.5 gap-2">
<span class="text-2xs text-gray-600 uppercase"> <span class="text-2xs text-gray-600 uppercase">
pemilik jaminan pemilik jaminan
</span> </span>
@@ -115,7 +125,8 @@
background-image: url('/assets/media/images/2600x1200/bg-4-dark.png'); background-image: url('/assets/media/images/2600x1200/bg-4-dark.png');
} }
</style> </style>
<a class="card border-2 border-dashed border-brand-clarity bg-center bg-[length:600px] bg-no-repeat add-new-bg" href="{{ route('debitur.jaminan.create',$debitur->id) }}"> @if(request()->get('permohonan_id'))
<a class="card border-2 border-dashed border-brand-clarity bg-center bg-[length:600px] bg-no-repeat add-new-bg" href="{{ route('debitur.jaminan.create',array_merge(request()->query(),['id'=>$debitur->id])) }}">
<div class="card-body grid items-center"> <div class="card-body grid items-center">
<div class="flex flex-col gap-3"> <div class="flex flex-col gap-3">
<div class="flex justify-center pt-5"> <div class="flex justify-center pt-5">
@@ -147,6 +158,7 @@
</div> </div>
</div> </div>
</a> </a>
@endif
</div> </div>
@include('lpj::component.pdfviewer') @include('lpj::component.pdfviewer')
@@ -155,33 +167,33 @@
<script type="text/javascript"> <script type="text/javascript">
function deleteData(data) { function deleteData(data) {
Swal.fire({ Swal.fire({
title: 'Are you sure?', title: "Are you sure?",
text: "You won't be able to revert this!", text: "You won't be able to revert this!",
icon: 'warning', icon: "warning",
showCancelButton: true, showCancelButton: true,
confirmButtonColor: '#3085d6', confirmButtonColor: "#3085d6",
cancelButtonColor: '#d33', cancelButtonColor: "#d33",
confirmButtonText: 'Yes, delete it!' confirmButtonText: "Yes, delete it!"
}).then((result) => { }).then((result) => {
if (result.isConfirmed) { if (result.isConfirmed) {
$.ajaxSetup({ $.ajaxSetup({
headers: { headers: {
'X-CSRF-TOKEN': '{{ csrf_token() }}' "X-CSRF-TOKEN": '{{ csrf_token() }}'
} }
}); });
$.ajax(`debitur/{{$debitur->id}}}/jaminan/${data}`, { $.ajax(`debitur/{{$debitur->id}}}/jaminan/${data}`, {
type: 'DELETE' type: "DELETE"
}).then((response) => { }).then((response) => {
swal.fire('Deleted!', 'Document Jaminan has been deleted.', 'success').then(() => { swal.fire("Deleted!", "Document Jaminan has been deleted.", "success").then(() => {
window.location.reload(); window.location.reload();
}); });
}).catch((error) => { }).catch((error) => {
console.error('Error:', error); console.error("Error:", error);
Swal.fire('Error!', 'An error occurred while deleting the file.', 'error'); Swal.fire("Error!", "An error occurred while deleting the file.", "error");
}); });
} }
}) });
} }
</script> </script>
@endpush @endpush

View File

@@ -26,31 +26,30 @@
<label class="form-label max-w-56">Kepada</label> <label class="form-label max-w-56">Kepada</label>
<div class="flex flex-wrap items-baseline w-full"> <div class="flex flex-wrap items-baseline w-full">
<input type="text" name="kepada" class="input w-full" placeholder="Masukkan..." <input type="text" name="kepada" class="input w-full" placeholder="Masukkan..."
value=""> value=" {{ $memo->kepada ?? "" }}">
</div> </div>
</div> </div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5"> <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Dari</label> <label class="form-label max-w-56">Dari</label>
<div class="flex flex-wrap items-baseline w-full"> <div class="flex flex-wrap items-baseline w-full">
<input type="text" name="dari" class="input w-full" placeholder="Masukkan..." <input type="text" name="dari" class="input w-full" placeholder="Masukkan..."
value=""> value="{{ $memo->dari ?? "" }}">
</div> </div>
</div> </div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5"> <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Nomor Memo</label> <label class="form-label max-w-56">Nomor Memo</label>
<div class="flex flex-wrap items-base line w-full"> <div class="flex flex-wrap items-base line w-full">
<input type="text" name="nomor_memo" class="input w-full" placeholder="Masukkan..." <input type="text" name="nomor_memo" class="input w-full" placeholder="Masukkan..."
value=""> value="{{ $memo->nomor_memo ?? "" }}">
</div> </div>
</div> </div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5"> <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Tanggal</label> <label class="form-label max-w-56">Tanggal</label>
<div class="flex flex-wrap items-baseline w-full"> <div class="flex flex-wrap items-baseline w-full">
<input type="date" name="tanggal" class="input w-full" placeholder="Masukkan..." <input type="date" name="tanggal" class="input w-full" placeholder="Masukkan..."
value=""> value="{{ $memo->tanggal ?? "" }}">
</div> </div>
</div> </div>
@@ -58,7 +57,7 @@
<label class="form-label max-w-56">Perihal</label> <label class="form-label max-w-56">Perihal</label>
<div class="flex flex-wrap items-base line w-full"> <div class="flex flex-wrap items-base line w-full">
<input type="text" name="perihal" class="input w-full" placeholder="Masukkan..." <input type="text" name="perihal" class="input w-full" placeholder="Masukkan..."
value=""> value="{{ $memo->perihal ?? "" }}">
</div> </div>
</div> </div>
</div> </div>
@@ -67,9 +66,8 @@
<div class="card w-full bg-white rounded-lg shadow-md "> <div class="card w-full bg-white rounded-lg shadow-md ">
<div class="card-header"> <div class="card-header">
<h1 class="text-md font-medium text-gray-900 uppercase">Sehubungan dengan permintaan BAGI Cabang <h1 class="text-md font-medium text-gray-900 uppercase">Sehubungan dengan permintaan BAGI Cabang
............., untuk dilakukan survey untuk penilaian baru/review, calon debitur/debitur an <b>{{ $permohonan->branch->name }}</b>, untuk dilakukan survey untuk penilaian baru/review, calon debitur/debitur an
............., <b>{{ $permohonan->debiture->name }}</b>,dengan deskripsi sebagai berikut :
dengan deskripsi sebagai berikut :
</h1> </h1>
</div> </div>
<div class="card-body"> <div class="card-body">
@@ -82,15 +80,12 @@
<select id="jenis_asset_tidak_sesuai" class="input w-full" name="jenis_asset_tidak_sesuai"> <select id="jenis_asset_tidak_sesuai" class="input w-full" name="jenis_asset_tidak_sesuai">
<option value="">Select Jenis asset</option> <option value="">Select Jenis asset</option>
@foreach ($basicData['jenisJaminan'] as $item) @foreach ($basicData['jenisJaminan'] as $item)
<option value="{{ $item->name }}">{{ $item->name }}</option> <option value="{{ $item->name }}" {{ ($memo->jenis_asset_tidak_sesuai ?? '') == $item->name ? 'selected' : '' }}>
{{ $item->name }}
</option>
@endforeach @endforeach
</select> </select>
</div> </div>
</div> </div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5"> <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
@@ -99,7 +94,7 @@
<label for="address" class="form-label max-w-56">Lokasi</label> <label for="address" class="form-label max-w-56">Lokasi</label>
<div class="flex flex-wrap items-baseline w-full"> <div class="flex flex-wrap items-baseline w-full">
<input type="text" id="address" name="address" class="input w-full" <input type="text" id="address" name="address" class="input w-full"
placeholder="Masukkan Jl." value="{{ old('address') }}"> placeholder="Masukkan Jl." value="{{ $memo->address ?? old('address') }}">
</div> </div>
</div> </div>
@@ -109,7 +104,7 @@
<select id="province_code" name="province_code" class="input w-full"> <select id="province_code" name="province_code" class="input w-full">
<option value="">Pilih Provinsi</option> <option value="">Pilih Provinsi</option>
@foreach ($provinces as $item) @foreach ($provinces as $item)
<option value="{{ $item->code }}">{{ $item->name }}</option> <option value="{{ $item->code }}" {{ ($memo->province_code ?? '') == $item->code ? 'selected' : '' }}>{{ $item->name }}</option>
@endforeach @endforeach
</select> </select>
</div> </div>
@@ -120,6 +115,11 @@
<div class="flex flex-wrap items-baseline w-full"> <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">
<option value="">Pilih Kota/Kabupaten</option> <option value="">Pilih Kota/Kabupaten</option>
@if(isset($cities))
@foreach ($cities as $item)
<option value="{{ $item->code }}" {{ ($memo->city_code?? '') == $item->code ? 'selected' : '' }}>{{ $item->name }}</option>
@endforeach
@endif
</select> </select>
</div> </div>
</div> </div>
@@ -129,6 +129,11 @@
<div class="flex flex-wrap items-baseline w-full"> <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">
<option value="">Pilih Kecamatan</option> <option value="">Pilih Kecamatan</option>
@if(isset($districts))
@foreach ($districts as $item)
<option value="{{ $item->code }}" {{ ($memo->district_code?? '') == $item->code ? 'selected' : '' }}>{{ $item->name }}</option>
@endforeach
@endif
</select> </select>
</div> </div>
</div> </div>
@@ -138,23 +143,36 @@
<div class="flex flex-wrap items-baseline w-full"> <div class="flex flex-wrap items-baseline w-full">
<select id="village_code" name="village_code" class="select w-full"> <select id="village_code" name="village_code" class="select w-full">
<option value="">Pilih Kelurahan</option> <option value="">Pilih Kelurahan</option>
@if(isset($villages))
@foreach ($villages as $item)
<option value="{{ $item->code }}" {{ ($memo->village_code ?? '') == $item->code ? 'selected' : '' }}>{{ $item->name }}</option>
@endforeach
@endif
</select> </select>
</div> </div>
</div> </div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full"> <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
<label for="address" class="form-label max-w-56">Tanggal Survey</label> <label for="address" class="form-label max-w-56">Address</label>
<div class="flex flex-wrap items-baseline w-full"> <div class="flex flex-wrap items-baseline w-full">
<input type="date" id="address" name="address" class="input w-full" <input type="text" id="address" name="address" class="input w-full"
placeholder="Masukkan Jl." value="{{ old('address') }}"> placeholder="Masukkan Jl." value="{{ $memo->address ?? old('address') }}">
</div> </div>
</div> </div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full"> <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
<label for="address" class="form-label max-w-56">Penilai</label> <label for="tanggal_survey" class="form-label max-w-56">Tanggal Survey</label>
<div class="flex flex-wrap items-baseline w-full"> <div class="flex flex-wrap items-baseline w-full">
<input type="text" id="address" name="address" class="input w-full" <input type="date" id="tanggal_survey" name="tanggal_survey" class="input w-full"
placeholder="Masukkan Jl." value="{{ old('address') }}"> placeholder="Masukkan Tanggal Survey" value="{{ $memo->tanggal_survey ?? old('tanggal_survey') }}">
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
<label for="penilai" class="form-label max-w-56">Penilai</label>
<div class="flex flex-wrap items-baseline w-full">
<input type="text" id="penilai" name="penilai" class="input w-full"
placeholder="Masukkan Penilai" value="{{ $memo->penilai ?? old('penilai') }}">
</div> </div>
</div> </div>
@@ -167,7 +185,6 @@
</div> </div>
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
<h3 class="card-title uppercase"> <h3 class="card-title uppercase">
@@ -181,7 +198,7 @@
<div id="fakta-positif-container" class="flex flex-wrap items-baseline w-full"> <div id="fakta-positif-container" class="flex flex-wrap items-baseline w-full">
<div class="terlampir flex items-center gap-2 mt-2 textarea-group w-full"> <div class="terlampir flex items-center gap-2 mt-2 textarea-group w-full">
<textarea class="textarea mt-2" name="terlampir[]" rows="3">{{ old('terlampir', '') }}</textarea> <textarea class="textarea mt-2" name="terlampir[]" rows="3">{{ $memo->terlampir[0] ?? old('terlampir', '') }}</textarea>
</div> </div>
</div> </div>
@@ -190,8 +207,8 @@
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5"> <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Berdasarkan hasil survey dapat disampaikan sbb:</label> <label class="form-label max-w-56">Berdasarkan hasil survey dapat disampaikan sbb:</label>
<div id="hasil_survey" class="flex flex-wrap items-baseline w-full"> <div id="hasil_survey" class="flex flex-wrap items-baseline w-full">
@if (!empty($forminspeksi['hasil_survey'])) @if (!empty($memo->hasil_survey))
@foreach ($forminspeksi['hasil_survey'] as $index => $positif) @foreach ($memo->hasil_survey as $index => $positif)
<div class="hasil_survey flex items-center gap-2 mt-2 textarea-group w-full"> <div class="hasil_survey flex items-center gap-2 mt-2 textarea-group w-full">
<textarea class="textarea mt-2" name="hasil_survey[]" rows="3">{{ old("hasil_survey.$index", $positif) }}</textarea> <textarea class="textarea mt-2" name="hasil_survey[]" rows="3">{{ old("hasil_survey.$index", $positif) }}</textarea>
<button class="btn btn-danger btn-sm remove-btn" type="button" <button class="btn btn-danger btn-sm remove-btn" type="button"
@@ -220,8 +237,8 @@
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5"> <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">Kesimpulan dan saran</label> <label class="form-label max-w-56">Kesimpulan dan saran</label>
<div id="fakta-negatif-container" class="flex flex-wrap items-baseline w-full"> <div id="fakta-negatif-container" class="flex flex-wrap items-baseline w-full">
@if (!empty($forminspeksi['kesimpulan_saran'])) @if (!empty($memo->kesimpulan_saran))
@foreach ($forminspeksi['kesimpulan_saran'] as $index => $negatif) @foreach ($memo->kesimpulan_saran as $index => $negatif)
<div class="fakta_negatif flex items-center gap-2 mt-2 textarea-group w-full"> <div class="fakta_negatif flex items-center gap-2 mt-2 textarea-group w-full">
<textarea class="textarea mt-2" name="kesimpulan_saran[]" rows="3">{{ old("kesimpulan_saran.$index", $negatif) }}</textarea> <textarea class="textarea mt-2" name="kesimpulan_saran[]" rows="3">{{ old("kesimpulan_saran.$index", $negatif) }}</textarea>
<button class="btn btn-danger btn-sm remove-btn" type="button" <button class="btn btn-danger btn-sm remove-btn" type="button"
@@ -232,7 +249,7 @@
@endforeach @endforeach
@else @else
<div class="kesimpulan_saran flex items-center gap-2 mt-2 textarea-group w-full"> <div class="kesimpulan_saran flex items-center gap-2 mt-2 textarea-group w-full">
<textarea class="textarea mt-2" name="kesimpulan_saran[]" rows="3">{{ old('kesimpulan_saran.0', $forminspeksi['kesimpulan_saran'][0] ?? '') }}</textarea> <textarea class="textarea mt-2" name="kesimpulan_saran[]" rows="3">{{ old('kesimpulan_saran.0') }}</textarea>
<button class="btn btn-danger btn-sm remove-btn" type="button" <button class="btn btn-danger btn-sm remove-btn" type="button"
style="display: none;"> style="display: none;">
<i class="ki-outline ki-trash"></i> <i class="ki-outline ki-trash"></i>
@@ -250,7 +267,6 @@
</div> </div>
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
<h3 class="card-title uppercase"> <h3 class="card-title uppercase">
@@ -315,10 +331,7 @@
{{ $item['name_rute'] . ' ' . $loop->index + 1 }} {{ $item['name_rute'] . ' ' . $loop->index + 1 }}
</h2> </h2>
<div class="flex items-center"> <div class="flex items-center">
<img src="{{ Storage::url($item['foto_rute']) }}" alt=""> <img src="{{ Storage::url($item['foto_rute']) }}" alt="">
</div> </div>
</div> </div>
</div> </div>
@@ -449,8 +462,6 @@
</div> </div>
@endsection @endsection
@include('lpj::surveyor.js.utils') @include('lpj::surveyor.js.utils')
<script> <script>
function saveMemo() { function saveMemo() {
const form = document.getElementById('form-memo'); const form = document.getElementById('form-memo');

View File

@@ -22,8 +22,12 @@
</div> </div>
<div class="card-body flex items-center justify-between"> <div class="card-body flex items-center justify-between">
@php @php
$url = '';
$fileName = '';
if ($penilai && $penilai->kertas_kerja) {
$url = asset('storage/' . $penilai->kertas_kerja); $url = asset('storage/' . $penilai->kertas_kerja);
$fileName = basename($penilai->kertas_kerja); $fileName = basename($penilai->kertas_kerja);
}
@endphp @endphp
<button type="button" class="btn btn-primary" onclick="window.open('{{ $url }}', '_blank')"> <button type="button" class="btn btn-primary" onclick="window.open('{{ $url }}', '_blank')">
<i class="ki-outline ki-cloud-download"></i> <i class="ki-outline ki-cloud-download"></i>

View File

@@ -139,31 +139,31 @@
debitur_id: { debitur_id: {
title: 'Debitur', title: 'Debitur',
render: (item, data) => { render: (item, data) => {
return `${data.debiture.name}`; return data.debiture && data.debiture.name ? `${data.debiture.name}` : '-';
}, },
}, },
branch_id: { branch_id: {
title: 'Cabang Pemohon', title: 'Cabang Pemohon',
render: (item, data) => { render: (item, data) => {
return `${data.branch.name}`; return data.branch && data.branch.name ? `${data.branch.name}` : '-';
}, },
}, },
user_id: { user_id: {
title: 'User Pemohon', title: 'User Pemohon',
render: (item, data) => { render: (item, data) => {
return `${data.user.name}`; return data.user && data.user.name ? `${data.user.name}` : '-';
}, },
}, },
tujuan_penilaian_id: { tujuan_penilaian_id: {
title: 'Tujuan Penilaian', title: 'Tujuan Penilaian',
render: (item, data) => { render: (item, data) => {
return `${data.tujuan_penilaian.name}`; return data.tujuan_penilaian && data.tujuan_penilaian.name ? `${data.tujuan_penilaian.name}` : '-';
}, },
}, },
jenis_fasilitas_kredit_id: { jenis_fasilitas_kredit_id: {
title: 'Fasilitas Kredit', title: 'Fasilitas Kredit',
render: (item, data) => { render: (item, data) => {
return `${data.jenisfasilitas_kredit.name}`; return data.jenisfasilitas_kredit && data.jenisfasilitas_kredit.name ? `${data.jenisfasilitas_kredit.name}` : '-';
}, },
}, },
tanggal_survei: { tanggal_survei: {

View File

@@ -451,11 +451,11 @@
<tr> <tr>
<td class="px-4 py-2">Harga Setelah Diskon</td> <td class="px-4 py-2">Harga Setelah Diskon</td>
<td class="px-4 py-2"> <td class="px-4 py-2">
<input type="text" name="harga_diskon" class="input currency-format" <input type="text" name="harga_diskon" class="input currency-format" readonly
value="{{ $inspectionData['asset']['harga_diskon'] ?? '' }}"> value="{{ $inspectionData['asset']['harga_diskon'] ?? '' }}">
</td> </td>
<td class="px-4 py-2"> <td class="px-4 py-2">
<input type="text" name="harga_diskon_pembanding[]" <input type="text" name="harga_diskon_pembanding[]" readonly
class="input currency-format"> class="input currency-format">
</td> </td>
</tr> </tr>
@@ -777,7 +777,6 @@
if (input.name.includes('diskon_pembanding')) { if (input.name.includes('diskon_pembanding')) {
input.addEventListener('input', function() { input.addEventListener('input', function() {
let value = parseFloat(this.value.replace(/[^\d]/g, '') || '0'); let value = parseFloat(this.value.replace(/[^\d]/g, '') || '0');
value = Math.min(value, 100);
this.value = formatCurrency(value.toString()); this.value = formatCurrency(value.toString());
}); });
} }

View File

@@ -1,5 +1,3 @@
<div class="card w-full rounded-lg shadow-md overflow-hidden"> <div class="card w-full rounded-lg shadow-md overflow-hidden">
<div class="card-header"> <div class="card-header">
<h3 class="card-title uppercase"> <h3 class="card-title uppercase">
@@ -44,7 +42,8 @@
class="input w-full" placeholder="Masukan Luas Tanah" class="input w-full" placeholder="Masukan Luas Tanah"
value="{{ old('luas_tanah_tidak_sesuai', $forminspeksi['tanah']['luas_tanah']['tidak sesuai'] ?? '') }}"> value="{{ old('luas_tanah_tidak_sesuai', $forminspeksi['tanah']['luas_tanah']['tidak sesuai'] ?? '') }}">
<button type="button" class="btn btn-md btn-primary" <button type="button" class="btn btn-md btn-primary"
onclick="updateAnalisa('analisa_tanah')">Save</button> onclick="updateAnalisa('analisa_tanah')">Save
</button>
</div> </div>
</div> </div>
<em id="error-luas_tanah" class="alert text-danger text-sm"></em> <em id="error-luas_tanah" class="alert text-danger text-sm"></em>
@@ -60,10 +59,14 @@
@foreach ($permohonan->debiture->documents as $item) @foreach ($permohonan->debiture->documents as $item)
@php @php
$luas = $item->detail; $luas = $item->detail;
if(is_array($luas)){
$details = json_decode($luas[0]->details, true); $details = json_decode($luas[0]->details, true);
$hadap_mata_angin = isset($details['hadap_mata_angin']) $hadap_mata_angin = isset($details['hadap_mata_angin'])
? $details['hadap_mata_angin'] ? $details['hadap_mata_angin']
: 'N/A'; : 'N/A';
} else {
$luas_tanah = $hadap_mata_angin= 'N/A';
}
@endphp @endphp
<input type="hidden" name="hadap_mata_angin_sesuai" class="input" <input type="hidden" name="hadap_mata_angin_sesuai" class="input"
value="{{ $hadap_mata_angin }}"> value="{{ $hadap_mata_angin }}">

View File

@@ -138,23 +138,25 @@
}, },
user_id: { user_id: {
title: 'User Pemohon', title: 'User Pemohon',
render: (item, data) => `${data.user.name}`, render: (item, data) => data.user ? `${data.user.name}` : 'N/A',
}, },
branch_id: { branch_id: {
title: 'Cabang Pemohon', title: 'Cabang Pemohon',
render: (item, data) => `${data.branch.name}`, render: (item, data) => data.branch ? `${data.branch.name}` : 'N/A',
}, },
debitur_id: { debitur_id: {
title: 'Debitur', title: 'Debitur',
render: (item, data) => `${data.debiture.name}`, render: (item, data) => {
return data.debiture ? `${data.debiture.name}` : 'N/A';
},
}, },
tujuan_penilaian_id: { tujuan_penilaian_id: {
title: 'Tujuan Penilaian', title: 'Tujuan Penilaian',
render: (item, data) => `${data.tujuan_penilaian.name}`, render: (item, data) => data.tujuan_penilaian ? `${data.tujuan_penilaian.name}` : 'N/A',
}, },
jenis_fasilitas_kredit_id: { jenis_fasilitas_kredit_id: {
title: 'Fasilitas Kredit', title: 'Fasilitas Kredit',
render: (item, data) => `${data.jenis_fasilitas_kredit.name}`, render: (item, data) => data.jenis_fasilitas_kredit ? `${data.jenis_fasilitas_kredit.name}` : 'N/A',
}, },
actions: { actions: {
title: 'Action', title: 'Action',