Class BillingAccountWorker
java.lang.Object
org.apache.ofbiz.accounting.payment.BillingAccountWorker
Worker methods for BillingAccounts
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic BigDecimal
availableToCapture
(GenericValue billingAccount) Returns the amount of the billing account which could be captured, which is BillingAccount.accountLimit - net balancecalcBillingAccountBalance
(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 methodstatic 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 accountmakePartyBillingAccountList
(GenericValue userLogin, String currencyUomId, String partyId, Delegator delegator, LocalDispatcher dispatcher)
-
Constructor Details
-
BillingAccountWorker
protected BillingAccountWorker()
-
-
Method Details
-
makePartyBillingAccountList
public static List<Map<String,Object>> makePartyBillingAccountList(GenericValue userLogin, String currencyUomId, String partyId, Delegator delegator, LocalDispatcher dispatcher) throws GeneralException - Throws:
GeneralException
-
getBillingAccountOpenOrders
public static List<GenericValue> getBillingAccountOpenOrders(Delegator delegator, String billingAccountId) throws GenericEntityException Returns list of orders which are currently open against a billing account- Throws:
GenericEntityException
-
getBillingAccountAvailableBalance
public static BigDecimal getBillingAccountAvailableBalance(GenericValue billingAccount) throws GenericEntityException 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- Parameters:
billingAccount
- GenericValue object of the billing account- Returns:
- returns the amount which could be charged to a billing account
- Throws:
GenericEntityException
-
getBillingAccountAvailableBalance
public static BigDecimal getBillingAccountAvailableBalance(Delegator delegator, String billingAccountId) throws GenericEntityException - Throws:
GenericEntityException
-
getBillingAccountNetBalance
public static BigDecimal getBillingAccountNetBalance(Delegator delegator, String billingAccountId) throws GenericEntityException 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. When charging or capturing an invoice to a billing account, use this method- Parameters:
delegator
- the delegatorbillingAccountId
- the billing account id- Returns:
- the amount of the billing account which could be captured
- Throws:
GenericEntityException
-
availableToCapture
public static BigDecimal availableToCapture(GenericValue billingAccount) throws GenericEntityException Returns the amount of the billing account which could be captured, which is BillingAccount.accountLimit - net balance- Parameters:
billingAccount
- GenericValue object of the billing account- Returns:
- the amount of the billing account which could be captured
- Throws:
GenericEntityException
-
calcBillingAccountBalance
-