From 29c552c9ea000d3c65983426e2c8e482796de7c6 Mon Sep 17 00:00:00 2001 From: trifonnt Date: Fri, 4 Dec 2009 20:14:41 +0000 Subject: [PATCH] BF [1733602] - Price List including Tax Error http://sourceforge.net/tracker/index.php?func=detail&aid=1733602&group_id=176962&atid=879332 Handle the case when no Default Tax Rate is specified. --- base/src/org/compiere/model/MTaxCategory.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/base/src/org/compiere/model/MTaxCategory.java b/base/src/org/compiere/model/MTaxCategory.java index 6d0af76435..848b45fee7 100644 --- a/base/src/org/compiere/model/MTaxCategory.java +++ b/base/src/org/compiere/model/MTaxCategory.java @@ -75,15 +75,14 @@ public class MTaxCategory extends X_C_TaxCategory List list = new Query(getCtx(), MTax.Table_Name, whereClause, get_TrxName()) .setParameters(new Object[]{getC_TaxCategory_ID()}) .list(); - if (list.size() == 1) + if (list.size() == 0) { + throw new AdempiereException("NoDefaultTaxRate"); // Error - should be at least one default + } else if (list.size() == 1) { m_tax = list.get(0); - else { - // Error - should only be one default - throw new AdempiereException("TooManyDefaults"); + } else { + throw new AdempiereException("TooManyDefaults"); // Error - should only be one default } - - return m_tax; } // getDefaultTax