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:
@ -4,14 +4,11 @@ import java.text.Collator;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.imprimelibros.erp.direcciones.DireccionRepository;
|
||||
import com.imprimelibros.erp.paises.Paises;
|
||||
|
||||
@Service
|
||||
public class DireccionService {
|
||||
@ -84,13 +81,15 @@ public class DireccionService {
|
||||
}
|
||||
|
||||
public Boolean checkFreeShipment(Integer cp, String paisCode3) {
|
||||
if(paisCode3.equals("ESP")) {
|
||||
// España peninsular y baleares
|
||||
if(cp != null && cp < 35000 && cp >= 35999) {
|
||||
return true;
|
||||
}
|
||||
if (paisCode3 != null && paisCode3.equals("ESP") && cp != null) {
|
||||
// Excluir Canarias (35xxx y 38xxx), Baleares (07xxx), Ceuta (51xxx), Melilla (52xxx)
|
||||
int provincia = cp / 1000;
|
||||
|
||||
if (provincia != 7 && provincia != 35 && provincia != 38 && provincia != 51 && provincia != 52) {
|
||||
return true; // España peninsular
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user