KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ofbiz > accounting > tax > TaxAuthorityServices


1 /*
2  * $Id: OrderServices.java 6133 2005-11-17 03:56:16Z jaz $
3  *
4  * Copyright (c) 2001-2005 The Open For Business Project - www.ofbiz.org
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a
7  * copy of this software and associated documentation files (the "Software"),
8  * to deal in the Software without restriction, including without limitation
9  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  * and/or sell copies of the Software, and to permit persons to whom the
11  * Software is furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included
14  * in all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
21  * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
22  * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23  */

24 package org.ofbiz.accounting.tax;
25
26 import java.math.BigDecimal JavaDoc;
27 import java.sql.Timestamp JavaDoc;
28 import java.util.ArrayList JavaDoc;
29 import java.util.Iterator JavaDoc;
30 import java.util.List JavaDoc;
31 import java.util.Map JavaDoc;
32 import java.util.Set JavaDoc;
33
34 import javolution.util.FastList;
35 import javolution.util.FastSet;
36
37 import org.ofbiz.base.util.Debug;
38 import org.ofbiz.base.util.UtilDateTime;
39 import org.ofbiz.base.util.UtilMisc;
40 import org.ofbiz.base.util.UtilValidate;
41 import org.ofbiz.base.util.UtilNumber;
42 import org.ofbiz.common.geo.GeoWorker;
43 import org.ofbiz.entity.GenericDelegator;
44 import org.ofbiz.entity.GenericEntityException;
45 import org.ofbiz.entity.GenericValue;
46 import org.ofbiz.entity.condition.EntityCondition;
47 import org.ofbiz.entity.condition.EntityConditionList;
48 import org.ofbiz.entity.condition.EntityExpr;
49 import org.ofbiz.entity.condition.EntityOperator;
50 import org.ofbiz.entity.util.EntityUtil;
51 import org.ofbiz.service.DispatchContext;
52 import org.ofbiz.service.ServiceUtil;
53
54 /**
55  * Tax Authority tax calculation and other misc services
56  *
57  * @author <a HREF="mailto:jonesde@ofbiz.org">David E. Jones</a>
58  * @version $Rev: 7175 $
59  * @since 2.0
60  */

61
62 public class TaxAuthorityServices {
63
64     public static final String JavaDoc module = TaxAuthorityServices.class.getName();
65     public static final BigDecimal JavaDoc ZERO_BASE = new BigDecimal JavaDoc("0.000");
66     public static final BigDecimal JavaDoc ONE_BASE = new BigDecimal JavaDoc("1.000");
67     public static final BigDecimal JavaDoc PERCENT_SCALE = new BigDecimal JavaDoc("100.000");
68
69     public static Map JavaDoc rateProductTaxCalcForDisplay(DispatchContext dctx, Map JavaDoc context) {
70         GenericDelegator delegator = dctx.getDelegator();
71         String JavaDoc productStoreId = (String JavaDoc) context.get("productStoreId");
72         String JavaDoc billToPartyId = (String JavaDoc) context.get("billToPartyId");
73         String JavaDoc productId = (String JavaDoc) context.get("productId");
74         BigDecimal JavaDoc quantity = (BigDecimal JavaDoc) context.get("quantity");
75         BigDecimal JavaDoc basePrice = (BigDecimal JavaDoc) context.get("basePrice");
76         BigDecimal JavaDoc shippingPrice = (BigDecimal JavaDoc) context.get("shippingPrice");
77
78         if (quantity == null) quantity = ONE_BASE;
79         BigDecimal JavaDoc amount = basePrice.multiply(quantity);
80         int salestaxFinalDecimals=UtilNumber.getBigDecimalScale("salestax.final.decimals");
81         int salestaxCalcDecimals=UtilNumber.getBigDecimalScale("salestax.calc.decimals");
82         int salestaxRounding=UtilNumber.getBigDecimalRoundingMode("salestax.rounding");
83         
84         BigDecimal JavaDoc taxTotal = ZERO_BASE;
85         BigDecimal JavaDoc taxPercentage = ZERO_BASE;
86         BigDecimal JavaDoc priceWithTax = basePrice;
87         if (shippingPrice != null) priceWithTax = priceWithTax.add(shippingPrice);
88
89         try {
90             GenericValue product = delegator.findByPrimaryKeyCache("Product", UtilMisc.toMap("productId", productId));
91             GenericValue productStore = delegator.findByPrimaryKeyCache("ProductStore", UtilMisc.toMap("productStoreId", productStoreId));
92             if (productStore == null) {
93                 throw new IllegalArgumentException JavaDoc("Could not find ProductStore with ID [" + productStoreId + "] for tax calculation");
94             }
95             
96             if ("Y".equals(productStore.getString("showPricesWithVatTax"))) {
97                 Set JavaDoc taxAuthoritySet = FastSet.newInstance();
98                 if (productStore.get("vatTaxAuthPartyId") == null) {
99                     List JavaDoc taxAuthorityRawList = delegator.findByConditionCache("TaxAuthority", new EntityExpr("taxAuthGeoId", EntityOperator.EQUALS, productStore.get("vatTaxAuthGeoId")), null, null);
100                     taxAuthoritySet.addAll(taxAuthorityRawList);
101                 } else {
102                     GenericValue taxAuthority = delegator.findByPrimaryKeyCache("TaxAuthority", UtilMisc.toMap("taxAuthGeoId", productStore.get("vatTaxAuthGeoId"), "taxAuthPartyId", productStore.get("vatTaxAuthPartyId")));
103                     taxAuthoritySet.add(taxAuthority);
104                 }
105                 
106                 if (taxAuthoritySet.size() == 0) {
107                     throw new IllegalArgumentException JavaDoc("Could not find any Tax Authories for store with ID [" + productStoreId + "] for tax calculation; the store settings may need to be corrected.");
108                 }
109                 
110                 List JavaDoc taxAdustmentList = getTaxAdjustments(delegator, product, productStore, billToPartyId, taxAuthoritySet, basePrice, amount, shippingPrice);
111                 if (taxAdustmentList.size() == 0) {
112                     // this is something that happens every so often for different products and such, so don't blow up on it...
113
Debug.logWarning("Could not find any Tax Authories Rate Rules for store with ID [" + productStoreId + "], productId [" + productId + "], basePrice [" + basePrice + "], amount [" + amount + "], for tax calculation; the store settings may need to be corrected.", module);
114                 }
115
116                 // add up amounts from adjustments (amount OR exemptAmount, sourcePercentage)
117
Iterator JavaDoc taxAdustmentIter = taxAdustmentList.iterator();
118                 while (taxAdustmentIter.hasNext()) {
119                     GenericValue taxAdjustment = (GenericValue) taxAdustmentIter.next();
120                     taxPercentage = taxPercentage.add(taxAdjustment.getBigDecimal("sourcePercentage"));
121                     BigDecimal JavaDoc adjAmount = taxAdjustment.getBigDecimal("amount");
122                     taxTotal = taxTotal.add(adjAmount);
123                     priceWithTax = priceWithTax.add(adjAmount.divide(quantity,salestaxCalcDecimals,salestaxRounding));
124                     Debug.logInfo("For productId [" + productId + "] added [" + adjAmount.divide(quantity,salestaxCalcDecimals,salestaxRounding) + "] of tax to price for geoId [" + taxAdjustment.getString("taxAuthGeoId") + "], new price is [" + priceWithTax + "]", module);
125                 }
126             }
127         } catch (GenericEntityException e) {
128             String JavaDoc errMsg = "Data error getting tax settings: " + e.toString();
129             Debug.logError(e, errMsg, module);
130             return ServiceUtil.returnError(errMsg);
131         }
132         
133         // round to 2 decimal places for display/etc
134
taxTotal.setScale(salestaxFinalDecimals, salestaxRounding);
135         priceWithTax.setScale(salestaxFinalDecimals, salestaxRounding);
136         
137         Map JavaDoc result = ServiceUtil.returnSuccess();
138         result.put("taxTotal", taxTotal);
139         result.put("taxPercentage", taxPercentage);
140         result.put("priceWithTax", priceWithTax);
141         return result;
142     }
143     
144     public static Map JavaDoc rateProductTaxCalc(DispatchContext dctx, Map JavaDoc context) {
145         GenericDelegator delegator = dctx.getDelegator();
146         String JavaDoc productStoreId = (String JavaDoc) context.get("productStoreId");
147         String JavaDoc billToPartyId = (String JavaDoc) context.get("billToPartyId");
148         List JavaDoc itemProductList = (List JavaDoc) context.get("itemProductList");
149         List JavaDoc itemAmountList = (List JavaDoc) context.get("itemAmountList");
150         List JavaDoc itemPriceList = (List JavaDoc) context.get("itemPriceList");
151         List JavaDoc itemShippingList = (List JavaDoc) context.get("itemShippingList");
152         BigDecimal JavaDoc orderShippingAmount = (BigDecimal JavaDoc) context.get("orderShippingAmount");
153         GenericValue shippingAddress = (GenericValue) context.get("shippingAddress");
154
155         // without knowing the TaxAuthority parties, just find all TaxAuthories for the set of IDs...
156
Set JavaDoc taxAuthoritySet = FastSet.newInstance();
157         GenericValue productStore = null;
158         try {
159             Set JavaDoc geoIdSet = FastSet.newInstance();
160             if (shippingAddress != null) {
161                 if (shippingAddress.getString("countryGeoId") != null) {
162                     geoIdSet.add(shippingAddress.getString("countryGeoId"));
163                 }
164                 if (shippingAddress.getString("stateProvinceGeoId") != null) {
165                     geoIdSet.add(shippingAddress.getString("stateProvinceGeoId"));
166                 }
167             }
168             
169             if (geoIdSet.size() == 0) {
170                 return ServiceUtil.returnError("The address(es) used for tax calculation did not have State/Province or Country values set, so we cannot determine the taxes to charge.");
171             }
172             
173             // get the most granular, or all available, geoIds and then find parents by GeoAssoc with geoAssocTypeId="REGIONS" and geoIdTo=<granular geoId> and find the GeoAssoc.geoId
174
geoIdSet = GeoWorker.expandGeoRegionDeep(geoIdSet, delegator);
175
176             List JavaDoc taxAuthorityRawList = delegator.findByConditionCache("TaxAuthority", new EntityExpr("taxAuthGeoId", EntityOperator.IN, geoIdSet), null, null);
177             taxAuthoritySet.addAll(taxAuthorityRawList);
178
179             productStore = delegator.findByPrimaryKey("ProductStore", UtilMisc.toMap("productStoreId", productStoreId));
180         } catch (GenericEntityException e) {
181             String JavaDoc errMsg = "Data error getting tax settings: " + e.toString();
182             Debug.logError(e, errMsg, module);
183             return ServiceUtil.returnError(errMsg);
184         }
185         
186         if (productStore == null) {
187             throw new IllegalArgumentException JavaDoc("Could not find ProductStore with ID [" + productStoreId + "] for tax calculation");
188         }
189         
190         // Setup the return lists.
191
List JavaDoc orderAdjustments = FastList.newInstance();
192         List JavaDoc itemAdjustments = FastList.newInstance();
193
194         // Loop through the products; get the taxCategory; and lookup each in the cache.
195
for (int i = 0; i < itemProductList.size(); i++) {
196             GenericValue product = (GenericValue) itemProductList.get(i);
197             BigDecimal JavaDoc itemAmount = (BigDecimal JavaDoc) itemAmountList.get(i);
198             BigDecimal JavaDoc itemPrice = (BigDecimal JavaDoc) itemPriceList.get(i);
199             BigDecimal JavaDoc shippingAmount = (BigDecimal JavaDoc) itemShippingList.get(i);
200             List JavaDoc taxList = null;
201             if (shippingAddress != null) {
202                 taxList = getTaxAdjustments(delegator, product, productStore, billToPartyId, taxAuthoritySet, itemPrice, itemAmount, shippingAmount);
203             }
204             // this is an add and not an addAll because we want a List of Lists of GenericValues, one List of Adjustments per item
205
itemAdjustments.add(taxList);
206         }
207         if (orderShippingAmount.doubleValue() > 0) {
208             List JavaDoc taxList = getTaxAdjustments(delegator, null, productStore, billToPartyId, taxAuthoritySet, ZERO_BASE, ZERO_BASE, orderShippingAmount);
209             orderAdjustments.addAll(taxList);
210         }
211
212         Map JavaDoc result = ServiceUtil.returnSuccess();
213         result.put("orderAdjustments", orderAdjustments);
214         result.put("itemAdjustments", itemAdjustments);
215
216         return result;
217     }
218
219     private static List JavaDoc getTaxAdjustments(GenericDelegator delegator, GenericValue product, GenericValue productStore, String JavaDoc billToPartyId, Set JavaDoc taxAuthoritySet, BigDecimal JavaDoc itemPrice, BigDecimal JavaDoc itemAmount, BigDecimal JavaDoc shippingAmount) {
220         Timestamp JavaDoc nowTimestamp = UtilDateTime.nowTimestamp();
221         List JavaDoc adjustments = FastList.newInstance();
222
223         String JavaDoc payToPartyId = productStore.getString("payToPartyId");
224
225         // store expr
226
EntityCondition storeCond = new EntityExpr("productStoreId", EntityOperator.EQUALS, productStore.get("productStoreId"));
227
228         // build the TaxAuthority expressions (taxAuthGeoId, taxAuthPartyId)
229
List JavaDoc taxAuthCondOrList = FastList.newInstance();
230         // start with the _NA_ TaxAuthority...
231
taxAuthCondOrList.add(new EntityExpr(
232                 new EntityExpr("taxAuthPartyId", EntityOperator.EQUALS, "_NA_"),
233                 EntityOperator.AND,
234                 new EntityExpr("taxAuthGeoId", EntityOperator.EQUALS, "_NA_")));
235         
236         Iterator JavaDoc taxAuthorityIter = taxAuthoritySet.iterator();
237         while (taxAuthorityIter.hasNext()) {
238             GenericValue taxAuthority = (GenericValue) taxAuthorityIter.next();
239             EntityCondition taxAuthCond = new EntityExpr(
240                     new EntityExpr("taxAuthPartyId", EntityOperator.EQUALS, taxAuthority.getString("taxAuthPartyId")),
241                     EntityOperator.AND,
242                     new EntityExpr("taxAuthGeoId", EntityOperator.EQUALS, taxAuthority.getString("taxAuthGeoId")));
243             taxAuthCondOrList.add(taxAuthCond);
244         }
245         EntityCondition taxAuthoritiesCond = new EntityConditionList(taxAuthCondOrList, EntityOperator.OR);
246
247         try {
248             EntityCondition productCategoryCond = null;
249             if (product != null) {
250                 // find the tax categories associated with the product and filter by those, with an IN clause or some such
251
// question: get all categories, or just a special type? for now let's do all categories...
252
Set JavaDoc productCategoryIdSet = FastSet.newInstance();
253                 List JavaDoc pcmList = delegator.findByAndCache("ProductCategoryMember", UtilMisc.toMap("productId", product.get("productId")));
254                 pcmList = EntityUtil.filterByDate(pcmList, true);
255                 Iterator JavaDoc pcmIter = pcmList.iterator();
256                 while (pcmIter.hasNext()) {
257                     GenericValue pcm = (GenericValue) pcmIter.next();
258                     productCategoryIdSet.add(pcm.get("productCategoryId"));
259                 }
260                 
261                 if (productCategoryIdSet.size() == 0) {
262                     productCategoryCond = new EntityExpr("productCategoryId", EntityOperator.EQUALS, null);
263                 } else {
264                     productCategoryCond = new EntityExpr(
265                             new EntityExpr("productCategoryId", EntityOperator.EQUALS, null),
266                             EntityOperator.OR,
267                             new EntityExpr("productCategoryId", EntityOperator.IN, productCategoryIdSet));
268                 }
269             } else {
270                 productCategoryCond = new EntityExpr("productCategoryId", EntityOperator.EQUALS, null);
271             }
272
273             // build the main condition clause
274
List JavaDoc mainExprs = UtilMisc.toList(storeCond, taxAuthoritiesCond, productCategoryCond);
275             mainExprs.add(new EntityExpr(new EntityExpr("minItemPrice", EntityOperator.EQUALS, null), EntityOperator.OR, new EntityExpr("minItemPrice", EntityOperator.LESS_THAN_EQUAL_TO, itemPrice)));
276             mainExprs.add(new EntityExpr(new EntityExpr("minPurchase", EntityOperator.EQUALS, null), EntityOperator.OR, new EntityExpr("minPurchase", EntityOperator.LESS_THAN_EQUAL_TO, itemAmount)));
277             EntityCondition mainCondition = new EntityConditionList(mainExprs, EntityOperator.AND);
278
279             // create the orderby clause
280
List JavaDoc orderList = UtilMisc.toList("minItemPrice", "minPurchase", "fromDate");
281
282             // finally ready... do the rate query
283
List JavaDoc lookupList = delegator.findByCondition("TaxAuthorityRateProduct", mainCondition, null, orderList);
284             List JavaDoc filteredList = EntityUtil.filterByDate(lookupList, true);
285
286             if (filteredList.size() == 0) {
287                 Debug.logWarning("In TaxAuthority Product Rate no records were found for condition:" + mainCondition.toString(), module);
288                 return adjustments;
289             }
290
291             // find the right entry(s) based on purchase amount
292
Iterator JavaDoc flIt = filteredList.iterator();
293             while (flIt.hasNext()) {
294                 GenericValue taxAuthorityRateProduct = (GenericValue) flIt.next();
295
296                 BigDecimal JavaDoc taxRate = taxAuthorityRateProduct.get("taxPercentage") != null ? taxAuthorityRateProduct.getBigDecimal("taxPercentage") : ZERO_BASE;
297                 BigDecimal JavaDoc taxable = ZERO_BASE;
298
299                 if (product != null && (product.get("taxable") == null || (product.get("taxable") != null && product.getBoolean("taxable").booleanValue()))) {
300                     taxable = taxable.add(itemAmount);
301                 }
302                 if (taxAuthorityRateProduct != null && (taxAuthorityRateProduct.get("taxShipping") == null || (taxAuthorityRateProduct.get("taxShipping") != null && taxAuthorityRateProduct.getBoolean("taxShipping").booleanValue()))) {
303                     taxable = taxable.add(shippingAmount);
304                 }
305                 
306                 if (taxable.doubleValue() == 0) {
307                     // this should make it less confusing if the taxable flag on the product is not Y/true, and there is no shipping and such
308
continue;
309                 }
310
311                 // taxRate is in percentage, so needs to be divided by 100
312
BigDecimal JavaDoc taxAmount = (taxable.multiply(taxRate)).divide(PERCENT_SCALE, 3, BigDecimal.ROUND_CEILING);
313
314                 String JavaDoc taxAuthGeoId = taxAuthorityRateProduct.getString("taxAuthGeoId");
315                 String JavaDoc taxAuthPartyId = taxAuthorityRateProduct.getString("taxAuthPartyId");
316
317                 // get glAccountId from TaxAuthorityGlAccount entity using the ProductStore.payToPartyId as the organizationPartyId
318
GenericValue taxAuthorityGlAccount = delegator.findByPrimaryKey("TaxAuthorityGlAccount", UtilMisc.toMap("taxAuthPartyId", taxAuthPartyId, "taxAuthGeoId", taxAuthGeoId, "organizationPartyId", payToPartyId));
319                 String JavaDoc taxAuthGlAccountId = null;
320                 if (taxAuthorityGlAccount != null) {
321                     taxAuthGlAccountId = taxAuthorityGlAccount.getString("glAccountId");
322                 } else {
323                     // TODO: what to do if no TaxAuthorityGlAccount found? Use some default, or is that done elsewhere later on?
324
}
325
326                 GenericValue adjValue = delegator.makeValue("OrderAdjustment", null);
327                 adjValue.set("taxAuthorityRateSeqId", taxAuthorityRateProduct.getString("taxAuthorityRateSeqId"));
328                 adjValue.set("amount", taxAmount);
329                 adjValue.set("sourcePercentage", taxRate);
330                 adjValue.set("orderAdjustmentTypeId", "SALES_TAX");
331                 // the primary Geo should be the main jurisdiction that the tax is for, and the secondary would just be to define a parent or wrapping jurisdiction of the primary
332
adjValue.set("primaryGeoId", taxAuthGeoId);
333                 adjValue.set("comments", taxAuthorityRateProduct.getString("description"));
334                 if (taxAuthPartyId != null) adjValue.set("taxAuthPartyId", taxAuthPartyId);
335                 if (taxAuthGlAccountId != null) adjValue.set("overrideGlAccountId", taxAuthGlAccountId);
336                 if (taxAuthGeoId != null) adjValue.set("taxAuthGeoId", taxAuthGeoId);
337
338                 // check to see if this party has a tax ID for this, and if the party is tax exempt in the primary (most-local) jurisdiction
339
if (UtilValidate.isNotEmpty(billToPartyId) && taxAuthGeoId != null) {
340                     // see if partyId is a member of any groups , if so honor their tax exemptions
341
// look for PartyRelationship with partyRelationshipTypeId=GROUP_ROLLUP, the partyIdTo is the group member, so the partyIdFrom is the groupPartyId
342
Set JavaDoc billToPartyIdSet = FastSet.newInstance();
343                     billToPartyIdSet.add(billToPartyId);
344                     List JavaDoc partyRelationshipList = EntityUtil.filterByDate(delegator.findByAndCache("PartyRelationship", UtilMisc.toMap("partyIdTo", billToPartyId, "partyRelationshipTypeId", "GROUP_ROLLUP")), true);
345                     Iterator JavaDoc partyRelationshipIter = partyRelationshipList.iterator();
346                     while (partyRelationshipIter.hasNext()) {
347                         GenericValue partyRelationship = (GenericValue) partyRelationshipIter.next();
348                         billToPartyIdSet.add(partyRelationship.get("partyIdFrom"));
349                     }
350
351                     List JavaDoc ptiConditionList = UtilMisc.toList(
352                             new EntityExpr("partyId", EntityOperator.IN, billToPartyIdSet),
353                             new EntityExpr("taxAuthGeoId", EntityOperator.EQUALS, taxAuthGeoId),
354                             new EntityExpr("taxAuthPartyId", EntityOperator.EQUALS, taxAuthPartyId));
355                     ptiConditionList.add(new EntityExpr("fromDate", EntityOperator.LESS_THAN_EQUAL_TO, nowTimestamp));
356                     ptiConditionList.add(new EntityExpr(new EntityExpr("thruDate", EntityOperator.EQUALS, null), EntityOperator.OR, new EntityExpr("thruDate", EntityOperator.GREATER_THAN, nowTimestamp)));
357                     EntityCondition ptiCondition = new EntityConditionList(ptiConditionList, EntityOperator.AND);
358                     // sort by -fromDate to get the newest (largest) first, just in case there is more than one, we only want the most recent valid one, should only be one per jurisdiction...
359
List JavaDoc partyTaxInfos = delegator.findByCondition("PartyTaxAuthInfo", ptiCondition, null, UtilMisc.toList("-fromDate"));
360                     if (partyTaxInfos.size() > 0) {
361                         GenericValue partyTaxInfo = (GenericValue) partyTaxInfos.get(0);
362                         adjValue.set("customerReferenceId", partyTaxInfo.get("partyTaxId"));
363                         if ("Y".equals(partyTaxInfo.getString("isExempt"))) {
364                             adjValue.set("amount", new Double JavaDoc(0));
365                             adjValue.set("exemptAmount", taxAmount);
366                         }
367                     }
368                 } else {
369                     Debug.logInfo("NOTE: A tax calculation was done without a billToPartyId or taxAuthGeoId, so no tax exemptions or tax IDs considered; billToPartyId=[" + billToPartyId + "] taxAuthGeoId=[" + taxAuthGeoId + "]", module);
370                 }
371
372                 adjustments.add(adjValue);
373             }
374         } catch (GenericEntityException e) {
375             Debug.logError(e, "Problems looking up tax rates", module);
376             return new ArrayList JavaDoc();
377         }
378
379         return adjustments;
380     }
381 }
382
Popular Tags