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.
This commit is contained in:
parent
bc25c66b3e
commit
29c552c9ea
|
@ -75,15 +75,14 @@ public class MTaxCategory extends X_C_TaxCategory
|
||||||
List<MTax> list = new Query(getCtx(), MTax.Table_Name, whereClause, get_TrxName())
|
List<MTax> list = new Query(getCtx(), MTax.Table_Name, whereClause, get_TrxName())
|
||||||
.setParameters(new Object[]{getC_TaxCategory_ID()})
|
.setParameters(new Object[]{getC_TaxCategory_ID()})
|
||||||
.list();
|
.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);
|
m_tax = list.get(0);
|
||||||
else {
|
} else {
|
||||||
// Error - should only be one default
|
throw new AdempiereException("TooManyDefaults"); // Error - should only be one default
|
||||||
throw new AdempiereException("TooManyDefaults");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return m_tax;
|
return m_tax;
|
||||||
} // getDefaultTax
|
} // getDefaultTax
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue