mirror of
https://git.imnavajas.es/jjimenez/erp-imprimelibros.git
synced 2026-01-13 00:48:49 +00:00
añadidas las direcciones de pedido
This commit is contained in:
@ -0,0 +1,151 @@
|
||||
databaseChangeLog:
|
||||
- changeSet:
|
||||
id: 0014-create-pedidos-direcciones
|
||||
author: jjo
|
||||
changes:
|
||||
- createTable:
|
||||
tableName: pedidos_direcciones
|
||||
columns:
|
||||
- column:
|
||||
name: id
|
||||
type: BIGINT AUTO_INCREMENT
|
||||
constraints:
|
||||
primaryKey: true
|
||||
nullable: false
|
||||
|
||||
- column:
|
||||
name: pedido_linea_id
|
||||
type: BIGINT
|
||||
constraints:
|
||||
nullable: true
|
||||
|
||||
- column:
|
||||
name: pedido_id
|
||||
type: BIGINT
|
||||
constraints:
|
||||
nullable: true
|
||||
|
||||
- column:
|
||||
name: unidades
|
||||
type: MEDIUMINT UNSIGNED
|
||||
constraints:
|
||||
nullable: true
|
||||
|
||||
- column:
|
||||
name: is_facturacion
|
||||
type: TINYINT(1)
|
||||
defaultValueNumeric: 0
|
||||
constraints:
|
||||
nullable: false
|
||||
|
||||
- column:
|
||||
name: is_ejemplar_prueba
|
||||
type: TINYINT(1)
|
||||
defaultValueNumeric: 0
|
||||
constraints:
|
||||
nullable: false
|
||||
|
||||
- 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)
|
||||
constraints:
|
||||
nullable: false
|
||||
|
||||
- column:
|
||||
name: instrucciones
|
||||
type: VARCHAR(255)
|
||||
constraints:
|
||||
nullable: true
|
||||
|
||||
- column:
|
||||
name: razon_social
|
||||
type: VARCHAR(150)
|
||||
constraints:
|
||||
nullable: true
|
||||
|
||||
- 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)
|
||||
constraints:
|
||||
nullable: true
|
||||
|
||||
- column:
|
||||
name: created_at
|
||||
type: TIMESTAMP
|
||||
defaultValueComputed: CURRENT_TIMESTAMP
|
||||
constraints:
|
||||
nullable: false
|
||||
|
||||
- addForeignKeyConstraint:
|
||||
baseTableName: pedidos_direcciones
|
||||
baseColumnNames: pedido_linea_id
|
||||
referencedTableName: pedidos_lineas
|
||||
referencedColumnNames: id
|
||||
constraintName: fk_pedidos_direcciones_pedido_linea
|
||||
onDelete: SET NULL
|
||||
onUpdate: CASCADE
|
||||
|
||||
- addForeignKeyConstraint:
|
||||
baseTableName: pedidos_direcciones
|
||||
baseColumnNames: pedido_id
|
||||
referencedTableName: pedidos
|
||||
referencedColumnNames: id
|
||||
constraintName: fk_pedidos_direcciones_pedidos
|
||||
onDelete: SET NULL
|
||||
onUpdate: CASCADE
|
||||
|
||||
- createIndex:
|
||||
tableName: pedidos_direcciones
|
||||
indexName: idx_pedidos_direcciones_pedido_linea_id
|
||||
columns:
|
||||
- column:
|
||||
name: pedido_linea_id
|
||||
|
||||
rollback:
|
||||
- dropTable:
|
||||
tableName: pedidos_direcciones
|
||||
cascadeConstraints: true
|
||||
@ -0,0 +1,48 @@
|
||||
databaseChangeLog:
|
||||
- changeSet:
|
||||
id: 0015-alter-pedidos-lineas-and-presupuesto-estados
|
||||
author: jjo
|
||||
changes:
|
||||
# Añadir columnas a pedidos_lineas
|
||||
- addColumn:
|
||||
tableName: pedidos_lineas
|
||||
columns:
|
||||
- column:
|
||||
name: estado
|
||||
type: "ENUM('aprobado','maquetación','haciendo_ferro','producción','terminado','cancelado')"
|
||||
defaultValue: aprobado
|
||||
constraints:
|
||||
nullable: false
|
||||
afterColumn: presupuesto_id
|
||||
|
||||
- column:
|
||||
name: estado_manual
|
||||
type: TINYINT(1)
|
||||
defaultValueNumeric: 0
|
||||
constraints:
|
||||
nullable: false
|
||||
afterColumn: estado
|
||||
|
||||
# Añadir columna a presupuesto
|
||||
- addColumn:
|
||||
tableName: presupuesto
|
||||
columns:
|
||||
- column:
|
||||
name: is_reimpresion
|
||||
type: TINYINT(1)
|
||||
defaultValueNumeric: 0
|
||||
constraints:
|
||||
nullable: false
|
||||
|
||||
rollback:
|
||||
- dropColumn:
|
||||
tableName: pedidos_lineas
|
||||
columnName: estado
|
||||
|
||||
- dropColumn:
|
||||
tableName: pedidos_lineas
|
||||
columnName: estado_manual
|
||||
|
||||
- dropColumn:
|
||||
tableName: presupuesto
|
||||
columnName: is_reimpresion
|
||||
@ -24,4 +24,8 @@ databaseChangeLog:
|
||||
- include:
|
||||
file: db/changelog/changesets/0012--drop-unique-gateway-txid-2.yml
|
||||
- include:
|
||||
file: db/changelog/changesets/0013-drop-unique-refund-gateway-id.yml
|
||||
file: db/changelog/changesets/0013-drop-unique-refund-gateway-id.yml
|
||||
- include:
|
||||
file: db/changelog/changesets/0014-create-pedidos-direcciones.yml
|
||||
- include:
|
||||
file: db/changelog/changesets/0015-alter-pedidos-lineas-and-presupuesto-estados.yml
|
||||
@ -15,4 +15,11 @@ checkout.error.payment=Error al procesar el pago: el pago ha sido cancelado o re
|
||||
checkout.success.payment=Pago realizado con éxito. Gracias por su compra.
|
||||
|
||||
checkout.make-payment=Realizar el pago
|
||||
checkout.authorization-required=Certifico que tengo los derechos para imprimir los archivos incluidos en mi pedido y me hago responsable en caso de reclamación de los mismos
|
||||
checkout.authorization-required=Certifico que tengo los derechos para imprimir los archivos incluidos en mi pedido y me hago responsable en caso de reclamación de los mismos
|
||||
|
||||
pedido.estado.aprobado=Aprobado
|
||||
pedido.estado.maquetacion=Maquetación
|
||||
pedido.estado.haciendo_ferro=Haciendo ferro
|
||||
pedido.estado.produccion=Producción
|
||||
pedido.estado.terminado=Terminado
|
||||
pedido.estado.cancelado=Cancelado
|
||||
@ -140,6 +140,7 @@ $(() => {
|
||||
let uri = `/checkout/get-address/${direccionId}`;
|
||||
const response = await fetch(uri);
|
||||
if (response.ok) {
|
||||
$('#dirFactId').val(direccionId);
|
||||
const html = await response.text();
|
||||
$('#direccion-div').append(html);
|
||||
$('#addBillingAddressBtn').addClass('d-none');
|
||||
|
||||
@ -50,6 +50,7 @@
|
||||
<input type="hidden" name="amountCents" th:value="${summary.amountCents}" />
|
||||
<input type="hidden" name="method" value="card" />
|
||||
<input type="hidden" name="cartId" th:value="${summary.cartId}" />
|
||||
<input type="hidden" id="dirFactId" name="dirFactId" value="" />
|
||||
<button id="btn-checkout" type="submit" class="btn btn-secondary w-100 mt-2"
|
||||
th:text="#{checkout.make-payment}" disabled>Checkout</button>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user