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 6913772d
authored
Aug 29, 2023
by
Owo Sugiana
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Jangan hitung tagihan bila status lunas
1 parent
3dfd900b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
61 deletions
CHANGES.txt
sismiop/services/base.py
sismiop/services/tangsel.py
CHANGES.txt
View file @
6913772
0.2.11 2023-08-29
-----------------
- Jangan hitung tagihan bila status lunas
- Discount Kota Tangerang Selatan
0.2.10 2023-08-16
-----------------
- Discount Kabupaten Bekasi
...
...
sismiop/services/base.py
View file @
6913772
...
...
@@ -161,7 +161,8 @@ class Inquiry(Query):
self
.
persen_denda
=
persen_denda
# Digunakan untuk ISO8583
self
.
tagihan
=
self
.
denda
=
self
.
discount
=
self
.
total
=
0
self
.
hitung
()
if
not
self
.
is_paid
():
self
.
hitung
()
def
get_kelurahan_model
(
self
):
pass
...
...
@@ -239,7 +240,7 @@ class Inquiry(Query):
return
self
.
invoice
.
status_pembayaran_sppt
def
is_paid
(
self
):
return
self
.
total
<
1
return
self
.
get_status_pembayaran
()
==
'1'
def
get_payment_sum
(
self
):
Payment
=
self
.
get_payment_model
()
...
...
@@ -407,7 +408,7 @@ class AvailableInvoice(Query):
if
not
inv
:
continue
inq
=
inq_cls
(
invoice
=
inv
)
if
inq
.
is_paid
()
:
if
inq
.
total
<
1
:
continue
no
+=
1
msg
=
self
.
get_msg
(
inq
)
...
...
sismiop/services/tangsel.py
View file @
6913772
# File ini berdasarkan Peraturan Walikota Tangerang Selatan Bulan April
# Tahun 2021
from
datetime
import
(
date
,
datetime
,
...
...
@@ -22,13 +20,8 @@ from .default import (
from
..models.tangsel
import
PembayaranSppt
AKHIR_DISC_2022
=
date
(
2022
,
12
,
31
)
AWAL_DISC_PERIODE_1
=
date
(
2023
,
1
,
1
)
AKHIR_DISC_PERIODE_1
=
date
(
2023
,
4
,
30
)
AWAL_DISC_PERIODE_2
=
date
(
2023
,
5
,
1
)
AKHIR_DISC_PERIODE_2
=
date
(
2023
,
6
,
30
)
AWAL_DISC
=
date
(
2023
,
9
,
1
)
AKHIR_DISC
=
date
(
2023
,
12
,
28
)
class
Inquiry
(
BaseInquiry
):
...
...
@@ -53,17 +46,6 @@ class Inquiry(BaseInquiry):
tagihan
=
self
.
invoice
.
pbb_yg_harus_dibayar_sppt
-
sisa
self
.
tagihan
=
round_up
(
tagihan
)
def
tahun_2022_belum_lunas
(
self
):
DBSession
=
get_db_session
()
Sppt
=
self
.
get_invoice_model
()
q
=
DBSession
.
query
(
Sppt
)
q
=
self
.
get_filter_op
(
q
)
q
=
q
.
filter_by
(
thn_pajak_sppt
=
'2022'
)
row
=
q
.
first
()
if
row
:
return
row
.
status_pembayaran_sppt
!=
'1'
return
True
def
hitung_denda
(
self
):
# Override
super
()
.
hitung_denda
()
self
.
denda_sblm_diskon
=
self
.
denda
...
...
@@ -79,56 +61,38 @@ class Inquiry(BaseInquiry):
# faktor_pengurang = self.invoice.faktor_pengurang_sppt or 0
# if faktor_pengurang > 0:
# return 0
if
self
.
invoice
.
thn_pajak_sppt
>=
'2014'
and
\
self
.
invoice
.
thn_pajak_sppt
<=
'2021'
:
disc
=
0.3
elif
self
.
invoice
.
thn_pajak_sppt
<
'2014'
:
if
self
.
invoice
.
thn_pajak_sppt
<
'2014'
:
disc
=
0.75
elif
'2014'
<=
self
.
invoice
.
thn_pajak_sppt
<=
'2020'
:
disc
=
0.3
else
:
disc
=
0
return
int
(
disc
*
self
.
tagihan
)
def
hitung_discount_2022
(
self
):
if
self
.
tgl_bayar
>
AKHIR_DISC_2022
:
return
if
self
.
tahun_2022_belum_lunas
():
return
self
.
discount_denda
=
self
.
hitung_discount_denda
()
self
.
discount_pokok
=
self
.
hitung_discount_pokok
()
return
True
def
hitung_discount_denda_periode_1
(
self
):
if
self
.
invoice
.
thn_pajak_sppt
<
'2023'
:
def
hitung_discount_denda
(
self
):
if
'1994'
<=
self
.
invoice
.
thn_pajak_sppt
<=
'2022'
:
return
self
.
denda
# discount 100%
return
0
def
hitung_discount_pokok_periode_1
(
self
):
if
self
.
invoice
.
thn_pajak_sppt
==
'2023'
:
disc
=
0.1
elif
self
.
invoice
.
thn_pajak_sppt
>=
'2014'
and
\
self
.
invoice
.
thn_pajak_sppt
<=
'2022'
:
disc
=
0.3
else
:
disc
=
0.75
return
int
(
disc
*
self
.
tagihan
)
def
hitung_discount_pokok_periode_2
(
self
):
if
self
.
invoice
.
thn_pajak_sppt
==
'2023'
:
disc
=
0.05
return
int
(
disc
*
self
.
tagihan
)
return
0
def
tahun_lunas
(
self
,
tahun
):
DBSession
=
get_db_session
()
Sppt
=
self
.
get_invoice_model
()
q
=
DBSession
.
query
(
Sppt
)
q
=
self
.
get_filter_op
(
q
)
q
=
q
.
filter_by
(
thn_pajak_sppt
=
tahun
)
row
=
q
.
first
()
return
row
and
row
.
status_pembayaran_sppt
==
'1'
def
hitung_discount
(
self
):
# Override
self
.
discount_pokok
=
self
.
discount_denda
=
0
if
self
.
hitung_discount_2022
():
if
self
.
tgl_bayar
<
AWAL_DISC
:
return
if
self
.
tgl_bayar
>
AKHIR_DISC
:
return
if
self
.
tgl_bayar
>=
AWAL_DISC_PERIODE_1
and
\
self
.
tgl_bayar
<=
AKHIR_DISC_PERIODE_1
:
self
.
discount_denda
=
self
.
hitung_discount_denda_periode_1
()
self
.
discount_pokok
=
self
.
hitung_discount_pokok_periode_1
()
elif
self
.
tgl_bayar
>=
AWAL_DISC_PERIODE_2
and
\
self
.
tgl_bayar
<=
AKHIR_DISC_PERIODE_2
:
self
.
discount_pokok
=
self
.
hitung_discount_pokok_periode_2
()
if
not
self
.
tahun_lunas
(
'2023'
):
return
self
.
discount_pokok
=
self
.
hitung_discount_pokok
()
self
.
discount_denda
=
self
.
hitung_discount_denda
()
self
.
discount
=
self
.
discount_denda
+
self
.
discount_pokok
def
before_save
(
self
,
payment
):
# Override
...
...
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