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 f184ac80
authored
Feb 01, 2022
by
Owo Sugiana
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Rumus discount Kota Bogor
1 parent
91bf4c9a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
38 deletions
CHANGES.txt
sismiop/models/bogor_kota.py
sismiop/models/default.py
sismiop/services/bogor_kota.py
CHANGES.txt
View file @
f184ac8
0.1.33 2022-1-31
----------------
- Rumus discount Kota Bogor
0.1.32 2022-1-20
----------------
- Rumus discount pokok dan discount denda Kabupaten Cirebon
...
...
sismiop/models/bogor_kota.py
View file @
f184ac8
...
...
@@ -2,6 +2,7 @@ from sqlalchemy import (
Column
,
String
,
Integer
,
Float
,
BigInteger
,
)
from
.default
import
Base
...
...
@@ -21,6 +22,33 @@ class PembayaranSppt(BasePembayaranSppt):
discount
=
Column
(
BigInteger
)
class
ESppt
(
Base
):
__tablename__
=
'e_sppt'
kd_propinsi
=
Column
(
String
(
2
),
primary_key
=
True
)
kd_dati2
=
Column
(
String
(
2
),
primary_key
=
True
)
kd_kecamatan
=
Column
(
String
(
3
),
primary_key
=
True
)
kd_kelurahan
=
Column
(
String
(
3
),
primary_key
=
True
)
kd_blok
=
Column
(
String
(
3
),
primary_key
=
True
)
no_urut
=
Column
(
String
(
4
),
primary_key
=
True
)
kd_jns_op
=
Column
(
String
(
1
),
primary_key
=
True
)
__table_args__
=
dict
(
schema
=
'pbb'
)
class
PenguranganCovid
(
Base
):
__tablename__
=
'pengurangan_covid'
kd_propinsi
=
Column
(
String
(
2
),
primary_key
=
True
)
kd_dati2
=
Column
(
String
(
2
),
primary_key
=
True
)
kd_kecamatan
=
Column
(
String
(
3
),
primary_key
=
True
)
kd_kelurahan
=
Column
(
String
(
3
),
primary_key
=
True
)
kd_blok
=
Column
(
String
(
3
),
primary_key
=
True
)
no_urut
=
Column
(
String
(
4
),
primary_key
=
True
)
kd_jns_op
=
Column
(
String
(
1
),
primary_key
=
True
)
thn_pajak_sppt
=
Column
(
String
(
4
),
primary_key
=
True
)
pembayaran_sppt_ke
=
Column
(
Integer
,
primary_key
=
True
)
bayar
=
Column
(
Float
,
nullable
=
False
)
denda
=
Column
(
Float
,
nullable
=
False
)
class
PenguranganPst
(
Base
):
__tablename__
=
'pengurangan_pst'
__table_args__
=
dict
(
schema
=
'pbb'
)
...
...
sismiop/models/default.py
View file @
f184ac8
...
...
@@ -43,28 +43,3 @@ class Propinsi(Base, PropinsiMixin):
class
TempatPembayaran
(
Base
,
TempatPembayaranMixin
):
pass
class
PenguranganCovid
(
Base
):
__tablename__
=
'pengurangan_covid'
kd_propinsi
=
Column
(
String
(
2
),
primary_key
=
True
)
kd_dati2
=
Column
(
String
(
2
),
primary_key
=
True
)
kd_kecamatan
=
Column
(
String
(
3
),
primary_key
=
True
)
kd_kelurahan
=
Column
(
String
(
3
),
primary_key
=
True
)
kd_blok
=
Column
(
String
(
3
),
primary_key
=
True
)
no_urut
=
Column
(
String
(
4
),
primary_key
=
True
)
kd_jns_op
=
Column
(
String
(
1
),
primary_key
=
True
)
thn_pajak_sppt
=
Column
(
String
(
4
),
primary_key
=
True
)
pembayaran_sppt_ke
=
Column
(
Integer
,
primary_key
=
True
)
bayar
=
Column
(
Float
,
nullable
=
False
)
denda
=
Column
(
Float
,
nullable
=
False
)
# __table_args__ = (
# ForeignKeyConstraint(
# [kd_propinsi, kd_dati2, kd_kecamatan, kd_kelurahan, kd_blok,
# no_urut, kd_jns_op, thn_pajak_sppt, pembayaran_sppt_ke],
# [PembayaranSppt.kd_propinsi, PembayaranSppt.kd_dati2,
# PembayaranSppt.kd_kecamatan, PembayaranSppt.kd_kelurahan,
# PembayaranSppt.kd_blok, PembayaranSppt.no_urut,
# PembayaranSppt.kd_jns_op, PembayaranSppt.thn_pajak_sppt,
# PembayaranSppt.pembayaran_sppt_ke]),
# )
sismiop/services/bogor_kota.py
View file @
f184ac8
from
datetime
import
date
from
..models.default
import
PenguranganCovid
from
..models.bogor_kota
import
PenguranganPst
from
..models.bogor_kota
import
(
PenguranganCovid
,
PenguranganPst
,
ESppt
,
)
from
.base
import
(
get_db_session
,
Query
,
...
...
@@ -12,12 +15,9 @@ from .default import (
)
AWAL_DISC
=
date
(
2021
,
2
,
1
)
AKHIR_DISC
=
date
(
2021
,
4
,
30
)
# Discount pokok berdasarkan bulan
NILAI_DISC
=
{
2
:
0.15
,
3
:
0.1
,
4
:
0.05
}
THN_PAJAK_DISC
=
'2021'
DISC_POKOK_2022
=
{
2
:
0.15
,
3
:
0.1
,
4
:
0.05
}
DISC_POKOK_MAX_2017
=
{
2
:
0.2
,
3
:
0.2
,
4
:
0.2
}
class
Common
(
Query
):
...
...
@@ -35,6 +35,16 @@ class Common(Query):
class
Inquiry
(
BaseInquiry
,
Common
):
def
is_e_sppt
(
self
):
DBSession
=
get_db_session
()
inv_id
=
self
.
invoice_id
q
=
DBSession
.
query
(
ESppt
)
.
filter_by
(
kd_propinsi
=
inv_id
[
'Propinsi'
],
kd_dati2
=
inv_id
[
'Kabupaten'
],
kd_kecamatan
=
inv_id
[
'Kecamatan'
],
kd_kelurahan
=
inv_id
[
'Kelurahan'
],
kd_blok
=
inv_id
[
'Blok'
],
no_urut
=
inv_id
[
'Urut'
],
kd_jns_op
=
inv_id
[
'Jenis'
])
return
q
.
first
()
def
is_pst
(
self
):
DBSession
=
get_db_session
()
inv_id
=
self
.
invoice_id
...
...
@@ -50,20 +60,29 @@ class Inquiry(BaseInquiry, Common):
return
pst
and
pst
.
no_sk
and
pst
.
status_sk_peng_pst
!=
'2'
def
hitung_discount_pokok
(
self
):
if
self
.
invoice
.
thn_pajak_sppt
==
THN_PAJAK_DISC
:
potongan
=
NILAI_DISC
[
self
.
tgl_bayar
.
month
]
self
.
discount_pokok
=
int
(
potongan
*
self
.
tagihan
)
if
self
.
invoice
.
thn_pajak_sppt
==
'2022'
:
potongan
=
DISC_POKOK_2022
[
self
.
tgl_bayar
.
month
]
elif
self
.
invoice
.
thn_pajak_sppt
<=
'2017'
:
potongan
=
DISC_POKOK_MAX_2017
[
self
.
tgl_bayar
.
month
]
else
:
return
self
.
discount_pokok
=
int
(
potongan
*
self
.
tagihan
)
def
hitung_discount_denda
(
self
):
self
.
discount_denda
=
self
.
denda
if
self
.
invoice
.
thn_pajak_sppt
<=
'2021'
:
self
.
discount_denda
=
self
.
denda
def
hitung_discount
(
self
):
# Override
self
.
discount_pokok
=
self
.
discount_denda
=
0
if
self
.
tgl_bayar
<
AWAL_DISC
or
self
.
tgl_bayar
>
AKHIR_DISC
:
if
self
.
tgl_bayar
.
year
>
2022
:
return
if
self
.
tgl_bayar
.
month
not
in
(
2
,
3
,
4
):
return
if
not
self
.
is_e_sppt
():
return
if
self
.
denda
:
self
.
hitung_discount_denda
()
el
if
not
self
.
is_pst
():
if
not
self
.
is_pst
():
self
.
hitung_discount_pokok
()
self
.
discount
=
self
.
discount_pokok
+
self
.
discount_denda
...
...
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