Adicionar resumen de compra en el formulario de compra #14

Merged
mono merged 8 commits from pagar_una_compra_en_efectivo_#13 into main 2024-08-03 09:45:27 -05:00
Showing only changes of commit 7b74e4d381 - Show all commits

View File

@ -54,7 +54,7 @@ class Product(models.Model):
return self.name
class PyamentMethods(models.TextChoices):
class PaymentMethods(models.TextChoices):
CASH = 'CASH', _('Cash')
CONFIAR = 'CONFIAR', _('Confiar')
BANCOLOMBIA = 'BANCOLOMBIA', _('Bancolombia')
@ -112,8 +112,8 @@ class Payment(models.Model):
date_time = models.DateTimeField()
type_payment = models.CharField(
max_length=30,
choices=PyamentMethods.choices,
default=PyamentMethods.CASH
choices=PaymentMethods.choices,
default=PaymentMethods.CASH
)
amount = models.DecimalField(max_digits=9, decimal_places=2)
reconciliation_jar = models.ForeignKey(
@ -129,7 +129,7 @@ class Payment(models.Model):
def get_reconciliation_jar_summary(cls):
return ReconciliationJarSummary(
cls.objects.filter(
type_payment=PyamentMethods.CASH,
type_payment=PaymentMethods.CASH,
reconciliation_jar=None
)
)