|
|
@ -133,11 +133,17 @@ class Pembayaran extends \App\Controllers\Kewilayahan\Kytp |
|
|
|
$npwp->groupEnd(); |
|
|
|
$npwp->groupEnd(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$data = $db->newQuery() |
|
|
|
$dataSub = $db->newQuery() |
|
|
|
->select("'" . $tahun . '-' . $bulan . "' AS THN_BLN, NVL(WARNA_BYR, 'black') WARNA_BYR, COUNT(1) AS Y") |
|
|
|
->select("'" . $tahun . '-' . $bulan . "' AS THN_BLN, NVL(WARNA_BYR, 'grey') WARNA_BYR, COUNT(1) AS Y") |
|
|
|
->fromSubquery($npwp, 'A') |
|
|
|
->fromSubquery($npwp, 'A') |
|
|
|
->join('KPDL_MV_PENERIMAAN_AGG B', new RawSql("A.NPWP=B.NPWP and B.THNBYR = '" . $tahun . "' and B.BULAN=" . $bulan), 'left') |
|
|
|
->join('KPDL_MV_PENERIMAAN_AGG B', new RawSql("A.NPWP=B.NPWP and B.THNBYR = '" . $tahun . "' and B.BULAN=" . $bulan), 'left') |
|
|
|
->groupBy("NVL(WARNA_BYR, 'black')")->orderBy("WARNA_BYR"); |
|
|
|
->groupBy("NVL(WARNA_BYR, 'grey')"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$data = $db->newQuery() |
|
|
|
|
|
|
|
->select("A.THN_BLN, A.WARNA_BYR, A.Y, B.ID_WARNA, B.RGB, B.NAMA_WARNA") |
|
|
|
|
|
|
|
->fromSubquery($dataSub, "A") |
|
|
|
|
|
|
|
->join('KPDL_REF_WARNA_PEMBAYARAN B', 'A.WARNA_BYR=B.WARNA', 'inner') |
|
|
|
|
|
|
|
->orderBy('B.ID_WARNA'); |
|
|
|
// print_r($data->getCompiledSelect()); |
|
|
|
// print_r($data->getCompiledSelect()); |
|
|
|
// exit; |
|
|
|
// exit; |
|
|
|
$data = $data->get()->getResult(); |
|
|
|
$data = $data->get()->getResult(); |
|
|
@ -147,7 +153,9 @@ class Pembayaran extends \App\Controllers\Kewilayahan\Kytp |
|
|
|
foreach ($data as $b) { |
|
|
|
foreach ($data as $b) { |
|
|
|
$name = ''; |
|
|
|
$name = ''; |
|
|
|
switch ($b->WARNA_BYR) { |
|
|
|
switch ($b->WARNA_BYR) { |
|
|
|
case 'black':$name = '<=0'; |
|
|
|
case 'black':$name = '<0'; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case 'grey':$name = 'Rp0'; |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 'red':$name = '< 5 jt'; |
|
|
|
case 'red':$name = '< 5 jt'; |
|
|
|
break; |
|
|
|
break; |
|
|
@ -159,7 +167,7 @@ class Pembayaran extends \App\Controllers\Kewilayahan\Kytp |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
array_push($ret, ['name' => $name, |
|
|
|
array_push($ret, ['name' => $b->NAMA_WARNA, |
|
|
|
'color' => $b->WARNA_BYR, |
|
|
|
'color' => $b->WARNA_BYR, |
|
|
|
'key' => $Ald->encryptMe($b->WARNA_BYR, $username), |
|
|
|
'key' => $Ald->encryptMe($b->WARNA_BYR, $username), |
|
|
|
'y' => floatval($b->Y), |
|
|
|
'y' => floatval($b->Y), |
|
|
@ -332,13 +340,8 @@ class Pembayaran extends \App\Controllers\Kewilayahan\Kytp |
|
|
|
->join('KPDL_MV_PENERIMAAN_AGG C', "A.NPWP = C.NPWP AND C.THNBYR = '" . $tahun . "' and BULAN=" . $bulan, "left") |
|
|
|
->join('KPDL_MV_PENERIMAAN_AGG C', "A.NPWP = C.NPWP AND C.THNBYR = '" . $tahun . "' and BULAN=" . $bulan, "left") |
|
|
|
->join('REF_KPP D', "A.KPPADM_MFWP = D.KD_KPP", "left") |
|
|
|
->join('REF_KPP D', "A.KPPADM_MFWP = D.KD_KPP", "left") |
|
|
|
->join('KPDL_REF_STATUS_SPT E', "A.STATUS_SPT_TAHUNAN_TERAKHIR = E.ID_STATUS_SPT", "left"); |
|
|
|
->join('KPDL_REF_STATUS_SPT E', "A.STATUS_SPT_TAHUNAN_TERAKHIR = E.ID_STATUS_SPT", "left"); |
|
|
|
if ($query == 'black') { |
|
|
|
if ($query == 'grey') { |
|
|
|
$data->groupStart(); |
|
|
|
$data->Where("C.WARNA_BYR IS NULL"); |
|
|
|
$data->orGroupStart(); |
|
|
|
|
|
|
|
$data->Where("C.WARNA_BYR IS NULL") |
|
|
|
|
|
|
|
->orWhere("C.WARNA_BYR", 'black'); |
|
|
|
|
|
|
|
$data->groupEnd(); |
|
|
|
|
|
|
|
$data->groupEnd(); |
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$data->where("C.WARNA_BYR", $query); |
|
|
|
$data->where("C.WARNA_BYR", $query); |
|
|
|
} |
|
|
|
} |
|
|
@ -385,7 +388,7 @@ class Pembayaran extends \App\Controllers\Kewilayahan\Kytp |
|
|
|
if ($type == 'raw') { |
|
|
|
if ($type == 'raw') { |
|
|
|
$data = $data->select("A.NPWP, A.NAMA_WP, A.ALAMAT_MFWP, A.KELURAHAN_MFWP, A.KECAMATAN_MFWP, A.KOTA_MFWP, A.PROPINSI_MFWP, |
|
|
|
$data = $data->select("A.NPWP, A.NAMA_WP, A.ALAMAT_MFWP, A.KELURAHAN_MFWP, A.KECAMATAN_MFWP, A.KOTA_MFWP, A.PROPINSI_MFWP, |
|
|
|
A.KPPADM_MFWP, A.NAMA_AR_MFWP, A.FLAG_WPS_WPK, A.STATUS_WP_MFWP, A.JNS_WP_MFWP, A.STATUS_SPT_TAHUNAN_TERAKHIR, |
|
|
|
A.KPPADM_MFWP, A.NAMA_AR_MFWP, A.FLAG_WPS_WPK, A.STATUS_WP_MFWP, A.JNS_WP_MFWP, A.STATUS_SPT_TAHUNAN_TERAKHIR, |
|
|
|
A.TGL_DAFTAR,COALESCE(C.JML,0) JML,CASE WHEN C.WARNA_BYR IS NULL THEN 'BLACK' ELSE C.WARNA_BYR END WARNA_BYR, |
|
|
|
A.TGL_DAFTAR,COALESCE(C.JML,0) JML,CASE WHEN C.WARNA_BYR IS NULL THEN 'grey' ELSE C.WARNA_BYR END WARNA_BYR, |
|
|
|
E.KETERANGAN, D.NM_KANTOR"); |
|
|
|
E.KETERANGAN, D.NM_KANTOR"); |
|
|
|
// print_r($data->getCompiledSelect()); |
|
|
|
// print_r($data->getCompiledSelect()); |
|
|
|
// exit; |
|
|
|
// exit; |
|
|
|