Commit ea3214c1 by Owo Sugiana

Bug fixed BPHTB --update-from-date

1 parent b197bc90
import sys import sys
from datetime import datetime
from sqlalchemy import ( from sqlalchemy import (
Column, Column,
Integer, Integer,
...@@ -134,10 +135,14 @@ class App(BaseApp): ...@@ -134,10 +135,14 @@ class App(BaseApp):
return f'{s_tgl} {s_jam}' return f'{s_tgl} {s_jam}'
def get_filter_query(self, q): def get_filter_query(self, q):
if isinstance(self.tgl_awal, datetime):
return q.filter( return q.filter(
self.Payment.tanggal >= self.tgl_awal.date(), self.Payment.tanggal >= self.tgl_awal.date(),
self.Payment.jam >= self.tgl_awal.time(), self.Payment.jam >= self.tgl_awal.time(),
self.Payment.tanggal < self.tgl_akhir + one_day) 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)
def get_count(self) -> int: # Override def get_count(self) -> int: # Override
q = self.get_filter_query(self.base_q_func) q = self.get_filter_query(self.base_q_func)
......
...@@ -61,7 +61,8 @@ BIT_PROFILE_NAMES = { ...@@ -61,7 +61,8 @@ BIT_PROFILE_NAMES = {
'TRAVELOK': 'TRAVELOKA', 'TRAVELOK': 'TRAVELOKA',
'SHOPEE': 'SHOPEE', 'SHOPEE': 'SHOPEE',
'OVO': 'OVO', 'OVO': 'OVO',
'BLIBLI': 'BLIBLI'} 'BLIBLI': 'BLIBLI',
'ARTPAY': 'ARTPAY'}
BANK_NAMES = {'700': 'PT POS'} BANK_NAMES = {'700': 'PT POS'}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!