Add basic refill support

This commit is contained in:
Skia
2016-06-26 20:07:29 +02:00
parent 9989b75b3e
commit 1feea061f6
4 changed files with 40 additions and 4 deletions

View File

@ -127,16 +127,16 @@ class Refilling(models.Model):
# TODO: add the bank if the payment is made by cheque
def __str__(self):
return "Refilling: %f for %s" % (self.amount, self.customer.user.get_display_name())
return "Refilling: %.2f for %s" % (self.amount, self.customer.user.get_display_name())
# def get_absolute_url(self):
# return reverse('counter:details', kwargs={'counter_id': self.id})
def save(self, *args, **kwargs):
self.full_clean()
self.customer.amount += self.quantity * self.unit_price
self.customer.amount += self.amount
self.customer.save()
super(Selling, self).save(*args, **kwargs)
super(Refilling, self).save(*args, **kwargs)
class Selling(models.Model):
"""