public class TaxUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static org.apache.commons.logging.Log |
log
the log
|
static int |
TAX_ON_TOTAL
Quantity rule
|
static int |
TAX_PER_ITEM
Quantity rule
|
Constructor and Description |
---|
TaxUtils() |
Modifier and Type | Method and Description |
---|---|
static java.math.BigDecimal |
getTaxAmount(java.math.BigDecimal taxRate,
java.math.BigDecimal cost,
int quantity,
int scale,
int rule)
Calculates the tax for one or more items
|
protected static org.apache.commons.logging.Log log
public static final int TAX_ON_TOTAL
public static final int TAX_PER_ITEM
public static java.math.BigDecimal getTaxAmount(java.math.BigDecimal taxRate, java.math.BigDecimal cost, int quantity, int scale, int rule)
taxRate
- tax rate as a percentagecost
- cost of a single itemquantity
- Number of itemsscale
- This is the scale used for the precision of the calculations. It is contained in
the ADMIN_CURRENCY_DECIMAL_PLACES configuration variable.rule
- The rule to be used which should be either TAX_PER_ITEM or TAX_ON_TOTAL.
Copyright © 2018 DS Data Systems UK Ltd.