mirror of
https://github.com/adrigongv23/G26---Telemetry-Software.git
synced 2026-08-25 11:33:17 +02:00
Sección de contabilida añadida
This commit is contained in:
parent
408d4d006e
commit
a15f836e07
7 changed files with 430 additions and 9 deletions
18
Plataform_Web/documentos/migrations/0003_factura_estado.py
Normal file
18
Plataform_Web/documentos/migrations/0003_factura_estado.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 6.0.2 on 2026-06-30 16:00
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('documentos', '0002_factura_alter_documento_options_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='factura',
|
||||
name='estado',
|
||||
field=models.CharField(choices=[('pendiente', 'Pendiente'), ('aceptada', 'Aceptada'), ('rechazada', 'Rechazada')], default='pendiente', max_length=20),
|
||||
),
|
||||
]
|
||||
|
|
@ -62,11 +62,18 @@ class Documento(models.Model):
|
|||
os.remove(self.archivo.path)
|
||||
super().delete(*args, **kwargs)
|
||||
|
||||
ESTADO_FACTURA = [
|
||||
('pendiente', 'Pendiente'),
|
||||
('aceptada', 'Aceptada'),
|
||||
('rechazada', 'Rechazada'),
|
||||
]
|
||||
|
||||
# Herencia de la clase Factura: Factura hereda de Documento
|
||||
class Factura(Documento):
|
||||
# Al heredar de Documento, ya tiene nombre, archivo, categoria, etc.
|
||||
empresa = models.CharField(max_length=100, verbose_name="Nombre de la empresa")
|
||||
importe = models.DecimalField(max_digits=10, decimal_places=2, verbose_name="Importe (€)")
|
||||
estado = models.CharField(max_length=20, choices=ESTADO_FACTURA, default='pendiente')
|
||||
|
||||
class Meta:
|
||||
verbose_name = "Factura"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue