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 1f0aa88a
authored
Jun 30, 2020
by
Owo Sugiana
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Discount tagihan pokok untuk Tangerang Selatan
1 parent
eef8497f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
59 additions
and
5 deletions
CHANGES.txt
sismiop/scripts/inquiry.py
sismiop/services/base.py
sismiop/services/tangsel/__init__.py
sismiop/services/tangsel/models.py
CHANGES.txt
View file @
1f0aa88
0.1.5 2020-06-30
----------------
- Discount tagihan pokok untuk Tangerang Selatan
0.1.4 2020-06-23
0.1.4 2020-06-23
----------------
----------------
- Penambahan Tangerang Selatan
- Penambahan Tangerang Selatan
...
...
sismiop/scripts/inquiry.py
View file @
1f0aa88
import
sys
import
sys
from
datetime
import
date
from
datetime
import
date
time
from
configparser
import
ConfigParser
from
configparser
import
ConfigParser
from
optparse
import
OptionParser
from
optparse
import
OptionParser
import
transaction
import
transaction
...
@@ -20,7 +20,7 @@ def show_rp(label, value):
...
@@ -20,7 +20,7 @@ def show_rp(label, value):
def
date_from_str
(
s
):
def
date_from_str
(
s
):
d
,
m
,
y
=
s
.
split
(
'-'
)
d
,
m
,
y
=
s
.
split
(
'-'
)
return
date
(
int
(
y
),
int
(
m
),
int
(
d
))
return
date
time
(
int
(
y
),
int
(
m
),
int
(
d
))
def
get_option
(
argv
):
def
get_option
(
argv
):
...
@@ -49,6 +49,7 @@ def show(inq):
...
@@ -49,6 +49,7 @@ def show(inq):
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
())
show_val
(
'Status Pembayaran'
,
inq
.
get_status_pembayaran
())
if
not
inq
.
is_paid
():
if
not
inq
.
is_paid
():
return
return
pay
=
inq
.
invoice2payment
()
pay
=
inq
.
invoice2payment
()
...
...
sismiop/services/base.py
View file @
1f0aa88
...
@@ -197,6 +197,9 @@ class Inquiry(Query):
...
@@ -197,6 +197,9 @@ class Inquiry(Query):
def
get_luas_bangunan
(
self
):
def
get_luas_bangunan
(
self
):
return
self
.
invoice
.
luas_bng_sppt
return
self
.
invoice
.
luas_bng_sppt
def
get_status_pembayaran
(
self
):
return
self
.
invoice
.
status_pembayaran_sppt
def
is_paid
(
self
):
def
is_paid
(
self
):
return
self
.
total
<
1
return
self
.
total
<
1
...
...
sismiop/services/tangsel/__init__.py
View file @
1f0aa88
...
@@ -6,12 +6,20 @@ from ..base import (
...
@@ -6,12 +6,20 @@ from ..base import (
)
)
from
..default
import
(
from
..default
import
(
Inquiry
as
BaseInquiry
,
Inquiry
as
BaseInquiry
,
Reversal
,
Reversal
as
BaseReversal
,
AvailableInvoice
as
BaseAvailableInvoice
,
AvailableInvoice
as
BaseAvailableInvoice
,
)
)
from
.models
import
PembayaranSppt
AKHIR_DISC
=
date
(
2020
,
12
,
31
)
PERIODE_DISC_POKOK
=
{
2020
:
{
7
:
0.15
,
8
:
0.1
,
},
}
AKHIR_DISC_DENDA
=
date
(
2020
,
12
,
31
)
THN_AWAL
=
2014
THN_AWAL
=
2014
THN_AKHIR
=
2019
THN_AKHIR
=
2019
THN_DISC
=
[]
THN_DISC
=
[]
...
@@ -20,6 +28,21 @@ for i in range(THN_AWAL, THN_AKHIR+1):
...
@@ -20,6 +28,21 @@ for i in range(THN_AWAL, THN_AKHIR+1):
class
Inquiry
(
BaseInquiry
):
class
Inquiry
(
BaseInquiry
):
def
get_payment_model
(
self
):
# Override
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
def
belum_lunas_di_periode_discount
(
self
):
def
belum_lunas_di_periode_discount
(
self
):
DBSession
=
get_db_session
()
DBSession
=
get_db_session
()
Sppt
=
self
.
get_invoice_model
()
Sppt
=
self
.
get_invoice_model
()
...
@@ -33,7 +56,7 @@ class Inquiry(BaseInquiry):
...
@@ -33,7 +56,7 @@ class Inquiry(BaseInquiry):
def
hitung_denda
(
self
):
# Override
def
hitung_denda
(
self
):
# Override
BaseInquiry
.
hitung_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
:
if
self
.
tgl_bayar
.
date
()
>
AKHIR_DISC
_DENDA
:
return
return
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
():
...
@@ -44,6 +67,12 @@ class Inquiry(BaseInquiry):
...
@@ -44,6 +67,12 @@ class Inquiry(BaseInquiry):
def
before_save
(
self
,
bayar
):
# Override
def
before_save
(
self
,
bayar
):
# Override
bayar
.
denda_sblm_diskon
=
self
.
denda_sblm_diskon
bayar
.
denda_sblm_diskon
=
self
.
denda_sblm_diskon
bayar
.
discount_pokok
=
self
.
discount_pokok
class
Reversal
(
BaseReversal
):
def
get_payment_model
(
self
):
# Override
return
PembayaranSppt
class
AvailableInvoice
(
BaseAvailableInvoice
):
class
AvailableInvoice
(
BaseAvailableInvoice
):
...
@@ -63,6 +92,13 @@ class AvailableInvoiceTangsel(AvailableInvoice):
...
@@ -63,6 +92,13 @@ class AvailableInvoiceTangsel(AvailableInvoice):
AvailableInvoice
.
__init__
(
self
,
persen_denda
,
option
.
count
,
option
.
tahun
)
AvailableInvoice
.
__init__
(
self
,
persen_denda
,
option
.
count
,
option
.
tahun
)
self
.
option
=
option
self
.
option
=
option
def
get_msg
(
self
,
inq
):
s
=
AvailableInvoice
.
get_msg
(
self
,
inq
)
if
not
inq
.
discount_pokok
:
return
s
return
'{}, Discount Pokok {}'
.
format
(
s
,
thousand
(
inq
.
discount_pokok
))
def
get_filter
(
self
,
q
):
# Override
def
get_filter
(
self
,
q
):
# Override
if
self
.
option
.
discount_penuh
:
if
self
.
option
.
discount_penuh
:
DBSession
=
get_db_session
()
DBSession
=
get_db_session
()
...
...
sismiop/services/tangsel/models.py
0 → 100644
View file @
1f0aa88
from
sqlalchemy
import
(
Column
,
Float
,
)
from
sismiop.models.default
import
PembayaranSppt
as
BasePembayaranSppt
class
PembayaranSppt
(
BasePembayaranSppt
):
__table_args__
=
dict
(
extend_existing
=
True
)
discount_pokok
=
Column
(
Float
)
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