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 a5748532
authored
Oct 08, 2020
by
Owo Sugiana
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Penambahan field discount_denda dan notes
1 parent
32615dc0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
16 deletions
CHANGES.txt
opensipkd/pad/models/tangsel.py
opensipkd/pad/scripts/inquiry.py
opensipkd/pad/services/default/__init__.py
opensipkd/pad/services/tangsel/__init__.py
CHANGES.txt
View file @
a574853
0.2.4 2020-10-0
7
0.2.4 2020-10-0
8
----------------
----------------
- Penambahan field discount_denda dan notes
- Perubahan rumus modul tangsel
- Perubahan rumus modul tangsel
0.2.3 2020-09-04
0.2.3 2020-09-04
...
...
opensipkd/pad/models/tangsel.py
View file @
a574853
...
@@ -370,6 +370,7 @@ class Payment(Base):
...
@@ -370,6 +370,7 @@ class Payment(Base):
is_inject
=
Column
(
Integer
)
is_inject
=
Column
(
Integer
)
posted
=
Column
(
Integer
)
posted
=
Column
(
Integer
)
discount_denda
=
Column
(
Float
)
discount_denda
=
Column
(
Float
)
notes
=
Column
(
Text
)
__table_args__
=
(
__table_args__
=
(
UniqueConstraint
(
'tahun'
,
'sspdno'
),)
UniqueConstraint
(
'tahun'
,
'sspdno'
),)
...
...
opensipkd/pad/scripts/inquiry.py
View file @
a574853
...
@@ -67,7 +67,7 @@ def show(inq):
...
@@ -67,7 +67,7 @@ def show(inq):
show_rp
(
'Denda'
,
inq
.
denda_pokok
)
show_rp
(
'Denda'
,
inq
.
denda_pokok
)
show_rp
(
'Discount Denda'
,
inq
.
discount_denda
)
show_rp
(
'Discount Denda'
,
inq
.
discount_denda
)
if
inq
.
discount_denda
:
if
inq
.
discount_denda
:
show_val
(
'
Alasan Discount Denda'
,
inq
.
alasan_discount
)
show_val
(
'
Note'
,
inq
.
notes
)
show_rp
(
'Total Denda'
,
inq
.
denda
)
show_rp
(
'Total Denda'
,
inq
.
denda
)
show_rp
(
'Total Bayar'
,
inq
.
total_bayar
)
show_rp
(
'Total Bayar'
,
inq
.
total_bayar
)
show_rp
(
'Total Tagihan'
,
inq
.
total
)
show_rp
(
'Total Tagihan'
,
inq
.
total
)
...
...
opensipkd/pad/services/default/__init__.py
View file @
a574853
...
@@ -248,6 +248,7 @@ class Inquiry(BaseInquiry):
...
@@ -248,6 +248,7 @@ class Inquiry(BaseInquiry):
super
()
.
__init__
(
invoice_id
,
rekening_notes
)
super
()
.
__init__
(
invoice_id
,
rekening_notes
)
if
not
self
.
invoice
:
if
not
self
.
invoice
:
return
return
self
.
notes
=
''
self
.
tgl_bayar
=
tgl_bayar
or
datetime
.
now
()
self
.
tgl_bayar
=
tgl_bayar
or
datetime
.
now
()
self
.
set_profile
()
self
.
set_profile
()
self
.
persen_denda
=
persen_denda
self
.
persen_denda
=
persen_denda
...
@@ -284,7 +285,6 @@ class Inquiry(BaseInquiry):
...
@@ -284,7 +285,6 @@ class Inquiry(BaseInquiry):
self
.
denda
-=
self
.
discount_denda
self
.
denda
-=
self
.
discount_denda
def
get_discount_denda
(
self
):
def
get_discount_denda
(
self
):
self
.
alasan_discount
=
''
return
0
return
0
def
hitung_bayar
(
self
):
def
hitung_bayar
(
self
):
...
...
opensipkd/pad/services/tangsel/__init__.py
View file @
a574853
from
datetime
import
date
from
datetime
import
(
date
,
datetime
,
timedelta
,
)
from
opensipkd.pad.services.default
import
(
from
opensipkd.pad.services.default
import
(
Inquiry
as
BaseInquiry
,
Inquiry
as
BaseInquiry
,
Reversal
as
BaseReversal
,
Reversal
as
BaseReversal
,
...
@@ -19,41 +23,69 @@ from opensipkd.pad.models.tangsel import (
...
@@ -19,41 +23,69 @@ from opensipkd.pad.models.tangsel import (
)
)
SEPT_30
=
date
(
2020
,
9
,
30
)
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
]])
class
Inquiry
(
BaseInquiry
):
class
Inquiry
(
BaseInquiry
):
def
get_discount_denda
(
self
):
# Override
def
get_discount_denda
(
self
):
# Override
if
self
.
tgl_bayar
.
year
>
2020
:
tgl_bayar
=
to_date
(
self
.
tgl_bayar
)
return
0
if
tgl_bayar
>
TGL_BAYAR_MAX
:
if
self
.
tgl_bayar
.
month
>
12
:
return
0
return
0
notes
=
[
ALASAN_TGL_BAYAR
]
usaha
=
self
.
get_nama_jenis_usaha
()
usaha
=
self
.
get_nama_jenis_usaha
()
is_self
=
self
.
is_self
()
is_self
=
self
.
is_self
()
if
is_self
or
usaha
==
'AIR TANAH'
:
if
is_self
or
usaha
==
'AIR TANAH'
:
masa_dari
=
self
.
invoice
.
masadari
.
date
()
masa_dari
=
self
.
invoice
.
masadari
.
date
()
if
masa_dari
>
SEPT_30
:
if
masa_dari
>
TGL_MASA_MAX
:
return
0
return
0
masa_sd
=
self
.
invoice
.
masasd
.
date
()
masa_sd
=
self
.
invoice
.
masasd
.
date
()
if
masa_sd
>
SEPT_30
:
if
masa_sd
>
TGL_MASA_MAX
:
return
0
return
0
if
is_self
:
if
is_self
:
self
.
alasan_discount
=
'Self'
notes
.
append
(
'self'
)
else
:
else
:
self
.
alasan_discount
=
'Usaha AIR TANAH'
notes
.
append
(
f
'usaha {usaha}'
)
self
.
alasan_discount
+=
', masa pajak maksimal 30 Sep 2020'
notes
.
append
(
'masa pajak sebelum {}'
.
format
(
t
(
TGL_MASA_MAX_USAI
)))
elif
usaha
==
'REKLAME'
:
elif
usaha
==
'REKLAME'
:
tgl_kohir
=
self
.
get_tgl_kohir
()
tgl_kohir
=
self
.
get_tgl_kohir
()
if
not
tgl_kohir
:
if
not
tgl_kohir
:
return
0
return
0
if
tgl_kohir
>
SEPT_30
:
if
tgl_kohir
>
TGL_KOHIR_MAX
:
return
0
return
0
self
.
alasan_discount
=
f
'Usaha {usaha}, kohir <= 30 Sep 2020'
notes
.
append
(
f
'usaha {usaha}'
)
notes
.
append
(
'tanggal kohir sebelum {}'
.
format
(
t
(
TGL_KOHIR_MAX_USAI
)))
else
:
else
:
tipe
=
self
.
get_type_name
()
tipe
=
self
.
get_type_name
()
if
tipe
not
in
(
'SKPDKB'
,
'STPD'
):
if
tipe
not
in
(
'SKPDKB'
,
'STPD'
):
return
0
return
0
self
.
alasan_discount
=
f
'Tipe {tipe}'
notes
.
append
(
f
'tipe {tipe}'
)
self
.
notes
=
satu_kalimat
(
notes
)
return
self
.
denda
return
self
.
denda
def
get_kecamatan_model
(
self
):
# Override
def
get_kecamatan_model
(
self
):
# Override
...
@@ -91,6 +123,8 @@ class Inquiry(BaseInquiry):
...
@@ -91,6 +123,8 @@ class Inquiry(BaseInquiry):
def
before_save
(
self
,
pay
):
def
before_save
(
self
,
pay
):
pay
.
discount_denda
=
self
.
discount_denda
pay
.
discount_denda
=
self
.
discount_denda
if
self
.
notes
is
not
None
:
pay
.
notes
=
self
.
notes
class
Reversal
(
BaseReversal
):
class
Reversal
(
BaseReversal
):
...
...
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