fix(surveyor):perbaikkan print out form inspeksi dan penambahan helper nama detail jaminan, dan form penilaian lpj
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user