mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-11 04:19:25 +00:00
enhance admin pages
This commit is contained in:
@ -305,6 +305,10 @@ class Product(models.Model):
|
||||
return True
|
||||
return False
|
||||
|
||||
@property
|
||||
def profit(self):
|
||||
return self.selling_price - self.purchase_price
|
||||
|
||||
def __str__(self):
|
||||
return "%s (%s)" % (self.name, self.code)
|
||||
|
||||
@ -762,6 +766,12 @@ class Permanency(models.Model):
|
||||
self.end.strftime("%Y-%m-%d %H:%M:%S") if self.end else "",
|
||||
)
|
||||
|
||||
@property
|
||||
def duration(self):
|
||||
if self.end is None:
|
||||
return self.activity - self.start
|
||||
return self.end - self.start
|
||||
|
||||
|
||||
class CashRegisterSummary(models.Model):
|
||||
user = models.ForeignKey(
|
||||
|
Reference in New Issue
Block a user