Martín Miranda

Merge branch 'feature/#68_agregar_campos_edicto' into 'develop'

Feature/#68 agregar campos edicto



See merge request !62
... ... @@ -15,7 +15,7 @@ class EdictoViewSet(mixins.CreateModelMixin,
viewsets.GenericViewSet):
serializer_class = EdictoSerializer
permission_classes = [IsAuthenticated]
permission_classes = [IsAuthenticated, ]
filter_backends = (DjangoFilterBackend, filters.OrderingFilter)
filterset_class = EdictoFilter
queryset = Edicto.objects.all()
... ...
... ... @@ -10,7 +10,6 @@ RECHAZADO = 'rechazado'
STATUS_CHOICE = [
(INICIADO, _('iniciado')),
(PENDIENTE_REVISION, _('pendiente_revision')),
(PENDIENTE_DE_PAGO, _('pendiente_de_pago')),
(PENDIENTE_PAGO_REVISION, _('pendiente_pago_revision')),
(PUBLICADO, _('publicado')),
... ...
# Generated by Django 4.1.9 on 2023-09-29 10:02
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('edicto', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='comprobantepago',
old_name='monto',
new_name='monto_descuento',
),
migrations.AddField(
model_name='comprobantepago',
name='monto_subtotal',
field=models.FloatField(),
preserve_default=False,
),
migrations.AddField(
model_name='comprobantepago',
name='monto_total',
field=models.FloatField(),
preserve_default=False,
),
migrations.AddField(
model_name='edicto',
name='tiene_descuento',
field=models.BooleanField(editable=False),
preserve_default=False,
),
migrations.AddField(
model_name='precio',
name='precio_dia',
field=models.FloatField(max_length=50),
preserve_default=False,
),
migrations.AlterField(
model_name='edicto',
name='estado',
field=models.CharField(choices=[('iniciado', 'iniciado'), ('pendiente_de_pago', 'pendiente_de_pago'), ('pendiente_pago_revision', 'pendiente_pago_revision'), ('publicado', 'publicado'), ('aprobado', 'aprobado'), ('rechazado', 'rechazado')], default='inciado', max_length=23),
),
]
... ...
... ... @@ -17,6 +17,7 @@ class Precio(models.Model):
moneda = models.CharField(max_length=50, blank=False, null=False, choices=MONEDA,
default='peso_argentino')
precio_ejemplar = models.FloatField(max_length=50, blank=False, null=False)
precio_dia = models.FloatField(max_length=50, blank=False, null=False)
class Meta:
verbose_name = 'Precio'
... ... @@ -48,6 +49,7 @@ class Edicto(models.Model):
modificado_por = models.ForeignKey(
Usuario, on_delete=models.CASCADE, related_name='update_edicto', editable=False
)
tiene_descuento = models.BooleanField(editable=False)
def __str__(self):
return f"{self.creado_por} - Edicto"
... ... @@ -58,7 +60,9 @@ class ComprobantePago(models.Model):
verbose_name = 'ComprobantePago'
verbose_name_plural = 'ComprobantesPagos'
monto = models.FloatField()
monto_subtotal = models.FloatField()
monto_total = models.FloatField()
monto_descuento = models.FloatField()
numero_comprobante = models.CharField(max_length=300, blank=True, null=True)
fecha_pago = models.DateTimeField(blank=True, null=True)
edicto = models.OneToOneField(Edicto, on_delete=models.CASCADE)
... ...