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 b8f31ed0
authored
Dec 16, 2025
by
aa.gustiana@gmail.com
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Add method to retrieve daily PBB data and update related calls
1 parent
e0efc019
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
4 deletions
eispajak/views/pcpd.py
eispajak/views/pcpd.py
View file @
b8f31ed
...
...
@@ -155,6 +155,49 @@ class Views(BaseView):
"monthtrAccTrx"
:
[(
"JAN"
,
100
),
(
"FEB"
,
200
),
(
"MAR"
,
300
),
(
"APR"
,
200
),
(
"MAY"
,
100
),
(
"JUN"
,
100
),
(
"JUL"
,
700
)],
}
def
get_daily_data_pbb
(
self
,
table
,
field
,
today
,
filters
,
typ
=
None
):
# todo ada kemungkinan menyebabkan error ke transaksi yang lain
if
type
(
filters
)
is
not
list
:
filters
=
[
filters
]
if
PCDBSession
.
registry
()
.
in_transaction
():
PCDBSession
.
rollback
()
columns
=
[
field
.
label
(
"step"
)]
qry
=
table
.
qry_sum
(
columns
)
\
.
group_by
(
field
)
\
.
order_by
(
field
)
qry
=
qry
.
filter
(
*
filters
)
if
typ
!=
None
:
if
typ
==
"pajak"
:
qry
=
qry
.
filter
(
table
.
jenis_pajak
.
notin_
(
PAD_TYP
[
'pbb'
]))
else
:
qry
=
qry
.
filter
(
table
.
jenis_pajak
.
in_
(
PAD_TYP
[
typ
]))
daily
=
[]
dailyTrx
=
[]
dailyAcc
=
[]
dailyAccTrx
=
[]
amt
=
trx
=
acc
=
accTrx
=
0
for
r
in
qry
:
mapped
=
r
.
_mapping
step
=
mapped
.
get
(
"step"
,
""
)
pokok
=
mapped
.
get
(
"bayar"
,
0
)
denda
=
mapped
.
get
(
"denda"
,
0
)
bayar
=
pokok
+
denda
tx
=
mapped
.
get
(
"trx"
,
0
)
daily
.
append
((
step
,
pokok
))
dailyTrx
.
append
((
step
,
tx
))
acc
+=
pokok
accTrx
+=
tx
dailyAcc
.
append
((
step
,
acc
))
dailyAccTrx
.
append
((
step
,
accTrx
))
if
step
==
today
:
amt
=
pokok
trx
=
tx
return
amt
,
trx
,
daily
,
dailyTrx
,
dailyAcc
,
dailyAccTrx
def
get_daily_data
(
self
,
table
,
field
,
today
,
filters
,
typ
=
None
):
# todo ada kemungkinan menyebabkan error ke transaksi yang lain
if
type
(
filters
)
is
not
list
:
...
...
@@ -227,7 +270,7 @@ class Views(BaseView):
today
-
timedelta
(
days
=
6
),
today
)
amt
,
trx
,
daily
,
dailyTrx
,
dailyAcc
,
dailyAccTrx
=
\
self
.
get_daily_data
(
PembayaranSppt
,
field
,
self
.
get_daily_data
_pbb
(
PembayaranSppt
,
field
,
today
.
strftime
(
"
%
Y-
%
m-
%
d"
),
filter_exp
)
# Total Setahun
...
...
@@ -235,14 +278,14 @@ class Views(BaseView):
filter_exp
=
PembayaranSppt
.
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
(
PembayaranSppt
,
field
,
self
.
get_daily_data
_pbb
(
PembayaranSppt
,
field
,
str
(
today
.
year
),
filter_exp
)
# Piutang
filter_exp
=
[
PembayaranSppt
.
tgl_pembayaran_sppt
.
between
(
datetime
.
strptime
(
f
"{today.year}-01-01"
,
"
%
Y-
%
m-
%
d"
),
today
),
PembayaranSppt
.
thn_pajak_sppt
<
today
.
year
]
piutang
,
piutangTrx
,
yearly
,
yearlyTrx
,
yearlyAcc
,
yearlyAccTrx
=
\
self
.
get_daily_data
(
PembayaranSppt
,
field
,
self
.
get_daily_data
_pbb
(
PembayaranSppt
,
field
,
str
(
today
.
year
),
filter_exp
)
# Bulanan
...
...
@@ -255,7 +298,7 @@ class Views(BaseView):
filter_exp
=
PembayaranSppt
.
tgl_pembayaran_sppt
.
between
(
today
-
timedelta
(
weeks
=
6
),
today
)
week
,
weekTrx
,
weekly
,
weeklyTrx
,
weeklyAcc
,
weeklyAccTrx
=
\
self
.
get_daily_data
(
PembayaranSppt
,
field
,
None
,
filter_exp
)
self
.
get_daily_data
_pbb
(
PembayaranSppt
,
field
,
None
,
filter_exp
)
try
:
ytd_target
=
self
.
get_targets
(
"pbb"
)
...
...
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