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 9a7683a6
authored
Jan 04, 2024
by
Owo Sugiana
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Bug fixed Kabupaten Bekasi saat hitung denda
1 parent
00d81116
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
2 deletions
opensipkd/pad/models/bekasi_kab.py
opensipkd/pad/services/bekasi_kab.py
opensipkd/pad/models/bekasi_kab.py
0 → 100644
View file @
9a7683a
from
sqlalchemy
import
(
Column
,
Integer
,
Text
,
DateTime
,
UniqueConstraint
,
)
from
sqlalchemy.ext.declarative
import
declarative_base
Base
=
declarative_base
()
class
Kohir
(
Base
):
__tablename__
=
'pad_kohir'
id
=
Column
(
Integer
,
primary_key
=
True
)
tahun
=
Column
(
Integer
,
nullable
=
False
)
usaha_id
=
Column
(
Integer
)
kohirno
=
Column
(
Integer
,
nullable
=
False
)
kohirtgl
=
Column
(
DateTime
,
nullable
=
False
)
sptpd_id
=
Column
(
Integer
,
nullable
=
False
)
enabled
=
Column
(
Integer
)
create_date
=
Column
(
DateTime
)
create_uid
=
Column
(
Integer
)
write_date
=
Column
(
DateTime
)
write_uid
=
Column
(
Integer
)
is_cancel
=
Column
(
Integer
)
bap_no
=
Column
(
Text
)
bap_date
=
Column
(
DateTime
)
cancel_no
=
Column
(
Integer
)
cancel_date
=
Column
(
DateTime
)
cancel_uid
=
Column
(
Integer
)
__table_args__
=
(
UniqueConstraint
(
tahun
,
kohirno
,
usaha_id
),
dict
(
schema
=
'pad'
))
opensipkd/pad/services/bekasi_kab.py
View file @
9a7683a
...
@@ -3,6 +3,12 @@ from datetime import (
...
@@ -3,6 +3,12 @@ from datetime import (
datetime
,
datetime
,
)
)
from
opensipkd.hitung
import
round_up
from
opensipkd.hitung
import
round_up
from
..models.banjar
import
(
Invoice
,
Payment
,
)
from
..models.bekasi_kab
import
Kohir
from
.base
import
get_db_session
from
.default
import
(
from
.default
import
(
Inquiry
as
BaseInquiry
,
Inquiry
as
BaseInquiry
,
Reversal
as
BaseReversal
,
Reversal
as
BaseReversal
,
...
@@ -53,7 +59,7 @@ class Denda(BaseDenda):
...
@@ -53,7 +59,7 @@ class Denda(BaseDenda):
def
__init__
(
def
__init__
(
self
,
tagihan
,
jatuh_tempo
,
persen_denda
,
tgl_hitung
=
None
,
self
,
tagihan
,
jatuh_tempo
,
persen_denda
,
tgl_hitung
=
None
,
invoice
=
None
):
invoice
=
None
):
super
()
.
__init__
(
tagihan
,
jatuh_tempo
,
persen_denda
,
tgl_hitung
=
None
)
super
()
.
__init__
(
tagihan
,
jatuh_tempo
,
persen_denda
,
tgl_hitung
)
self
.
invoice
=
invoice
self
.
invoice
=
invoice
def
get_max_bln
(
self
):
def
get_max_bln
(
self
):
...
@@ -83,6 +89,10 @@ NOTE_TGL_TERIMA = 'field terimatgl {tgl} >= ' + dmy(AKHIR_TERIMA)
...
@@ -83,6 +89,10 @@ NOTE_TGL_TERIMA = 'field terimatgl {tgl} >= ' + dmy(AKHIR_TERIMA)
class
Inquiry
(
BaseInquiry
):
class
Inquiry
(
BaseInquiry
):
invoice_id_structure
=
INVOICE_ID
invoice_id_structure
=
INVOICE_ID
# Cekal 2024, Pak Yasir, 2-1-2024
def
is_available
(
self
):
# Override
return
super
()
.
is_available
()
and
self
.
tahun_terbit
<
2024
def
hitung_denda
(
self
):
# Override
def
hitung_denda
(
self
):
# Override
bunga
=
self
.
invoice
.
bunga
or
0
bunga
=
self
.
invoice
.
bunga
or
0
self
.
denda
=
self
.
bunga
=
round_up
(
bunga
)
self
.
denda
=
self
.
bunga
=
round_up
(
bunga
)
...
@@ -125,13 +135,42 @@ class Inquiry(BaseInquiry):
...
@@ -125,13 +135,42 @@ class Inquiry(BaseInquiry):
return
self
.
denda
return
self
.
denda
return
0
return
0
def
get_invoice_model
(
self
):
# Override
return
Invoice
def
get_kohir_model
(
self
):
# Override
return
Kohir
def
get_payment_model
(
self
):
# Override
return
Payment
def
get_kohir
(
self
):
# Override
def
get_kohir
(
self
):
# Override
return
DBSession
=
get_db_session
()
Kohir
=
self
.
get_kohir_model
()
q
=
DBSession
.
query
(
Kohir
)
.
filter_by
(
sptpd_id
=
self
.
invoice
.
sptpd_id
)
q
=
q
.
order_by
(
Kohir
.
id
.
desc
())
return
q
.
first
()
class
Reversal
(
BaseReversal
):
class
Reversal
(
BaseReversal
):
invoice_id_structure
=
INVOICE_ID
invoice_id_structure
=
INVOICE_ID
def
get_invoice_model
(
self
):
# Override
return
Invoice
def
get_kohir_model
(
self
):
# Override
return
Kohir
def
get_payment_model
(
self
):
# Override
return
Payment
def
get_kohir
(
self
):
# Override
DBSession
=
get_db_session
()
Kohir
=
self
.
get_kohir_model
()
q
=
DBSession
.
query
(
Kohir
)
.
filter_by
(
sptpd_id
=
self
.
invoice
.
sptpd_id
)
q
=
q
.
order_by
(
Kohir
.
id
.
desc
())
return
q
.
first
()
class
AvailableInvoice
(
BaseAvailableInvoice
):
class
AvailableInvoice
(
BaseAvailableInvoice
):
invoice_id_structure
=
INVOICE_ID
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