You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

88 lines
3.7 KiB

<?php
namespace App\Models;
use CodeIgniter\Model;
class Mpemby extends Model
{
function getPenn($param)
{
$tahun = $param['tahun'];
$bln = date('m');
$query = $this->db->query("SELECT NM_KANWIL, TARGET, SUM(PENERIMAAN_BERJALAN) PENB, SUM(PENERIMAAN_LALU) PENL,
(SUM(PENERIMAAN_BERJALAN)/TARGET)*100 PENCAPAIAN, ((SUM(PENERIMAAN_BERJALAN)-SUM(PENERIMAAN_LALU))/SUM(PENERIMAAN_LALU))*100 PERTUMBUHAN
FROM KINERJA_PENERIMAAN
WHERE THN_KINERJA = '" . $tahun . "' AND TO_NUMBER(BLN_KINERJA)
BETWEEN TO_NUMBER('01') AND TO_NUMBER('" . $bln . "') GROUP BY NM_KANWIL, TARGET");
return $query;
}
function getUpd()
{
$query = $this->db->query("SELECT LAST_DDL_TIME UPD
FROM DBA_OBJECTS
WHERE owner = 'GENAPP'
AND object_name = 'KINERJA_PENERIMAAN'");
return $query;
}
function getKat($param)
{
$tahun = $param['tahun'];
$tahunl = $tahun - 1;
$bln = date('m');
$query = $this->db->query("SELECT CASE WHEN KD_KATEGORI IS NULL THEN '-' ELSE KD_KATEGORI END KODE,
CASE WHEN KD_KATEGORI IS NULL THEN 'UNKNOWN' ELSE NM_KATEGORI END NMKAT,
SUM(CASE WHEN THNBYR = '" . $tahun . "' AND BLNBYR = '" . $bln . "' THEN WPBAYAR ELSE 0 END)WPBYRN,
SUM(CASE WHEN THNBYR = '" . $tahunl . "' AND BLNBYR = '" . $bln . "' THEN WPBAYAR ELSE 0 END)WPBYRP,
SUM(CASE WHEN THNBYR = '" . $tahun . "' AND BLNBYR = '" . $bln . "' THEN ROUND(TOTAL) ELSE 0 END) KPENN,
SUM(CASE WHEN THNBYR = '" . $tahunl . "' AND BLNBYR = '" . $bln . "' THEN ROUND(TOTAL) ELSE 0 END) KPENP
FROM PERKATEGORI_MV
GROUP BY KD_KATEGORI,NM_KATEGORI
ORDER BY KD_KATEGORI ASC
");
return $query;
}
function getPiePen($param)
{
$tahun = $param['tahun'];
$tahunl = $tahun - 1;
$bln = date('m');
$query = $this->db->query("SELECT NM_PAJAK,TOTALN PENERIMAAN,
(SELECT ROUND(SUM(TOTAL)) FROM PERJENIS_MV WHERE THNBYR = '" . $tahun . "') PENERIMAAN_TOT
FROM (
SELECT NM_PAJAK,ROUND(SUM(CASE WHEN THNBYR= '" . $tahun . "' THEN TOTAL ELSE 0 END)) TOTALN,
ROUND(SUM(CASE WHEN THNBYR= '" . $tahunl . "' THEN TOTAL ELSE 0 END)) TOTALP
FROM PERJENIS_MV
GROUP BY NM_PAJAK ORDER BY TOTALN DESC) WHERE ROWNUM < = 10
");
return $query;
}
function paycompNas($param)
{
$tahun = $param['tahun'];
$tahunl = $tahun - 1;
$query = $this->db->query("SELECT A.JMLBULAN, A.JUMLAHWP,B.JUMLAHWP JUMLAHWPP FROM
(SELECT TO_NUMBER(BLNBYR) JMLBULAN,JUMLAHWP FROM PAYCOMPNAS
WHERE THNBYR = '" . $tahun . "') A,
(SELECT TO_NUMBER(BLNBYR) JMLBULAN,JUMLAHWP FROM PAYCOMPNAS
WHERE THNBYR = '" . $tahunl . "') B
WHERE A.JMLBULAN =B.JMLBULAN");
return $query;
}
function sofNas($param)
{
$tahun = $param['tahun'];
$query = $this->db->query("SELECT LAPISAN,TO_NUMBER(WPBYR) WPBYR,ROUND(TOTAL) TOTAL FROM SOFNAS WHERE THNBYR = '" . $tahun . "'");
return $query;
}
}