public final class JournalUtil
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static double |
calcSalePrice(double lp,
double discountRate)
Calculates sale price i.e listed price less discount
|
static double |
calcTaxAmt(double sp,
double taxRate)
Calculates tax from inctax amount
|
static long |
convertToCents(double dollars) |
static double |
convertToMoney(double val)
Deprecated.
|
static java.util.Hashtable |
generateExTaxAccountsTable(DBObject[] chargeItems)
Generates a hashtable of accounts and total price excluding tax for each account.
|
static java.util.Hashtable |
generateTaxAccountsTable(DBObject[] chargeItems)
Generates a hashtable of accounts and total tax for each account.
|
static double |
round(java.math.BigDecimal value,
java.math.BigDecimal increment,
java.math.RoundingMode roundingMode)
rounding a value
|
static double |
round1Cent(double value) |
static double |
round5Cent(double value) |
static double |
roundUp(double value)
Round up to the closest cent
|
static double |
roundUp5Cent(double value)
round up to the closest 5 cents.
|
public static long convertToCents(double dollars)
@Deprecated public static double convertToMoney(double val)
val - The valuepublic static double calcSalePrice(double lp,
double discountRate)
throws java.lang.ArithmeticException
lp - discountRate - java.lang.ArithmeticExceptionpublic static double calcTaxAmt(double sp,
double taxRate)
throws java.lang.ArithmeticException
sp - taxRate - java.lang.ArithmeticExceptionpublic static java.util.Hashtable generateTaxAccountsTable(DBObject[] chargeItems) throws java.lang.Exception
chargeItems - java.lang.Exception - a serious problempublic static java.util.Hashtable generateExTaxAccountsTable(DBObject[] chargeItems)
chargeItems - public static double roundUp(double value)
value - pricepublic static double roundUp5Cent(double value)
value - pricepublic static double round5Cent(double value)
public static double round1Cent(double value)
public static double round(java.math.BigDecimal value,
java.math.BigDecimal increment,
java.math.RoundingMode roundingMode)
value - number to roundincrement - round to value, for example 0.05 is rounding to the closest 0.05roundingMode - rounding modestSoftware Copyright © 2001-2014 stSoftware All Rights Reserved.