Commit 1221c6fd by Owo Sugiana

Bug fixed BPHTB terkait query waktu

1 parent 1873f024
......@@ -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)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!