|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.broadleafcommerce.core.workflow.BaseActivity
org.broadleafcommerce.core.pricing.service.workflow.FulfillmentItemPricingActivity
public class FulfillmentItemPricingActivity
Called during the pricing workflow to set each item's merchandise total and taxable total
| Constructor Summary | |
|---|---|
FulfillmentItemPricingActivity()
|
|
| Method Summary | |
|---|---|
long |
applyDifferenceToAmount(FulfillmentGroupItem fgItem,
long numApplicationsNeeded,
Money unitAmount)
|
long |
applyDifferenceToProratedAdj(FulfillmentGroupItem fgItem,
long numApplicationsNeeded,
Money unitAmount)
|
long |
applyTaxDifference(FulfillmentGroupItem fgItem,
long numApplicationsNeeded,
Money unitAmount)
|
protected Money |
calculateTotalPriceForAllFulfillmentItems(Order order)
Returns the total price for all fulfillment items. |
long |
countNumberOfUnits(Money difference)
|
protected Money |
distributeOrderSavingsToItems(Order order,
BigDecimal totalAllItems)
Distributes the order adjustments (if any) to the individual fulfillment group items. |
ProcessContext |
execute(ProcessContext context)
Called by the encompassing processor to activate the execution of the Activity |
protected void |
fixItemTotalRoundingIssues(Order order,
Map<OrderItem,List<FulfillmentGroupItem>> partialOrderItemMap)
Because an item may have multiple price details that don't round cleanly, we may have pennies left over that need to be distributed. |
protected void |
fixOrderSavingsRoundingIssues(Order order,
Money totalOrderAdjustmentDistributed)
It is possible due to rounding that the order adjustments do not match the total. |
protected BroadleafCurrency |
getCurrency(FulfillmentGroup fg)
|
protected Money |
getOrderSavingsToDistribute(Order order)
Returns the order adjustment value or zero if none exists |
Money |
getUnitAmount(Money difference)
Returns the unit amount (e.g. |
protected void |
populateItemTotalAmount(Order order,
Map<OrderItem,List<FulfillmentGroupItem>> partialOrderItemMap)
Sets the fulfillment amount which includes the relative portion of the total price for the corresponding order item. |
protected Money |
sumItemAmount(List<FulfillmentGroupItem> items,
Order order)
|
protected Money |
sumTaxAmount(List<FulfillmentGroupItem> items,
Order order)
|
protected void |
updateTaxableAmountsOnItems(Order order)
Returns the total price for all fulfillment items. |
| Methods inherited from class org.broadleafcommerce.core.workflow.BaseActivity |
|---|
getAutomaticallyRegisterRollbackHandler, getBeanName, getErrorHandler, getRollbackHandler, getRollbackRegion, getStateConfiguration, setAutomaticallyRegisterRollbackHandler, setBeanName, setErrorHandler, setRollbackHandler, setRollbackRegion, setStateConfiguration |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FulfillmentItemPricingActivity()
| Method Detail |
|---|
protected BroadleafCurrency getCurrency(FulfillmentGroup fg)
protected Money getOrderSavingsToDistribute(Order order)
order -
public ProcessContext execute(ProcessContext context)
throws Exception
Activity
context - - process context for this workflow
Exception
protected void populateItemTotalAmount(Order order,
Map<OrderItem,List<FulfillmentGroupItem>> partialOrderItemMap)
order - partialOrderItemMap -
protected void fixItemTotalRoundingIssues(Order order,
Map<OrderItem,List<FulfillmentGroupItem>> partialOrderItemMap)
order - partialOrderItemMap - protected Money calculateTotalPriceForAllFulfillmentItems(Order order)
order -
protected Money distributeOrderSavingsToItems(Order order,
BigDecimal totalAllItems)
order - totalAllItems -
protected void fixOrderSavingsRoundingIssues(Order order,
Money totalOrderAdjustmentDistributed)
order - partialOrderItemMap - protected void updateTaxableAmountsOnItems(Order order)
order -
protected Money sumItemAmount(List<FulfillmentGroupItem> items,
Order order)
protected Money sumTaxAmount(List<FulfillmentGroupItem> items,
Order order)
public long countNumberOfUnits(Money difference)
public Money getUnitAmount(Money difference)
currency -
public long applyDifferenceToAmount(FulfillmentGroupItem fgItem,
long numApplicationsNeeded,
Money unitAmount)
public long applyDifferenceToProratedAdj(FulfillmentGroupItem fgItem,
long numApplicationsNeeded,
Money unitAmount)
public long applyTaxDifference(FulfillmentGroupItem fgItem,
long numApplicationsNeeded,
Money unitAmount)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||