This commit is contained in:
anhduy-tech
2026-02-10 10:14:23 +07:00
parent 41a51c65f1
commit 63e5d71ca2
8 changed files with 326 additions and 75 deletions

View File

@@ -1667,7 +1667,7 @@ class Internal_Entry(AutoCodeModel):
inputer = models.ForeignKey(User, null=False, related_name='+', on_delete=models.PROTECT)
account = models.ForeignKey(Internal_Account, null=False, related_name='+', on_delete=models.PROTECT)
date = models.DateField(null=False)
ref = models.CharField(max_length=30, null=True)
ref = models.CharField(max_length=30, null=True, unique=True)
customer = models.ForeignKey(Customer, null=True, related_name='entrycus', on_delete=models.PROTECT)
product = models.ForeignKey(Product, null=True, related_name='+', on_delete=models.PROTECT)
allocation_amount = models.DecimalField(null=True, max_digits=35, decimal_places=2)
@@ -1694,8 +1694,6 @@ class Payment_Schedule(AutoCodeModel):
code_prefix = "SH"
code_padding = 5
code = models.CharField(max_length=30, null=True, unique=True)
link = models.CharField(max_length=100, null=True)
ref_code = models.CharField(max_length=30, null=True)
from_date = models.DateField(null=False)
to_date = models.DateField(null=False)
amount = models.DecimalField(max_digits=35, decimal_places=2)
@@ -1722,6 +1720,19 @@ class Payment_Schedule(AutoCodeModel):
class Meta:
db_table = 'payment_schedule'
class Invoice(AutoCodeModel):
code_prefix = "HD"
code_padding = 5
link = models.CharField(max_length=100, null=True)
ref_code = models.CharField(max_length=30, null=True)
amount = models.DecimalField(max_digits=35, decimal_places=2)
payment = models.ForeignKey(Payment_Schedule, null=False, related_name='invoice', on_delete=models.PROTECT)
note = models.CharField(max_length=100, null=True)
class Meta:
db_table = 'invoice'
class Phone_Otp(models.Model):
code = models.CharField(max_length=30, null=False, unique=True)