mirror of
https://git.imnavajas.es/jjimenez/erp-imprimelibros.git
synced 2026-01-13 08:58:48 +00:00
falta actualizar bien el resumen
This commit is contained in:
@ -1,7 +1,9 @@
|
||||
package com.imprimelibros.erp.cart;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Locale;
|
||||
|
||||
import org.springframework.context.MessageSource;
|
||||
import com.imprimelibros.erp.cart.dto.DireccionCardDTO;
|
||||
import com.imprimelibros.erp.direcciones.Direccion;
|
||||
import com.imprimelibros.erp.presupuesto.dto.Presupuesto;
|
||||
|
||||
@ -33,28 +35,67 @@ public class CartDireccion {
|
||||
@Column(name = "isPalets", nullable = false)
|
||||
private Boolean isPalets;
|
||||
|
||||
@Column(name = "base", precision = 12, scale = 2)
|
||||
private BigDecimal base;
|
||||
|
||||
// --- Getters & Setters ---
|
||||
public Long getId() { return id; }
|
||||
public void setId(Long id) { this.id = id; }
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public Cart getCart() { return cart; }
|
||||
public void setCart(Cart cart) { this.cart = cart; }
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Direccion getDireccion() { return direccion; }
|
||||
public void setDireccion(Direccion direccion) { this.direccion = direccion; }
|
||||
public Cart getCart() {
|
||||
return cart;
|
||||
}
|
||||
|
||||
public Presupuesto getPresupuesto() { return presupuesto; }
|
||||
public void setPresupuesto(Presupuesto presupuesto) { this.presupuesto = presupuesto; }
|
||||
public void setCart(Cart cart) {
|
||||
this.cart = cart;
|
||||
}
|
||||
|
||||
public Integer getUnidades() { return unidades; }
|
||||
public void setUnidades(Integer unidades) { this.unidades = unidades; }
|
||||
public Direccion getDireccion() {
|
||||
return direccion;
|
||||
}
|
||||
|
||||
public BigDecimal getBase() { return base; }
|
||||
public void setBase(BigDecimal base) { this.base = base; }
|
||||
public void setDireccion(Direccion direccion) {
|
||||
this.direccion = direccion;
|
||||
}
|
||||
|
||||
public Presupuesto getPresupuesto() {
|
||||
return presupuesto;
|
||||
}
|
||||
|
||||
public void setPresupuesto(Presupuesto presupuesto) {
|
||||
this.presupuesto = presupuesto;
|
||||
}
|
||||
|
||||
public Integer getUnidades() {
|
||||
return unidades;
|
||||
}
|
||||
|
||||
public void setUnidades(Integer unidades) {
|
||||
this.unidades = unidades;
|
||||
}
|
||||
|
||||
public Boolean getIsPalets() {
|
||||
return isPalets;
|
||||
}
|
||||
|
||||
public void setIsPalets(Boolean isPalets) {
|
||||
this.isPalets = isPalets;
|
||||
}
|
||||
|
||||
public DireccionCardDTO toDireccionCard(MessageSource messageSource, Locale locale) {
|
||||
|
||||
String pais = messageSource.getMessage("paises." + this.direccion.getPais().getKeyword(), null,
|
||||
this.direccion.getPais().getKeyword(), locale);
|
||||
|
||||
return new DireccionCardDTO(
|
||||
this.direccion,
|
||||
this.presupuesto != null ? this.presupuesto.getId() : null,
|
||||
this.unidades,
|
||||
this.isPalets,
|
||||
pais
|
||||
);
|
||||
}
|
||||
|
||||
public Boolean getIsPalets() { return isPalets; }
|
||||
public void setIsPalets(Boolean isPalets) { this.isPalets = isPalets; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user