Feat(WIP): Calculo Total en Linea

This commit is contained in:
2024-08-03 07:13:58 -05:00
parent ef2f630dba
commit 2b7d708d76
6 changed files with 68 additions and 1 deletions

View File

@@ -14,12 +14,12 @@ class Sale(models.Model):
class SaleLine(models.Model):
sale = models.ForeignKey(Sale, on_delete=models.CASCADE)
product = models.CharField(max_length=100)
quantity = models.IntegerField(null=True)
unit_price = models.DecimalField(max_digits=9, decimal_places=2)
description = models.CharField(max_length=255, null=True, blank=True)
total = models.DecimalField(max_digits=9, decimal_places=2)
def __str__(self):
return f"{self.sale} - {self.product}"