Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Owo Sugiana
/
sismiop-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 148e5a5e
authored
Oct 14, 2023
by
Owo Sugiana
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Bug fixed inquiry pasca payment Majalengka saat ada discount
1 parent
8d75668f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletions
sismiop/services/cilegon.py
sismiop/services/majalengka.py
sismiop/services/cilegon.py
View file @
148e5a5
from
datetime
import
date
from
sqlalchemy
import
func
from
.default
import
(
Inquiry
as
BaseInquiry
,
Reversal
as
BaseReversal
,
AvailableInvoice
as
BaseAvailableInvoice
,
)
from
.base
import
get_db_session
from
..models.cilegon
import
PembayaranSppt
...
...
@@ -29,6 +31,16 @@ class Inquiry(BaseInquiry):
self
.
denda_sblm_diskon
=
self
.
denda
self
.
discount
=
self
.
hitung_discount_denda
()
def
get_payment_sum
(
self
):
# Override
Payment
=
self
.
get_payment_model
()
DBSession
=
get_db_session
()
return
DBSession
.
query
(
func
.
sum
(
Payment
.
jml_sppt_yg_dibayar
)
.
label
(
'jml_sppt_yg_dibayar'
),
func
.
sum
(
Payment
.
denda_sppt
)
.
label
(
'denda_sppt'
),
func
.
sum
(
0
)
.
label
(
'discount'
))
def
before_save
(
self
,
payment
):
# Override
payment
.
denda_sppt
=
self
.
denda
-
self
.
discount
# Sekedar catatan
...
...
sismiop/services/majalengka.py
View file @
148e5a5
...
...
@@ -8,7 +8,7 @@ from .cilegon import (
AWAL_DISC
=
date
(
2023
,
8
,
7
)
AKHIR_DISC_2018_2022
=
date
(
2023
,
12
,
31
)
AKHIR_DISC_2023
=
date
(
2023
,
9
,
8
)
AKHIR_DISC_2023
=
date
(
2023
,
12
,
31
)
class
Inquiry
(
BaseInquiry
):
...
...
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