Bugs Fix Realisasi Pendapatan dan Tambahan unit pada download realisasi belanja
This commit is contained in:
@@ -1000,21 +1000,38 @@ class RealisasiBelanjaController extends Controller
|
||||
];
|
||||
|
||||
foreach(GetBulan() as $key=>$namaBulan){
|
||||
$arrCol+=[$namaBulan=>"jumlah_realisasi_".($key+1)];
|
||||
$arrCol+=[$namaBulan=>["jumlah_realisasi_".($key+1),"volume_satuan_realisasi_".($key+1)]];
|
||||
}
|
||||
|
||||
|
||||
$i=0;
|
||||
foreach($arrCol as $key=>$fieldVal){
|
||||
$sheet->setCellValue(getAlphabetCell($i).'1', $key);
|
||||
$i++;
|
||||
if (is_array($fieldVal)){
|
||||
foreach($fieldVal as $rowfieldVal){
|
||||
$sheet->setCellValue(getAlphabetCell($i).'1', $key);
|
||||
$i++;
|
||||
}
|
||||
$sheet->mergeCells(getAlphabetCell($i-2).'1:'.getAlphabetCell($i-1).'1');
|
||||
}else{
|
||||
$sheet->setCellValue(getAlphabetCell($i).'1', $key);
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
$rows = 2;
|
||||
foreach ($data as $val){
|
||||
$i=0;
|
||||
foreach($arrCol as $key=>$fieldVal){
|
||||
$sheet->setCellValue(getAlphabetCell($i) . $rows, $val[$fieldVal]);
|
||||
$i++;
|
||||
if (is_array($fieldVal)){
|
||||
foreach($fieldVal as $rowfieldVal){
|
||||
$valNotNull = $val[$rowfieldVal]?$val[$rowfieldVal]:0;
|
||||
$contentVal = str_contains($rowfieldVal,"volume_satuan_realisasi")? $valNotNull." ".$val["unit_satuan"]:$valNotNull;
|
||||
$sheet->setCellValue(getAlphabetCell($i) . $rows, $contentVal);
|
||||
$i++;
|
||||
}
|
||||
}else{
|
||||
$sheet->setCellValue(getAlphabetCell($i) . $rows, $val[$fieldVal]);
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
$rows++;
|
||||
}
|
||||
|
||||
@@ -71,6 +71,8 @@ class BelanjaRealisasi extends Eloquent
|
||||
$sqlstr = "SELECT a.*,NVL(b.jml,0) as jml,
|
||||
CASE WHEN a.jenis_dana = 'DBH' AND a.nama_subjenis_dana<>'CHT'
|
||||
THEN NVL(d.jml_spd, 0) ELSE NVL(c.jml_spd, 0) END AS jml_spd,
|
||||
volume_satuan_realisasi_1,volume_satuan_realisasi_2,volume_satuan_realisasi_3,volume_satuan_realisasi_4,volume_satuan_realisasi_5,volume_satuan_realisasi_6,volume_satuan_realisasi_7,
|
||||
volume_satuan_realisasi_8,volume_satuan_realisasi_9,volume_satuan_realisasi_10,volume_satuan_realisasi_11,volume_satuan_realisasi_12,
|
||||
jumlah_realisasi_1,jumlah_realisasi_2,jumlah_realisasi_3,jumlah_realisasi_4,jumlah_realisasi_5,jumlah_realisasi_6,jumlah_realisasi_7,
|
||||
jumlah_realisasi_8,jumlah_realisasi_9,jumlah_realisasi_10,jumlah_realisasi_11,jumlah_realisasi_12
|
||||
FROM VW_BELANJA_REALISASI a
|
||||
|
||||
+2
-3
@@ -122,9 +122,8 @@ function getAlphabetCell($idx)
|
||||
{
|
||||
$alphabet = range("A","Z");
|
||||
if ($idx > 25)
|
||||
{
|
||||
$idx -= 26;
|
||||
return $alphabet[round($idx/25)].= getAlphabetCell($idx);
|
||||
{
|
||||
return $alphabet[(int)($idx/25)-1].= getAlphabetCell($idx%25);
|
||||
}else{
|
||||
return $alphabet[$idx];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user