mirror of
https://git.imnavajas.es/jjimenez/erp-imprimelibros.git
synced 2026-02-09 12:29:13 +00:00
sistema de pedidos pendientes de pago hechos
This commit is contained in:
@ -6,6 +6,8 @@ import com.imprimelibros.erp.direcciones.Direccion.TipoIdentificacionFiscal;
|
||||
import com.imprimelibros.erp.paises.Paises;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Entity
|
||||
@Table(name = "pedidos_direcciones")
|
||||
@ -33,6 +35,9 @@ public class PedidoDireccion {
|
||||
@Column(name = "is_ejemplar_prueba", nullable = false)
|
||||
private boolean ejemplarPrueba = false;
|
||||
|
||||
@Column(name = "email", length = 255)
|
||||
private String email;
|
||||
|
||||
@Column(name = "att", nullable = false, length = 150)
|
||||
private String att;
|
||||
|
||||
@ -74,6 +79,9 @@ public class PedidoDireccion {
|
||||
@Column(name = "identificacion_fiscal", length = 50)
|
||||
private String identificacionFiscal;
|
||||
|
||||
@Column(name = "is_palets", nullable = false)
|
||||
private boolean palets = false;
|
||||
|
||||
@CreationTimestamp
|
||||
@Column(name = "created_at", nullable = false, updatable = false)
|
||||
private LocalDateTime createdAt;
|
||||
@ -124,6 +132,14 @@ public class PedidoDireccion {
|
||||
this.ejemplarPrueba = ejemplarPrueba;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public String getAtt() {
|
||||
return att;
|
||||
}
|
||||
@ -220,6 +236,14 @@ public class PedidoDireccion {
|
||||
this.identificacionFiscal = identificacionFiscal;
|
||||
}
|
||||
|
||||
public boolean isPalets() {
|
||||
return palets;
|
||||
}
|
||||
|
||||
public void setPalets(boolean palets) {
|
||||
this.palets = palets;
|
||||
}
|
||||
|
||||
public LocalDateTime getCreatedAt() {
|
||||
return createdAt;
|
||||
}
|
||||
@ -231,4 +255,54 @@ public class PedidoDireccion {
|
||||
public void setPaisNombre(String paisNombre) {
|
||||
this.paisNombre = paisNombre;
|
||||
}
|
||||
|
||||
|
||||
public Map<String, Object> toSkMap(Double pesoKg) {
|
||||
|
||||
Map<String, Object> direccion = new HashMap<>();
|
||||
direccion.put("cantidad", this.getUnidades());
|
||||
direccion.put("peso", pesoKg);
|
||||
direccion.put("att", this.getAtt());
|
||||
direccion.put("email", this.getEmail());
|
||||
direccion.put("direccion", this.getDireccion());
|
||||
direccion.put("pais_code3", this.getPaisCode3());
|
||||
direccion.put("cp", this.getCp());
|
||||
direccion.put("municipio", this.getCiudad());
|
||||
direccion.put("provincia", this.getProvincia());
|
||||
direccion.put("telefono", this.getTelefono());
|
||||
direccion.put("entregaPieCalle", this.isPalets() ? 1 : 0);
|
||||
direccion.put("is_ferro_prototipo", this.isEjemplarPrueba() ? 1 : 0);
|
||||
direccion.put("num_ferro_prototipo", this.isEjemplarPrueba() ? 1 : 0);
|
||||
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("direccion", direccion);
|
||||
map.put("unidades", this.getUnidades());
|
||||
map.put("entregaPalets", this.isPalets() ? 1 : 0);
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
public static Map<String, Object> toSkMapDepositoLegal() {
|
||||
Map<String, Object> direccion = new HashMap<>();
|
||||
direccion.put("cantidad", 4);
|
||||
direccion.put("peso", 0);
|
||||
direccion.put("att", "Unidades para Depósito Legal (sin envío)");
|
||||
direccion.put("email", "");
|
||||
direccion.put("direccion", "");
|
||||
direccion.put("pais_code3", "esp");
|
||||
direccion.put("cp", "");
|
||||
direccion.put("municipio", "");
|
||||
direccion.put("provincia", "");
|
||||
direccion.put("telefono", "");
|
||||
direccion.put("entregaPieCalle", 0);
|
||||
direccion.put("is_ferro_prototipo", 0);
|
||||
direccion.put("num_ferro_prototipo", 0);
|
||||
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("direccion", direccion);
|
||||
map.put("unidades", 4);
|
||||
map.put("entregaPalets", 0);
|
||||
|
||||
return map;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user