diff --git a/billard/templatetags/display_daily_sale.py b/billard/templatetags/display_daily_sale.py index 0cae624..10fe099 100644 --- a/billard/templatetags/display_daily_sale.py +++ b/billard/templatetags/display_daily_sale.py @@ -1,4 +1,4 @@ -from datetime import datetime, timedelta +from datetime import datetime, timedelta, date from django import template from django.db.models import Sum @@ -10,8 +10,14 @@ register = template.Library() @register.filter(is_safe=True) def display_daily_sale(location): - start_date = datetime.now().replace(hour=5, minute=0, second=0, microsecond=0) - end_date = start_date + timedelta(days=1) + date = datetime.now().replace(hour=6, minute=0, second=0, microsecond=0) + now = datetime.now() + if now < date: + start_date = date - timedelta(days=1) + end_date = date + else: + start_date = date + end_date = date + timedelta(days=1) prize__sum = Accounting.objects.filter(desk__client__location=location, time_to__range=(start_date, end_date)).aggregate(Sum('prize')) if prize__sum['prize__sum'] is None: diff --git a/caromserver/settings.py b/caromserver/settings.py index ad3ce5b..18d993a 100644 --- a/caromserver/settings.py +++ b/caromserver/settings.py @@ -163,7 +163,7 @@ EMAIL_PORT = 25 URL_LOCATION_PROCESSOR = 'http://127.0.0.1:8000/billard/process_locationdata' PRODUCT_INFO = 'CAROM-DEV' -PRODUCT_VERSION = 'v 1.0.0' +PRODUCT_VERSION = 'v 1.0.1' INTERNAL_IPS = ['127.0.0.1']