Download Jadwal Salur
This commit is contained in:
@@ -0,0 +1,137 @@
|
||||
<?php
|
||||
|
||||
namespace App\Exports;
|
||||
|
||||
use App\Models\VwSkppHst;
|
||||
use Maatwebsite\Excel\Concerns\FromQuery;
|
||||
use Maatwebsite\Excel\Concerns\Exportable;
|
||||
use Maatwebsite\Excel\Concerns\WithMapping;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadings;
|
||||
|
||||
class JadwalSalurExport implements FromQuery, WithMapping, WithHeadings
|
||||
{
|
||||
use Exportable;
|
||||
|
||||
public function __construct($ta)
|
||||
{
|
||||
$this->ta = $ta;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function query()
|
||||
{
|
||||
$sqlStr = 'SELECT kode_rekening,nama_rekening,spsbulan1,spsbulan2,spsbulan3,spsbulan4,
|
||||
spsbulan5,spsbulan6,spsbulan7,spsbulan8,spsbulan9,spsbulan10,spsbulan11,spsbulan12,
|
||||
SUBSTR(KODE_REKENING,1,12) AS kodegrup,SUBSTR(KODE_REKENING,1,9) AS groupall,
|
||||
NVL("1",0) AS "REAL1",NVL("2",0) AS "REAL2",NVL("3",0) AS "REAL3",
|
||||
NVL("4",0) AS "REAL4",NVL("5",0) AS "REAL5",NVL("6",0) AS "REAL6",
|
||||
NVL("7",0) AS "REAL7",NVL("8",0) AS "REAL8",NVL("9",0) AS "REAL9",
|
||||
NVL("10",0) AS "REAL10",NVL("11",0) AS "REAL11",NVL("12",0) AS "REAL12"
|
||||
FROM PROKSI.SPS_PENDAPATAN x
|
||||
LEFT JOIN
|
||||
(
|
||||
SELECT * FROM (
|
||||
SELECT ID_SPS,extract(month from RKUD_TGL) AS BULAN,RKUD_JUMLAH
|
||||
FROM SAMASA.PENDAPATAN_REALISASI
|
||||
WHERE TAHUN=\''.$this->ta.'\'
|
||||
)
|
||||
PIVOT
|
||||
(
|
||||
SUM(RKUD_JUMLAH)
|
||||
FOR BULAN IN(1,2,3,4,5,6,7,8,9,10,11,12)
|
||||
)
|
||||
)y ON x.ID = y.ID_SPS
|
||||
WHERE x.TAHUN = '.$this->ta.' AND x.SKPD_ID=980 AND SUBSTR(x.KODE_REKENING,1,3)=\'4.2\'';
|
||||
|
||||
return $sqlStr;
|
||||
}
|
||||
|
||||
public function columnFormats(): array
|
||||
{
|
||||
return [
|
||||
'B' => NumberFormat::FORMAT_TEXT,
|
||||
];
|
||||
}
|
||||
|
||||
public function map($skpp_hst): array
|
||||
{
|
||||
return [
|
||||
$skpp_hst->no_skpp,
|
||||
"'".$skpp_hst->nip,
|
||||
$skpp_hst->nrk,
|
||||
$skpp_hst->nama,
|
||||
$skpp_hst->nama_golongan,
|
||||
$skpp_hst->status_pegawai,
|
||||
$skpp_hst->tugas,
|
||||
$skpp_hst->dinas,
|
||||
$skpp_hst->tgl_akhir,
|
||||
$skpp_hst->nama_hak,
|
||||
$skpp_hst->nama_keputusan,
|
||||
$skpp_hst->no_pen,
|
||||
$skpp_hst->tgl_pen,
|
||||
$skpp_hst->tgl_tmt,
|
||||
$skpp_hst->ga_pok,
|
||||
$skpp_hst->t_issum,
|
||||
$skpp_hst->t_anak,
|
||||
$skpp_hst->t_lain,
|
||||
$skpp_hst->t_jab,
|
||||
$skpp_hst->t_beras,
|
||||
$skpp_hst->tpph,
|
||||
$skpp_hst->bulat,
|
||||
$skpp_hst->p_beras,
|
||||
$skpp_hst->iuran,
|
||||
$skpp_hst->ppph,
|
||||
$skpp_hst->lain_2,
|
||||
$skpp_hst->nama_kantor,
|
||||
$skpp_hst->wilayah_kantor,
|
||||
$skpp_hst->tgl_cetak,
|
||||
$skpp_hst->keterangan,
|
||||
$skpp_hst->nama_kantor1,
|
||||
$skpp_hst->nama_kantor2,
|
||||
$skpp_hst->wilayah,
|
||||
$skpp_hst->revisi_remarks,
|
||||
date("Y-m-d",strtotime($skpp_hst->created_at)),
|
||||
];
|
||||
}
|
||||
|
||||
public function headings(): array
|
||||
{
|
||||
return [
|
||||
"No SKPP",
|
||||
"NIP",
|
||||
"NRK",
|
||||
"Nama",
|
||||
"Golongan",
|
||||
"Status Pegawai",
|
||||
"Tugas",
|
||||
"Dinas",
|
||||
"Tgl akhir",
|
||||
"Hak",
|
||||
"Keputusan",
|
||||
"No Keputusan",
|
||||
"Tgl Keputusan",
|
||||
"Tgl TMT",
|
||||
"Gaji Pokok",
|
||||
"Tunjangan Suami Istri",
|
||||
"Tunjangan Anak",
|
||||
"Tunjangan Lain",
|
||||
"Tunjangan Jabatan",
|
||||
"Tunjangan Beras",
|
||||
"Tunjangan PPH",
|
||||
"Pembulatan",
|
||||
"Potongan Beras",
|
||||
"Iuran",
|
||||
"Potongan PPH",
|
||||
"lain - Lain",
|
||||
"Kantor",
|
||||
"Wilayah",
|
||||
"Tgl Cetak",
|
||||
"Pindah Tugas Kantor 1",
|
||||
"Pindah Tugas Kantor 2",
|
||||
"Pindah Tugas Wilayah",
|
||||
"Keterangan",
|
||||
"revisi_remarks",
|
||||
"Tgl Dibuat",
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user