fixed service calls
This commit is contained in:
@@ -36,8 +36,6 @@ def get_sidebar_counts():
|
|||||||
|
|
||||||
automatic_count = db.session.query(Auto_Delivery).filter(Auto_Delivery.estimated_gallons_left <= 80).count()
|
automatic_count = db.session.query(Auto_Delivery).filter(Auto_Delivery.estimated_gallons_left <= 80).count()
|
||||||
|
|
||||||
upcoming_service_count = db.session.query(Service_Service).filter(Service_Service.scheduled_date >= now_local).count()
|
|
||||||
|
|
||||||
start_of_today = datetime.combine(today_date, datetime.min.time())
|
start_of_today = datetime.combine(today_date, datetime.min.time())
|
||||||
start_of_tomorrow = datetime.combine(today_date + timedelta(days=1), datetime.min.time())
|
start_of_tomorrow = datetime.combine(today_date + timedelta(days=1), datetime.min.time())
|
||||||
today_service_count = db.session.query(Service_Service).filter(
|
today_service_count = db.session.query(Service_Service).filter(
|
||||||
@@ -45,6 +43,9 @@ def get_sidebar_counts():
|
|||||||
Service_Service.scheduled_date < start_of_tomorrow
|
Service_Service.scheduled_date < start_of_tomorrow
|
||||||
).count()
|
).count()
|
||||||
|
|
||||||
|
# Upcoming service calls start from tomorrow, not today
|
||||||
|
upcoming_service_count = db.session.query(Service_Service).filter(Service_Service.scheduled_date >= start_of_tomorrow).count()
|
||||||
|
|
||||||
transaction_count = db.session.query(Transaction).filter(Transaction.transaction_type == 0).count()
|
transaction_count = db.session.query(Transaction).filter(Transaction.transaction_type == 0).count()
|
||||||
|
|
||||||
return jsonify({
|
return jsonify({
|
||||||
|
|||||||
Reference in New Issue
Block a user