|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectatg.nucleus.logging.VariableArgumentApplicationLoggingImpl
atg.nucleus.GenericService
atg.b2bcommerce.order.CostCenterManager
public class CostCenterManager
This class is the business layer object for managing and manipulating Cost Centers. This class holds all the business logic for manipulating a Cost Center. The various types of methods in this class are used for creating cost centers, adding cost centers to an Order, adding CommerceItems to cost centers.
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
protected static CostCenterManager |
mCostCenterManager
|
protected static java.util.ResourceBundle |
sB2BResourceBundle
|
protected static java.util.ResourceBundle |
sResourceBundle
Resource Bundle |
Fields inherited from class atg.nucleus.GenericService |
---|
SERVICE_INFO_KEY |
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging |
---|
DEFAULT_LOG_TRACE_STATUS |
Fields inherited from interface atg.nucleus.logging.ApplicationLogging |
---|
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS |
Constructor Summary | |
---|---|
CostCenterManager()
Constructs an CostCenterManager object. |
Method Summary | |
---|---|
CostCenter |
addCostCenterToOrder(B2BOrder pOrder,
CostCenter pCostCenter)
Adds the given cost center to the given order. |
void |
addItemAmountToCostCenter(B2BOrder pOrder,
java.lang.String pCommerceItemId,
java.lang.String pCostCenterId,
double pAmount)
Adds the given amount of the CommerceItem with the given id to the CostCenter with the given id. |
void |
addItemQuantityToCostCenter(B2BOrder pOrder,
java.lang.String pCommerceItemId,
java.lang.String pCostCenterId,
long pQuantity)
Adds the given quantity of the CommerceItem with the given id to the CostCenter with the given id. |
void |
addOrderAmountToCostCenter(B2BOrder pOrder,
java.lang.String pCostCenterId,
double pAmount)
Adds the given amount of the Order's cost to the CostCenter with the given id. |
void |
addRemainingItemAmountToCostCenter(B2BOrder pOrder,
java.lang.String pCommerceItemId,
java.lang.String pCostCenterId)
Adds any unassigned amount of the CommerceItem with the given id to the CostCenter with the given id. |
void |
addRemainingItemQuantityToCostCenter(B2BOrder pOrder,
java.lang.String pCommerceItemId,
java.lang.String pCostCenterId)
Adds any unassigned quantity of the CommerceItem with the given id to the CostCenter with the given id. |
void |
addRemainingOrderAmountToCostCenter(B2BOrder pOrder,
java.lang.String pCostCenterId)
Adds any unassigned amount of the Order's cost to the CostCenter with the given id. |
void |
addRemainingShippingCostToCostCenter(B2BOrder pOrder,
java.lang.String pShippingGroupId,
java.lang.String pCostCenterId)
Adds any unassigned amount of the ShippingGroup's cost with the given id to the CostCenter with the given id. |
void |
addRemainingTaxAmountToCostCenter(B2BOrder pOrder,
java.lang.String pCostCenterId)
Adds any unassigned amount of the Order's tax to the CostCenter with the given id. |
void |
addShippingCostAmountToCostCenter(B2BOrder pOrder,
java.lang.String pShippingGroupId,
java.lang.String pCostCenterId,
double pAmount)
Adds the given amount of the ShippingGroup's cost with the given id to the CostCenter with the given id. |
void |
addTaxAmountToCostCenter(B2BOrder pOrder,
java.lang.String pCostCenterId,
double pAmount)
Adds the given amount of the Order's tax to the CostCenter with the given id. |
CostCenter |
createCostCenter(java.lang.String pIdentifier)
Creates a new CostCenter object using the default type specified in the OrderTools defaultCostCenterType property. |
CostCenter |
createCostCenter(java.lang.String pCostCenterType,
java.lang.String pIdentifier)
Creates a new CostCenter object using the class mapped to the given name in pCostCenterType. |
protected Relationship |
createRelationship(java.lang.String pRelationshipType)
Creates a new Relationship object using the class type mapped to the type supplied in pShippingGroupType. |
CostCenter |
getCostCenterByIdentifier(java.util.List pCostCenters,
java.lang.String pIdentifier)
This method will return a CostCenter whose identifier is pIdentifier. |
CostCenterCommerceItemRelationship |
getCostCenterCommerceItemRelationship(B2BOrder pOrder,
java.lang.String pCommerceItemId,
java.lang.String pCostCenterId)
Returns the relationship object which exists between the given CommerceItem and CostCenter. |
static CostCenterManager |
getCostCenterManager()
|
CostCenterOrderRelationship |
getCostCenterOrderRelationship(B2BOrder pOrder,
java.lang.String pCostCenterId)
Returns the relationship object which exists between the given Order and CostCenter. |
CostCenterShippingGroupRelationship |
getCostCenterShippingGroupRelationship(B2BOrder pOrder,
java.lang.String pCostCenterId,
java.lang.String pShippingGroupId)
Returns the relationship object which exists between the given ShippingGroup and CostCenter. |
java.util.List |
getOrderIdsForCostCenter(java.lang.String pCostCenterId,
int pStartIndex,
int pNumOrders)
Returns the order ids for the given cost center. |
OrderManager |
getOrderManager()
Returns the OrderManager |
java.util.List |
getOrdersForCostCenter(java.lang.String pCostCenterId,
int pStartIndex,
int pNumOrders)
Returns all the orders for the given cost center id. |
B2BOrderTools |
getOrderTools()
Returns the OrderTools |
double |
getRemainingAmountForCostCenter(B2BCommerceItem pItem)
Calculate the "amount remaining" for a given item. |
long |
getRemainingQuantityForCostCenter(B2BCommerceItem pItem)
Calculate the "quantity remaining" for a given item. |
double |
getUnassignedAmountForCommerceItem(B2BCommerceItem pItem)
This method returns the unassigned amount for a CommerceItem. |
long |
getUnassignedQuantityForCommerceItem(B2BCommerceItem pItem)
This method returns the unassigned quantity for a CommerceItem. |
void |
moveItemToCostCenter(B2BOrder pOrder,
B2BCommerceItem pCommerceItem,
long pQuantity,
CostCenter pSrcCostCenter,
CostCenter pDestCostCenter)
This method moves an item from one CostCenter to another. |
void |
moveItemToCostCenter(B2BOrder pOrder,
java.lang.String pCatalogRefId,
long pQuantity,
java.lang.String pSrcCostCenterId,
java.lang.String pDestCostCenterId)
This method moves an item from one CostCenter to another. |
PipelineResult |
recalculateCostCenterAmounts(Order pOrder)
Recalculates the amounts for each CostCenter supplied in pCostCenterList. |
void |
removeAllCostCentersFromOrder(B2BOrder pOrder)
Removes all the CostCenters and their Relationships from an Order. |
void |
removeAllRelationshipsFromCostCenter(B2BOrder pOrder,
java.lang.String pCostCenterId)
Removes all the relationships from the CostCenter with the given id in the given order. |
void |
removeCostCenterFromOrder(B2BOrder pOrder,
java.lang.String pCostCenterId)
Removes the given CostCenter from the given order. |
void |
removeItemQuantityFromCostCenter(B2BOrder pOrder,
java.lang.String pCommerceItemId,
java.lang.String pCostCenterId,
long pQuantity)
Removes the given quantity of the CommerceItem with the given id from the CostCenter with the given id. |
void |
setOrderManager(OrderManager pOrderManager)
Sets the OrderManager |
void |
setOrderTools(B2BOrderTools pOrderTools)
Sets the OrderTools |
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl |
---|
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
protected static java.util.ResourceBundle sResourceBundle
protected static java.util.ResourceBundle sB2BResourceBundle
protected static CostCenterManager mCostCenterManager
Constructor Detail |
---|
public CostCenterManager()
Method Detail |
---|
public static CostCenterManager getCostCenterManager()
public OrderManager getOrderManager()
public void setOrderManager(OrderManager pOrderManager)
public B2BOrderTools getOrderTools()
public void setOrderTools(B2BOrderTools pOrderTools)
public CostCenter createCostCenter(java.lang.String pIdentifier) throws CommerceException
InvalidParameterException
- thrown if any of the parameters are null
ObjectCreationException
- if the instantiation of an object fails
CommerceException
B2BOrderTools.getDefaultCostCenterType()
public CostCenter createCostCenter(java.lang.String pCostCenterType, java.lang.String pIdentifier) throws CommerceException
pIdentifier
- the user-defined name of the CostCenterpDescription
- the description of the cost centerpCostCenterType
- the name that is mapped in the OrderTools.properties file to the class of
the desired type to create
InvalidParameterException
- thrown if any of the parameters are null
ObjectCreationException
- if the instantiation of an object fails
CommerceException
public CostCenter addCostCenterToOrder(B2BOrder pOrder, CostCenter pCostCenter) throws CommerceException
pOrder
- the Order to add the CommerceItem topCostCenter
- the CostCenter to add to the Order
InvalidParameterException
- thrown if any of the parameters are null
CommerceException
public void removeCostCenterFromOrder(B2BOrder pOrder, java.lang.String pCostCenterId) throws CommerceException
pOrder
- the Order to remove the CostCenter frompCostCenterId
- the id of the CostCenter to remove from the Order
InvalidParameterException
- thrown if any of the parameters are null
CostCenterNotFoundException
- if a CostCenter with the given id is not found in the given order
ObjectRemovalException
- thrown if the CostCenter contains any relationships
CommerceException
public void removeAllCostCentersFromOrder(B2BOrder pOrder) throws CommerceException
pOrder
- the Order which contains the CostCenters to be removed
InvalidParameterException
- thrown if any of the parameters are null
ObjectRemovalException
- thrown if a CostCenter cannot be removed
CommerceException
public void removeAllRelationshipsFromCostCenter(B2BOrder pOrder, java.lang.String pCostCenterId) throws CommerceException
pOrder
- the Order which contains the CostCenter to remove the relationships frompCostCenterId
- the id of the CostCenter
InvalidParameterException
- thrown if any of the parameters are null
CostCenterNotFoundException
- if a CostCenter with the given id is not found in the given order
ObjectRemovalException
- thrown if a relationship cannot be removed
CommerceException
public CostCenter getCostCenterByIdentifier(java.util.List pCostCenters, java.lang.String pIdentifier) throws CommerceException
pCostCenters
- a List of CostCenterspIdentifier
- the identifier to search for in the List of CostCenters
InvalidParameterException
- if any of the parameters are null
CommerceException
public CostCenterCommerceItemRelationship getCostCenterCommerceItemRelationship(B2BOrder pOrder, java.lang.String pCommerceItemId, java.lang.String pCostCenterId) throws CommerceException
pCommerceItemId
- the id of the CommerceItem which makes up a half of the relationshippCostCenterId
- the id of the CostCenter which makes up a half of the relationship
InvalidParameterException
- thrown if any of the parameters are null
RelationshipNotFoundException
- if a relationship is not found
CommerceException
public CostCenterOrderRelationship getCostCenterOrderRelationship(B2BOrder pOrder, java.lang.String pCostCenterId) throws CommerceException
pOrder
- the Order which makes up half of the relationshippCostCenterId
- the id of the CostCenter which makes up a half of the relationship
InvalidParameterException
- thrown if any of the parameters are null
RelationshipNotFoundException
- if a relationship is not found
CommerceException
public CostCenterShippingGroupRelationship getCostCenterShippingGroupRelationship(B2BOrder pOrder, java.lang.String pCostCenterId, java.lang.String pShippingGroupId) throws CommerceException
pShippingGroupId
- the id of the ShippingGroup which makes up a half of the relationshippCostCenterId
- the id of the CostCenter which makes up a half of the relationship
InvalidParameterException
- thrown if any of the parameters are null
RelationshipNotFoundException
- if a relationship is not found
CommerceException
public void moveItemToCostCenter(B2BOrder pOrder, java.lang.String pCatalogRefId, long pQuantity, java.lang.String pSrcCostCenterId, java.lang.String pDestCostCenterId) throws CommerceException
pOrder
- the order which the item exists inpCatalogRefId
- the catalogRefId of the item to movepQuantity
- the quantity to movepSrcCostCenterId
- the id of the costCenter to move the item frompDestCostCenterId
- the id of the costCenter to move the item to
CommerceException
- thrown if the operation could not be completed. More information
can be found within the exception.public void moveItemToCostCenter(B2BOrder pOrder, B2BCommerceItem pCommerceItem, long pQuantity, CostCenter pSrcCostCenter, CostCenter pDestCostCenter) throws CommerceException
pOrder
- the order which the item exists inpCatalogRefId
- the catalogRefId of the item to movepQuantity
- the quantity to movepSrcCostCenter
- the costCenter to move the item frompDestCostCenter
- the costCenter to move the item to
CommerceException
- thrown if the operation could not be completed. More information
can be found within the exception.public void removeItemQuantityFromCostCenter(B2BOrder pOrder, java.lang.String pCommerceItemId, java.lang.String pCostCenterId, long pQuantity) throws CommerceException
pOrder
- the Order which the CommerceItem and CostCenter existpCommerceItemId
- the id of the CommerceItem to to remove from the CostCenterpCostCenterId
- the id of the CostCenter which the CommerceItem will be removed frompQuantity
- the quantity of the CommerceItem which will be removed
InvalidParameterException
- thrown if any of the parameters are null
ObjectRemovalException
- if the removal of the quantity fails
CommerceException
public void addItemQuantityToCostCenter(B2BOrder pOrder, java.lang.String pCommerceItemId, java.lang.String pCostCenterId, long pQuantity) throws CommerceException
pOrder
- the Order which the CommerceItem and CostCenter existpCommerceItemId
- the id of the CommerceItem to addpCostCenterId
- the id of the CostCenter which the CommerceItem will be added topQuantity
- the quantity of the CommerceItem which will be added
InvalidParameterException
- thrown if any of the parameters are null
InvalidTypeException
- thrown if more than one REMAINING relationship type is added to a CostCenter
or if an invalid type is set to the Relationship
ObjectCreationException
- if the instantiation of an object fails
CommerceException
atg.commerce.order.CostCenterCommerceItemRelationship
public void addRemainingItemQuantityToCostCenter(B2BOrder pOrder, java.lang.String pCommerceItemId, java.lang.String pCostCenterId) throws CommerceException
pOrder
- the Order which the CommerceItem and CostCenter existpCommerceItemId
- the id of the CommerceItem to addpCostCenterId
- the id of the CostCenter which the CommerceItem will be added to
InvalidParameterException
- thrown if any of the parameters are null
InvalidTypeException
- thrown if more than one REMAINING relationship type is added to a CostCenter
or if an invalid type is set to the Relationship
ObjectCreationException
- if the instantiation of an object fails
CommerceException
CostCenterCommerceItemRelationship
public void addItemAmountToCostCenter(B2BOrder pOrder, java.lang.String pCommerceItemId, java.lang.String pCostCenterId, double pAmount) throws CommerceException
pOrder
- the Order which the CommerceItem and CostCenter existpCommerceItemId
- the id of the CommerceItem to addpCostCenterId
- the id of the CostCenter which the CommerceItem will be added topAmount
- the amount of the CommerceItem which will be added
InvalidParameterException
- thrown if any of the parameters are null
InvalidTypeException
- thrown if more than one REMAINING relationship type is added to a CostCenter
or if an invalid type is set to the Relationship
ObjectCreationException
- if the instantiation of an object fails
CommerceException
atg.commerce.order.CostCenterCommerceItemRelationship
public void addRemainingItemAmountToCostCenter(B2BOrder pOrder, java.lang.String pCommerceItemId, java.lang.String pCostCenterId) throws CommerceException
pOrder
- the Order which the CommerceItem and CostCenter existpCommerceItemId
- the id of the CommerceItem to addpCostCenterId
- the id of the CostCenter which the CommerceItem will be added to
InvalidParameterException
- thrown if any of the parameters are null
InvalidTypeException
- thrown if more than one REMAINING relationship type is added to a CostCenter
or if an invalid type is set to the Relationship
ObjectCreationException
- if the instantiation of an object fails
CommerceException
CostCenterCommerceItemRelationship
public long getUnassignedQuantityForCommerceItem(B2BCommerceItem pItem)
pItem
- the CommerceItem we are checking
getRemainingQuantityForCostCenter(B2BCommerceItem)
public long getRemainingQuantityForCostCenter(B2BCommerceItem pItem)
pItem
- The CommerceItem we are checking
public double getUnassignedAmountForCommerceItem(B2BCommerceItem pItem)
pItem
- the CommerceItem we are checking
getRemainingAmountForCostCenter(B2BCommerceItem)
public double getRemainingAmountForCostCenter(B2BCommerceItem pItem)
pItem
- The CommerceItem we are checking
public void addShippingCostAmountToCostCenter(B2BOrder pOrder, java.lang.String pShippingGroupId, java.lang.String pCostCenterId, double pAmount) throws CommerceException
pOrder
- the Order which the CostCenter and ShippingGroup existpShippingGroupId
- the id of the ShippingGroup's cost to addpCostCenterId
- the id of the CostCenter which the ShippingGroup's cost will be added topAmount
- the amount that is assigned for payment to the CostCenter
InvalidParameterException
- thrown if any of the parameters are null
InvalidTypeException
- thrown if more than one REMAINING relationship type is added to a CostCenter
or if an invalid type is set to the Relationship
ObjectCreationException
- if the instantiation of an object fails
CommerceException
CostCenterShippingGroupRelationship
public void addRemainingShippingCostToCostCenter(B2BOrder pOrder, java.lang.String pShippingGroupId, java.lang.String pCostCenterId) throws CommerceException
pOrder
- the Order which the CostCenter and ShippingGroup existpShippingGroupId
- the id of the ShippingGroup's cost to addpCostCenterId
- the id of the CostCenter which the ShippingGroup's cost will be added to
InvalidParameterException
- thrown if any of the parameters are null
InvalidTypeException
- thrown if more than one REMAINING relationship type is added to a CostCenter
or if an invalid type is set to the Relationship
ObjectCreationException
- if the instantiation of an object fails
CommerceException
CostCenterShippingGroupRelationship
public void addTaxAmountToCostCenter(B2BOrder pOrder, java.lang.String pCostCenterId, double pAmount) throws CommerceException
pOrder
- the Order which the CostCenter existspCostCenterId
- the id of the CostCenter which the Order's tax will be added topAmount
- the amount that is assigned for payment to the CostCenter
InvalidParameterException
- thrown if any of the parameters are null
InvalidTypeException
- thrown if more than one REMAINING relationship type is added to a CostCenter
or if an invalid type is set to the Relationship
ObjectCreationException
- if the instantiation of an object fails
CommerceException
CostCenterOrderRelationship
public void addRemainingTaxAmountToCostCenter(B2BOrder pOrder, java.lang.String pCostCenterId) throws CommerceException
pOrder
- the Order which the PaymentGroup existspCostCenterId
- the id of the CostCenter which the Order's tax will be added to
InvalidParameterException
- thrown if any of the parameters are null
InvalidTypeException
- thrown if more than one REMAINING relationship type is added to a CostCenter
or if an invalid type is set to the Relationship
ObjectCreationException
- if the instantiation of an object fails
CommerceException
CostCenterOrderRelationship
public void addOrderAmountToCostCenter(B2BOrder pOrder, java.lang.String pCostCenterId, double pAmount) throws CommerceException
pOrder
- the Order which the CostCenter existspCostCenterId
- the id of the CostCenter which the Order's cost will be added topAmount
- the amount that is assigned for payment to the CostCenter
InvalidParameterException
- thrown if any of the parameters are null
InvalidTypeException
- thrown if more than one REMAINING relationship type is added to a CostCenter
or if an invalid type is set to the Relationship
ObjectCreationException
- if the instantiation of an object fails
CommerceException
CostCenterOrderRelationship
public void addRemainingOrderAmountToCostCenter(B2BOrder pOrder, java.lang.String pCostCenterId) throws CommerceException
pOrder
- the Order which the CostCenter existspCostCenterId
- the id of the CostCenter which the Order's cost will be added to
InvalidParameterException
- thrown if any of the parameters are null
InvalidTypeException
- thrown if more than one REMAINING relationship type is added to a CostCenter
or if an invalid type is set to the Relationship
ObjectCreationException
- if the instantiation of an object fails
CommerceException
atg.commerce.order.CostCenterOrderRelationship
public PipelineResult recalculateCostCenterAmounts(Order pOrder) throws CommerceException
pOrder
- the Order to recalculate the CostCenters in
CommerceException
- thrown if an error occurs while recalculating the amountspublic java.util.List getOrdersForCostCenter(java.lang.String pCostCenterId, int pStartIndex, int pNumOrders) throws CommerceException
pCostCenterId
- the CostCenter id
InvalidParameterException
- thrown if any of the parameters are null or empty string
CommerceException
- thrown if an exception occurs while accessing the repositorypublic java.util.List getOrderIdsForCostCenter(java.lang.String pCostCenterId, int pStartIndex, int pNumOrders) throws CommerceException
pCostCenterId
- the CostCenter id
InvalidParameterException
- thrown if any of the parameters are null or empty string
CommerceException
- thrown if an exception occurs while accessing the repositoryprotected Relationship createRelationship(java.lang.String pRelationshipType) throws CommerceException
pRelationshipType
- the type that is mapped in the OrderTools.properties file to the class of
the desired type to create
ObjectCreationException
- if the instantiation of an object fails
InvalidTypeException
- if the given type is not valid
InvalidParameterException
- thrown if any of the parameters are null
CommerceException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |