añadido seeder para series de facturacion

This commit is contained in:
2026-01-04 13:11:47 +01:00
parent 400251ac3d
commit 4a535ab644
11 changed files with 799 additions and 13 deletions

View File

@ -0,0 +1,67 @@
databaseChangeLog:
- changeSet:
id: 0024-series-facturacion-seeder
author: jjo
context: demo
changes:
# --- SERIES ---
- sql:
splitStatements: true
stripComments: true
sql: |
INSERT INTO series_facturas
(nombre_serie, prefijo, tipo, numero_actual, created_at, updated_at, created_by, updated_by)
SELECT
'IMPRESIÓN DIGITAL', 'IMPR', 'facturacion', 1, NOW(), NOW(), 1, 1
WHERE NOT EXISTS (
SELECT 1 FROM series_facturas WHERE prefijo = 'IMPR'
);
INSERT INTO series_facturas
(nombre_serie, prefijo, tipo, numero_actual, created_at, updated_at, created_by, updated_by)
SELECT
'RECT. IMPRESIÓN DIGITAL', 'REC IL', 'facturacion', 1, NOW(), NOW(), 1, 1
WHERE NOT EXISTS (
SELECT 1 FROM series_facturas WHERE prefijo = 'REC IL'
);
# --- VARIABLES (con el id real de la serie) ---
# serie_facturacion_default -> id de la serie con prefijo IMPR
- sql:
splitStatements: true
stripComments: true
sql: |
INSERT INTO variables (clave, valor)
SELECT
'serie_facturacion_default',
CAST(sf.id AS CHAR)
FROM series_facturas sf
WHERE sf.prefijo = 'IMPR'
LIMIT 1
ON DUPLICATE KEY UPDATE valor = VALUES(valor);
# sere_facturacion_rect_default -> id de la serie con prefijo REC IL
- sql:
splitStatements: true
stripComments: true
sql: |
INSERT INTO variables (clave, valor)
SELECT
'sere_facturacion_rect_default',
CAST(sf.id AS CHAR)
FROM series_facturas sf
WHERE sf.prefijo = 'REC IL'
LIMIT 1
ON DUPLICATE KEY UPDATE valor = VALUES(valor);
rollback:
- sql:
splitStatements: true
stripComments: true
sql: |
DELETE FROM variables
WHERE clave IN ('serie_facturacion_default', 'sere_facturacion_rect_default');
DELETE FROM series_facturas
WHERE prefijo IN ('IMPR', 'REC IL');

View File

@ -44,4 +44,6 @@ databaseChangeLog:
- include:
file: db/changelog/changesets/0022-add-estados-pago-to-pedidos-lineas-3.yml
- include:
file: db/changelog/changesets/0023-facturacion.yml
file: db/changelog/changesets/0023-facturacion.yml
- include:
file: db/changelog/changesets/0024-series-facturacion-seeder.yml

View File

@ -45,6 +45,8 @@ facturas.lineas.delete.title=¿Eliminar línea de factura?
facturas.lineas.delete.text=Esta acción no se puede deshacer.
facturas.lineas.error.base=La base imponible no es válida.
facturas.lineas.gastos-envio=Gastos de envío
facturas.direccion.titulo=Dirección de Facturación
facturas.direccion.razon-social=Razón Social
facturas.direccion.identificacion-fiscal=Identificación Fiscal

View File

@ -28,6 +28,7 @@ pedido.estado.esperando_aceptacion_ferro=Esperando aceptación de ferro
pedido.estado.ferro_cliente=Esperando aprobación de ferro
pedido.estado.produccion=Producción
pedido.estado.terminado=Terminado
pedido.estado.enviado=Enviado
pedido.estado.cancelado=Cancelado
pedido.module-title=Pedidos

View File

@ -42,7 +42,7 @@ $(() => {
if (estadoSpan.length) {
estadoSpan.text(response.state);
}
if (response.stateKey === 'terminado' || response.stateKey === 'cancelado') {
if (response.stateKey === 'enviado' || response.stateKey === 'cancelado') {
$(`.update-estado-button[data-linea-id='${lineaId}']`)
.closest('.update-estado-button')
.addClass('d-none');