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 d7e83800
authored
Sep 30, 2020
by
Owo Sugiana
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Perubahan rumus tangkota
1 parent
8bfd26fd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
14 deletions
CHANGES.txt
sismiop/scripts/available_invoice.py
sismiop/services/base.py
sismiop/services/tangkota/__init__.py
CHANGES.txt
View file @
d7e8380
0.1.12 2020-09-
29
0.1.12 2020-09-
30
-----------------
- Perubahan rumus tangkota
- Perubahan rumus bogor_kota
0.1.11 2020-09-28
...
...
sismiop/scripts/available_invoice.py
View file @
d7e8380
...
...
@@ -12,6 +12,8 @@ def get_option(argv):
pars
=
ArgumentParser
()
pars
.
add_argument
(
'conf'
)
pars
.
add_argument
(
'--tahun'
)
pars
.
add_argument
(
'--min-nominal'
,
type
=
int
)
pars
.
add_argument
(
'--max-nominal'
,
type
=
int
)
pars
.
add_argument
(
'--count'
,
type
=
int
,
default
=
default_count
,
help
=
help_count
)
return
pars
.
parse_args
(
argv
)
...
...
@@ -32,7 +34,7 @@ def main(argv=sys.argv):
engine
=
create_engine
(
db_url
)
session_factory
=
sessionmaker
(
bind
=
engine
)
sismiop
.
services
.
base
.
DBSession
=
session_factory
()
a
=
AvailableInvoice
(
persen_denda
,
count
,
option
.
tahu
n
)
a
=
AvailableInvoice
(
persen_denda
,
optio
n
)
a
.
show
()
...
...
sismiop/services/base.py
View file @
d7e8380
...
...
@@ -342,15 +342,27 @@ def not_null(invoice):
class
AvailableInvoice
(
Query
):
def
__init__
(
self
,
persen_denda
=
2
,
count
=
10
,
tahu
n
=
None
):
self
.
count
=
count
def
__init__
(
self
,
persen_denda
=
2
,
optio
n
=
None
):
self
.
count
=
option
.
count
self
.
persen_denda
=
persen_denda
self
.
tahun
=
tahun
self
.
tahun
=
option
.
tahun
self
.
option
=
option
def
get_inquiry_class
(
self
):
return
Inquiry
def
get_filter
(
self
,
q
):
Invoice
=
self
.
get_invoice_model
()
if
self
.
option
.
tahun
:
q
=
q
.
filter_by
(
thn_pajak_sppt
=
self
.
option
.
tahun
)
if
self
.
option
.
min_nominal
:
q
=
q
.
filter
(
Invoice
.
pbb_yg_harus_dibayar_sppt
>=
self
.
option
.
min_nominal
)
if
self
.
option
.
max_nominal
:
q
=
q
.
filter
(
Invoice
.
pbb_yg_harus_dibayar_sppt
<=
self
.
option
.
max_nominal
)
return
q
def
show
(
self
):
...
...
@@ -374,8 +386,6 @@ class AvailableInvoice(Query):
break
offset
+=
1
q
=
DBSession
.
query
(
Invoice
)
.
filter_by
(
status_pembayaran_sppt
=
'0'
)
if
self
.
tahun
:
q
=
q
.
filter_by
(
thn_pajak_sppt
=
self
.
tahun
)
q
=
self
.
get_filter
(
q
)
q
=
q
.
offset
(
offset
)
.
limit
(
1
)
inv
=
q
.
first
()
...
...
sismiop/services/tangkota/__init__.py
View file @
d7e8380
...
...
@@ -8,6 +8,9 @@ from ..tangsel import (
from
sismiop.models.tangsel
import
PembayaranSppt
AWAL_DISC
=
date
(
2020
,
10
,
1
)
AKHIR_DISC
=
date
(
2020
,
12
,
23
)
TAHUN_PAJAK_DISC_POKOK
=
[
'2020'
]
PERIODE_DISC_POKOK
=
{
2020
:
{
...
...
@@ -35,25 +38,41 @@ PERIODE_DISC_POKOK = {
},
}
AKHIR_DISC_DENDA
=
date
(
2020
,
7
,
31
)
class
Inquiry
(
BaseInquiry
):
def
get_payment_model
(
self
):
return
PembayaranSppt
def
hitung_discount
(
self
):
# Override
self
.
discount_denda
=
self
.
hitung_discount_denda
()
self
.
discount_pokok
=
self
.
hitung_discount_pokok
()
self
.
denda_sblm_diskon
=
self
.
denda
self
.
discount_denda
=
self
.
discount_pokok
=
0
if
self
.
tgl_bayar
>
AKHIR_DISC
:
return
if
self
.
tgl_bayar
<
AWAL_DISC
:
self
.
discount_pokok
=
self
.
hitung_discount_pokok_2020_07_09
()
else
:
self
.
discount_denda
=
self
.
hitung_discount_denda
()
self
.
discount_pokok
=
self
.
hitung_discount_pokok_2020_10_12
()
self
.
discount
=
self
.
discount_denda
+
self
.
discount_pokok
def
hitung_discount_denda
(
self
):
self
.
denda_sblm_diskon
=
self
.
denda
if
self
.
tgl_bayar
>
AKHIR_DISC_DENDA
:
if
self
.
invoice
.
thn_pajak_sppt
>
'2020'
:
return
0
return
self
.
denda
def
hitung_discount_pokok
(
self
):
def
hitung_discount_pokok_2020_10_12
(
self
):
thn
=
self
.
invoice
.
thn_pajak_sppt
if
thn
>
'2019'
:
return
0
if
thn
<
'2010'
:
disc
=
0.2
elif
thn
<
'2015'
:
disc
=
0.15
else
:
disc
=
0.1
return
int
(
disc
*
self
.
tagihan
)
def
hitung_discount_pokok_2020_07_09
(
self
):
if
self
.
invoice
.
thn_pajak_sppt
not
in
TAHUN_PAJAK_DISC_POKOK
:
return
0
if
self
.
tgl_bayar
.
year
not
in
PERIODE_DISC_POKOK
:
...
...
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