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 0fde535a
authored
Sep 05, 2023
by
Owo Sugiana
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Discount Kabupaten Sukabumi
1 parent
a467e0a6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
1 deletions
CHANGES.txt
opensipkd/pad/services/sukabumi_kab.py
CHANGES.txt
View file @
0fde535
0.4.13 2023-09-05
-----------------
- Discount Kabupaten Sukabumi
0.4.12 2023-08-16
0.4.12 2023-08-16
-----------------
-----------------
- Bug fixed Kota Cimahi pada nilai tagihan pokok. Adapun total yang harus
- Bug fixed Kota Cimahi pada nilai tagihan pokok. Adapun total yang harus
...
...
opensipkd/pad/services/sukabumi_kab.py
View file @
0fde535
from
datetime
import
date
from
opensipkd.string
import
FixLength
from
opensipkd.hitung
import
(
from
opensipkd.hitung
import
(
hitung_denda
,
hitung_denda
,
round_up
,
round_up
,
)
)
from
.base
import
get_db_session
from
.banjar
import
(
from
.banjar
import
(
Inquiry
as
BaseInquiry
,
Inquiry
as
BaseInquiry
,
Reversal
,
Reversal
,
AvailableInvoice
,
AvailableInvoice
as
BaseAvailableInvoice
,
)
)
...
@@ -14,10 +17,31 @@ INVOICE_ID = [
...
@@ -14,10 +17,31 @@ INVOICE_ID = [
(
'SptNo'
,
5
,
'N'
),
(
'SptNo'
,
5
,
'N'
),
]
]
AWAL_DISC
=
date
(
2023
,
9
,
5
)
AKHIR_DISC
=
date
(
2023
,
12
,
20
)
AWAL_MASA
=
date
(
2023
,
1
,
1
)
AKHIR_MASA
=
date
(
2023
,
10
,
31
)
def
get_invoice_id
(
row
):
invoice_id
=
FixLength
(
INVOICE_ID
)
invoice_id
[
'Tahun'
]
=
row
.
tahun
invoice_id
[
'SptNo'
]
=
row
.
sptno
return
invoice_id
class
Inquiry
(
BaseInquiry
):
class
Inquiry
(
BaseInquiry
):
invoice_id_structure
=
INVOICE_ID
invoice_id_structure
=
INVOICE_ID
def
belum_lunas
(
self
,
tahun
):
Invoice
=
self
.
get_invoice_model
()
DBSession
=
get_db_session
()
q
=
DBSession
.
query
(
Invoice
)
.
filter
(
Invoice
.
customer_usaha_id
==
self
.
invoice
.
customer_usaha_id
,
Invoice
.
tahun
<=
tahun
,
Invoice
.
status_pembayaran
!=
1
)
return
q
.
first
()
def
hitung_denda
(
self
):
# Override
def
hitung_denda
(
self
):
# Override
self
.
bln_tunggakan
=
None
self
.
bln_tunggakan
=
None
self
.
denda
=
0
self
.
denda
=
0
...
@@ -41,7 +65,32 @@ class Inquiry(BaseInquiry):
...
@@ -41,7 +65,32 @@ class Inquiry(BaseInquiry):
self
.
denda
-=
self
.
discount_denda
self
.
denda
-=
self
.
discount_denda
def
get_discount_denda
(
self
):
# Override
def
get_discount_denda
(
self
):
# Override
self
.
notes
=
[]
nama_rek
=
self
.
get_nama_rekening
()
nama_rek
=
self
.
get_nama_rekening
()
if
nama_rek
[
-
4
:]
==
' OPD'
:
if
nama_rek
[
-
4
:]
==
' OPD'
:
self
.
notes
.
append
(
'Rekening OPD'
)
return
self
.
denda
return
self
.
denda
tgl_bayar
=
self
.
tgl_bayar
.
date
()
if
not
(
AWAL_DISC
<=
tgl_bayar
<=
AKHIR_DISC
):
return
0
tgl_masa
=
self
.
invoice
.
masadari
.
date
()
if
not
(
AWAL_MASA
<=
tgl_masa
<=
AKHIR_MASA
):
return
0
inv
=
self
.
belum_lunas
(
2022
)
if
inv
:
inv_id
=
get_invoice_id
(
inv
)
self
.
notes
.
append
(
f
'Tagihan {inv_id.get_raw()} belum lunas'
)
return
0
return
0
self
.
notes
.
append
(
f
'Lunas tahun pajak 2022 ke bawah'
)
self
.
notes
.
append
(
f
'{AWAL_MASA} <= field masadari {tgl_masa} <= {AKHIR_MASA}'
)
self
.
notes
.
append
(
f
'{AWAL_DISC} <= tgl bayar {tgl_bayar} <= {AKHIR_DISC}'
)
return
self
.
denda
class
AvailableInvoice
(
BaseAvailableInvoice
):
invoice_id_structure
=
INVOICE_ID
def
get_inquiry_class
(
self
):
# Override
return
Inquiry
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