Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Owo Sugiana
/
payment-report
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 1221c6fd
authored
Mar 07, 2023
by
Owo Sugiana
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Bug fixed BPHTB terkait query waktu
1 parent
1873f024
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
payment_report/scripts/bphtb.py
payment_report/scripts/bphtb.py
View file @
1221c6f
...
...
@@ -10,6 +10,8 @@ from sqlalchemy import (
Date
,
ForeignKey
,
UniqueConstraint
,
func
,
or_
,
and_
,
)
from
sqlalchemy.ext.declarative
import
declared_attr
from
sqlalchemy.exc
import
(
...
...
@@ -303,9 +305,13 @@ class App(BaseApp):
def
get_filter_query
(
self
,
q
):
if
isinstance
(
self
.
tgl_awal
,
datetime
):
return
q
.
filter
(
or_
(
and_
(
self
.
Payment
.
tanggal
>=
self
.
tgl_awal
.
date
(),
self
.
Payment
.
jam
>=
self
.
tgl_awal
.
time
(),
self
.
Payment
.
tanggal
<
self
.
tgl_akhir
+
one_day
)
self
.
Payment
.
jam
>=
self
.
tgl_awal
.
time
()),
and_
(
self
.
Payment
.
tanggal
>
self
.
tgl_awal
.
date
(),
self
.
Payment
.
tanggal
<
self
.
tgl_akhir
+
one_day
)))
return
q
.
filter
(
self
.
Payment
.
tanggal
>=
self
.
tgl_awal
,
self
.
Payment
.
tanggal
<
self
.
tgl_akhir
+
one_day
)
...
...
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