Add cash register summary view

This commit is contained in:
Skia
2016-09-13 02:04:49 +02:00
parent b0ce448ec7
commit 6cf253365b
8 changed files with 171 additions and 48 deletions

View File

@ -346,6 +346,14 @@ class CashRegisterSummary(models.Model):
def __str__(self):
return "At %s by %s - Total: %s" % (self.counter, self.user, self.get_total())
def is_owned_by(self, user):
"""
Method to see if that object can be edited by the given user
"""
if user.is_in_group(settings.SITH_GROUPS['counter-admin']['name']):
return True
return False
def get_total(self):
t = 0
for it in self.items.all():