terminado (provisional) modulo de facturas

This commit is contained in:
2026-01-07 21:21:33 +01:00
parent 292aebcf65
commit 8263d97bf7
27 changed files with 13608 additions and 720 deletions

View File

@ -48,7 +48,7 @@ databaseChangeLog:
sql: |
INSERT INTO variables (clave, valor)
SELECT
'sere_facturacion_rect_default',
'serie_facturacion_rect_default',
CAST(sf.id AS CHAR)
FROM series_facturas sf
WHERE sf.prefijo = 'REC IL'

View File

@ -0,0 +1,114 @@
databaseChangeLog:
- changeSet:
id: create-facturas-direcciones
author: jjo
changes:
- createTable:
tableName: facturas_direcciones
columns:
- column:
name: id
type: BIGINT
autoIncrement: true
constraints:
primaryKey: true
nullable: false
- column:
name: factura_id
type: BIGINT
constraints:
nullable: false
- column:
name: unidades
type: MEDIUMINT UNSIGNED
- column:
name: email
type: VARCHAR(255)
- column:
name: att
type: VARCHAR(150)
constraints:
nullable: false
- column:
name: direccion
type: VARCHAR(255)
constraints:
nullable: false
- column:
name: cp
type: MEDIUMINT UNSIGNED
constraints:
nullable: false
- column:
name: ciudad
type: VARCHAR(100)
constraints:
nullable: false
- column:
name: provincia
type: VARCHAR(100)
constraints:
nullable: false
- column:
name: pais_code3
type: CHAR(3)
defaultValue: esp
constraints:
nullable: false
- column:
name: telefono
type: VARCHAR(30)
- column:
name: instrucciones
type: VARCHAR(255)
- column:
name: razon_social
type: VARCHAR(150)
- column:
name: tipo_identificacion_fiscal
type: ENUM('DNI','NIE','CIF','Pasaporte','VAT_ID')
defaultValue: DNI
constraints:
nullable: false
- column:
name: identificacion_fiscal
type: VARCHAR(50)
- column:
name: created_at
type: TIMESTAMP
defaultValueComputed: CURRENT_TIMESTAMP
constraints:
nullable: false
- addForeignKeyConstraint:
constraintName: fk_facturas_direcciones_factura
baseTableName: facturas_direcciones
baseColumnNames: factura_id
referencedTableName: facturas
referencedColumnNames: id
onDelete: CASCADE
onUpdate: RESTRICT
rollback:
- dropForeignKeyConstraint:
baseTableName: facturas_direcciones
constraintName: fk_facturas_direcciones_factura
- dropTable:
tableName: facturas_direcciones

View File

@ -46,4 +46,6 @@ databaseChangeLog:
- include:
file: db/changelog/changesets/0023-facturacion.yml
- include:
file: db/changelog/changesets/0024-series-facturacion-seeder.yml
file: db/changelog/changesets/0024-series-facturacion-seeder.yml
- include:
file: db/changelog/changesets/0025-create-facturas-direcciones.yml