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 %}"> <table class="table table-striped{% if not nodatatable %} datatable{% endif %}">
<thead> <thead>
<tr> <tr>
@ -5,6 +6,7 @@
<th>Pos</th> <th>Pos</th>
<th>Bank Responsible</th> <th>Bank Responsible</th>
<th>Pos Responsible</th> <th>Pos Responsible</th>
<th class="text-center">OK?</th>
<th>Actions</th> <th>Actions</th>
</tr> </tr>
</thead> </thead>
@ -15,6 +17,7 @@
<td>{{ pr.pos.name }}</td> <td>{{ pr.pos.name }}</td>
<td>{{ pr.bank_responsible }}</td> <td>{{ pr.bank_responsible }}</td>
<td>{{ pr.pos_responsible }}</td> <td>{{ pr.pos_responsible }}</td>
<td class="text-center">{{ pr.allok | truefalseicon }}</td>
<td> <td>
<div class="btn-group-vertical"> <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> <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' %} {% extends 'base.html' %}
{% load bornhack %}
{% block title %} {% block title %}
PosReport {{ posreport.date }} {{ posreport.pos.name }} | Pos | BackOffice | {{ block.super }} 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> <th>Pos Responsible</th>
<td>{{ posreport.pos_responsible }}</p> <td>{{ posreport.pos_responsible }}</p>
</tr> </tr>
<tr>
<th>All OK?</th>
<td>{{ posreport.allok | truefalseicon }}</p>
</tr>
<tr> <tr>
<th>Counts</th> <th>Counts</th>
<td> <td>
@ -58,8 +63,10 @@ PosReport {{ posreport.date }} {{ posreport.pos.name }} | Pos | BackOffice | {{
<th>What</th> <th>What</th>
<th>Bank Start</th> <th>Bank Start</th>
<th>Pos Start</th> <th>Pos Start</th>
<th>Start OK?</th>
<th>Pos End</th> <th>Pos End</th>
<th>Bank End</th> <th>Bank End</th>
<th>End OK?</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -67,47 +74,63 @@ PosReport {{ posreport.date }} {{ posreport.pos.name }} | Pos | BackOffice | {{
<td>DKK</td> <td>DKK</td>
<td>{{ posreport.bank_count_dkk_start }}</td> <td>{{ posreport.bank_count_dkk_start }}</td>
<td>{{ posreport.pos_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.pos_count_dkk_end }}</td>
<td>{{ posreport.bank_count_dkk_end }}</td> <td>{{ posreport.bank_count_dkk_end }}</td>
<td>{{ posreport.dkk_end_ok | truefalseicon }}</td>
</tr> </tr>
<tr> <tr>
<td>5 HAX</td> <td>5 HAX</td>
<td>{{ posreport.bank_count_hax5_start }}</td> <td>{{ posreport.bank_count_hax5_start }}</td>
<td>{{ posreport.pos_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.pos_count_hax5_end }}</td>
<td>{{ posreport.bank_count_hax5_end }}</td> <td>{{ posreport.bank_count_hax5_end }}</td>
<td>{{ posreport.hax5_end_ok | truefalseicon }}</td>
</tr> </tr>
<tr> <tr>
<td>10 HAX</td> <td>10 HAX</td>
<td>{{ posreport.bank_count_hax10_start }}</td> <td>{{ posreport.bank_count_hax10_start }}</td>
<td>{{ posreport.pos_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.pos_count_hax10_end }}</td>
<td>{{ posreport.bank_count_hax10_end }}</td> <td>{{ posreport.bank_count_hax10_end }}</td>
<td>{{ posreport.hax10_end_ok | truefalseicon }}</td>
</tr> </tr>
<td>20 HAX</td> <td>20 HAX</td>
<td>{{ posreport.bank_count_hax20_start }}</td> <td>{{ posreport.bank_count_hax20_start }}</td>
<td>{{ posreport.pos_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.pos_count_hax20_end }}</td>
<td>{{ posreport.bank_count_hax20_end }}</td> <td>{{ posreport.bank_count_hax20_end }}</td>
<td>{{ posreport.hax20_end_ok | truefalseicon }}</td>
</tr> </tr>
<tr> <tr>
<td>50 HAX</td> <td>50 HAX</td>
<td>{{ posreport.bank_count_hax50_start }}</td> <td>{{ posreport.bank_count_hax50_start }}</td>
<td>{{ posreport.pos_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.pos_count_hax50_end }}</td>
<td>{{ posreport.bank_count_hax50_end }}</td> <td>{{ posreport.bank_count_hax50_end }}</td>
<td>{{ posreport.hax50_end_ok | truefalseicon }}</td>
</tr> </tr>
<tr> <tr>
<td>100 HAX</td> <td>100 HAX</td>
<td>{{ posreport.bank_count_hax100_start }}</td> <td>{{ posreport.bank_count_hax100_start }}</td>
<td>{{ posreport.pos_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.pos_count_hax100_end }}</td>
<td>{{ posreport.bank_count_hax100_end }}</td> <td>{{ posreport.bank_count_hax100_end }}</td>
<td>{{ posreport.hax100_end_ok | truefalseicon }}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</td> </td>
</tr> </tr>
<tr>
<th>POS JSON</th>
<td>{{ posreport.pos_json }}</p>
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>

View file

@ -691,3 +691,70 @@ class PosReport(CampRelatedModel, UUIDModel):
"posreport_uuid": self.uuid, "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,
]
)