Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
aa.gusti
/
opensipkd-tools
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 6036cd6d
authored
Dec 29, 2024
by
aa.gusti
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
perhitungan bulan denda
1 parent
a8a22117
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
13 deletions
opensipkd/tools/__init__.py
opensipkd/tools/api.py
opensipkd/tools/buttons.py
opensipkd/tools/pbb.py
opensipkd/tools/__init__.py
View file @
6036cd6
...
@@ -199,7 +199,7 @@ def create_now():
...
@@ -199,7 +199,7 @@ def create_now():
def
date_from_str
(
value
):
def
date_from_str
(
value
):
if
type
(
value
)
!=
str
:
if
not
value
or
type
(
value
)
!=
str
:
return
value
return
value
separator
=
None
separator
=
None
...
...
opensipkd/tools/api.py
View file @
6036cd6
...
@@ -364,7 +364,7 @@ def send_rpc(auth, message):
...
@@ -364,7 +364,7 @@ def send_rpc(auth, message):
log
.
info
(
results
.
text
)
log
.
info
(
results
.
text
)
return
return
rows
=
results
.
text
and
json
.
loads
(
results
.
text
)
or
None
rows
=
results
.
text
and
json
.
loads
(
results
.
text
)
or
None
log
.
info
(
"RESPONSE {}"
.
format
(
rows
))
log
.
warning
(
"RESPONSE {}"
.
format
(
rows
))
return
rows
return
rows
...
@@ -392,6 +392,4 @@ def pars_rpc_url(params, method=None):
...
@@ -392,6 +392,4 @@ def pars_rpc_url(params, method=None):
)
)
if
method
:
if
method
:
resp
[
"method"
]
=
method
resp
[
"method"
]
=
method
return
resp
return
resp
\ No newline at end of file
\ No newline at end of file
opensipkd/tools/buttons.py
View file @
6036cd6
...
@@ -85,5 +85,6 @@ btn_no = Button('no', title=_('No'), css_class="btn-danger")
...
@@ -85,5 +85,6 @@ btn_no = Button('no', title=_('No'), css_class="btn-danger")
# karena error serve, sy tambahkan ini
# karena error serve, sy tambahkan ini
btn_post
=
Button
(
'ttr'
,
title
=
_
(
'Post'
),
css_class
=
"btn-info"
,
type
=
"button"
)
btn_post
=
Button
(
'post'
,
title
=
_
(
'Post'
),
css_class
=
"btn-info"
,
type
=
"button"
)
btn_unpost
=
Button
(
'ttr'
,
title
=
_
(
'UnPost'
),
css_class
=
"btn-info"
,
type
=
"button"
)
btn_unpost
=
Button
(
'unpost'
,
title
=
_
(
'UnPost'
),
css_class
=
"btn-info"
,
type
=
"button"
)
btn_check
=
Button
(
'check'
,
title
=
_
(
'Check'
),
css_class
=
"btn-info"
,
type
=
"button"
)
\ No newline at end of file
\ No newline at end of file
opensipkd/tools/pbb.py
View file @
6036cd6
...
@@ -239,10 +239,7 @@ def ensure_datetime(d):
...
@@ -239,10 +239,7 @@ def ensure_datetime(d):
return
d
return
d
return
datetime
(
d
.
year
,
d
.
month
,
d
.
day
)
return
datetime
(
d
.
year
,
d
.
month
,
d
.
day
)
def
hitung_bulan
(
jatuh_tempo
,
tanggal
=
None
,
max_denda
=
24
):
def
hitung_denda
(
piutang_pokok
,
jatuh_tempo
,
tanggal
=
None
,
max_denda
=
24
):
persen_denda
=
2
# jatuh_tempo = jatuh_tempo.date()
if
not
tanggal
:
if
not
tanggal
:
tanggal
=
datetime
.
now
()
.
date
()
tanggal
=
datetime
.
now
()
.
date
()
...
@@ -260,10 +257,13 @@ def hitung_denda(piutang_pokok, jatuh_tempo, tanggal=None, max_denda=24):
...
@@ -260,10 +257,13 @@ def hitung_denda(piutang_pokok, jatuh_tempo, tanggal=None, max_denda=24):
bln_tunggakan
=
0
bln_tunggakan
=
0
if
bln_tunggakan
>
max_denda
:
if
bln_tunggakan
>
max_denda
:
bln_tunggakan
=
max_denda
bln_tunggakan
=
max_denda
return
bln_tunggakan
def
hitung_denda
(
piutang_pokok
,
jatuh_tempo
,
tanggal
=
None
,
max_denda
=
24
,
persen_denda
=
2
):
# jatuh_tempo = jatuh_tempo.date()
bln_tunggakan
=
hitung_bulan
(
jatuh_tempo
,
tanggal
,
max_denda
)
if
jatuh_tempo
.
year
>
2023
:
if
jatuh_tempo
.
year
>
2023
:
persen_denda
=
1
persen_denda
=
1
return
int
(
ceil
(
bln_tunggakan
*
persen_denda
/
100.0
*
piutang_pokok
))
return
int
(
ceil
(
bln_tunggakan
*
persen_denda
/
100.0
*
piutang_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