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
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
36 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
0.1.32 2022-1-20
----------------
----------------
- Rumus discount pokok dan discount denda Kabupaten Cirebon
- Rumus discount pokok dan discount denda Kabupaten Cirebon
...
...
sismiop/models/bogor_kota.py
View file @
f184ac8
...
@@ -2,6 +2,7 @@ from sqlalchemy import (
...
@@ -2,6 +2,7 @@ from sqlalchemy import (
Column
,
Column
,
String
,
String
,
Integer
,
Integer
,
Float
,
BigInteger
,
BigInteger
,
)
)
from
.default
import
Base
from
.default
import
Base
...
@@ -21,6 +22,33 @@ class PembayaranSppt(BasePembayaranSppt):
...
@@ -21,6 +22,33 @@ class PembayaranSppt(BasePembayaranSppt):
discount
=
Column
(
BigInteger
)
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
):
class
PenguranganPst
(
Base
):
__tablename__
=
'pengurangan_pst'
__tablename__
=
'pengurangan_pst'
__table_args__
=
dict
(
schema
=
'pbb'
)
__table_args__
=
dict
(
schema
=
'pbb'
)
...
...
sismiop/models/default.py
View file @
f184ac8
...
@@ -43,28 +43,3 @@ class Propinsi(Base, PropinsiMixin):
...
@@ -43,28 +43,3 @@ class Propinsi(Base, PropinsiMixin):
class
TempatPembayaran
(
Base
,
TempatPembayaranMixin
):
class
TempatPembayaran
(
Base
,
TempatPembayaranMixin
):
pass
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
datetime
import
date
from
..models.default
import
PenguranganCovid
from
..models.bogor_kota
import
(
from
..models.bogor_kota
import
PenguranganPst
PenguranganCovid
,
PenguranganPst
,
ESppt
,
)
from
.base
import
(
from
.base
import
(
get_db_session
,
get_db_session
,
Query
,
Query
,
...
@@ -12,12 +15,9 @@ from .default import (
...
@@ -12,12 +15,9 @@ from .default import (
)
)
AWAL_DISC
=
date
(
2021
,
2
,
1
)
AKHIR_DISC
=
date
(
2021
,
4
,
30
)
# Discount pokok berdasarkan bulan
# Discount pokok berdasarkan bulan
NILAI_DISC
=
{
2
:
0.15
,
3
:
0.1
,
4
:
0.05
}
DISC_POKOK_2022
=
{
2
:
0.15
,
3
:
0.1
,
4
:
0.05
}
THN_PAJAK_DISC
=
'2021'
DISC_POKOK_MAX_2017
=
{
2
:
0.2
,
3
:
0.2
,
4
:
0.2
}
class
Common
(
Query
):
class
Common
(
Query
):
...
@@ -35,6 +35,16 @@ class Common(Query):
...
@@ -35,6 +35,16 @@ class Common(Query):
class
Inquiry
(
BaseInquiry
,
Common
):
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
):
def
is_pst
(
self
):
DBSession
=
get_db_session
()
DBSession
=
get_db_session
()
inv_id
=
self
.
invoice_id
inv_id
=
self
.
invoice_id
...
@@ -50,20 +60,29 @@ class Inquiry(BaseInquiry, Common):
...
@@ -50,20 +60,29 @@ class Inquiry(BaseInquiry, Common):
return
pst
and
pst
.
no_sk
and
pst
.
status_sk_peng_pst
!=
'2'
return
pst
and
pst
.
no_sk
and
pst
.
status_sk_peng_pst
!=
'2'
def
hitung_discount_pokok
(
self
):
def
hitung_discount_pokok
(
self
):
if
self
.
invoice
.
thn_pajak_sppt
==
THN_PAJAK_DISC
:
if
self
.
invoice
.
thn_pajak_sppt
==
'2022'
:
potongan
=
NILAI_DISC
[
self
.
tgl_bayar
.
month
]
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
)
self
.
discount_pokok
=
int
(
potongan
*
self
.
tagihan
)
def
hitung_discount_denda
(
self
):
def
hitung_discount_denda
(
self
):
if
self
.
invoice
.
thn_pajak_sppt
<=
'2021'
:
self
.
discount_denda
=
self
.
denda
self
.
discount_denda
=
self
.
denda
def
hitung_discount
(
self
):
# Override
def
hitung_discount
(
self
):
# Override
self
.
discount_pokok
=
self
.
discount_denda
=
0
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
return
if
self
.
denda
:
if
self
.
denda
:
self
.
hitung_discount_denda
()
self
.
hitung_discount_denda
()
el
if
not
self
.
is_pst
():
if
not
self
.
is_pst
():
self
.
hitung_discount_pokok
()
self
.
hitung_discount_pokok
()
self
.
discount
=
self
.
discount_pokok
+
self
.
discount_denda
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