public class FulfillmentItemPricingActivity extends BaseActivity<ProcessContext<Order>>
automaticallyRegisterRollbackHandler, beanName, errorHandler, order, rollbackHandler, rollbackRegion, stateConfiguration| Constructor and Description |
|---|
FulfillmentItemPricingActivity() |
| Modifier and Type | Method and Description |
|---|---|
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<Order> |
execute(ProcessContext<Order> 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.
|
getAutomaticallyRegisterRollbackHandler, getBeanName, getErrorHandler, getOrder, getRollbackHandler, getRollbackRegion, getStateConfiguration, setAutomaticallyRegisterRollbackHandler, setBeanName, setErrorHandler, setOrder, setRollbackHandler, setRollbackRegion, setStateConfiguration, shouldExecuteprotected BroadleafCurrency getCurrency(FulfillmentGroup fg)
protected Money getOrderSavingsToDistribute(Order order)
order - public ProcessContext<Order> execute(ProcessContext<Order> context) throws Exception
Activitycontext - - process context for this workflowExceptionprotected 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)
Copyright © 2014. All Rights Reserved.