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 f4044e38
authored
Jun 12, 2025
by
aa.gustiana@gmail.com
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
perbaikan pbb
1 parent
c968d32a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
99 additions
and
46 deletions
eispajak/scripts/data/routes.csv
eispajak/views/pcpd.py
eispajak/scripts/data/routes.csv
View file @
f4044e3
...
...
@@ -2,7 +2,7 @@ kode,nama,path,status,type,is_menu,parent_id,file_name,class_name,func_name,perm
eis-pcpd,PCPD,/eis/pcpd,1,0,0
eis-pcpd-act,PCPD Act,/eis/pcpd/{act}/act,1,0
eis-pajak,Pajak,#,1,0,1
eis-pajak-kumulatif,Pajak,/eis/pajak,1,0,1,eis-pajak,pcpd,Views,view_pajak,
eis
,pcpd.pt
eis-pajak-kumulatif,Pajak,/eis/pajak,1,0,1,eis-pajak,pcpd,Views,view_pajak,,pcpd.pt
eis-pbb,PBB,/eis/pbb,1,0,1,eis-pajak,pcpd,Views,view_pbb,eis,pcpd.pt
eis-bphtb,BPHTB,/eis/bphtb,1,0,1,eis-pajak,pcpd,Views,view_bphtb,eis,pcpd.pt
eis-hotel,Hotel,/eis/hotel,1,0,1,eis-pajak,pcpd,Views,view_hotel,eis,pcpd.pt
...
...
eispajak/views/pcpd.py
View file @
f4044e3
...
...
@@ -9,6 +9,7 @@ from datatables import ColumnDT, DataTables
from
sqlalchemy
import
func
,
and_
,
String
from
sqlalchemy.sql.expression
import
cast
from
..models.payment
import
PaymentPBB
,
PaymentPAD
,
PaymentBPHTB
,
PaymentWEBR
from
opensipkd.pbb.monitoring.models
import
PembayaranSppt
from
datetime
import
timedelta
logger
=
logging
.
getLogger
(
__name__
)
...
...
@@ -91,38 +92,91 @@ class Views(BaseView):
trx
=
tx
return
amt
,
trx
,
daily
,
dailyTrx
,
dailyAcc
,
dailyAccTrx
# def get_pbb_data(self):
# if log.root.level == logging.DEBUG:
# today = datetime.strptime('2025-06-05', "%Y-%m-%d")
# else:
# today = datetime.now().date()
# field = func.to_char(PaymentPBB.tgl_pembayaran_sppt, 'yyyy-mm-dd')
# filter_exp = PaymentPBB.tgl_pembayaran_sppt.between(
# today-timedelta(6), today)
# amt, trx, daily, dailyTrx, dailyAcc, dailyAccTrx = \
# self.get_daily_data(PaymentPBB, field,
# today.strftime("%Y-%m-%d"), filter_exp)
# filter_exp = PaymentPBB.tgl_pembayaran_sppt.between(
# today-timedelta(days=6), today)
# field = func.to_char(PaymentPBB.tgl_pembayaran_sppt, 'IYYY')
# filter_exp = PaymentPBB.tgl_pembayaran_sppt.between(
# datetime.strptime(f"{today.year}-01-01", "%Y-%m-%d"), today)
# ytd, ytdTrx, yearly, yearlyTrx, yearlyAcc, yearlyAccTrx = \
# self.get_daily_data(PaymentPBB, field,
# str(today.year), filter_exp)
# field = func.to_char(PaymentPBB.tgl_pembayaran_sppt, 'MM')
# month, monthTrx, monthly, monthlyTrx, monthlyAcc, monthlyAccTrx = \
# self.get_daily_data(PaymentPBB, field, None, filter_exp)
# field = func.to_char(PaymentPBB.tgl_pembayaran_sppt, 'WW')
# filter_exp = PaymentPBB.tgl_pembayaran_sppt.between(
# today-timedelta(weeks=6), today)
# week, weekTrx, weekly, weeklyTrx, weeklyAcc, weeklyAccTrx = \
# self.get_daily_data(PaymentPBB, field, None, filter_exp)
# return {"today": amt,
# "trx": trx,
# "daily": daily,
# "dailyTrx": dailyTrx,
# "dailyAcc": dailyAcc,
# "dailyAccTrx": dailyAccTrx,
# "ytd": ytd,
# "trxYtd": ytdTrx,
# "pie": [("I", 100, '#16a75c'), ("II", 200, '#ffb900'),
# ("III", 300, '#133132'), ("IV", 200, '#123456'),
# ("V", 100, '#545355')],
# "weekly": weekly,
# "weeklyTrx": weeklyTrx,
# "weeklyAcc": weeklyAcc,
# "weeklyAccTrx": weeklyAccTrx,
# "monthly": monthly,
# "monthlyTrx": monthlyTrx,
# "monthlyAcc": monthlyAcc,
# "monthlyAccTrx": monthlyAccTrx,
# }
def
get_pbb_data
(
self
):
if
log
.
root
.
level
==
logging
.
DEBUG
:
today
=
datetime
.
strptime
(
'2025-06-05'
,
"
%
Y-
%
m-
%
d"
)
else
:
today
=
datetime
.
now
()
.
date
()
field
=
func
.
to_char
(
P
aymentPBB
.
tgl_pembayaran_sppt
,
'yyyy-mm-dd'
)
filter_exp
=
P
aymentPBB
.
tgl_pembayaran_sppt
.
between
(
field
=
func
.
to_char
(
P
embayaranSppt
.
tgl_pembayaran_sppt
,
'yyyy-mm-dd'
)
filter_exp
=
P
embayaranSppt
.
tgl_pembayaran_sppt
.
between
(
today
-
timedelta
(
6
),
today
)
amt
,
trx
,
daily
,
dailyTrx
,
dailyAcc
,
dailyAccTrx
=
\
self
.
get_daily_data
(
P
aymentPBB
,
field
,
self
.
get_daily_data
(
P
embayaranSppt
,
field
,
today
.
strftime
(
"
%
Y-
%
m-
%
d"
),
filter_exp
)
filter_exp
=
P
aymentPBB
.
tgl_pembayaran_sppt
.
between
(
filter_exp
=
P
embayaranSppt
.
tgl_pembayaran_sppt
.
between
(
today
-
timedelta
(
days
=
6
),
today
)
field
=
func
.
to_char
(
P
aymentPBB
.
tgl_pembayaran_sppt
,
'IYYY'
)
filter_exp
=
P
aymentPBB
.
tgl_pembayaran_sppt
.
between
(
field
=
func
.
to_char
(
P
embayaranSppt
.
tgl_pembayaran_sppt
,
'IYYY'
)
filter_exp
=
P
embayaranSppt
.
tgl_pembayaran_sppt
.
between
(
datetime
.
strptime
(
f
"{today.year}-01-01"
,
"
%
Y-
%
m-
%
d"
),
today
)
ytd
,
ytdTrx
,
yearly
,
yearlyTrx
,
yearlyAcc
,
yearlyAccTrx
=
\
self
.
get_daily_data
(
P
aymentPBB
,
field
,
self
.
get_daily_data
(
P
embayaranSppt
,
field
,
str
(
today
.
year
),
filter_exp
)
field
=
func
.
to_char
(
P
aymentPBB
.
tgl_pembayaran_sppt
,
'MM'
)
field
=
func
.
to_char
(
P
embayaranSppt
.
tgl_pembayaran_sppt
,
'MM'
)
month
,
monthTrx
,
monthly
,
monthlyTrx
,
monthlyAcc
,
monthlyAccTrx
=
\
self
.
get_daily_data
(
P
aymentPBB
,
field
,
None
,
filter_exp
)
self
.
get_daily_data
(
P
embayaranSppt
,
field
,
None
,
filter_exp
)
field
=
func
.
to_char
(
P
aymentPBB
.
tgl_pembayaran_sppt
,
'WW'
)
filter_exp
=
P
aymentPBB
.
tgl_pembayaran_sppt
.
between
(
field
=
func
.
to_char
(
P
embayaranSppt
.
tgl_pembayaran_sppt
,
'WW'
)
filter_exp
=
P
embayaranSppt
.
tgl_pembayaran_sppt
.
between
(
today
-
timedelta
(
weeks
=
6
),
today
)
week
,
weekTrx
,
weekly
,
weeklyTrx
,
weeklyAcc
,
weeklyAccTrx
=
\
self
.
get_daily_data
(
P
aymentPBB
,
field
,
None
,
filter_exp
)
self
.
get_daily_data
(
P
embayaranSppt
,
field
,
None
,
filter_exp
)
return
{
"today"
:
amt
,
"trx"
:
trx
,
...
...
@@ -319,21 +373,21 @@ class Views(BaseView):
dst
.
sort
()
def
get_pajak_data
(
self
):
pbb
=
self
.
get_pbb_data
()
bphtb
=
self
.
get_bphtb_data
()
pdl
=
self
.
get_pad_data
(
"pbb"
)
daily
=
[]
dailyTrx
=
[]
dailyAcc
=
[]
dailyAccTrx
=
[]
monthly
=
[]
monthlyTrx
=
[]
monthlyAcc
=
[]
monthlyAccTrx
=
[]
weekly
=
[]
weeklyTrx
=
[]
weeklyAcc
=
[]
weeklyAccTrx
=
[]
pbb
=
self
.
get_pbb_data
()
bphtb
=
self
.
get_bphtb_data
()
pdl
=
self
.
get_pad_data
(
"pbb"
)
daily
=
[]
dailyTrx
=
[]
dailyAcc
=
[]
dailyAccTrx
=
[]
monthly
=
[]
monthlyTrx
=
[]
monthlyAcc
=
[]
monthlyAccTrx
=
[]
weekly
=
[]
weeklyTrx
=
[]
weeklyAcc
=
[]
weeklyAccTrx
=
[]
self
.
loop_data
(
pbb
[
"daily"
],
daily
)
self
.
loop_data
(
pbb
[
"dailyTrx"
],
dailyTrx
)
...
...
@@ -374,8 +428,7 @@ class Views(BaseView):
self
.
loop_data
(
pdl
[
"weeklyAcc"
],
weeklyAcc
)
self
.
loop_data
(
pdl
[
"weeklyAccTrx"
],
weeklyAccTrx
)
resp
=
{
"today"
:
float
(
pbb
.
get
(
"today"
,
0
))
+
float
(
bphtb
.
get
(
"today"
,
0
))
+
float
(
pdl
.
get
(
"today"
,
0
)),
resp
=
{
"today"
:
float
(
pbb
.
get
(
"today"
,
0
))
+
float
(
bphtb
.
get
(
"today"
,
0
))
+
float
(
pdl
.
get
(
"today"
,
0
)),
"trx"
:
float
(
pbb
.
get
(
"trx"
,
0
))
+
float
(
bphtb
.
get
(
"trx"
,
0
))
+
float
(
pdl
.
get
(
"trx"
,
0
)),
"daily"
:
daily
,
"dailyTrx"
:
dailyTrx
,
...
...
@@ -397,31 +450,31 @@ class Views(BaseView):
}
return
resp
@
view_config
(
route_name
=
'eis-pcpd-act'
,
renderer
=
'json'
)
@view_config
(
route_name
=
'eis-pcpd-act'
,
renderer
=
'json'
)
def
view_app_act
(
self
):
tahun
=
self
.
ses
[
'tahun'
]
req
=
self
.
req
ses
=
req
.
session
params
=
req
.
params
id
=
'id'
in
params
and
params
[
'id'
]
or
0
json_data
=
{}
json_data
[
'success'
]
=
False
act
=
req
.
matchdict
[
'act'
]
tahun
=
self
.
ses
[
'tahun'
]
req
=
self
.
req
ses
=
req
.
session
params
=
req
.
params
id
=
'id'
in
params
and
params
[
'id'
]
or
0
json_data
=
{}
json_data
[
'success'
]
=
False
act
=
req
.
matchdict
[
'act'
]
if
act
==
'grid'
:
rows
=
DBSession
.
query
(
Eis
)
.
filter
(
Eis
.
id
==
id
)
rows
=
DBSession
.
query
(
Eis
)
.
filter
(
Eis
.
id
==
id
)
if
not
rows
:
return
json_data
elif
act
==
'pbb'
:
resp
=
self
.
get_pbb_data
()
resp
=
self
.
get_pbb_data
()
elif
act
==
'bphtb'
:
resp
=
self
.
get_bphtb_data
()
resp
=
self
.
get_bphtb_data
()
elif
act
==
'webr'
:
resp
=
self
.
get_webr_data
()
resp
=
self
.
get_webr_data
()
elif
act
==
'pajak'
:
resp
=
self
.
get_pajak_data
()
resp
=
self
.
get_pajak_data
()
else
:
resp
=
self
.
get_pad_data
(
act
)
resp
[
"time"
]
=
datetime
.
now
()
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
resp
=
self
.
get_pad_data
(
act
)
resp
[
"time"
]
=
datetime
.
now
()
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
return
resp
def
view_pajak
(
self
):
...
...
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