1 32 33 package com.knowgate.hipergate.locale.es; 34 35 import java.math.BigDecimal ; 36 37 import com.knowgate.hipergate.locale.ITaxCalculator; 38 39 44 public class TaxCalculatorEs implements ITaxCalculator { 45 46 49 public static final BigDecimal IPSICeuta = new BigDecimal ("0.03"); 50 53 public static final BigDecimal IPSIMelilla = new BigDecimal ("0.04"); 54 57 public static final BigDecimal IGICCanarias = new BigDecimal ("0.05"); 58 61 public static final BigDecimal IVAPeninsula = new BigDecimal ("0.16"); 62 63 65 76 public static BigDecimal pctTasa (String sCodPost, String sTipo) { 77 if (null==sCodPost) 78 return IVAPeninsula; 79 else if (sCodPost.startsWith("38") || sCodPost.startsWith("35") || 80 sCodPost.toUpperCase().indexOf("TENERIFE")>=0 || 81 sCodPost.equalsIgnoreCase("PALMAS, LAS") || 82 sCodPost.startsWith("LAS PALMAS ") || 83 sCodPost.toUpperCase().indexOf("GRAN CANARIA")>=0) 84 return IGICCanarias; 85 else if (sCodPost.startsWith("51") || sCodPost.equalsIgnoreCase("CEUTA")) 86 return IPSICeuta; 87 else if (sCodPost.startsWith("52") || sCodPost.equalsIgnoreCase("MELILLA")) 88 return IPSIMelilla; 89 else 90 return IVAPeninsula; 91 } 93 95 98 public BigDecimal getTaxPct(String sTaxZone, String sItemType) 99 throws NullPointerException ,IllegalArgumentException { 100 return pctTasa(sTaxZone, sItemType); 101 } 102 103 105 114 public BigDecimal getTax(BigDecimal oBasePrice, String sCodPost, String sItemType) 115 throws NullPointerException ,IllegalArgumentException { 116 return oBasePrice.multiply(pctTasa(sCodPost,sItemType)); 117 } 118 } 119 | Popular Tags |