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 0172b515
authored
Dec 08, 2024
by
Owo Sugiana
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Discount Kabupaten Serang
1 parent
8b1a6147
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
91 additions
and
1 deletions
CHANGES.txt
opensipkd/pad/services/serang_kab.py
pyproject.toml
CHANGES.txt
View file @
0172b51
0.5.17 2024-12-08
-----------------
- Discount denda Kabupaten Serang
0.5.16 2024-10-31
-----------------
- Discount denda Kota Serang
...
...
opensipkd/pad/services/serang_kab.py
0 → 100644
View file @
0172b51
from
datetime
import
date
from
..models.tangerang_kab
import
(
Kecamatan
,
Kelurahan
,
Customer
,
CustomerUsaha
,
Invoice
,
Payment
,
Pajak
,
Rekening
,
Usaha
,
SptType
,
Kohir
,
)
from
.default
import
(
Inquiry
as
BaseInquiry
,
Reversal
,
AvailableInvoice
as
BaseAvailableInvoice
,
)
def
dmy
(
tgl
):
return
tgl
.
strftime
(
'
%
d-
%
m-
%
Y'
)
AKHIR_MASA
=
date
(
2024
,
11
,
30
)
AWAL_DISC
=
date
(
2024
,
12
,
9
)
AKHIR_DISC
=
date
(
2024
,
12
,
31
)
NOTE_AKHIR_MASA
=
'field masadari {tgl} <= '
+
dmy
(
AKHIR_MASA
)
NOTE_TGL_BAYAR
=
dmy
(
AWAL_DISC
)
+
' <= tanggal bayar {tgl} <= '
+
\
dmy
(
AKHIR_DISC
)
class
Inquiry
(
BaseInquiry
):
def
get_discount_denda
(
self
):
# Override
masadari
=
self
.
invoice
.
masadari
.
date
()
if
masadari
>
AKHIR_MASA
:
return
0
tgl_bayar
=
self
.
tgl_bayar
.
date
()
if
AWAL_DISC
<=
tgl_bayar
<=
AKHIR_DISC
and
\
self
.
invoice
.
masadari
.
date
()
<=
AKHIR_MASA
:
alasan1
=
NOTE_AKHIR_MASA
.
format
(
tgl
=
masadari
)
alasan2
=
NOTE_TGL_BAYAR
.
format
(
tgl
=
tgl_bayar
)
self
.
notes
.
append
(
alasan1
)
self
.
notes
.
append
(
alasan2
)
return
self
.
denda
return
0
def
get_kecamatan_model
(
self
):
# Override
return
Kecamatan
def
get_kelurahan_model
(
self
):
# Override
return
Kelurahan
def
get_customer_model
(
self
):
# Override
return
Customer
def
get_usaha_model
(
self
):
# Override
return
Usaha
def
get_type_model
(
self
):
# Override
return
SptType
def
get_kohir_model
(
self
):
# Override
return
Kohir
def
get_customer_usaha_model
(
self
):
# Override
return
CustomerUsaha
def
get_rekening_model
(
self
):
# Override
return
Rekening
def
get_pajak_model
(
self
):
# Override
return
Pajak
def
get_invoice_model
(
self
):
# Override
return
Invoice
def
get_payment_model
(
self
):
# Override
return
Payment
class
AvailableInvoice
(
BaseAvailableInvoice
):
def
get_inquiry_class
(
self
):
# Override
return
Inquiry
pyproject.toml
View file @
0172b51
...
...
@@ -3,7 +3,7 @@ requires = ['setuptools >= 64']
[project]
name
=
'opensipkd-pad-models'
version
=
'
0.5.1
6
'
version
=
'
0.5.1
7
'
dependencies
=
[
'sqlalchemy'
,
'zope.sqlalchemy'
,
...
...
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