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 3250a357
authored
Aug 16, 2023
by
Owo Sugiana
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Discount Kabupaten Bekasi
1 parent
628d27f8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
10 deletions
CHANGES.txt
sismiop/models/bekasi_kab.py
sismiop/services/bekasi_kab.py
CHANGES.txt
View file @
3250a35
0.2.10 2023-08-16
-----------------
- Discount Kabupaten Bekasi
0.2.9 2023-08-08
----------------
- Discount Kabupaten Majalengka
...
...
sismiop/models/bekasi_kab.py
0 → 100644
View file @
3250a35
from
sqlalchemy
import
(
Column
,
Float
,
)
from
.default
import
PembayaranSppt
as
BasePembayaranSppt
class
PembayaranSppt
(
BasePembayaranSppt
):
__table_args__
=
dict
(
extend_existing
=
True
)
denda_sblm_diskon
=
Column
(
Float
)
discount_pokok
=
Column
(
Float
)
discount_denda
=
Column
(
Float
)
sismiop/services/bekasi_kab.py
View file @
3250a35
from
datetime
import
date
from
.
cilegon
import
(
from
.
default
import
(
Inquiry
as
BaseInquiry
,
Reversal
,
AvailableInvoice
,
Reversal
as
BaseReversal
,
AvailableInvoice
as
BaseAvailableInvoice
,
)
from
..models.bekasi_kab
import
PembayaranSppt
# Permintaan Gilang, 18 Januari 2023
AWAL_DISC
=
date
(
2023
,
1
,
20
)
AKHIR_DISC
=
date
(
2023
,
3
,
31
)
AWAL_DISC
=
date
(
2023
,
8
,
17
)
AKHIR_DISC
=
date
(
2023
,
11
,
30
)
class
Inquiry
(
BaseInquiry
):
def
hitung_discount_denda
(
self
):
# Override
if
self
.
denda
<
1
or
self
.
tgl_bayar
<
AWAL_DISC
or
\
self
.
tgl_bayar
>
AKHIR_DISC
or
\
self
.
invoice
.
thn_pajak_sppt
>
'2022'
:
def
get_payment_model
(
self
):
# Override
return
PembayaranSppt
def
hitung_discount_denda
(
self
):
if
self
.
denda
<
1
or
self
.
invoice
.
thn_pajak_sppt
>
'2022'
:
return
0
return
self
.
denda
def
hitung_discount_pokok
(
self
):
if
self
.
invoice
.
thn_pajak_sppt
<=
'2013'
:
potongan
=
0.5
elif
'2014'
<=
self
.
invoice
.
thn_pajak_sppt
<=
'2019'
:
potongan
=
0.2
else
:
potongan
=
0
return
int
(
potongan
*
self
.
tagihan
)
def
hitung_discount
(
self
):
# Override
if
AWAL_DISC
<=
self
.
tgl_bayar
<=
AKHIR_DISC
:
self
.
discount_denda
=
self
.
hitung_discount_denda
()
self
.
discount_pokok
=
self
.
hitung_discount_pokok
()
self
.
discount
=
self
.
discount_denda
+
self
.
discount_pokok
else
:
self
.
discount_denda
=
self
.
discount_pokok
=
0
def
before_save
(
self
,
payment
):
# Override
payment
.
denda_sppt
=
self
.
denda
-
self
.
discount_denda
# Netto
payment
.
jml_sppt_yg_dibayar
+=
self
.
discount_pokok
# Bruto
payment
.
denda_sblm_diskon
=
self
.
denda
payment
.
discount_denda
=
self
.
discount_denda
payment
.
discount_pokok
=
self
.
discount_pokok
class
Reversal
(
BaseReversal
):
def
get_payment_model
(
self
):
# Override
return
PembayaranSppt
def
before_save
(
self
):
# Override
self
.
payment
.
denda_sblm_diskon
=
self
.
payment
.
discount
=
\
self
.
payment
.
discount_pokok
=
self
.
payment
.
discount_denda
=
0
class
AvailableInvoice
(
BaseAvailableInvoice
):
def
get_inquiry_class
(
self
):
return
Inquiry
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