fix(surveyor):perbaikkan print out form inspeksi dan penambahan helper nama detail jaminan, dan form penilaian lpj

This commit is contained in:
majid
2025-03-07 07:37:16 +07:00
parent d37ebeff3c
commit 5fa6f2c9ef
14 changed files with 1083 additions and 1028 deletions

View File

@@ -432,20 +432,15 @@ function getWilayahName($code, $type)
function formatLabel($key) {
$customLabels = [
'shgb_no_kel_desa' => 'SHGB',
'nib' => 'NIB',
'img_pbg_no' =>'IMB/PBG NO',
'no_surat_ukur_gs' => 'No Surat Ukur/GS',
];
// Jika ada dalam mapping, gunakan label custom
if (array_key_exists($key, $customLabels)) {
return $customLabels[$key];
static $labelCache = [];
if (isset($labelCache[$key])) {
return $labelCache[$key];
}
// Default: Ubah underscore menjadi spasi dan kapitalisasi
return ucwords(str_replace('_', ' ', $key));
$customLabel = CustomField::where('name', $key)->first();
$labelCache[$key] = $customLabel->label ?? ucwords(str_replace('_', ' ', $key));
return $labelCache[$key];
}
function calculateSLA($permohonan, $type)