clean up code
This commit is contained in:
parent
0f6805ea4e
commit
2f14ecce7e
@ -1,5 +1,4 @@
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
#import models
|
|
||||||
|
|
||||||
|
|
||||||
def get_prize_for(start, end, pph=0):
|
def get_prize_for(start, end, pph=0):
|
||||||
@ -15,40 +14,3 @@ def get_prize_for(start, end, pph=0):
|
|||||||
time = (end - start).seconds
|
time = (end - start).seconds
|
||||||
prize = round((pps * time), 1)
|
prize = round((pps * time), 1)
|
||||||
return prize
|
return prize
|
||||||
|
|
||||||
|
|
||||||
def process_location_data():
|
|
||||||
pass
|
|
||||||
#data = models.LocationData.objects.filter(processed=False)
|
|
||||||
#for ld in data:
|
|
||||||
# cli = models.Client.objects.filter(uuid=ld.client_id)
|
|
||||||
# if cli.count() < 1:
|
|
||||||
# ld.processed = True
|
|
||||||
# ld.error_msg = 'No location object found. Stopp processing!'
|
|
||||||
# ld.save()
|
|
||||||
# # TODO Send error eMail to Admin
|
|
||||||
# else:
|
|
||||||
# cli = cli[0]
|
|
||||||
# ac = models.Accounting.objects.filter(client=cli, desk_no=ld.table_no).order_by('time_from').reverse()
|
|
||||||
# if ld.on_off:
|
|
||||||
# if ac.count() > 0 and ac[0].time_to is None:
|
|
||||||
# ac[0].time_to = datetime.now()
|
|
||||||
# ac[0].save()
|
|
||||||
# # TODO Send error eMail to Admin
|
|
||||||
# acc = models.Accounting(
|
|
||||||
# client=cli,
|
|
||||||
# desk_no=ld.table_no,
|
|
||||||
# time_from=ld.tst,
|
|
||||||
# )
|
|
||||||
# acc.save()
|
|
||||||
# ld.delete()
|
|
||||||
# else:
|
|
||||||
# acc = ac[0]
|
|
||||||
# acc.time_to = ld.tst
|
|
||||||
# acc.prize = get_prize_for(
|
|
||||||
# start=acc.time_from,
|
|
||||||
# end=ld.tst,
|
|
||||||
# pph=cli.desk1_prize_ht
|
|
||||||
# )
|
|
||||||
# acc.save()
|
|
||||||
# ld.delete()
|
|
||||||
|
Loading…
Reference in New Issue
Block a user