Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
aa.gusti
/
eis
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 2e660d0d
authored
Oct 06, 2025
by
Ari Agung Prasetiyo
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
update query pbb
1 parent
1f8e56ae
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
3 deletions
eispajak/views/pcpd.py
eispajak/views/realisasi_pad.sql
eispajak/views/pcpd.py
View file @
2e660d0
# from types import NoneType
import
os
from
pyramid.view
import
(
view_config
,
)
...
...
@@ -6,11 +7,11 @@ from ..views import BaseView
from
..models
import
*
from
..models.eis
import
Eis
,
Chart
,
ChartItem
,
Slide
from
datatables
import
ColumnDT
,
DataTables
from
sqlalchemy
import
func
,
and_
,
String
from
sqlalchemy
import
func
,
and_
,
String
,
text
from
sqlalchemy.sql.expression
import
cast
from
..models.payment
import
PaymentPBB
,
PaymentPAD
,
PaymentBPHTB
,
PaymentWEBR
,
TargetsBangbadil
,
UploadRealisasiOpsen
from
opensipkd.pbb.monitoring.models
import
PembayaranSppt
,
Kecamatan
,
Kelurahan
,
Sppt
from
opensipkd.pjdl.models
import
Sspd
,
Pajak
,
Usaha
from
opensipkd.pjdl.models
import
Sspd
,
Pajak
,
Usaha
,
PdlDBSession
from
datetime
import
timedelta
from
..models.payment
import
PCDBSession
...
...
@@ -29,6 +30,20 @@ PAD_TYP = {
"pbb"
:
[
"0"
],
}
PAD2_TYP
=
{
"hotel"
:
"41011903"
,
"resto"
:
"41011901"
,
"hiburan"
:
"41011905"
,
"ppju"
:
"41011902"
,
"minerba"
:
"410114"
,
"parkir"
:
"41011904"
,
"walet"
:
"410113"
,
"atd"
:
"410112"
,
"reklame"
:
"410109"
,
"pbb"
:
"0"
,
}
jenis_pajak
=
{
"opsen_pkb"
:
{
"kode"
:
"4.1.01.20.01.0001"
,
...
...
@@ -165,6 +180,8 @@ class Views(BaseView):
bayar
=
mapped
.
get
(
"bayar"
,
0
)
denda
=
mapped
.
get
(
"denda"
,
0
)
pokok
=
float
(
bayar
)
if
typ
==
'pbb'
:
pokok
=
bayar
-
denda
tx
=
mapped
.
get
(
"trx"
,
0
)
daily
.
append
((
step
,
pokok
))
dailyTrx
.
append
((
step
,
tx
))
...
...
@@ -793,8 +810,9 @@ class Views(BaseView):
elif
jenis
==
"bphtb"
:
realisasi
=
self
.
get_bphtb_data
()[
"ytd"
]
else
:
realisasi
=
self
.
get_pad_data
(
jenis
)[
"ytd"
]
#realisasi = self.get_pad_data(jenis)
#realisasi = realisasi[f"{jenis}"]["realisasi"]
return
{
jenis
:
{
"kode"
:
jenis_pajak
[
jenis
][
"kode"
]
.
ljust
(
8
,
'0'
),
"nama"
:
jenis_pajak
[
jenis
][
"nama"
],
...
...
@@ -863,6 +881,32 @@ class Views(BaseView):
resp
[
"time"
]
=
datetime
.
now
()
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
return
resp
def
realisasi_pad
(
self
,
jenis
):
target
=
self
.
get_targets
(
jenis
)
today
=
datetime
.
now
()
.
date
()
file_dir
=
os
.
path
.
split
(
__file__
)[
0
]
filename
=
os
.
path
.
join
(
file_dir
,
'realisasi_pad.sql'
)
rekeningkd
=
PAD2_TYP
[
jenis
]
with
open
(
filename
,
'r'
)
as
f
:
qry
=
f
.
read
()
.
format
(
bulan
=
today
.
month
,
tahun
=
today
.
year
,
kondisi
=
f
"and levelid in (3,4) and issummary = 1 and rekeningkd='{rekeningkd}'"
)
engine
=
PdlDBSession
.
get_bind
()
with
engine
.
connect
()
as
conn
:
result
=
conn
.
execute
(
text
(
qry
.
replace
(
'
\n
'
,
' '
)))
d
=
[]
# r = result[0]
for
r
in
result
:
d
.
append
(
dict
(
zip
(
result
.
keys
(),
r
)))
d
=
d
[
0
]
realisasi
=
d
[
"realisasi_lalu"
]
+
d
[
"realisasi"
]
return
{
jenis
:
{
"kode"
:
d
[
"kode"
],
"nama"
:
d
[
"nama"
],
"target"
:
target
,
"realisasi"
:
realisasi
,
"sisa"
:
target
-
realisasi
,
"persen"
:
round
(
realisasi
/
target
*
100
,
2
)
if
target
>
0
else
0
}
}
def
view_pajak
(
self
):
return
{
"module"
:
'pajak'
,
"title"
:
"Realisasi Pajak Daerah"
}
...
...
eispajak/views/realisasi_pad.sql
0 → 100644
View file @
2e660d0
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment