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 a0c0a2c7
authored
Aug 30, 2020
by
Owo Sugiana
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Perubahan rumus pada tangsel sesuai SK No. 34 Tahun 2020
1 parent
11d67be1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
19 deletions
.gitignore
CHANGES.txt
sismiop/services/tangsel/__init__.py
.gitignore
View file @
a0c0a2c
...
@@ -3,4 +3,4 @@ build
...
@@ -3,4 +3,4 @@ build
dist
dist
__pycache__
__pycache__
*.pyc
*.pyc
test
.ini
test
*
CHANGES.txt
View file @
a0c0a2c
0.1.9 2020-08-30
----------------
- Perubahan rumus discount pokok dan discount denda pada modul tangsel sesuai
Peraturan Walikota Tangerang Selatan Nomor 34 Tahun 2020
0.1.8 2020-08-26
0.1.8 2020-08-26
----------------
----------------
- get_alamat_op() yang lebih lengkap.
- get_alamat_op() yang lebih lengkap.
...
...
sismiop/services/tangsel/__init__.py
View file @
a0c0a2c
# File ini berdasarkan Peraturan Walikota Tangerang Selatan No. 34 Tahun 2020
from
datetime
import
date
from
datetime
import
date
from
sqlalchemy
import
(
from
sqlalchemy
import
(
func
,
func
,
...
@@ -17,20 +18,23 @@ from ..default import (
...
@@ -17,20 +18,23 @@ from ..default import (
from
.models
import
PembayaranSppt
from
.models
import
PembayaranSppt
TAHUN_PAJAK_DISC_POKOK
=
[
'2020'
]
# Halaman 6 pasal 8
SATU_SEPTEMBER
=
date
(
2020
,
9
,
1
)
AKHIR_DISC_DENDA
=
date
(
2020
,
12
,
31
)
# Sebelum 1 September 2020
PERIODE_DISC_POKOK
=
{
PERIODE_DISC_POKOK
=
{
2020
:
{
2020
:
{
7
:
0.15
,
7
:
0.15
,
8
:
0.1
,
8
:
0.1
,
},
},
}
}
AKHIR_DISC_DENDA
=
date
(
2020
,
12
,
31
)
THN_AWAL
=
2014
THN_AWAL
=
2014
THN_AKHIR
=
2019
THN_AKHIR
=
2019
THN_DISC
=
[]
THN_DISC
=
[]
for
i
in
range
(
THN_AWAL
,
THN_AKHIR
+
1
):
for
i
in
range
(
THN_AWAL
,
THN_AKHIR
+
1
):
THN_DISC
.
append
(
str
(
i
))
THN_DISC
.
append
(
str
(
i
))
THN_AWAL_STR
=
str
(
THN_AWAL
)
class
Inquiry
(
BaseInquiry
):
class
Inquiry
(
BaseInquiry
):
...
@@ -43,8 +47,6 @@ class Inquiry(BaseInquiry):
...
@@ -43,8 +47,6 @@ class Inquiry(BaseInquiry):
q
=
DBSession
.
query
(
q
=
DBSession
.
query
(
func
.
sum
(
Payment
.
jml_sppt_yg_dibayar
)
.
func
.
sum
(
Payment
.
jml_sppt_yg_dibayar
)
.
label
(
'jml_sppt_yg_dibayar'
),
label
(
'jml_sppt_yg_dibayar'
),
# func.sum(Payment.discount_pokok).
# label('discount_pokok'),
func
.
sum
(
Payment
.
denda_sppt
)
.
func
.
sum
(
Payment
.
denda_sppt
)
.
label
(
'denda_sppt'
))
label
(
'denda_sppt'
))
q
=
self
.
get_filter
(
q
)
q
=
self
.
get_filter
(
q
)
...
@@ -52,8 +54,6 @@ class Inquiry(BaseInquiry):
...
@@ -52,8 +54,6 @@ class Inquiry(BaseInquiry):
self
.
total_bayar
=
bayar
.
jml_sppt_yg_dibayar
or
0
self
.
total_bayar
=
bayar
.
jml_sppt_yg_dibayar
or
0
denda_lalu
=
bayar
.
denda_sppt
or
0
denda_lalu
=
bayar
.
denda_sppt
or
0
sisa
=
float
(
self
.
total_bayar
-
denda_lalu
)
sisa
=
float
(
self
.
total_bayar
-
denda_lalu
)
#disc_pokok_lalu = bayar.discount_pokok or 0
#sisa = float(self.total_bayar + disc_pokok_lalu - denda_lalu)
tagihan
=
self
.
invoice
.
pbb_yg_harus_dibayar_sppt
-
sisa
tagihan
=
self
.
invoice
.
pbb_yg_harus_dibayar_sppt
-
sisa
self
.
tagihan
=
round_up
(
tagihan
)
self
.
tagihan
=
round_up
(
tagihan
)
...
@@ -67,23 +67,31 @@ class Inquiry(BaseInquiry):
...
@@ -67,23 +67,31 @@ class Inquiry(BaseInquiry):
Sppt
.
status_pembayaran_sppt
!=
'1'
)
Sppt
.
status_pembayaran_sppt
!=
'1'
)
return
q
.
first
()
return
q
.
first
()
def
hitung_discount_denda
(
self
):
def
hitung_discount_denda_sebelum_september
(
self
):
self
.
denda_sblm_diskon
=
self
.
denda
if
self
.
invoice
.
thn_pajak_sppt
<
THN_AWAL_STR
:
if
self
.
tgl_bayar
.
date
()
>
AKHIR_DISC_DENDA
:
return
0
if
self
.
invoice
.
thn_pajak_sppt
<
str
(
THN_AWAL
):
if
self
.
belum_lunas_di_periode_discount
():
if
self
.
belum_lunas_di_periode_discount
():
return
0
return
0
return
self
.
denda
# 100 %
return
self
.
denda
# 100 %
el
if
self
.
invoice
.
thn_pajak_sppt
in
THN_DISC
:
if
self
.
invoice
.
thn_pajak_sppt
in
THN_DISC
:
return
int
(
0.5
*
self
.
denda
)
return
int
(
0.5
*
self
.
denda
)
return
0
return
0
def
hitung_discount_pokok
(
self
):
# Halaman 5 pasal 4
faktor_pengurang
=
self
.
invoice
.
faktor_pengurang_sppt
or
0
def
hitung_discount_denda_sk_34_2020
(
self
):
if
faktor_pengurang
>
0
:
if
self
.
invoice
.
thn_pajak_sppt
<
'2020'
:
return
self
.
denda
return
0
def
hitung_discount_denda
(
self
):
self
.
denda_sblm_diskon
=
self
.
denda
if
self
.
tgl_bayar
.
date
()
>
AKHIR_DISC_DENDA
:
return
0
return
0
if
self
.
invoice
.
thn_pajak_sppt
not
in
TAHUN_PAJAK_DISC_POKOK
:
if
self
.
tgl_bayar
.
date
()
<
SATU_SEPTEMBER
:
return
self
.
hitung_discount_denda_sebelum_september
()
return
self
.
hitung_discount_denda_sk_34_2020
()
def
hitung_discount_pokok_sebelum_september
(
self
):
if
self
.
invoice
.
thn_pajak_sppt
<
'2020'
:
return
0
return
0
if
self
.
tgl_bayar
.
year
not
in
PERIODE_DISC_POKOK
:
if
self
.
tgl_bayar
.
year
not
in
PERIODE_DISC_POKOK
:
return
0
return
0
...
@@ -93,6 +101,20 @@ class Inquiry(BaseInquiry):
...
@@ -93,6 +101,20 @@ class Inquiry(BaseInquiry):
disc
=
bulan_disc
[
self
.
tgl_bayar
.
month
]
disc
=
bulan_disc
[
self
.
tgl_bayar
.
month
]
return
int
(
disc
*
self
.
tagihan
)
return
int
(
disc
*
self
.
tagihan
)
# Halaman 4 pasal 2 ayat 1
def
hitung_discount_pokok_sk_34_2020
(
self
):
if
self
.
invoice
.
thn_pajak_sppt
<
'2020'
:
return
int
(
0.5
*
self
.
tagihan
)
return
0
def
hitung_discount_pokok
(
self
):
faktor_pengurang
=
self
.
invoice
.
faktor_pengurang_sppt
or
0
if
faktor_pengurang
>
0
:
return
0
if
self
.
tgl_bayar
.
date
()
<
SATU_SEPTEMBER
:
return
self
.
hitung_discount_pokok_sebelum_september
()
return
self
.
hitung_discount_pokok_sk_34_2020
()
def
hitung_discount
(
self
):
# Override
def
hitung_discount
(
self
):
# Override
self
.
discount_denda
=
self
.
hitung_discount_denda
()
self
.
discount_denda
=
self
.
hitung_discount_denda
()
self
.
discount_pokok
=
self
.
hitung_discount_pokok
()
self
.
discount_pokok
=
self
.
hitung_discount_pokok
()
...
@@ -179,7 +201,7 @@ class AvailableInvoiceTangsel(AvailableInvoice):
...
@@ -179,7 +201,7 @@ class AvailableInvoiceTangsel(AvailableInvoice):
Sppt2
.
thn_pajak_sppt
.
in_
(
THN_DISC
),
Sppt2
.
thn_pajak_sppt
.
in_
(
THN_DISC
),
Sppt2
.
status_pembayaran_sppt
!=
'1'
)
Sppt2
.
status_pembayaran_sppt
!=
'1'
)
q
=
q
.
filter
(
q
=
q
.
filter
(
Sppt
.
thn_pajak_sppt
<
str
(
THN_AWAL
)
,
Sppt
.
thn_pajak_sppt
<
THN_AWAL_STR
,
subq1
.
exists
(),
subq1
.
exists
(),
~
subq2
.
exists
())
~
subq2
.
exists
())
if
self
.
option
.
faktor_pengurang
is
not
None
:
if
self
.
option
.
faktor_pengurang
is
not
None
:
...
...
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