susioma/ledger/models.py

16 lines
639 B
Python
Raw Normal View History

2019-10-26 15:25:21 +00:00
from django.db import models
2020-10-24 14:50:04 +00:00
from buyer.models import Card
2019-10-26 15:25:21 +00:00
# Create your models here.
class Payment(models.Model):
description = models.CharField("Payment description", max_length=128)
amount = models.DecimalField("Payment amount", max_digits=15, decimal_places=2)
date = models.DateTimeField("Date of payment", auto_now_add=True)
2019-10-27 15:20:28 +00:00
repayment = models.DateTimeField("Date of repayment", default=None, null=True, blank=True)
2020-10-24 14:50:04 +00:00
card = models.ForeignKey(Card, models.SET_NULL, null=True, blank=True)
attachment = models.FileField("uploads", null=True, blank=True)
2019-10-26 15:39:14 +00:00
def __str__(self):
return self.description