fix(penilai/surveyor): perbaikkan print out dokument jaminan
This commit is contained in:
committed by
Daeng Deni Mardaeni
parent
d52edb9481
commit
340dce7ed7
@@ -430,7 +430,8 @@ function getWilayahName($code, $type)
|
||||
}
|
||||
|
||||
|
||||
function formatLabel($key) {
|
||||
function formatLabel($key)
|
||||
{
|
||||
|
||||
static $labelCache = [];
|
||||
if (isset($labelCache[$key])) {
|
||||
@@ -468,3 +469,35 @@ function calculateSLA($permohonan, $type)
|
||||
|
||||
return $slaMap[$type] ?? null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Menghitung total nilai berdasarkan key dan jenis legalitas.
|
||||
*
|
||||
* @param array $detailsArray
|
||||
* @param string $key
|
||||
* @param int $jenisLegalitas
|
||||
* @return int
|
||||
*/
|
||||
function calculateTotalLuas($detailsArray, $key, $jenisLegalitas)
|
||||
{
|
||||
$total = 0;
|
||||
|
||||
if ($detailsArray) {
|
||||
foreach ($detailsArray as $item) {
|
||||
if (isset($item->jenis_legalitas_jaminan_id) && $item->jenis_legalitas_jaminan_id === $jenisLegalitas) {
|
||||
$details = json_decode($item->details, true);
|
||||
|
||||
if (is_array($details)) {
|
||||
foreach ($details as $detail) {
|
||||
if (isset($detail[$key])) {
|
||||
$total += (int) $detail[$key];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $total;
|
||||
}
|
||||
|
||||
@@ -1344,6 +1344,8 @@ class PenilaiController extends Controller
|
||||
// return $pdf;
|
||||
$cleanNomorLaporan = str_replace(['/', '\\'], '-', $nomorLaporan);
|
||||
$pdf->setPaper('A4', 'portrait');
|
||||
$pdf->set_option('isHtml5ParserEnabled', true);
|
||||
$pdf->set_option('isPhpEnabled', true);
|
||||
return response($pdf->output(), 200)
|
||||
->header('Content-Type', 'application/pdf')
|
||||
->header('Content-Disposition', 'inline; filename="Laporan_' . $tipeLaporan . '_' . $permohonan->debiture->name . '_' . $cleanNomorLaporan . '.pdf"');
|
||||
@@ -1371,6 +1373,8 @@ class PenilaiController extends Controller
|
||||
// return $pdf;
|
||||
$cleanNomorLaporan = str_replace(['/', '\\'], '-', $nomorLaporan);
|
||||
$pdf->setPaper('A4', 'portrait');
|
||||
$pdf->set_option('isHtml5ParserEnabled', true);
|
||||
$pdf->set_option('isPhpEnabled', true);
|
||||
return $pdf->download('Laporan_' . $tipeLaporan . '_' . $permohonan->debiture->name . '_' . $cleanNomorLaporan . '_data.pdf');
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user