Anzeige des PReises pro Tisch
This commit is contained in:
Robert Einsle 2017-02-26 10:32:38 +01:00
parent 2e6cc938aa
commit 9ed10884e2

View File

@ -13,6 +13,7 @@ def display_client(client, desk_no):
if len(desks) == 0: if len(desks) == 0:
return '' return ''
desk = desks[0] desk = desks[0]
loc = desk.client.location
if not desk.enabled: if not desk.enabled:
return '' return ''
alert = 'alert-success' alert = 'alert-success'
@ -25,8 +26,8 @@ def display_client(client, desk_no):
start=a.time_from, start=a.time_from,
end=datetime.now(), end=datetime.now(),
pph=desk.prize, pph=desk.prize,
hh_start=desk.client.location.happy_hour_start, hh_start=loc.happy_hour_start,
hh_end=desk.client.location.happy_hour_end, hh_end=loc.happy_hour_end,
pphh=desk.prize_hh, pphh=desk.prize_hh,
) )
prize = '{0:.2f}'.format(prize) prize = '{0:.2f}'.format(prize)
@ -35,6 +36,16 @@ def display_client(client, desk_no):
html = '<div class="col-md-6">\n' html = '<div class="col-md-6">\n'
html += ' <div class="col-md-12 table-info alert {}">\n'.format(alert) html += ' <div class="col-md-12 table-info alert {}">\n'.format(alert)
html += ' <h4 style="text-align: center">({}) {}</h4>\n'.format(desk_no, desk.name) html += ' <h4 style="text-align: center">({}) {}</h4>\n'.format(desk_no, desk.name)
if loc.happy_hour_start is not None and desk.prize_hh is not None:
html += ' <h5 style="text-align: center">Preis: {:.2f} € / Stunde | {} - {}: {:.2f} / € Stunde</h5a>\n'\
.format(
desk.prize,
loc.happy_hour_start,
loc.happy_hour_end,
desk.prize_hh,)
else:
html += ' <h5 style="text-align: center">Preis: {0:.2f} / Stunde</h5a>\n'.format(
desk.prize,)
if len(acc) > 0: if len(acc) > 0:
html += ' <table class="table">\n' html += ' <table class="table">\n'
for a in acc: for a in acc: