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 bface8d5
authored
Apr 23, 2020
by
Owo Sugiana
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Penerapan discount pada rumus periode covid
1 parent
19009269
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
54 deletions
CHANGES.txt
sismiop/scripts/inquiry.py
sismiop/services/base.py
sismiop/services/bogor_kota/__init__.py
CHANGES.txt
View file @
bface8d
0.1.2 2020-04-2
2
0.1.2 2020-04-2
3
----------------
----------------
- Tambah
pengurangan pokok untuk Kota Bogor.
- Tambah
discount terkait periode covid untuk Kota Bogor
- Tambah tabel tempat_pembayaran
- Tambah tabel tempat_pembayaran
0.1.1 2019-05-27
0.1.1 2019-05-27
...
...
sismiop/scripts/inquiry.py
View file @
bface8d
...
@@ -101,7 +101,7 @@ def main(argv=sys.argv):
...
@@ -101,7 +101,7 @@ def main(argv=sys.argv):
register
(
sismiop
.
services
.
base
.
DBSession
)
register
(
sismiop
.
services
.
base
.
DBSession
)
persen_denda
=
conf
.
getfloat
(
'main'
,
'persen_denda'
)
persen_denda
=
conf
.
getfloat
(
'main'
,
'persen_denda'
)
with
transaction
.
manager
:
with
transaction
.
manager
:
inq
=
Inquiry
(
invoice_id
,
persen_denda
,
tgl_bayar
)
inq
=
Inquiry
(
invoice_id
,
persen_denda
,
tgl_bayar
=
tgl_bayar
)
if
not
inq
.
invoice
:
if
not
inq
.
invoice
:
print
(
'Invoice ID {} tidak ada.'
.
format
(
invoice_id
))
print
(
'Invoice ID {} tidak ada.'
.
format
(
invoice_id
))
return
return
...
...
sismiop/services/base.py
View file @
bface8d
...
@@ -124,6 +124,8 @@ class Inquiry(Query):
...
@@ -124,6 +124,8 @@ class Inquiry(Query):
self
.
tgl_bayar
=
tgl_bayar
self
.
tgl_bayar
=
tgl_bayar
else
:
else
:
self
.
tgl_bayar
=
datetime
.
now
()
self
.
tgl_bayar
=
datetime
.
now
()
# Digunakan untuk ISO8583
self
.
tagihan
=
self
.
denda
=
self
.
discount
=
self
.
total
=
0
self
.
hitung
()
self
.
hitung
()
def
get_kelurahan_model
(
self
):
def
get_kelurahan_model
(
self
):
...
@@ -206,15 +208,25 @@ class Inquiry(Query):
...
@@ -206,15 +208,25 @@ class Inquiry(Query):
self
.
tagihan
=
round_up
(
tagihan
)
self
.
tagihan
=
round_up
(
tagihan
)
def
hitung_denda
(
self
):
def
hitung_denda
(
self
):
if
isinstance
(
self
.
tgl_bayar
,
datetime
):
tgl_bayar
=
self
.
tgl_bayar
.
date
()
else
:
tgl_bayar
=
self
.
tgl_bayar
self
.
bln_tunggakan
,
denda
=
hitung_denda
(
self
.
bln_tunggakan
,
denda
=
hitung_denda
(
self
.
tagihan
,
self
.
invoice
.
tgl_jatuh_tempo_sppt
,
self
.
persen_denda
,
self
.
tagihan
,
self
.
invoice
.
tgl_jatuh_tempo_sppt
,
self
.
persen_denda
,
self
.
tgl_bayar
.
date
()
)
tgl_bayar
)
self
.
denda
=
round_up
(
denda
)
self
.
denda
=
round_up
(
denda
)
def
hitung_discount
(
self
):
pass
def
hitung
(
self
):
def
hitung
(
self
):
self
.
hitung_pokok
()
self
.
hitung_pokok
()
self
.
hitung_denda
()
self
.
hitung_denda
()
self
.
total
=
self
.
tagihan
+
self
.
denda
self
.
total
=
self
.
tagihan
+
self
.
denda
if
self
.
total
>
0
:
self
.
hitung_discount
()
self
.
total
=
self
.
total
-
self
.
discount
def
do_payment
(
self
,
bank_fields
,
nip_pencatat
):
def
do_payment
(
self
,
bank_fields
,
nip_pencatat
):
Payment
=
self
.
get_payment_model
()
Payment
=
self
.
get_payment_model
()
...
@@ -223,23 +235,20 @@ class Inquiry(Query):
...
@@ -223,23 +235,20 @@ class Inquiry(Query):
ke
=
bayar
.
pembayaran_sppt_ke
+
1
ke
=
bayar
.
pembayaran_sppt_ke
+
1
else
:
else
:
ke
=
1
ke
=
1
bayar
=
Payment
()
inv
=
self
.
invoice
bayar
=
Payment
(
kd_propinsi
=
inv
.
kd_propinsi
,
kd_dati2
=
inv
.
kd_dati2
,
kd_kecamatan
=
inv
.
kd_kecamatan
,
kd_kelurahan
=
inv
.
kd_kelurahan
,
kd_blok
=
inv
.
kd_blok
,
no_urut
=
inv
.
no_urut
,
kd_jns_op
=
inv
.
kd_jns_op
,
thn_pajak_sppt
=
inv
.
thn_pajak_sppt
,
pembayaran_sppt_ke
=
ke
,
tgl_rekam_byr_sppt
=
datetime
.
now
(),
tgl_pembayaran_sppt
=
self
.
tgl_bayar
,
nip_rekam_byr_sppt
=
nip_pencatat
,
jml_sppt_yg_dibayar
=
self
.
tagihan
+
self
.
denda
,
denda_sppt
=
self
.
denda
,
discount
=
self
.
discount
)
for
key
,
value
in
bank_fields
.
items
():
for
key
,
value
in
bank_fields
.
items
():
setattr
(
bayar
,
key
,
value
)
setattr
(
bayar
,
key
,
value
)
bayar
.
kd_propinsi
=
self
.
invoice
.
kd_propinsi
bayar
.
kd_dati2
=
self
.
invoice
.
kd_dati2
bayar
.
kd_kecamatan
=
self
.
invoice
.
kd_kecamatan
bayar
.
kd_kelurahan
=
self
.
invoice
.
kd_kelurahan
bayar
.
kd_blok
=
self
.
invoice
.
kd_blok
bayar
.
no_urut
=
self
.
invoice
.
no_urut
bayar
.
kd_jns_op
=
self
.
invoice
.
kd_jns_op
bayar
.
thn_pajak_sppt
=
self
.
invoice
.
thn_pajak_sppt
bayar
.
pembayaran_sppt_ke
=
ke
bayar
.
tgl_rekam_byr_sppt
=
datetime
.
now
()
bayar
.
tgl_pembayaran_sppt
=
self
.
tgl_bayar
bayar
.
jml_sppt_yg_dibayar
=
self
.
total
bayar
.
denda_sppt
=
self
.
denda
bayar
.
nip_rekam_byr_sppt
=
nip_pencatat
self
.
before_save
(
bayar
)
self
.
before_save
(
bayar
)
DBSession
.
add
(
bayar
)
DBSession
.
add
(
bayar
)
self
.
invoice
.
status_pembayaran_sppt
=
'1'
# Lunas
self
.
invoice
.
status_pembayaran_sppt
=
'1'
# Lunas
...
...
sismiop/services/bogor_kota/__init__.py
View file @
bface8d
from
time
import
time
from
time
import
time
from
datetime
import
date
from
datetime
import
(
from
opensipkd.hitung
import
(
date
,
round_up
,
datetime
,
hitung_denda
,
)
)
from
opensipkd.hitung
import
round_up
from
sismiop.models.default
import
(
from
sismiop.models.default
import
(
PenguranganPst
,
PenguranganPst
,
PenguranganCovid
,
PenguranganCovid
,
...
@@ -31,23 +31,10 @@ class Inquiry(BaseInquiry):
...
@@ -31,23 +31,10 @@ class Inquiry(BaseInquiry):
pst
=
q
.
first
()
pst
=
q
.
first
()
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_denda
(
self
):
# Override
self
.
bln_tunggakan
,
self
.
denda
=
hitung_denda
(
self
.
tagihan
,
self
.
invoice
.
tgl_jatuh_tempo_sppt
,
self
.
persen_denda
,
self
.
tgl_bayar
.
date
())
self
.
discount
=
0
def
rumus_normal
(
self
):
self
.
denda
=
round_up
(
self
.
denda
)
self
.
total
=
self
.
tagihan
+
self
.
denda
# 01-10-2017 Perwal Kota Bogor penghapusan denda
# 01-10-2017 Perwal Kota Bogor penghapusan denda
def
rumus_2017
(
self
):
def
rumus_2017
(
self
):
if
self
.
invoice
.
thn_pajak_sppt
<
'2013'
:
if
self
.
invoice
.
thn_pajak_sppt
<
'2013'
:
self
.
discount
=
self
.
denda
self
.
discount
=
self
.
denda
self
.
denda
=
0
else
:
self
.
discount
=
0
def
rumus_discount_pokok
(
self
):
def
rumus_discount_pokok
(
self
):
if
self
.
tgl_bayar
.
month
==
4
:
if
self
.
tgl_bayar
.
month
==
4
:
...
@@ -58,28 +45,20 @@ class Inquiry(BaseInquiry):
...
@@ -58,28 +45,20 @@ class Inquiry(BaseInquiry):
pengurang
=
0.05
pengurang
=
0.05
else
:
else
:
return
return
self
.
field_jml_sppt_yg_dibayar
=
self
.
tagihan
self
.
denda
=
0
self
.
field_denda_sppt
=
self
.
denda
=
0
# discount di-round-down
self
.
discount
=
int
(
pengurang
*
self
.
tagihan
)
self
.
discount
=
int
(
pengurang
*
self
.
tagihan
)
self
.
total
=
self
.
tagihan
-
self
.
discount
self
.
discount_pokok
=
True
self
.
discount_pokok
=
True
def
rumus_discount_denda
(
self
):
def
rumus_discount_denda
(
self
):
self
.
field_denda_sppt
=
self
.
discount
=
self
.
denda
=
int
(
self
.
denda
)
self
.
discount
=
self
.
denda
self
.
field_jml_sppt_yg_dibayar
=
self
.
tagihan
+
self
.
denda
self
.
denda
=
0
self
.
total
=
self
.
tagihan
self
.
discount_denda
=
True
self
.
discount_denda
=
True
# self.tagihan, self.denda, self.discount, dan self.total digunakan untuk
# ISO8583
def
hitung
(
self
):
# Override
def
hitung
(
self
):
# Override
self
.
hitung_pokok
()
self
.
hitung_denda
()
self
.
rumus_normal
()
if
self
.
total
<
1
:
return
self
.
discount_denda
=
self
.
discount_pokok
=
False
self
.
discount_denda
=
self
.
discount_pokok
=
False
BaseInquiry
.
hitung
(
self
)
def
hitung_discount
(
self
):
# Override
if
self
.
tgl_bayar
.
year
==
2020
and
self
.
tgl_bayar
.
month
in
(
4
,
5
,
6
):
if
self
.
tgl_bayar
.
year
==
2020
and
self
.
tgl_bayar
.
month
in
(
4
,
5
,
6
):
if
self
.
invoice
.
thn_pajak_sppt
==
'2020'
:
if
self
.
invoice
.
thn_pajak_sppt
==
'2020'
:
if
not
self
.
is_pst
():
if
not
self
.
is_pst
():
...
@@ -90,11 +69,8 @@ class Inquiry(BaseInquiry):
...
@@ -90,11 +69,8 @@ class Inquiry(BaseInquiry):
self
.
rumus_2017
()
self
.
rumus_2017
()
def
before_save
(
self
,
bayar
):
# Override
def
before_save
(
self
,
bayar
):
# Override
bayar
.
discount
=
self
.
discount
if
not
self
.
discount_pokok
and
not
self
.
discount_denda
:
if
not
self
.
discount
and
not
self
.
discount_denda
:
return
return
bayar
.
jml_sppt_yg_dibayar
=
self
.
field_jml_sppt_yg_dibayar
bayar
.
denda_sppt
=
self
.
field_denda_sppt
inv
=
self
.
invoice
inv
=
self
.
invoice
pc
=
PenguranganCovid
(
pc
=
PenguranganCovid
(
kd_propinsi
=
bayar
.
kd_propinsi
,
kd_dati2
=
bayar
.
kd_dati2
,
kd_propinsi
=
bayar
.
kd_propinsi
,
kd_dati2
=
bayar
.
kd_dati2
,
...
...
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