public class BillingAccountWorker extends Object
Modifier and Type | Class and Description |
---|---|
protected static class |
BillingAccountWorker.BillingAccountComparator |
Modifier and Type | Field and Description |
---|---|
static int |
decimals |
static String |
module |
static String |
resourceError |
static RoundingMode |
rounding |
static BigDecimal |
ZERO |
Constructor and Description |
---|
BillingAccountWorker() |
Modifier and Type | Method and Description |
---|---|
static BigDecimal |
availableToCapture(GenericValue billingAccount)
Returns the amount of the billing account which could be captured, which is BillingAccount.accountLimit - net balance
|
static Map<String,Object> |
calcBillingAccountBalance(DispatchContext dctx,
Map<String,? extends Object> context) |
static BigDecimal |
getBillingAccountAvailableBalance(Delegator delegator,
String billingAccountId) |
static BigDecimal |
getBillingAccountAvailableBalance(GenericValue billingAccount)
Returns the amount which could be charged to a billing account, which is defined as the accountLimit minus account balance and minus the balance of outstanding orders
When trying to figure out how much of a billing account can be used to pay for an outstanding order, use this method
|
static BigDecimal |
getBillingAccountNetBalance(Delegator delegator,
String billingAccountId)
Calculates the net balance of a billing account, which is sum of all amounts applied to invoices minus sum of all amounts applied from payments.
|
static List<GenericValue> |
getBillingAccountOpenOrders(Delegator delegator,
String billingAccountId)
Returns list of orders which are currently open against a billing account
|
static List<Map<String,Object>> |
makePartyBillingAccountList(GenericValue userLogin,
String currencyUomId,
String partyId,
Delegator delegator,
LocalDispatcher dispatcher) |
public static final String module
public static final String resourceError
public static final int decimals
public static final RoundingMode rounding
public static final BigDecimal ZERO
public static List<Map<String,Object>> makePartyBillingAccountList(GenericValue userLogin, String currencyUomId, String partyId, Delegator delegator, LocalDispatcher dispatcher) throws GeneralException
GeneralException
public static List<GenericValue> getBillingAccountOpenOrders(Delegator delegator, String billingAccountId) throws GenericEntityException
GenericEntityException
public static BigDecimal getBillingAccountAvailableBalance(GenericValue billingAccount) throws GenericEntityException
billingAccount
- GenericValue object of the billing accountGenericEntityException
public static BigDecimal getBillingAccountAvailableBalance(Delegator delegator, String billingAccountId) throws GenericEntityException
GenericEntityException
public static BigDecimal getBillingAccountNetBalance(Delegator delegator, String billingAccountId) throws GenericEntityException
delegator
- the delegatorbillingAccountId
- the billing account idGenericEntityException
public static BigDecimal availableToCapture(GenericValue billingAccount) throws GenericEntityException
billingAccount
- GenericValue object of the billing accountGenericEntityException