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 19009269
authored
Apr 22, 2020
by
Owo Sugiana
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Penambahan discount
1 parent
547db4ef
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
32 deletions
CHANGES.txt
sismiop/models/pembayaran_sppt.py
sismiop/scripts/inquiry.py
sismiop/services/bogor_kota/__init__.py
CHANGES.txt
View file @
1900926
0.1.2 2020-04-
19
0.1.2 2020-04-
22
----------------
----------------
- Tambah pengurangan pokok untuk Kota Bogor.
- Tambah pengurangan pokok untuk Kota Bogor.
- Tambah tabel tempat_pembayaran
0.1.1 2019-05-27
0.1.1 2019-05-27
----------------
----------------
...
...
sismiop/models/pembayaran_sppt.py
View file @
1900926
...
@@ -4,6 +4,7 @@ from sqlalchemy import (
...
@@ -4,6 +4,7 @@ from sqlalchemy import (
Integer
,
Integer
,
DateTime
,
DateTime
,
Float
,
Float
,
BigInteger
,
)
)
from
sqlalchemy.ext.declarative
import
declared_attr
from
sqlalchemy.ext.declarative
import
declared_attr
...
@@ -63,11 +64,15 @@ class PembayaranSpptMixin:
...
@@ -63,11 +64,15 @@ class PembayaranSpptMixin:
@declared_attr
@declared_attr
def
denda_sppt
(
self
):
def
denda_sppt
(
self
):
return
Column
(
Integer
)
return
Column
(
Big
Integer
)
@declared_attr
@declared_attr
def
jml_sppt_yg_dibayar
(
self
):
def
jml_sppt_yg_dibayar
(
self
):
return
Column
(
Integer
)
return
Column
(
BigInteger
)
@declared_attr
def
discount
(
self
):
return
Column
(
BigInteger
)
@declared_attr
@declared_attr
def
tgl_pembayaran_sppt
(
self
):
def
tgl_pembayaran_sppt
(
self
):
...
@@ -101,7 +106,3 @@ class PembayaranSpptMixin:
...
@@ -101,7 +106,3 @@ class PembayaranSpptMixin:
#def biaya_admin(self):
#def biaya_admin(self):
# return Column(Float)
# return Column(Float)
#@declared_attr
#def discount(self):
# return Column(Integer)
sismiop/scripts/inquiry.py
View file @
1900926
...
@@ -52,7 +52,7 @@ def show(inq):
...
@@ -52,7 +52,7 @@ def show(inq):
show_rp
(
'Tagihan'
,
inq
.
tagihan
)
show_rp
(
'Tagihan'
,
inq
.
tagihan
)
show_rp
(
'Denda'
,
inq
.
denda
)
show_rp
(
'Denda'
,
inq
.
denda
)
show_rp
(
'Total Bayar Sebelumnya'
,
inq
.
total_bayar
)
show_rp
(
'Total Bayar Sebelumnya'
,
inq
.
total_bayar
)
show_rp
(
'Total
Tagihan
'
,
inq
.
total
)
show_rp
(
'Total
Bayar
'
,
inq
.
total
)
show_val
(
'Jatuh Tempo'
,
inq
.
get_jatuh_tempo
())
show_val
(
'Jatuh Tempo'
,
inq
.
get_jatuh_tempo
())
show_val
(
'Bulan Tunggakan'
,
inq
.
bln_tunggakan
)
show_val
(
'Bulan Tunggakan'
,
inq
.
bln_tunggakan
)
show_val
(
'Tahun Pajak'
,
inq
.
get_tahun
())
show_val
(
'Tahun Pajak'
,
inq
.
get_tahun
())
...
@@ -71,7 +71,7 @@ def show_payment(module_name, inq, pay):
...
@@ -71,7 +71,7 @@ def show_payment(module_name, inq, pay):
if
module_name
not
in
[
'bogor_kota'
]:
if
module_name
not
in
[
'bogor_kota'
]:
return
return
print
(
'Tabel pembayaran_sppt'
)
print
(
'Tabel pembayaran_sppt'
)
show_fields
(
pay
,
[
'jml_sppt_yg_dibayar'
,
'denda_sppt'
])
show_fields
(
pay
,
[
'jml_sppt_yg_dibayar'
,
'denda_sppt'
,
'discount'
])
pc
=
inq
.
get_pengurangan_covid
(
pay
)
pc
=
inq
.
get_pengurangan_covid
(
pay
)
if
not
pc
:
if
not
pc
:
return
return
...
@@ -99,8 +99,9 @@ def main(argv=sys.argv):
...
@@ -99,8 +99,9 @@ def main(argv=sys.argv):
session_factory
=
sessionmaker
(
bind
=
engine
)
session_factory
=
sessionmaker
(
bind
=
engine
)
sismiop
.
services
.
base
.
DBSession
=
session_factory
()
sismiop
.
services
.
base
.
DBSession
=
session_factory
()
register
(
sismiop
.
services
.
base
.
DBSession
)
register
(
sismiop
.
services
.
base
.
DBSession
)
persen_denda
=
conf
.
getfloat
(
'main'
,
'persen_denda'
)
with
transaction
.
manager
:
with
transaction
.
manager
:
inq
=
Inquiry
(
invoice_id
,
conf
.
getfloat
(
'main'
,
'persen_denda'
))
inq
=
Inquiry
(
invoice_id
,
persen_denda
,
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
...
@@ -117,7 +118,7 @@ def main(argv=sys.argv):
...
@@ -117,7 +118,7 @@ def main(argv=sys.argv):
kd_kantor
=
conf
.
get
(
'main'
,
'kd_kantor'
),
kd_kantor
=
conf
.
get
(
'main'
,
'kd_kantor'
),
kd_tp
=
conf
.
get
(
'main'
,
'kd_tp'
))
kd_tp
=
conf
.
get
(
'main'
,
'kd_tp'
))
nip
=
conf
.
get
(
'main'
,
'nip_pencatat'
)
nip
=
conf
.
get
(
'main'
,
'nip_pencatat'
)
pay
=
inq
.
do_payment
(
tp
,
nip
,
tgl_bayar
)
pay
=
inq
.
do_payment
(
tp
,
nip
)
show_payment
(
module_name
,
inq
,
pay
)
show_payment
(
module_name
,
inq
,
pay
)
if
option
.
reversal
:
if
option
.
reversal
:
rev
=
Reversal
(
invoice_id
)
rev
=
Reversal
(
invoice_id
)
...
...
sismiop/services/bogor_kota/__init__.py
View file @
1900926
...
@@ -35,12 +35,21 @@ class Inquiry(BaseInquiry):
...
@@ -35,12 +35,21 @@ class Inquiry(BaseInquiry):
self
.
bln_tunggakan
,
self
.
denda
=
hitung_denda
(
self
.
bln_tunggakan
,
self
.
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
())
self
.
tgl_bayar
.
date
())
self
.
discount
=
0
def
rumus_normal
(
self
):
def
rumus_normal
(
self
):
self
.
denda
=
round_up
(
self
.
denda
)
self
.
denda
=
round_up
(
self
.
denda
)
self
.
total
=
self
.
tagihan
+
self
.
denda
self
.
total
=
self
.
tagihan
+
self
.
denda
def
rumus_pengurang_pokok
(
self
):
# 01-10-2017 Perwal Kota Bogor penghapusan denda
def
rumus_2017
(
self
):
if
self
.
invoice
.
thn_pajak_sppt
<
'2013'
:
self
.
discount
=
self
.
denda
self
.
denda
=
0
else
:
self
.
discount
=
0
def
rumus_discount_pokok
(
self
):
if
self
.
tgl_bayar
.
month
==
4
:
if
self
.
tgl_bayar
.
month
==
4
:
pengurang
=
0.15
pengurang
=
0.15
elif
self
.
tgl_bayar
.
month
==
5
:
elif
self
.
tgl_bayar
.
month
==
5
:
...
@@ -51,34 +60,38 @@ class Inquiry(BaseInquiry):
...
@@ -51,34 +60,38 @@ class Inquiry(BaseInquiry):
return
return
self
.
field_jml_sppt_yg_dibayar
=
self
.
tagihan
self
.
field_jml_sppt_yg_dibayar
=
self
.
tagihan
self
.
field_denda_sppt
=
self
.
denda
=
0
self
.
field_denda_sppt
=
self
.
denda
=
0
self
.
pengurang_pokok
=
int
(
pengurang
*
self
.
tagihan
)
self
.
discount
=
int
(
pengurang
*
self
.
tagihan
)
self
.
total
=
self
.
tagihan
=
self
.
tagihan
-
self
.
pengurang_pokok
self
.
total
=
self
.
tagihan
-
self
.
discount
return
True
self
.
discount_pokok
=
True
def
rumus_denda_sebagai_pengurang
(
self
):
def
rumus_discount_denda
(
self
):
self
.
field_denda_sppt
=
self
.
pengurang_denda
=
self
.
denda
=
\
self
.
field_denda_sppt
=
self
.
discount
=
self
.
denda
=
int
(
self
.
denda
)
int
(
self
.
denda
)
self
.
field_jml_sppt_yg_dibayar
=
self
.
tagihan
+
self
.
denda
self
.
field_jml_sppt_yg_dibayar
=
self
.
tagihan
+
self
.
denda
self
.
denda
=
0
self
.
denda
=
0
self
.
total
=
self
.
tagihan
self
.
total
=
self
.
tagihan
self
.
discount_denda
=
True
# self.tagihan, self.denda, dan self.total digunakan untuk ISO8583
# 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_pokok
()
self
.
hitung_denda
()
self
.
hitung_denda
()
self
.
rumus_normal
()
self
.
rumus_normal
()
if
self
.
total
<
1
or
self
.
tgl_bayar
.
year
!=
2020
:
if
self
.
total
<
1
:
return
return
self
.
pengurang_pokok
=
self
.
pengurang_denda
=
0
self
.
discount_denda
=
self
.
discount_pokok
=
False
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
()
and
self
.
rumus_pengurang_pokok
():
if
not
self
.
is_pst
():
return
self
.
rumus_discount_pokok
()
elif
self
.
invoice
.
thn_pajak_sppt
<
'2020'
and
\
elif
self
.
invoice
.
thn_pajak_sppt
<
'2020'
:
self
.
tgl_bayar
.
month
in
(
4
,
5
,
6
):
self
.
rumus_discount_denda
()
self
.
rumus_denda_sebagai_pengurang
()
else
:
self
.
rumus_2017
()
def
before_save
(
self
,
bayar
):
# Override
def
before_save
(
self
,
bayar
):
# Override
if
not
self
.
pengurang_pokok
and
not
self
.
pengurang_denda
:
bayar
.
discount
=
self
.
discount
if
not
self
.
discount
and
not
self
.
discount_denda
:
return
return
bayar
.
jml_sppt_yg_dibayar
=
self
.
field_jml_sppt_yg_dibayar
bayar
.
jml_sppt_yg_dibayar
=
self
.
field_jml_sppt_yg_dibayar
bayar
.
denda_sppt
=
self
.
field_denda_sppt
bayar
.
denda_sppt
=
self
.
field_denda_sppt
...
@@ -89,12 +102,12 @@ class Inquiry(BaseInquiry):
...
@@ -89,12 +102,12 @@ class Inquiry(BaseInquiry):
kd_kelurahan
=
bayar
.
kd_kelurahan
,
kd_kelurahan
=
bayar
.
kd_kelurahan
,
kd_blok
=
bayar
.
kd_blok
,
no_urut
=
bayar
.
no_urut
,
kd_blok
=
bayar
.
kd_blok
,
no_urut
=
bayar
.
no_urut
,
kd_jns_op
=
bayar
.
kd_jns_op
,
thn_pajak_sppt
=
bayar
.
thn_pajak_sppt
,
kd_jns_op
=
bayar
.
kd_jns_op
,
thn_pajak_sppt
=
bayar
.
thn_pajak_sppt
,
pembayaran_sppt_ke
=
bayar
.
pembayaran_sppt_ke
)
pembayaran_sppt_ke
=
bayar
.
pembayaran_sppt_ke
,
if
self
.
pengurang_pokok
:
bayar
=
self
.
discount
)
pc
.
bayar
=
self
.
pengurang_pokok
if
self
.
discount_pokok
:
pc
.
denda
=
0
pc
.
denda
=
0
elif
self
.
pengurang
_denda
:
elif
self
.
discount
_denda
:
pc
.
bayar
=
pc
.
denda
=
self
.
pengurang_denda
pc
.
denda
=
self
.
discount
DBSession
=
get_db_session
()
DBSession
=
get_db_session
()
DBSession
.
add
(
pc
)
DBSession
.
add
(
pc
)
...
...
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