Browse Source

sebaran zona pengawasan

main
pecintaseni 7 months ago
parent
commit
3f32725f7b
  1. 11
      app/Controllers/Kewilayahan/Kytp.php
  2. 7
      app/Controllers/Kewilayahan/Sebaran/Pengampu.php
  3. 86
      app/Controllers/Kewilayahan/Sebaran/ZonaPengawasan.php
  4. 2
      app/Views/kewilayahan/dist/kpdl.js
  5. 10
      app/Views/kewilayahan/kytp/TabProgresifitas.js
  6. 94
      app/Views/kewilayahan/kytp/componentProgresifitas/ZonaPengawasan.js

11
app/Controllers/Kewilayahan/Kytp.php

@ -10,6 +10,7 @@ use App\Controllers\Kewilayahan\Sebaran\Pembayaran;
use App\Controllers\Kewilayahan\Sebaran\Pengampu;
use App\Controllers\Kewilayahan\Sebaran\Sof;
use App\Controllers\Kewilayahan\Sebaran\SPTTAhunan;
use App\Controllers\Kewilayahan\Sebaran\ZonaPengawasan;
use App\Libraries\AldLibrary;
use CodeIgniter\API\ResponseTrait;
use CodeIgniter\Controller;
@ -121,6 +122,16 @@ class Kytp extends Controller
return $this->respond($dataReturn, 200);
}
public function sebaranZonaPengawasan()
{
ini_set('max_input_vars', 3000);
$sebaran = new ZonaPengawasan;
$dataReturn['dalamKpp'] = $sebaran->data($this->request, 'dalamKpp');
$dataReturn['luarKpp'] = $sebaran->data($this->request, 'luarKpp');
return $this->respond($dataReturn, 200);
}
public function sebaranSPTTahunan()
{

7
app/Controllers/Kewilayahan/Sebaran/Pengampu.php

@ -35,8 +35,8 @@ class Pengampu extends \App\Controllers\Kewilayahan\Kytp
$db = \Config\Database::connect();
$npwp = $db->table('KPDL_MV_LOKASI_SUBJEK')->select("NM_KANTOR_PENGAMPU, count(DISTINCT NPWP) JML", false)
->groupBy("NM_KANTOR_PENGAMPU")->orderBy("JML", 'desc');
$npwp = $db->table('KPDL_MV_LOKASI_SUBJEK')->select("KPPADM_PENGAMPU, NM_KANTOR_PENGAMPU, count(DISTINCT NPWP) JML", false)
->groupBy("KPPADM_PENGAMPU, NM_KANTOR_PENGAMPU")->orderBy("JML", 'desc');
switch ($jenis) {
case 'assign':
@ -71,10 +71,11 @@ class Pengampu extends \App\Controllers\Kewilayahan\Kytp
$ret = [];
foreach ($data as $b) {
array_push($ret, ['name' => $b->NM_KANTOR_PENGAMPU,
// 'color' => ,
'kode' => $Ald->encryptMe($b->KPPADM_PENGAMPU, $username),
'y' => floatval($b->JML),
]
);

86
app/Controllers/Kewilayahan/Sebaran/ZonaPengawasan.php

@ -0,0 +1,86 @@
<?php
namespace App\Controllers\Kewilayahan\Sebaran;
use App\Libraries\AldLibrary;
class ZonaPengawasan extends \App\Controllers\Kewilayahan\Kytp
{
protected function data($request, $jenis)
{
ini_set('max_input_vars', 3000);
$Ald = new AldLibrary;
$username = session('nip');
$opsiWilZona = $Ald->decryptMe($request->getPost('opsiWilZona'), $username);
$adm4_pcode = [];
foreach ($request->getPost('adm4_pcode') ?? [] as $key => $value) {
$adm4_pcode[] = $Ald->decryptKpdl($value, $username);
}
$id_poly_zona = [];
foreach ($request->getPost('id_poly_zona') ?? [] as $key => $value) {
$id_poly_zona[] = $Ald->decryptMe($value, $username);
}
$nip_ar_perekam = [];
foreach ($request->getPost('nip_ar_perekam') ?? [] as $key => $value) {
$nip_ar_perekam[] = $Ald->decryptMe($value, $username);
}
$nip_ar_pengampu = [];
foreach ($request->getPost('nip_ar_pengampu') ?? [] as $key => $value) {
$nip_ar_pengampu[] = $Ald->decryptMe($value, $username);
}
$db = \Config\Database::connect();
$npwp = $db->table('KPDL_MV_LOKASI_SUBJEK')->select("KPPADM_ZONA, NM_KPP_ZONA, count(DISTINCT NPWP) JML", false)
->groupBy("KPPADM_ZONA, NM_KPP_ZONA")->orderBy("JML", 'desc');
switch ($jenis) {
case 'dalamKpp':
$npwp = $npwp->where("NPWP IS NOT NULL")
->where("KPPADM_PENGAMPU = KPPADM_ZONA");
break;
case 'luarKpp':
$npwp = $npwp->where("NPWP IS NOT NULL")
->where("KPPADM_PENGAMPU != KPPADM_ZONA");
break;
default:
break;
}
if ($opsiWilZona == 'wilayah') {
$npwp->whereIn('ADM4_PCODE', $adm4_pcode);
}
if ($opsiWilZona == 'zona') {
$npwp->whereIn('ID_POLY_ZONA', $id_poly_zona);
}
if ($opsiWilZona == 'perekam') {
$npwp = $npwp->whereIn('CREATED_BY', $nip_ar_perekam);
}
if ($opsiWilZona == 'pengampu') {
$npwp = $npwp->whereIn('NIP_AR_PENGAMPU', $nip_ar_pengampu);
}
$data = $npwp->get()->getResult();
$ret = [];
foreach ($data as $b) {
array_push($ret, ['name' => $b->NM_KPP_ZONA,
'kode' => $Ald->encryptMe($b->KPPADM_ZONA, $username),
'y' => floatval($b->JML),
]
);
}
return $ret;
}
}

2
app/Views/kewilayahan/dist/kpdl.js vendored

File diff suppressed because one or more lines are too long

10
app/Views/kewilayahan/kytp/TabProgresifitas.js

@ -9,6 +9,7 @@ import JenisStatusWp from "./componentProgresifitas/JenisStatusWp"
import Pengampu from "./componentProgresifitas/Pengampu"
import SPTTahunan from "./componentProgresifitas/SPTTahunan"
import KLU from "./componentProgresifitas/KLU"
import ZonaPengawasan from "./componentProgresifitas/ZonaPengawasan"
export default function TabProgresifitas({ dataSend }) {
return (
@ -31,6 +32,9 @@ export default function TabProgresifitas({ dataSend }) {
<Sof dataSend={dataSend} />
</div>
</TabPanel>
<TabPanel id="tab_7" header="SPT Tahunan">
<SPTTahunan dataSend={dataSend} />
</TabPanel>
<TabPanel id="tab_5" header="Jenis/Status WP">
<JenisStatusWp dataSend={dataSend} />
@ -39,10 +43,10 @@ export default function TabProgresifitas({ dataSend }) {
<TabPanel id="tab_5" header="Pengampu">
<Pengampu dataSend={dataSend} />
</TabPanel>
<TabPanel id="tab_5" header="SPT Tahunan">
<SPTTahunan dataSend={dataSend} />
<TabPanel id="tab_6" header="Zona Pengawasan">
<ZonaPengawasan dataSend={dataSend} />
</TabPanel>
<TabPanel id="tab_6" header="KLU">
<TabPanel id="tab_8" header="KLU">
<KLU dataSend={dataSend} />
</TabPanel>
</TabView>

94
app/Views/kewilayahan/kytp/componentProgresifitas/ZonaPengawasan.js

@ -0,0 +1,94 @@
import React, { useEffect, useRef, useState } from "react"
import Highcharts from "highcharts"
import HighchartsReact from "highcharts-react-official"
import { Col, Row } from "reactstrap"
import { format_angka } from "../util"
import collect from "collect.js"
import $ from "jquery"
const ZonaPengawasan = ({ dataSend }) => {
const base_url = "<?=base_url()?>"
const refChart = useRef(null)
const refChart2 = useRef(null)
const [dataZpDalamKpp, setDataZpDalamKpp] = useState(null)
const [dataZpLuarKpp, setDataZpLuarKpp] = useState(null)
useEffect(() => {
$.get({
url: base_url + "kewilayahan/kytp/sebaranZonaPengawasan",
dataType: "json",
type: "POST",
data: {
...dataSend
},
success: (data) => {
setDataZpDalamKpp(data.dalamKpp)
setDataZpLuarKpp(data.luarKpp)
}
})
}, [dataSend])
const optionsChart = (data, title) => {
const total_wp = collect(data).sum("y")
return {
chart: {
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false,
type: "pie",
zoomType: "xy",
height: "300"
},
title: {
text: title,
style: { fontSize: "10px" }
},
tooltip: {
pointFormat: "<b>{point.percentage:.1f}%</b><br>: {point.y} dari " + format_angka(total_wp) + " total NPWP yang ada"
},
accessibility: {
point: {
valueSuffix: "%"
}
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: "pointer",
dataLabels: {
enabled: true,
style: { fontSize: "10px" },
format: "{point.name}: <br> {point.percentage:.1f} %"
}
}
// series: pie_click
},
series: [
{
name: "",
data
}
]
}
}
return (
<>
<Row>
<Col md="6">
<HighchartsReact ref={refChart} highcharts={Highcharts} options={optionsChart(dataZpDalamKpp, "Zona Pengawasan KPP Sendiri")} />
<div className="center text-center">
<span className="text-center">KPP Terdaftar = KPP Zona</span>
</div>
</Col>
<Col md="6">
<HighchartsReact ref={refChart} highcharts={Highcharts} options={optionsChart(dataZpLuarKpp, "Zona Pengawasan Luar KPP")} />
<div className="center text-center">
<span>KPP Terdaftar {"<>"} KPP Zona</span>
</div>
</Col>
</Row>
</>
)
}
export default ZonaPengawasan
Loading…
Cancel
Save