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 04830631
authored
Jul 05, 2021
by
Owo Sugiana
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Perubahan rumus denda Kabupaten Bekasi
1 parent
5d74d33b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
6 deletions
CHANGES.txt
opensipkd/pad/services/bekasi_kab.py
CHANGES.txt
View file @
0483063
0.3.6 2021-07-05
----------------
- Perubahan rumus denda pada Kabupaten Bekasi
0.3.5 2021-06-13
----------------
- Tambah Kabupaten Cirebon
...
...
opensipkd/pad/services/bekasi_kab.py
View file @
0483063
from
datetime
import
date
from
datetime
import
(
date
,
datetime
,
)
from
opensipkd.hitung
import
round_up
from
.default
import
(
Inquiry
as
BaseInquiry
,
Reversal
as
BaseReversal
,
Reversal
,
AvailableInvoice
as
BaseAvailableInvoice
,
)
...
...
@@ -10,6 +14,52 @@ def dmy(tgl):
return
tgl
.
strftime
(
'
%
d-
%
m-
%
Y'
)
class
BaseDenda
:
def
__init__
(
self
,
tagihan
,
jatuh_tempo
,
persen_denda
,
tgl_hitung
=
None
):
self
.
tagihan
=
tagihan
self
.
jatuh_tempo
=
jatuh_tempo
self
.
persen_denda
=
persen_denda
self
.
tgl_hitung
=
tgl_hitung
or
date
.
today
()
self
.
jatuh_tempo
=
isinstance
(
jatuh_tempo
,
datetime
)
and
\
self
.
jatuh_tempo
.
date
()
or
jatuh_tempo
def
hitung
(
self
):
if
self
.
jatuh_tempo
is
None
:
return
0
,
0
if
self
.
jatuh_tempo
>=
self
.
tgl_hitung
or
self
.
persen_denda
<=
0
:
return
0
,
0
bulan
=
self
.
bulan_tunggakan
()
denda
=
bulan
*
float
(
self
.
persen_denda
)
/
100
*
self
.
tagihan
return
bulan
,
denda
def
get_max_bln
(
self
):
return
24
def
bulan_tunggakan
(
self
):
x
=
(
self
.
tgl_hitung
.
year
-
self
.
jatuh_tempo
.
year
)
*
12
y
=
self
.
tgl_hitung
.
month
-
self
.
jatuh_tempo
.
month
n
=
x
+
y
if
n
<
0
:
return
0
max_bln
=
self
.
get_max_bln
()
if
self
.
tgl_hitung
.
day
>
self
.
jatuh_tempo
.
day
:
n
+=
1
if
n
>
max_bln
:
return
max_bln
return
n
class
Denda
(
BaseDenda
):
def
__init__
(
self
,
tagihan
,
jatuh_tempo
,
persen_denda
,
tgl_hitung
=
None
,
invoice
=
None
):
super
()
.
__init__
(
tagihan
,
jatuh_tempo
,
persen_denda
,
tgl_hitung
=
None
)
self
.
invoice
=
invoice
def
get_max_bln
(
self
):
return
self
.
invoice
.
type_id
in
(
5
,
15
)
and
24
or
15
PREFIX
=
'3218'
INVOICE_ID
=
[
(
'Prefix'
,
4
,
'N'
),
...
...
@@ -32,7 +82,24 @@ NOTE_TGL_TERIMA = 'field terimatgl {tgl} >= ' + dmy(AWAL_TERIMA)
class
Inquiry
(
BaseInquiry
):
invoice_id_structure
=
INVOICE_ID
def
hitung_denda
(
self
):
# Override
bunga
=
self
.
invoice
.
bunga
or
0
self
.
denda
=
self
.
bunga
=
round_up
(
bunga
)
if
self
.
invoice
.
jatuhtempotgl
:
d
=
Denda
(
self
.
tagihan
,
self
.
invoice
.
jatuhtempotgl
,
self
.
conf
[
'persen_denda'
],
self
.
tgl_bayar
.
date
(),
self
.
invoice
)
self
.
bln_tunggakan
,
self
.
denda_waktu
=
d
.
hitung
()
self
.
denda_waktu
=
round_up
(
self
.
denda_waktu
)
self
.
denda
+=
self
.
denda_waktu
else
:
self
.
bln_tunggakan
=
None
self
.
discount_denda
=
self
.
get_discount_denda
()
self
.
denda
-=
self
.
discount_denda
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
))
...
...
@@ -64,10 +131,6 @@ class Inquiry(BaseInquiry):
return
0
class
Reversal
(
BaseReversal
):
invoice_id_structure
=
INVOICE_ID
class
AvailableInvoice
(
BaseAvailableInvoice
):
invoice_id_structure
=
INVOICE_ID
...
...
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