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
...
...
sismiop/scripts/inquiry.py
View file @
f987e3f
...
...
@@ -44,6 +44,17 @@ def show(inq):
show_val
(
'Nama Wajib Pajak'
,
inq
.
get_nama_wp
())
show_rp
(
'Tagihan'
,
inq
.
tagihan
)
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'
,
inq
.
total
)
show_val
(
'Jatuh Tempo'
,
inq
.
get_jatuh_tempo
())
...
...
sismiop/services/base.py
View file @
f987e3f
...
...
@@ -284,10 +284,14 @@ class Reversal(Query):
def
do_reversal
(
self
):
self
.
payment
.
jml_sppt_yg_dibayar
=
self
.
payment
.
denda_sppt
=
\
self
.
payment
.
discount
=
0
self
.
before_save
()
DBSession
.
add
(
self
.
payment
)
self
.
invoice
.
status_pembayaran_sppt
=
'0'
DBSession
.
add
(
self
.
invoice
)
def
before_save
(
self
):
pass
class
AvailableInvoice
(
Query
):
def
__init__
(
self
,
persen_denda
=
2
,
count
=
10
,
tahun
=
None
):
...
...
sismiop/services/tangsel/__init__.py
View file @
f987e3f
from
datetime
import
date
from
sqlalchemy
import
func
from
sqlalchemy.orm
import
aliased
from
opensipkd.hitung
import
round_up
from
..base
import
(
thousand
,
get_db_session
,
...
...
@@ -32,16 +34,23 @@ class Inquiry(BaseInquiry):
return
PembayaranSppt
def
hitung_pokok
(
self
):
# Override
BaseInquiry
.
hitung_pokok
(
self
)
self
.
discount_pokok
=
None
if
self
.
tgl_bayar
.
year
not
in
PERIODE_DISC_POKOK
:
return
bulan_disc
=
PERIODE_DISC_POKOK
[
self
.
tgl_bayar
.
year
]
if
self
.
tgl_bayar
.
month
not
in
bulan_disc
:
return
disc
=
bulan_disc
[
self
.
tgl_bayar
.
month
]
self
.
discount_pokok
=
disc
*
self
.
tagihan
self
.
tagihan
-=
self
.
discount_pokok
DBSession
=
get_db_session
()
Payment
=
self
.
get_payment_model
()
q
=
DBSession
.
query
(
func
.
sum
(
Payment
.
jml_sppt_yg_dibayar
)
.
\
label
(
'jml_sppt_yg_dibayar'
),
func
.
sum
(
Payment
.
discount_pokok
)
.
\
label
(
'discount_pokok'
),
func
.
sum
(
Payment
.
denda_sppt
)
.
\
label
(
'denda_sppt'
))
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
):
DBSession
=
get_db_session
()
...
...
@@ -53,27 +62,52 @@ class Inquiry(BaseInquiry):
Sppt
.
status_pembayaran_sppt
!=
'1'
)
return
q
.
first
()
def
hitung_denda
(
self
):
# Override
BaseInquiry
.
hitung_denda
(
self
)
def
hitung_discount_denda
(
self
):
self
.
denda_sblm_diskon
=
self
.
denda
if
self
.
tgl_bayar
.
date
()
>
AKHIR_DISC_DENDA
:
return
return
0
if
self
.
invoice
.
thn_pajak_sppt
<
str
(
THN_AWAL
):
if
self
.
belum_lunas_di_periode_discount
():
return
self
.
denda
=
0
return
0
return
self
.
denda
# 100 %
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
bayar
.
denda_sblm_diskon
=
self
.
denda_sblm_diskon
bayar
.
discount_pokok
=
self
.
discount_pokok
def
before_save
(
self
,
payment
):
# Override
# Sekedar catatan
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
):
def
get_payment_model
(
self
):
# Override
return
PembayaranSppt
def
before_save
(
self
):
self
.
payment
.
discount_pokok
=
0
class
AvailableInvoice
(
BaseAvailableInvoice
):
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