Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Owo Sugiana
/
opensipkd-pad-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 fe6f4ebd
authored
Mar 10, 2021
by
Owo Sugiana
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Bug fixed maksimum denda 48% dari tagihan pokok
1 parent
904cda2b
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
48 additions
and
78 deletions
CHANGES.txt
opensipkd/pad/scripts/inquiry.py
opensipkd/pad/services/base.py
opensipkd/pad/services/bekasi_kab.py
opensipkd/pad/services/default.py
opensipkd/pad/services/tangsel.py
CHANGES.txt
View file @
fe6f4eb
0.3.1 2021-03-10
----------------
- Bug fixed maksimum denda 48% dari tagihan pokok.
0.3 2021-02-23
--------------
- Penambahan Kabupaten Bekasi
...
...
opensipkd/pad/scripts/inquiry.py
View file @
fe6f4eb
...
...
@@ -69,6 +69,15 @@ def show(inq):
show_rp
(
'Total Bayar'
,
inq
.
total_bayar
)
show_rp
(
'Total Tagihan'
,
inq
.
total
)
show_field
(
inq
.
invoice
,
'status_pembayaran'
)
show_field
(
inq
.
invoice
,
'bunga'
)
try
:
show_val
(
'Jumlah Bulan Denda'
,
inq
.
bln_tunggakan
)
except
AttributeError
:
pass
try
:
show_rp
(
'Denda Jatuh Tempo'
,
inq
.
denda_waktu
)
except
AttributeError
:
pass
if
inq
.
total_bayar
:
pay
=
inq
.
get_payment
()
show_field
(
pay
,
'sspdtgl'
)
...
...
opensipkd/pad/services/base.py
View file @
fe6f4eb
...
...
@@ -10,3 +10,7 @@ def satu_kalimat(notes):
return
notes
[
0
]
s
=
', '
.
join
(
notes
[:
-
1
])
return
', dan '
.
join
([
s
,
notes
[
-
1
]])
def
upper
(
s
):
return
s
and
s
.
strip
()
.
upper
()
or
''
opensipkd/pad/services/bekasi_kab.py
View file @
fe6f4eb
...
...
@@ -33,7 +33,6 @@ class Inquiry(BaseInquiry):
invoice_id_structure
=
INVOICE_ID
def
get_discount_denda
(
self
):
# Override
self
.
notes
=
[]
rek
=
self
.
rekening
.
rekeningkd
if
rek
in
self
.
conf
.
get
(
'rekening_tanpa_denda'
,
[]):
self
.
notes
.
append
(
NOTE_REK
.
format
(
rek
=
rek
))
...
...
opensipkd/pad/services/default.py
View file @
fe6f4eb
...
...
@@ -31,7 +31,10 @@ from opensipkd.pad.models.default import (
Kohir
,
IsoPayment
,
)
from
.base
import
get_db_session
from
.base
import
(
get_db_session
,
upper
,
)
INVOICE_ID
=
[
...
...
@@ -40,6 +43,12 @@ INVOICE_ID = [
]
MAX_PORSI_DENDA
=
0.48
NOTE_MAX_DENDA
=
'maksimum denda = 0,48 x tagihan pokok {pokok} = {maks}'
NOTE_DISC
=
'discount = bunga {bunga} + denda waktu {denda_waktu} '
\
'- {maks} = {disc}'
class
BaseInquiry
:
invoice_id_structure
=
INVOICE_ID
...
...
@@ -170,20 +179,18 @@ class BaseInquiry:
self
.
kelurahan
=
self
.
get_kelurahan
()
self
.
kecamatan
=
self
.
get_kecamatan
()
if
self
.
rekening
.
rekeningkd
in
self
.
conf
[
'rekening_notes'
]:
alamat
=
wrap
(
self
.
invoice
.
notes
,
40
)
alamat
=
wrap
(
upper
(
self
.
invoice
.
notes
)
,
40
)
if
alamat
[
1
:]:
self
.
alamat1
=
alamat
[
0
]
self
.
alamat2
=
alamat
[
1
]
else
:
self
.
alamat1
=
self
.
wajib_pajak
.
alamat
.
upper
(
)
self
.
alamat1
=
upper
(
self
.
wajib_pajak
.
alamat
)
self
.
alamat2
=
alamat
[
0
]
else
:
alamat
=
wrap
(
self
.
wajib_pajak
.
alamat
,
40
)
alamat
=
wrap
(
upper
(
self
.
wajib_pajak
.
alamat
)
,
40
)
self
.
alamat1
=
alamat
[
0
]
self
.
alamat2
=
alamat
[
1
:]
and
' '
.
join
(
alamat
[
1
:])
or
''
self
.
alamat2
=
self
.
alamat2
self
.
alamat1
=
self
.
alamat1
.
upper
()
self
.
alamat2
=
self
.
alamat2
.
upper
()
def
get_tahun
(
self
):
return
self
.
invoice
.
tahun
...
...
@@ -201,7 +208,7 @@ class BaseInquiry:
return
','
.
join
(
lengkap
)
def
get_alamat_wp
(
self
):
return
self
.
wajib_pajak
.
alamat
.
upper
(
)
return
upper
(
self
.
wajib_pajak
.
alamat
)
def
get_kode_pos_wp
(
self
):
return
self
.
wajib_pajak
.
wpkodepos
...
...
@@ -213,7 +220,7 @@ class BaseInquiry:
return
self
.
alamat2
def
get_alamat_op
(
self
):
return
self
.
objek_pajak
.
opalamat
.
strip
()
.
upper
(
)
return
upper
(
self
.
objek_pajak
.
opalamat
)
def
get_kelurahan_op
(
self
):
return
self
.
kelurahan
.
kelurahannm
.
strip
()
.
upper
()
...
...
@@ -262,7 +269,7 @@ class Inquiry(BaseInquiry):
super
()
.
__init__
(
invoice_id
,
conf
)
if
not
self
.
invoice
:
return
self
.
notes
=
''
self
.
notes
=
[]
self
.
tgl_bayar
=
tgl_bayar
or
datetime
.
now
()
self
.
set_profile
()
self
.
hitung
()
...
...
@@ -295,6 +302,18 @@ class Inquiry(BaseInquiry):
self
.
denda
-=
self
.
discount_denda
def
get_discount_denda
(
self
):
max_denda
=
MAX_PORSI_DENDA
*
self
.
tagihan
max_denda
=
round_up
(
max_denda
)
if
self
.
denda
>
max_denda
:
n
=
self
.
denda
-
max_denda
n
=
int
(
n
)
s
=
NOTE_MAX_DENDA
.
format
(
pokok
=
self
.
tagihan
,
maks
=
max_denda
)
self
.
notes
.
append
(
s
)
s
=
NOTE_DISC
.
format
(
bunga
=
self
.
bunga
,
denda_waktu
=
self
.
denda_waktu
,
maks
=
max_denda
,
disc
=
n
)
self
.
notes
.
append
(
s
)
return
n
return
0
def
hitung_bayar
(
self
):
...
...
opensipkd/pad/services/tangsel.py
View file @
fe6f4eb
...
...
@@ -21,34 +21,7 @@ from ..models.tangsel import (
SptType
,
Kohir
,
)
TGL_BAYAR_MAX
=
date
(
2020
,
12
,
31
)
TGL_DISC_USAI
=
TGL_BAYAR_MAX
+
timedelta
(
1
)
TGL_MASA_MAX
=
TGL_KOHIR_MAX
=
date
(
2020
,
9
,
30
)
TGL_MASA_MAX_USAI
=
TGL_KOHIR_MAX_USAI
=
TGL_MASA_MAX
+
timedelta
(
1
)
def
to_date
(
tgl
):
if
isinstance
(
tgl
,
datetime
):
return
tgl
.
date
()
return
tgl
def
t
(
tgl
):
return
tgl
.
strftime
(
'
%
d-
%
m-
%
Y'
)
ALASAN_TGL_BAYAR
=
'Alasan discount denda: tanggal bayar sebelum {}'
.
format
(
t
(
TGL_DISC_USAI
))
def
satu_kalimat
(
notes
):
if
not
notes
[
1
:]:
return
notes
[
0
]
s
=
', '
.
join
(
notes
[:
-
1
])
return
', dan '
.
join
([
s
,
notes
[
-
1
]])
from
.base
import
satu_kalimat
class
Inquiry
(
BaseInquiry
):
...
...
@@ -57,48 +30,10 @@ class Inquiry(BaseInquiry):
return
raw
[
6
:]
return
raw
def
get_discount_denda
(
self
):
# Override
if
self
.
denda
<
1
:
return
0
tgl_bayar
=
to_date
(
self
.
tgl_bayar
)
if
tgl_bayar
>
TGL_BAYAR_MAX
:
return
0
notes
=
[
ALASAN_TGL_BAYAR
]
usaha
=
self
.
get_nama_jenis_usaha
()
is_self
=
self
.
is_self
()
if
is_self
or
usaha
==
'AIR TANAH'
:
masa_dari
=
self
.
invoice
.
masadari
.
date
()
if
masa_dari
>
TGL_MASA_MAX
:
return
0
masa_sd
=
self
.
invoice
.
masasd
.
date
()
if
masa_sd
>
TGL_MASA_MAX
:
return
0
if
is_self
:
notes
.
append
(
'self'
)
else
:
notes
.
append
(
f
'usaha {usaha}'
)
notes
.
append
(
'masa pajak sebelum {}'
.
format
(
t
(
TGL_MASA_MAX_USAI
)))
elif
usaha
==
'REKLAME'
:
tgl_kohir
=
self
.
get_tgl_kohir
()
if
not
tgl_kohir
:
return
0
if
tgl_kohir
>
TGL_KOHIR_MAX
:
return
0
notes
.
append
(
f
'usaha {usaha}'
)
notes
.
append
(
'tanggal kohir sebelum {}'
.
format
(
t
(
TGL_KOHIR_MAX_USAI
)))
else
:
tipe
=
self
.
get_type_name
()
if
tipe
not
in
(
'SKPDKB'
,
'STPD'
):
return
0
notes
.
append
(
f
'tipe {tipe}'
)
self
.
notes
=
satu_kalimat
(
notes
)
return
self
.
denda
def
before_save
(
self
,
pay
):
# Override
pay
.
discount_denda
=
self
.
discount_denda
if
self
.
notes
is
not
None
:
pay
.
notes
=
s
elf
.
notes
if
self
.
notes
:
pay
.
notes
=
s
atu_kalimat
(
self
.
notes
)
def
get_kecamatan_model
(
self
):
# Override
return
Kecamatan
...
...
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