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 f987e3fb
authored
Jul 01, 2020
by
Owo Sugiana
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Penggunaan field discount pada Tangerang Selatan
1 parent
1f0aa88a
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
69 additions
and
20 deletions
CHANGES.txt
sismiop/scripts/inquiry.py
sismiop/services/base.py
sismiop/services/tangsel/__init__.py
CHANGES.txt
View file @
f987e3f
0.1.5 2020-0
6-30
0.1.5 2020-0
7-01
----------------
----------------
- Discount tagihan pokok untuk Tangerang Selatan
- Discount tagihan pokok untuk Tangerang Selatan
...
...
sismiop/scripts/inquiry.py
View file @
f987e3f
...
@@ -44,6 +44,17 @@ def show(inq):
...
@@ -44,6 +44,17 @@ def show(inq):
show_val
(
'Nama Wajib Pajak'
,
inq
.
get_nama_wp
())
show_val
(
'Nama Wajib Pajak'
,
inq
.
get_nama_wp
())
show_rp
(
'Tagihan'
,
inq
.
tagihan
)
show_rp
(
'Tagihan'
,
inq
.
tagihan
)
show_rp
(
'Denda'
,
inq
.
denda
)
show_rp
(
'Denda'
,
inq
.
denda
)
try
:
n
=
getattr
(
inq
,
'discount_pokok'
)
show_rp
(
'Discount Pokok'
,
n
)
except
AttributeError
:
pass
try
:
n
=
getattr
(
inq
,
'discount_denda'
)
show_rp
(
'Discount Denda'
,
n
)
except
AttributeError
:
pass
show_rp
(
'Discount'
,
inq
.
discount
)
show_rp
(
'Total Bayar Sebelumnya'
,
inq
.
total_bayar
)
show_rp
(
'Total Bayar Sebelumnya'
,
inq
.
total_bayar
)
show_rp
(
'Total Bayar'
,
inq
.
total
)
show_rp
(
'Total Bayar'
,
inq
.
total
)
show_val
(
'Jatuh Tempo'
,
inq
.
get_jatuh_tempo
())
show_val
(
'Jatuh Tempo'
,
inq
.
get_jatuh_tempo
())
...
...
sismiop/services/base.py
View file @
f987e3f
...
@@ -284,10 +284,14 @@ class Reversal(Query):
...
@@ -284,10 +284,14 @@ class Reversal(Query):
def
do_reversal
(
self
):
def
do_reversal
(
self
):
self
.
payment
.
jml_sppt_yg_dibayar
=
self
.
payment
.
denda_sppt
=
\
self
.
payment
.
jml_sppt_yg_dibayar
=
self
.
payment
.
denda_sppt
=
\
self
.
payment
.
discount
=
0
self
.
payment
.
discount
=
0
self
.
before_save
()
DBSession
.
add
(
self
.
payment
)
DBSession
.
add
(
self
.
payment
)
self
.
invoice
.
status_pembayaran_sppt
=
'0'
self
.
invoice
.
status_pembayaran_sppt
=
'0'
DBSession
.
add
(
self
.
invoice
)
DBSession
.
add
(
self
.
invoice
)
def
before_save
(
self
):
pass
class
AvailableInvoice
(
Query
):
class
AvailableInvoice
(
Query
):
def
__init__
(
self
,
persen_denda
=
2
,
count
=
10
,
tahun
=
None
):
def
__init__
(
self
,
persen_denda
=
2
,
count
=
10
,
tahun
=
None
):
...
...
sismiop/services/tangsel/__init__.py
View file @
f987e3f
from
datetime
import
date
from
datetime
import
date
from
sqlalchemy
import
func
from
sqlalchemy.orm
import
aliased
from
sqlalchemy.orm
import
aliased
from
opensipkd.hitung
import
round_up
from
..base
import
(
from
..base
import
(
thousand
,
thousand
,
get_db_session
,
get_db_session
,
...
@@ -32,16 +34,23 @@ class Inquiry(BaseInquiry):
...
@@ -32,16 +34,23 @@ class Inquiry(BaseInquiry):
return
PembayaranSppt
return
PembayaranSppt
def
hitung_pokok
(
self
):
# Override
def
hitung_pokok
(
self
):
# Override
BaseInquiry
.
hitung_pokok
(
self
)
DBSession
=
get_db_session
()
self
.
discount_pokok
=
None
Payment
=
self
.
get_payment_model
()
if
self
.
tgl_bayar
.
year
not
in
PERIODE_DISC_POKOK
:
q
=
DBSession
.
query
(
return
func
.
sum
(
Payment
.
jml_sppt_yg_dibayar
)
.
\
bulan_disc
=
PERIODE_DISC_POKOK
[
self
.
tgl_bayar
.
year
]
label
(
'jml_sppt_yg_dibayar'
),
if
self
.
tgl_bayar
.
month
not
in
bulan_disc
:
func
.
sum
(
Payment
.
discount_pokok
)
.
\
return
label
(
'discount_pokok'
),
disc
=
bulan_disc
[
self
.
tgl_bayar
.
month
]
func
.
sum
(
Payment
.
denda_sppt
)
.
\
self
.
discount_pokok
=
disc
*
self
.
tagihan
label
(
'denda_sppt'
))
self
.
tagihan
-=
self
.
discount_pokok
q
=
self
.
get_filter
(
q
)
bayar
=
q
.
first
()
self
.
total_bayar
=
bayar
.
jml_sppt_yg_dibayar
or
0
denda_lalu
=
bayar
.
denda_sppt
or
0
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
self
.
tagihan
=
round_up
(
tagihan
)
def
belum_lunas_di_periode_discount
(
self
):
def
belum_lunas_di_periode_discount
(
self
):
DBSession
=
get_db_session
()
DBSession
=
get_db_session
()
...
@@ -53,27 +62,52 @@ class Inquiry(BaseInquiry):
...
@@ -53,27 +62,52 @@ class Inquiry(BaseInquiry):
Sppt
.
status_pembayaran_sppt
!=
'1'
)
Sppt
.
status_pembayaran_sppt
!=
'1'
)
return
q
.
first
()
return
q
.
first
()
def
hitung_denda
(
self
):
# Override
def
hitung_discount_denda
(
self
):
BaseInquiry
.
hitung_denda
(
self
)
self
.
denda_sblm_diskon
=
self
.
denda
self
.
denda_sblm_diskon
=
self
.
denda
if
self
.
tgl_bayar
.
date
()
>
AKHIR_DISC_DENDA
:
if
self
.
tgl_bayar
.
date
()
>
AKHIR_DISC_DENDA
:
return
return
0
if
self
.
invoice
.
thn_pajak_sppt
<
str
(
THN_AWAL
):
if
self
.
invoice
.
thn_pajak_sppt
<
str
(
THN_AWAL
):
if
self
.
belum_lunas_di_periode_discount
():
if
self
.
belum_lunas_di_periode_discount
():
return
return
0
self
.
denda
=
0
return
self
.
denda
# 100 %
elif
self
.
invoice
.
thn_pajak_sppt
in
THN_DISC
:
elif
self
.
invoice
.
thn_pajak_sppt
in
THN_DISC
:
self
.
denda
-=
int
(
0.5
*
self
.
denda
)
return
int
(
0.5
*
self
.
denda
)
return
0
def
hitung_discount_pokok
(
self
):
if
self
.
tgl_bayar
.
year
not
in
PERIODE_DISC_POKOK
:
return
0
bulan_disc
=
PERIODE_DISC_POKOK
[
self
.
tgl_bayar
.
year
]
if
self
.
tgl_bayar
.
month
not
in
bulan_disc
:
return
0
disc
=
bulan_disc
[
self
.
tgl_bayar
.
month
]
return
int
(
disc
*
self
.
tagihan
)
def
hitung_discount
(
self
):
# Override
self
.
discount_denda
=
self
.
hitung_discount_denda
()
self
.
discount_pokok
=
self
.
hitung_discount_pokok
()
self
.
discount
=
self
.
discount_denda
+
self
.
discount_pokok
def
before_save
(
self
,
bayar
):
# Override
def
before_save
(
self
,
payment
):
# Override
bayar
.
denda_sblm_diskon
=
self
.
denda_sblm_diskon
# Sekedar catatan
bayar
.
discount_pokok
=
self
.
discount_pokok
payment
.
denda_sblm_diskon
=
self
.
denda_sblm_diskon
payment
.
discount
=
self
.
discount_pokok
+
self
.
discount_denda
payment
.
discount_pokok
=
self
.
discount_pokok
tagihan_netto
=
self
.
tagihan
-
self
.
discount_pokok
denda_netto
=
self
.
denda
-
self
.
discount_denda
payment
.
jml_sppt_yg_dibayar
=
tagihan_netto
+
denda_netto
payment
.
denda_sppt
=
denda_netto
class
Reversal
(
BaseReversal
):
class
Reversal
(
BaseReversal
):
def
get_payment_model
(
self
):
# Override
def
get_payment_model
(
self
):
# Override
return
PembayaranSppt
return
PembayaranSppt
def
before_save
(
self
):
self
.
payment
.
discount_pokok
=
0
class
AvailableInvoice
(
BaseAvailableInvoice
):
class
AvailableInvoice
(
BaseAvailableInvoice
):
def
get_inquiry_class
(
self
):
def
get_inquiry_class
(
self
):
...
...
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