Merge pull request 'feature/senior-officer' (#116) from feature/senior-officer into staging
Reviewed-on: #116
This commit is contained in:
@@ -891,7 +891,7 @@ class PenilaianController extends Controller
|
||||
|
||||
public function revisiLaporan(Request $request, $id)
|
||||
{
|
||||
$permohonan = Permohonan::findOrFail($id);
|
||||
$permohonan = Permohonan::find($id);
|
||||
$userRole = Auth::user()->roles[0]->name;
|
||||
|
||||
$authorization = Authorization::where('permohonan_id', $permohonan->id)
|
||||
|
||||
@@ -292,7 +292,7 @@ class SurveyorController extends Controller
|
||||
$validator = $request->validate([
|
||||
'foto_denah.*' => 'nullable|file|mimes:jpg,jpeg,png,bmp,gif,webp,pdf',
|
||||
'nama_denah.*' => 'nullable|string|max:255',
|
||||
'luas_denah.*' => 'nullable|numeric',
|
||||
'luas_denah.*' => 'nullable',
|
||||
'permohonan_id' => 'required|exists:permohonan,id',
|
||||
'dokument_id' => 'required',
|
||||
'nomor_registrasi' => 'required'
|
||||
@@ -2469,7 +2469,7 @@ class SurveyorController extends Controller
|
||||
$hasil_tanah = $luas_tanah_key === 'sesuai'
|
||||
? ($data['luas_tanah_sesuai'] ?? null)
|
||||
: ($data['luas_tanah_tidak_sesuai'] ?? null);
|
||||
$luas_tanah[$luas_tanah_key] = $hasil_tanah;
|
||||
$luas_tanah[$luas_tanah_key] = preg_replace('/[^0-9.,]/', '', $hasil_tanah);
|
||||
|
||||
// Hadap mata angin key
|
||||
$hadap_mata_angin_key = ($data['hadap_mata_angin'] ?? null) === 'sesuai' ? 'sesuai' : 'tidak sesuai';
|
||||
@@ -2571,7 +2571,7 @@ class SurveyorController extends Controller
|
||||
: ($data['luas_tanah_bagunan_tidak_sesuai'] ?? null);
|
||||
|
||||
// Masukkan key baru yang sesuai
|
||||
$luas_tanah_bagunan[$luas_tanah_bagunan_key] = $hasil_tanah_bagunan;
|
||||
$luas_tanah_bagunan[$luas_tanah_bagunan_key] = preg_replace('/[^0-9.,]/', '', $hasil_tanah_bagunan);
|
||||
|
||||
|
||||
return [
|
||||
@@ -3255,14 +3255,19 @@ class SurveyorController extends Controller
|
||||
|
||||
private function getUnitData($data, $request): array
|
||||
{
|
||||
$luas_unit_key = ($data['luas_unit'] ?? null) === 'sesuai' ? 'sesuai' : 'tidak sesuai';
|
||||
$luas_unit = [];
|
||||
|
||||
$hasil_luas_unit = $luas_unit_key === 'sesuai'
|
||||
? ($data['luas_unit_sesuai'] ?? null)
|
||||
: ($data['luas_unit_tidak_sesuai'] ?? null);
|
||||
|
||||
// Masukkan key baru yang sesuai
|
||||
$luas_luas_unit[$luas_luas_unit_key] = preg_replace('/[^0-9.,]/', '', $hasil_luas_unit);
|
||||
|
||||
return [
|
||||
'action' => $data['action'] ?? null,
|
||||
'luas_unit' => $this->getFieldData(
|
||||
$data,
|
||||
'luas_unit',
|
||||
true
|
||||
),
|
||||
'luas_unit' => $luas_luas_unit,
|
||||
'kondisi_unit' => $data['kondisi_unit'] ?? null,
|
||||
'posisi_unit' => $data['posisi_unit'] ?? null,
|
||||
'lantai' => $data['lantai'] ?? null,
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
name="luas_tanah_bagunan_tidak_sesuai" class="w-full number-format"
|
||||
placeholder="Masukan Luas Bangunan Tidak Sesuai..."
|
||||
value="{{ old('luas_tanah_bagunan_tidak_sesuai', $forminspeksi['bangunan']['luas_tanah_bagunan']['tidak sesuai'] ?? '') }}">
|
||||
<i>M<sup>2</sup></i>
|
||||
|
||||
</div>
|
||||
<button type="button" class="btn btn-md btn-primary"
|
||||
onclick="updateAnalisa('analisa_bangunan')">
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
</a>
|
||||
@elseif (Auth::user()->hasAnyRole(['administrator', 'surveyor']) && Route::currentRouteName('penilai.show'))
|
||||
@if (Request::is('surveyor/inspeksi/*/create') && request()->has('dokument') && request()->has('jenis_jaminan'))
|
||||
<a href="{{ route('surveyor.show', request()->get('dokument')) }}" class="btn btn-xs btn-info">
|
||||
<a href="{{ route('surveyor.show', $permohonan->id) }}" class="btn btn-xs btn-info">
|
||||
<i class="ki-filled ki-exit-left"></i> Back
|
||||
</a>
|
||||
@else
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
<input id="analisa_tanah_tidak_sesuai" type="text" name="luas_tanah_tidak_sesuai"
|
||||
class="w-full number-format" placeholder="Masukan Luas Tanah"
|
||||
value="{{ old('luas_tanah_tidak_sesuai', $forminspeksi['tanah']['luas_tanah']['tidak sesuai'] ?? '') }}">
|
||||
<i>M<sup>2</sup></i>
|
||||
|
||||
</div>
|
||||
<button type="button" class="btn btn-md btn-primary"
|
||||
onclick="updateAnalisa('analisa_tanah')">Save
|
||||
|
||||
@@ -27,21 +27,29 @@
|
||||
|
||||
|
||||
function formatNumber(input) {
|
||||
// Ambil posisi kursor saat ini
|
||||
const cursorPosition = input.selectionStart;
|
||||
|
||||
// Ambil nilai input tanpa "m²" dan karakter non-angka
|
||||
let value = input.value.replace(/[^\d]/g, '');
|
||||
let value = input.value.replace(/[^0-9,]/g, '');
|
||||
|
||||
if ((value.match(/,/g) || []).length > 1) {
|
||||
value = value.replace(/,/g, (match, offset) => (offset === value.indexOf(',') ? ',' : ''));
|
||||
}
|
||||
|
||||
if (value.includes(',')) {
|
||||
const [beforeComma, afterComma] = value.split(',');
|
||||
value = `${beforeComma},${afterComma.substring(0, 2)}`;
|
||||
}
|
||||
|
||||
// Update nilai input dengan format angka dan "m²"
|
||||
input.value = value ? value + ' m²' : 'm²';
|
||||
|
||||
// Atur posisi kursor di depan "m²"
|
||||
|
||||
input.setSelectionRange(cursorPosition, cursorPosition);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function formatCurrency(value, isDiskon = false) {
|
||||
// Ensure the value is a valid number
|
||||
const numericValue = parseFloat(value);
|
||||
|
||||
Reference in New Issue
Block a user