Merge branch 'release/1.0.1'
This commit is contained in:
commit
4dfdc644ea
@ -1,4 +1,4 @@
|
|||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta, date
|
||||||
|
|
||||||
from django import template
|
from django import template
|
||||||
from django.db.models import Sum
|
from django.db.models import Sum
|
||||||
@ -10,8 +10,14 @@ register = template.Library()
|
|||||||
|
|
||||||
@register.filter(is_safe=True)
|
@register.filter(is_safe=True)
|
||||||
def display_daily_sale(location):
|
def display_daily_sale(location):
|
||||||
start_date = datetime.now().replace(hour=5, minute=0, second=0, microsecond=0)
|
date = datetime.now().replace(hour=6, minute=0, second=0, microsecond=0)
|
||||||
end_date = start_date + timedelta(days=1)
|
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,
|
prize__sum = Accounting.objects.filter(desk__client__location=location,
|
||||||
time_to__range=(start_date, end_date)).aggregate(Sum('prize'))
|
time_to__range=(start_date, end_date)).aggregate(Sum('prize'))
|
||||||
if prize__sum['prize__sum'] is None:
|
if prize__sum['prize__sum'] is None:
|
||||||
|
@ -163,7 +163,7 @@ EMAIL_PORT = 25
|
|||||||
URL_LOCATION_PROCESSOR = 'http://127.0.0.1:8000/billard/process_locationdata'
|
URL_LOCATION_PROCESSOR = 'http://127.0.0.1:8000/billard/process_locationdata'
|
||||||
|
|
||||||
PRODUCT_INFO = 'CAROM-DEV'
|
PRODUCT_INFO = 'CAROM-DEV'
|
||||||
PRODUCT_VERSION = 'v 1.0.0'
|
PRODUCT_VERSION = 'v 1.0.1'
|
||||||
|
|
||||||
INTERNAL_IPS = ['127.0.0.1']
|
INTERNAL_IPS = ['127.0.0.1']
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user