mirror of
https://git.imnavajas.es/jjimenez/erp-imprimelibros.git
synced 2026-01-24 09:40:21 +00:00
terminando pdf de facturas
This commit is contained in:
@ -0,0 +1,110 @@
|
||||
package com.imprimelibros.erp.facturacion.dto;
|
||||
|
||||
import com.imprimelibros.erp.pedidos.PedidoDireccion;
|
||||
|
||||
public class DireccionFacturacionDto {
|
||||
private String razonSocial;
|
||||
private String identificacionFiscal;
|
||||
private String direccion;
|
||||
private String cp;
|
||||
private String ciudad;
|
||||
private String provincia;
|
||||
private String paisKeyword;
|
||||
private String telefono;
|
||||
|
||||
public String getRazonSocial() {
|
||||
return razonSocial;
|
||||
}
|
||||
|
||||
public void setRazonSocial(String razonSocial) {
|
||||
this.razonSocial = razonSocial;
|
||||
}
|
||||
|
||||
public String getIdentificacionFiscal() {
|
||||
return identificacionFiscal;
|
||||
}
|
||||
|
||||
public void setIdentificacionFiscal(String identificacionFiscal) {
|
||||
this.identificacionFiscal = identificacionFiscal;
|
||||
}
|
||||
|
||||
public String getDireccion() {
|
||||
return direccion;
|
||||
}
|
||||
|
||||
public void setDireccion(String direccion) {
|
||||
this.direccion = direccion;
|
||||
}
|
||||
|
||||
public String getCp() {
|
||||
return cp;
|
||||
}
|
||||
|
||||
public void setCp(String cp) {
|
||||
this.cp = cp;
|
||||
}
|
||||
|
||||
public String getCiudad() {
|
||||
return ciudad;
|
||||
}
|
||||
|
||||
public void setCiudad(String ciudad) {
|
||||
this.ciudad = ciudad;
|
||||
}
|
||||
|
||||
public String getProvincia() {
|
||||
return provincia;
|
||||
}
|
||||
|
||||
public void setProvincia(String provincia) {
|
||||
this.provincia = provincia;
|
||||
}
|
||||
|
||||
public String getPaisKeyword() {
|
||||
return paisKeyword;
|
||||
}
|
||||
|
||||
public void setPaisKeyword(String paisKeyword) {
|
||||
this.paisKeyword = paisKeyword;
|
||||
}
|
||||
|
||||
public String getTelefono() {
|
||||
return telefono;
|
||||
}
|
||||
|
||||
public void setTelefono(String telefono) {
|
||||
this.telefono = telefono;
|
||||
}
|
||||
|
||||
public PedidoDireccion toPedidoDireccion() {
|
||||
PedidoDireccion pd = new PedidoDireccion();
|
||||
applyTo(pd);
|
||||
pd.setFacturacion(true);
|
||||
return pd;
|
||||
}
|
||||
|
||||
public void applyTo(PedidoDireccion pd) {
|
||||
pd.setRazonSocial(this.razonSocial);
|
||||
pd.setIdentificacionFiscal(this.identificacionFiscal);
|
||||
pd.setDireccion(this.direccion);
|
||||
|
||||
// CP robusto
|
||||
Integer cpInt = null;
|
||||
if (this.cp != null && !this.cp.isBlank()) {
|
||||
try {
|
||||
cpInt = Integer.valueOf(this.cp.trim());
|
||||
} catch (NumberFormatException ignored) {
|
||||
// si quieres, lanza IllegalArgumentException para validarlo
|
||||
}
|
||||
}
|
||||
pd.setCp(cpInt);
|
||||
|
||||
pd.setCiudad(this.ciudad);
|
||||
pd.setProvincia(this.provincia);
|
||||
|
||||
pd.setPaisCode3(this.paisKeyword);
|
||||
|
||||
pd.setTelefono(this.telefono);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
package com.imprimelibros.erp.facturacion.dto;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
public class FacturaCabeceraDto {
|
||||
private Long serieId;
|
||||
private Long clienteId;
|
||||
private LocalDateTime fechaEmision;
|
||||
|
||||
public Long getSerieId() {
|
||||
return serieId;
|
||||
}
|
||||
|
||||
public void setSerieId(Long serieId) {
|
||||
this.serieId = serieId;
|
||||
}
|
||||
|
||||
public Long getClienteId() {
|
||||
return clienteId;
|
||||
}
|
||||
|
||||
public void setClienteId(Long clienteId) {
|
||||
this.clienteId = clienteId;
|
||||
}
|
||||
|
||||
public LocalDateTime getFechaEmision() {
|
||||
return fechaEmision;
|
||||
}
|
||||
|
||||
public void setFechaEmision(LocalDateTime fechaEmision) {
|
||||
this.fechaEmision = fechaEmision;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
package com.imprimelibros.erp.facturacion.dto;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
public class FacturaGuardarDto {
|
||||
@Valid private FacturaCabeceraDto cabecera;
|
||||
@Valid private DireccionFacturacionDto direccionFacturacion;
|
||||
|
||||
// getters/setters
|
||||
public FacturaCabeceraDto getCabecera() {
|
||||
return cabecera;
|
||||
}
|
||||
public void setCabecera(FacturaCabeceraDto cabecera) {
|
||||
this.cabecera = cabecera;
|
||||
}
|
||||
public DireccionFacturacionDto getDireccionFacturacion() {
|
||||
return direccionFacturacion;
|
||||
}
|
||||
public void setDireccionFacturacion(DireccionFacturacionDto direccionFacturacion) {
|
||||
this.direccionFacturacion = direccionFacturacion;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,25 +1,21 @@
|
||||
package com.imprimelibros.erp.facturacion.dto;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class FacturaLineaUpsertDto {
|
||||
|
||||
private Long id; // null => nueva línea
|
||||
|
||||
@NotBlank
|
||||
private String descripcion;
|
||||
// Para update puedes mandarlo, pero realmente lo sacamos del path
|
||||
private Long id;
|
||||
|
||||
@NotNull
|
||||
private Integer cantidad;
|
||||
private String descripcion; // HTML
|
||||
|
||||
@NotNull
|
||||
private BigDecimal baseLinea; // base imponible de la línea (sin IVA)
|
||||
private BigDecimal base;
|
||||
|
||||
private boolean aplicaIva4;
|
||||
private boolean aplicaIva21;
|
||||
private BigDecimal iva4;
|
||||
private BigDecimal iva21;
|
||||
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
@ -27,15 +23,12 @@ public class FacturaLineaUpsertDto {
|
||||
public String getDescripcion() { return descripcion; }
|
||||
public void setDescripcion(String descripcion) { this.descripcion = descripcion; }
|
||||
|
||||
public Integer getCantidad() { return cantidad; }
|
||||
public void setCantidad(Integer cantidad) { this.cantidad = cantidad; }
|
||||
public BigDecimal getBase() { return base; }
|
||||
public void setBase(BigDecimal base) { this.base = base; }
|
||||
|
||||
public BigDecimal getBaseLinea() { return baseLinea; }
|
||||
public void setBaseLinea(BigDecimal baseLinea) { this.baseLinea = baseLinea; }
|
||||
public BigDecimal getIva4() { return iva4; }
|
||||
public void setIva4(BigDecimal iva4) { this.iva4 = iva4; }
|
||||
|
||||
public boolean isAplicaIva4() { return aplicaIva4; }
|
||||
public void setAplicaIva4(boolean aplicaIva4) { this.aplicaIva4 = aplicaIva4; }
|
||||
|
||||
public boolean isAplicaIva21() { return aplicaIva21; }
|
||||
public void setAplicaIva21(boolean aplicaIva21) { this.aplicaIva21 = aplicaIva21; }
|
||||
public BigDecimal getIva21() { return iva21; }
|
||||
public void setIva21(BigDecimal iva21) { this.iva21 = iva21; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user