Commit d8735612 by Ari Agung Prasetiyo

update komposisi penerimaan

1 parent fd27fe0e
......@@ -679,6 +679,66 @@ class Views(BaseView):
}
return resp
def get_pie(self):
data = {}
data.update(self.get_grid_pajak("hotel"))
data.update(self.get_grid_pajak("resto"))
data.update(self.get_grid_pajak("hiburan"))
data.update(self.get_grid_pajak("parkir"))
data.update(self.get_grid_pajak("ppju"))
data.update(self.get_grid_pajak("minerba"))
data.update(self.get_grid_pajak("walet"))
data.update(self.get_grid_pajak("reklame"))
data.update(self.get_grid_pajak("atd"))
data.update(self.get_grid_pajak("pbb"))
data.update(self.get_grid_pajak("bphtb"))
data.update(self.get_grid_pajak("opsen_pkb"))
data.update(self.get_grid_pajak("opsen_bbnkb"))
resp = [{"kode": data[d]["kode"],
"nama": data[d]["nama"],
"target": data[d]["target"],
"realisasi": data[d]["realisasi"],
"sisa": data[d]["sisa"],
"persen": data[d]["persen"]} for d in data]
sum_realisasi = 0
for d in data :
sum_realisasi += data[d]["realisasi"]
hotel = f"{(resp[0]['realisasi']/sum_realisasi)*100:.2f}"
resto = f"{(resp[1]['realisasi']/sum_realisasi)*100:.2f}"
hiburan = f"{(resp[2]['realisasi']/sum_realisasi)*100:.2f}"
parkir = f"{(resp[3]['realisasi']/sum_realisasi)*100:.2f}"
ppju = f"{(resp[4]['realisasi']/sum_realisasi)*100:.2f}"
minerba = f"{(resp[5]['realisasi']/sum_realisasi)*100:.2f}"
walet = f"{(resp[6]['realisasi']/sum_realisasi)*100:.2f}"
reklame = f"{(resp[7]['realisasi']/sum_realisasi)*100:.2f}"
atd = f"{(resp[8]['realisasi']/sum_realisasi)*100:.2f}"
pbb = f"{(resp[9]['realisasi']/sum_realisasi)*100:.2f}"
bphtb = f"{(resp[10]['realisasi']/sum_realisasi)*100:.2f}"
opsen_pkb = f"{(resp[11]['realisasi']/sum_realisasi)*100:.2f}"
opsen_bbnkb = f"{(resp[12]['realisasi']/sum_realisasi)*100:.2f}"
resp = {
"pie": [
(resp[0]['nama'], hotel , '#16a75c'),
(resp[1]['nama'], resto, '#ffb900'),
(resp[2]['nama'], hiburan, "#92149B"),
(resp[3]['nama'], parkir, "#1188FF"),
(resp[4]['nama'], ppju, "#C2E915"),
(resp[5]['nama'], minerba, "#9BC8F4"),
(resp[6]['nama'], walet, "#FFA3A3"),
(resp[7]['nama'], reklame, "#082BA9"),
(resp[8]['nama'], atd, "#F05D89"),
(resp[9]['nama'], pbb, "#A7950F"),
(resp[10]['nama'], bphtb, "#73D3E9"),
(resp[11]['nama'], opsen_pkb, "#32A7E7"),
(resp[12]['nama'], opsen_bbnkb, "#F87911"),
],
}
return resp
def get_pbb_area(self):
if log.root.level == logging.DEBUG:
......@@ -800,6 +860,8 @@ class Views(BaseView):
resp = self.get_webr_data()
elif act == 'pajak':
resp = self.get_pajak_data()
elif act == 'pie':
return self.get_pie()
else:
resp = self.get_pad_data(act)
resp["time"] = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
......
......@@ -56,7 +56,7 @@
</style>
</head>
<body class="fixed-header">
<body class="fixed-header smart-style-1">
<div id="loading" style="display:none;">
<img id="loading-image" src="${home}/static/img/ajax-loader.gif" alt="Loading..." />
</div>
......
......@@ -14,8 +14,7 @@
<div class="row">
<div class="col-md-12">
<div class="text-center" style="margin-bottom: 20px; padding: 15px 0;">
<h2 style="margin: 0; font-weight: bold; color: #333; text-transform: uppercase; letter-spacing: 1px;
background-color:rgb(164, 162, 162);">
<h2 style="margin: 0; font-weight: bold;text-transform: uppercase;font-size:27px;background-color:rgb(164, 162, 162);">
BESARAN KOMPOSISI PENERIMAAN DARI JENIS PAJAK DAERAH
</h2>
</div>
......@@ -23,6 +22,7 @@
</div>
<div class="row hide">
<p id="tanggalHariIni"></p>
<div class="col-md-3 col1">
<img src="${home}/eis/static/pcpd-logo.png" class="img-responsive logo-pcpd" alt="PCPD Logo">
</div>
......@@ -75,7 +75,8 @@
</div>
<div class="panel-body">
<div class="chart-container text-center">
<canvas id="chartPie"></canvas>
<canvas id="chartPieX"></canvas>
<canvas id="gaugeChart" width="100%" height="100%"></canvas>
</div>
</div>
</div>
......@@ -114,17 +115,9 @@
<!-- Gauge Chart Section -->
<div class="col-md-4">
<div class="panel panel-default" id="gaugePanel" style="min-height: 500px;">
<div class="panel-heading" style="padding: 10px 15px;">
<h5 class="text-center bold" style="margin: 0;">REALISASI PAJAK DAERAH</h5>
</div>
<div class="panel-body" style="padding: 0; height: calc(100% - 50px); overflow: hidden; display: flex; flex-direction: column;">
<div id="chartContainer" style="flex: 1; display: flex; align-items: center; justify-content: center; margin: 0; padding: 0;">
<canvas id="gaugeChart" width="100%" height="100%"></canvas>
</div>
<div class="text-center" style="padding: 10px; background: rgba(0,0,0,0.02); border-top: 1px solid #ddd;">
<h4 id="gaugePercentage" style="margin: 2px 0; font-weight: bold; color: #333; font-size: 16px;">63.70%</h4>
<p style="margin: 1px 0; font-size: 11px; color: #666;">Realisasi: Rp.<span id="gaugeRealisasi">2.343.460.022.116</span></p>
<p style="margin: 1px 0; font-size: 11px; color: #666;">Target: Rp.<span id="gaugeTarget">3.679.068.431.493</span></p>
<canvas id="chartPie"></canvas>
</div>
</div>
</div>
......@@ -133,6 +126,11 @@
<hr>
<div class="row hide">
<div class="text-center" style="padding: 10px; background: rgba(0,0,0,0.02); border-top: 1px solid #ddd;">
<h4 id="gaugePercentage" style="margin: 2px 0; font-weight: bold; color: #333; font-size: 16px;">63.70%</h4>
</div>
<p style="margin: 1px 0; font-size: 11px; color: #666;">Realisasi: Rp.<span id="gaugeRealisasi">2.343.460.022.116</span></p>
<p style="margin: 1px 0; font-size: 11px; color: #666;">Target: Rp.<span id="gaugeTarget">3.679.068.431.493</span></p>
<div class="col-md-2">
<select class="form-control rounded" id="rangeType">
<option value="3">Bulanan</option>
......@@ -258,7 +256,7 @@
pieChart = new Chart(ctx,
{
type: 'pie',
type: 'doughnut',
data: pie_data,
options: {
responsive: true,
......@@ -593,7 +591,7 @@
"info": false,
"autoWidth": false,
"scrollX": true,
"order": [[0, 'asc']],
"ordering":false,
"columnDefs": [
{ className: 'text-center', width: "20px", targets: [0] },
{ className: 'text-left', targets: [1] },
......@@ -621,7 +619,7 @@
sum_sisa += row.sisa;
sum_persen += row.persen;
});
var c = [];
data.forEach(function (row) {
sum_besaran += (row.realisasi/sum_realisasi)*100;
table.row.add([
......@@ -636,6 +634,8 @@
$('#sum_realisasi').html(sum_realisasi.toLocaleString("id-ID"));
$('#sum_sisa').html(sum_sisa.toLocaleString("id-ID"));
$('#sum_persen').html((sum_realisasi / sum_target * 100).toFixed(2));
//addData(pieChart, row);
// Update gauge with total values
var gaugePercentage = (sum_realisasi / sum_target * 100);
......@@ -673,7 +673,7 @@
time.style.fontWeight = 'bold';
// removeData(pieChart);
addData(pieChart, newData.pie);
//addData(pieChart, newData.pie);
trendChart();
tableRefresh();
......@@ -696,6 +696,31 @@
$().datarefresh();
}, 60000);
});
$.get("${url}".replace("/pajak/", "/pie/"), {}, function (data, status) {
if (status === "success") {
newData = data;
addData(pieChart, newData.pie);
setTimeout(function () {
console.log("timeout");
$().datarefresh();
}, 300000);
} else {
setTimeout(function () {
console.log("timeout");
$().datarefresh();
}, 60000);
console.log("Request failed.");
}
}).fail(function () {
setTimeout(function () {
console.log("timeout");
$().datarefresh();
}, 60000);
});
}
</script>
......
......@@ -35,22 +35,28 @@
<div metal:fill-slot="content">
<!-- Main Title -->
<div class="row">
<div class="col-md-12">
<div class="col-md-2">
<img src="${home}/eis/static/bapend.png" class="icon-rounded" alt="" align="left">
</div>
<div class="col-md-8">
<div class="text-center" style="margin-bottom: 20px; padding: 15px 0;">
<h2 style="margin: 0; font-weight: bold; color: #333; text-transform: uppercase; letter-spacing: 1px;">
LAPORAN REALTIME REALISASI PAJAK DAERAH
TREND PENERIMAAN PAJAK DAERAH TAHUN 2022 SD 2025
</h2>
<h3 style="margin: 5px 0 0; font-weight: bold; color: #cc5200; text-transform: uppercase; letter-spacing: 1px;">
DATA DAN INFORMASI
</h3>
<h4 id="tanggalHariIni" style="margin: 5px 0 0; color: #003399; font-weight: bold;"></h4>
<h3 style="margin: 5px 0 0; font-weight: bold; color: #cc5200; text-transform: uppercase; letter-spacing: 1px;">
PADA PERIODE YANG SAMA
</h3>
</div>
</div>
<div class="col-md-2">
<img src="${home}/eis/static/img_logo.png" class="icon-rounded" alt="" align="left" width="100">
</div>
</div>
<h4 class="text-right" id="tanggalHariIni" style="font-size:12px;font-weight: bold;"></h4>
<div class="row hide">
<div class="col-md-3 col1">
<img src="${home}/eis/static/pcpd-logo.png" class="img-responsive logo-pcpd" alt="PCPD Logo">
</div>
<div class="col-md-9 col2">
<div class="panel panel-default text-center main-panel uppercase">
......@@ -110,22 +116,16 @@
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading">
<img src="${home}/eis/static/bapend.png" class="icon-rounded" alt="" align="left">
<h5 class="text-left bold">Target dan Realisasi per Pajak
<i class="fa fa-info-circle pull-right icon-color"></i>
</h5>
</div>
<div class="panel-body">
<table class="table table-bordered table-sm" id="table1">
<thead>
<tr>
<th class="align-middle text-center">Kode</th>
<th class="align-middle text-center">Uraian</th>
<th class="text-center">Target</th>
<th class="text-center">Realisasi</th>
<th class="text-center">Selisih</th>
<th class="text-center">%</th>
<th class="align-middle text-center">Uraian Pendapatan</th>
<th class="text-center">Tahun 2022</th>
<th class="text-center">Tahun 2023</th>
<th class="text-center">Tahun 2024</th>
<th class="text-center">Tahun 2025</th>
</tr>
</thead>
<tbody>
......@@ -631,7 +631,7 @@
"info": false,
"autoWidth": false,
"scrollX": true,
"order": [[0, 'asc']],
"ordering":false,
"columnDefs": [
{ className: 'text-center', width: "50px", targets: [0] },
{ className: 'text-left', width: "250px" ,targets: [1] },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!