fixup the PoS system a bit

This commit is contained in:
Thomas Steen Rasmussen 2020-08-13 18:35:17 +02:00
parent fde4a84ebe
commit ec1146a5dd
3 changed files with 93 additions and 0 deletions

View file

@ -1,3 +1,4 @@
{% load bornhack %}
<table class="table table-striped{% if not nodatatable %} datatable{% endif %}">
<thead>
<tr>
@ -5,6 +6,7 @@
<th>Pos</th>
<th>Bank Responsible</th>
<th>Pos Responsible</th>
<th class="text-center">OK?</th>
<th>Actions</th>
</tr>
</thead>
@ -15,6 +17,7 @@
<td>{{ pr.pos.name }}</td>
<td>{{ pr.bank_responsible }}</td>
<td>{{ pr.pos_responsible }}</td>
<td class="text-center">{{ pr.allok | truefalseicon }}</td>
<td>
<div class="btn-group-vertical">
<a href="{% url 'backoffice:posreport_detail' camp_slug=camp.slug pos_slug=pos.slug posreport_uuid=pr.uuid %}" class="btn btn-primary"><i class="fas fa-search"></i> Details</a>

View file

@ -1,4 +1,5 @@
{% extends 'base.html' %}
{% load bornhack %}
{% block title %}
PosReport {{ posreport.date }} {{ posreport.pos.name }} | Pos | BackOffice | {{ block.super }}
@ -49,6 +50,10 @@ PosReport {{ posreport.date }} {{ posreport.pos.name }} | Pos | BackOffice | {{
<th>Pos Responsible</th>
<td>{{ posreport.pos_responsible }}</p>
</tr>
<tr>
<th>All OK?</th>
<td>{{ posreport.allok | truefalseicon }}</p>
</tr>
<tr>
<th>Counts</th>
<td>
@ -58,8 +63,10 @@ PosReport {{ posreport.date }} {{ posreport.pos.name }} | Pos | BackOffice | {{
<th>What</th>
<th>Bank Start</th>
<th>Pos Start</th>
<th>Start OK?</th>
<th>Pos End</th>
<th>Bank End</th>
<th>End OK?</th>
</tr>
</thead>
<tbody>
@ -67,47 +74,63 @@ PosReport {{ posreport.date }} {{ posreport.pos.name }} | Pos | BackOffice | {{
<td>DKK</td>
<td>{{ posreport.bank_count_dkk_start }}</td>
<td>{{ posreport.pos_count_dkk_start }}</td>
<td>{{ posreport.dkk_start_ok | truefalseicon }}</td>
<td>{{ posreport.pos_count_dkk_end }}</td>
<td>{{ posreport.bank_count_dkk_end }}</td>
<td>{{ posreport.dkk_end_ok | truefalseicon }}</td>
</tr>
<tr>
<td>5 HAX</td>
<td>{{ posreport.bank_count_hax5_start }}</td>
<td>{{ posreport.pos_count_hax5_start }}</td>
<td>{{ posreport.hax5_start_ok | truefalseicon }}</td>
<td>{{ posreport.pos_count_hax5_end }}</td>
<td>{{ posreport.bank_count_hax5_end }}</td>
<td>{{ posreport.hax5_end_ok | truefalseicon }}</td>
</tr>
<tr>
<td>10 HAX</td>
<td>{{ posreport.bank_count_hax10_start }}</td>
<td>{{ posreport.pos_count_hax10_start }}</td>
<td>{{ posreport.hax10_start_ok | truefalseicon }}</td>
<td>{{ posreport.pos_count_hax10_end }}</td>
<td>{{ posreport.bank_count_hax10_end }}</td>
<td>{{ posreport.hax10_end_ok | truefalseicon }}</td>
</tr>
<td>20 HAX</td>
<td>{{ posreport.bank_count_hax20_start }}</td>
<td>{{ posreport.pos_count_hax20_start }}</td>
<td>{{ posreport.hax20_start_ok | truefalseicon }}</td>
<td>{{ posreport.pos_count_hax20_end }}</td>
<td>{{ posreport.bank_count_hax20_end }}</td>
<td>{{ posreport.hax20_end_ok | truefalseicon }}</td>
</tr>
<tr>
<td>50 HAX</td>
<td>{{ posreport.bank_count_hax50_start }}</td>
<td>{{ posreport.pos_count_hax50_start }}</td>
<td>{{ posreport.hax50_start_ok | truefalseicon }}</td>
<td>{{ posreport.pos_count_hax50_end }}</td>
<td>{{ posreport.bank_count_hax50_end }}</td>
<td>{{ posreport.hax50_end_ok | truefalseicon }}</td>
</tr>
<tr>
<td>100 HAX</td>
<td>{{ posreport.bank_count_hax100_start }}</td>
<td>{{ posreport.pos_count_hax100_start }}</td>
<td>{{ posreport.hax100_start_ok | truefalseicon }}</td>
<td>{{ posreport.pos_count_hax100_end }}</td>
<td>{{ posreport.bank_count_hax100_end }}</td>
<td>{{ posreport.hax100_end_ok | truefalseicon }}</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<th>POS JSON</th>
<td>{{ posreport.pos_json }}</p>
</tr>
</tbody>
</table>
</div>

View file

@ -691,3 +691,70 @@ class PosReport(CampRelatedModel, UUIDModel):
"posreport_uuid": self.uuid,
},
)
@property
def dkk_start_ok(self):
return self.bank_count_dkk_start == self.pos_count_dkk_start
@property
def hax5_start_ok(self):
return self.bank_count_hax5_start == self.pos_count_hax5_start
@property
def hax10_start_ok(self):
return self.bank_count_hax10_start == self.pos_count_hax10_start
@property
def hax20_start_ok(self):
return self.bank_count_hax20_start == self.pos_count_hax20_start
@property
def hax50_start_ok(self):
return self.bank_count_hax50_start == self.pos_count_hax50_start
@property
def hax100_start_ok(self):
return self.bank_count_hax100_start == self.pos_count_hax100_start
@property
def dkk_end_ok(self):
return self.bank_count_dkk_end == self.pos_count_dkk_end
@property
def hax5_end_ok(self):
return self.bank_count_hax5_end == self.pos_count_hax5_end
@property
def hax10_end_ok(self):
return self.bank_count_hax10_end == self.pos_count_hax10_end
@property
def hax20_end_ok(self):
return self.bank_count_hax20_end == self.pos_count_hax20_end
@property
def hax50_end_ok(self):
return self.bank_count_hax50_end == self.pos_count_hax50_end
@property
def hax100_end_ok(self):
return self.bank_count_hax100_end == self.pos_count_hax100_end
@property
def allok(self):
return all(
[
self.dkk_start_ok,
self.hax5_start_ok,
self.hax10_start_ok,
self.hax20_start_ok,
self.hax50_start_ok,
self.hax100_start_ok,
self.dkk_end_ok,
self.hax5_end_ok,
self.hax10_end_ok,
self.hax20_end_ok,
self.hax50_end_ok,
self.hax100_end_ok,
]
)