Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Owo Sugiana
/
sismiop-models
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 382bfd24
authored
Feb 25, 2023
by
Owo Sugiana
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Penggunaan tabel denda_adm_sppt di Kabupaten Serang
1 parent
11c4a85d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
68 additions
and
2 deletions
CHANGES.txt
setup.py
sismiop/models/serang_kab.py
sismiop/scripts/inquiry.py
sismiop/services/serang_kab.py
CHANGES.txt
View file @
382bfd2
0.1.51 2023-02-23
-----------------
- Di Kabupaten Serang denda dikurangi dengan tabel denda_adm_sppt
0.1.50 2023-01-31
-----------------
- Discount Kabupaten Subang
...
...
setup.py
View file @
382bfd2
...
...
@@ -15,7 +15,7 @@ line = CHANGES.splitlines()[0]
version
=
line
.
split
()[
0
]
requires
=
[
'sqlalchemy <
1.4
'
,
'sqlalchemy <
2
'
,
'transaction'
,
'zope.sqlalchemy'
,
'psycopg2-binary'
,
...
...
sismiop/models/serang_kab.py
View file @
382bfd2
...
...
@@ -2,6 +2,7 @@ from sqlalchemy import (
Column
,
Float
,
String
,
ForeignKeyConstraint
,
)
from
sqlalchemy.ext.declarative
import
declarative_base
from
.objek_pajak
import
BaseObjekPajakMixin
...
...
@@ -25,6 +26,32 @@ class Sppt(Base, BaseSpptMixin):
pbb_yg_hrs_dibayar_sppt
=
Column
(
Float
)
class
DendaAdm
(
Base
):
__tablename__
=
'denda_adm_sppt'
kd_propinsi
=
Column
(
String
(
2
),
primary_key
=
True
)
kd_dati2
=
Column
(
String
(
2
),
primary_key
=
True
)
kd_dinas
=
Column
(
String
(
2
),
primary_key
=
True
)
kd_kppd
=
Column
(
String
(
2
),
primary_key
=
True
)
no_pelayanan
=
Column
(
String
(
11
),
primary_key
=
True
)
kd_kecamatan_pemohon
=
Column
(
String
(
3
),
primary_key
=
True
)
kd_kelurahan_pemohon
=
Column
(
String
(
3
),
primary_key
=
True
)
kd_blok_pemohon
=
Column
(
String
(
3
),
primary_key
=
True
)
no_urut_pemohon
=
Column
(
String
(
4
),
primary_key
=
True
)
kd_jns_op_pemohon
=
Column
(
String
(
1
),
primary_key
=
True
)
thn_pajak_permohonan
=
Column
(
String
(
4
),
primary_key
=
True
)
jml_pokok_denda
=
Column
(
Float
,
nullable
=
False
)
jml_pengurangan_denda
=
Column
(
Float
)
__table_args__
=
(
ForeignKeyConstraint
([
kd_propinsi
,
kd_dati2
,
kd_kecamatan_pemohon
,
kd_kelurahan_pemohon
,
kd_blok_pemohon
,
no_urut_pemohon
,
kd_jns_op_pemohon
,
thn_pajak_permohonan
],
[
Sppt
.
kd_propinsi
,
Sppt
.
kd_dati2
,
Sppt
.
kd_kecamatan
,
Sppt
.
kd_kelurahan
,
Sppt
.
kd_blok
,
Sppt
.
no_urut
,
Sppt
.
kd_jns_op
,
Sppt
.
thn_pajak_sppt
]),
dict
(
schema
=
'iprotaxpbb'
))
class
PembayaranSppt
(
Base
,
BasePembayaranSpptMixin
):
__table_args__
=
dict
(
schema
=
'iprotaxpbb'
)
jml_denda_sppt
=
Column
(
Float
)
...
...
sismiop/scripts/inquiry.py
View file @
382bfd2
...
...
@@ -168,7 +168,7 @@ def main(argv=sys.argv):
invoice_id
,
persen_denda
,
tgl_bayar
=
tgl_bayar
,
debug
=
True
)
if
not
inq
.
invoice
:
print
(
'Invoice ID {} tidak ada.'
.
format
(
invoice_id
))
if
inq
.
debug_invoice
:
if
inq
.
debug_invoice
and
tgl_bayar
:
if
tgl_bayar
.
year
<
int
(
inq
.
debug_invoice
.
thn_pajak_sppt
):
print
(
'Ada tapi tahun pajak lebih besar dari tahun '
'tanggal bayar'
)
...
...
sismiop/services/serang_kab.py
View file @
382bfd2
from
logging
import
getLogger
from
datetime
import
datetime
from
sqlalchemy
import
func
from
opensipkd.hitung
import
round_up
...
...
@@ -8,16 +9,22 @@ from ..models.serang_kab import (
Kelurahan
,
Kecamatan
,
Propinsi
,
DendaAdm
,
)
from
.base
import
(
AvailableInvoice
as
BaseAvailableInvoice
,
Inquiry
as
BaseInquiry
,
Reversal
as
BaseReversal
,
get_db_session
,
get_id
,
)
class
Inquiry
(
BaseInquiry
):
def
is_available
(
self
):
# Override
if
self
.
invoice
.
thn_pajak_sppt
<
'2023'
:
return
super
()
.
is_available
()
def
hitung_pokok
(
self
):
# Override
DBSession
=
get_db_session
()
Payment
=
self
.
get_payment_model
()
...
...
@@ -37,6 +44,34 @@ class Inquiry(BaseInquiry):
else
:
self
.
tagihan
=
round_up
(
tagihan
)
def
hitung_denda
(
self
):
# Override
super
()
.
hitung_denda
()
if
self
.
denda
<
1
:
return
inv
=
self
.
invoice
DBSession
=
get_db_session
()
q
=
DBSession
.
query
(
DendaAdm
)
.
filter_by
(
kd_propinsi
=
inv
.
kd_propinsi
,
kd_dati2
=
inv
.
kd_dati2
,
kd_kecamatan_pemohon
=
inv
.
kd_kecamatan
,
kd_kelurahan_pemohon
=
inv
.
kd_kelurahan
,
kd_blok_pemohon
=
inv
.
kd_blok
,
no_urut_pemohon
=
inv
.
no_urut
,
kd_jns_op_pemohon
=
inv
.
kd_jns_op
,
thn_pajak_permohonan
=
inv
.
thn_pajak_sppt
)
adm
=
q
.
first
()
if
not
adm
:
return
d
=
self
.
denda
-
(
adm
.
jml_pengurangan_denda
or
0
)
if
d
<=
0
:
d
=
0
else
:
d
=
round_up
(
d
)
log
=
getLogger
(
'hitung_denda()'
)
inv_id
=
get_id
(
inv
)
msg
=
f
'Invoice ID {inv_id} denda = denda waktu {self.denda} - '
\
f
'denda administrasi {adm.jml_pokok_denda} = {d}'
self
.
denda
=
d
log
.
info
(
msg
)
def
do_payment
(
self
,
bank_fields
,
user_id
,
ntp
=
None
,
ntb
=
None
):
# Override
DBSession
=
get_db_session
()
Payment
=
self
.
get_payment_model
()
...
...
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