Class SalesOrderLogic
java.lang.Object
com.echothree.util.server.control.BaseLogic
com.echothree.model.control.order.server.logic.OrderLogic
com.echothree.model.control.sales.server.logic.SalesOrderLogic
-
Method Summary
Modifier and TypeMethodDescriptionvoid
checkOrderAvailableForModification
(Session session, ExecutionErrorAccumulator eea, Order order, PartyPK modifiedBy) Check to see if an Order is available for modification, and if it isn't, send back an error.createSalesOrder
(Session session, ExecutionErrorAccumulator eea, UserVisit userVisit, Batch batch, Source source, Party billToParty, OrderPriority orderPriority, Currency currency, Boolean holdUntilComplete, Boolean allowBackorders, Boolean allowSubstitutions, Boolean allowCombiningShipments, String reference, Term term, FreeOnBoard freeOnBoard, Boolean taxable, String workflowEntranceName, Party createdByParty) Create a new Sales Order given a set of parameters.createSalesOrder
(Session session, ExecutionErrorAccumulator eea, UserVisit userVisit, String batchName, String sourceName, String billToPartyName, String orderPriorityName, String currencyIsoName, String termName, String strHoldUntilComplete, String strAllowBackorders, String strAllowSubstitutions, String strAllowCombiningShipments, String reference, String freeOnBoardName, String strTaxable, String workflowEntranceName, Party createdByParty) getCancellationPolicy
(ExecutionErrorAccumulator eea, CustomerType customerType, Customer billToCustomer) getCustomerType
(ExecutionErrorAccumulator eea, Offer offer, Customer customer) getCustomerTypeFromParty
(Party party) Find the BILL_TO Party for a given Order.static SalesOrderLogic
getOrderBillToCustomerType
(Order order) Find the BILL_TO Party for a given Order.getOrderBillToParty
(Order order) Find the BILL_TO Party for a given Order.getOrderByName
(ExecutionErrorAccumulator eea, String orderName) getOrderByNameForUpdate
(ExecutionErrorAccumulator eea, String orderName) getOrderPriorityByName
(ExecutionErrorAccumulator eea, String orderPriorityName) getOrderPriorityByNameForUpdate
(ExecutionErrorAccumulator eea, String orderPriorityName) getOrderShipToParty
(Order order, boolean billToFallback, BasePK createdBy) Attempt to find a SHIP_TO Party for the Order.getReturnPolicy
(ExecutionErrorAccumulator eea, CustomerType customerType, Customer billToCustomer) getSalesOrderStatusChoices
(String defaultOrderStatusChoice, Language language, boolean allowNullChoice, Order order, PartyPK partyPK) boolean
isOrderInWorkflowSteps
(ExecutionErrorAccumulator eea, EntityInstance entityInstance, String... workflowStepNames) boolean
isOrderInWorkflowSteps
(ExecutionErrorAccumulator eea, Order order, String... workflowStepNames) void
setSalesOrderStatus
(Session session, ExecutionErrorAccumulator eea, Order order, String orderStatusChoice, PartyPK modifiedBy) void
validateSalesOrderReference
(ExecutionErrorAccumulator eea, String reference, CustomerType customerType, Customer billToCustomer) Methods inherited from class com.echothree.model.control.order.server.logic.OrderLogic
checkItemAgainstOrderPaymentPreferences, checkItemAgainstShippingMethod, createOrder, createOrderPaymentPreference, createOrderShipmentGroup, getDefaultOrderShipmentGroup, getItemsFromOrder, getOrderAliasTypeByName, getOrderByName, getOrderByNameForUpdate, getOrderCurrency, getOrderName, getOrderPaymentPreferenceByName, getOrderPaymentPreferenceByNameForUpdate, getOrderPriorityByName, getOrderPriorityByNameForUpdate, getOrderRoleTypeByName, getOrderSequence, getOrderSequenceType, getOrderTypeByName
Methods inherited from class com.echothree.util.server.control.BaseLogic
addExecutionError, addSecurityMessage, getEntityInstanceByBaseEntity, getEntityInstanceByBasePK, getSession, handleExecutionError, handleSecurityMessage, hasExecutionErrors
-
Method Details
-
getInstance
-
getCustomerType
-
validateSalesOrderReference
public void validateSalesOrderReference(ExecutionErrorAccumulator eea, String reference, CustomerType customerType, Customer billToCustomer) -
getCancellationPolicy
public CancellationPolicy getCancellationPolicy(ExecutionErrorAccumulator eea, CustomerType customerType, Customer billToCustomer) -
getReturnPolicy
public ReturnPolicy getReturnPolicy(ExecutionErrorAccumulator eea, CustomerType customerType, Customer billToCustomer) -
createSalesOrder
public Order createSalesOrder(Session session, ExecutionErrorAccumulator eea, UserVisit userVisit, Batch batch, Source source, Party billToParty, OrderPriority orderPriority, Currency currency, Boolean holdUntilComplete, Boolean allowBackorders, Boolean allowSubstitutions, Boolean allowCombiningShipments, String reference, Term term, FreeOnBoard freeOnBoard, Boolean taxable, String workflowEntranceName, Party createdByParty) Create a new Sales Order given a set of parameters. Default values will be determined as best as possible when a parameter is marked as Optional. If a previous preference has not been set then it may not be possible to to determine appropriate defaults.- Parameters:
session
- Required.eea
- Required.userVisit
- Required.source
- Optional.billToParty
- Optional.orderPriority
- Optional.currency
- Optional.holdUntilComplete
- Optional.allowBackorders
- Optional.allowSubstitutions
- Optional.allowCombiningShipments
- Optional.reference
- Optional.term
- Optional.taxable
- Optional.workflowEntranceName
- Optional.createdByParty
- Required.- Returns:
- The newly created Order, or null if there was an error.
-
createSalesOrder
public Order createSalesOrder(Session session, ExecutionErrorAccumulator eea, UserVisit userVisit, String batchName, String sourceName, String billToPartyName, String orderPriorityName, String currencyIsoName, String termName, String strHoldUntilComplete, String strAllowBackorders, String strAllowSubstitutions, String strAllowCombiningShipments, String reference, String freeOnBoardName, String strTaxable, String workflowEntranceName, Party createdByParty) -
isOrderInWorkflowSteps
public boolean isOrderInWorkflowSteps(ExecutionErrorAccumulator eea, Order order, String... workflowStepNames) -
isOrderInWorkflowSteps
public boolean isOrderInWorkflowSteps(ExecutionErrorAccumulator eea, EntityInstance entityInstance, String... workflowStepNames) -
getOrderByName
-
getOrderByNameForUpdate
-
getOrderPriorityByName
public OrderPriority getOrderPriorityByName(ExecutionErrorAccumulator eea, String orderPriorityName) -
getOrderPriorityByNameForUpdate
public OrderPriority getOrderPriorityByNameForUpdate(ExecutionErrorAccumulator eea, String orderPriorityName) -
getSalesOrderStatusChoices
public SalesOrderStatusChoicesBean getSalesOrderStatusChoices(String defaultOrderStatusChoice, Language language, boolean allowNullChoice, Order order, PartyPK partyPK) -
setSalesOrderStatus
public void setSalesOrderStatus(Session session, ExecutionErrorAccumulator eea, Order order, String orderStatusChoice, PartyPK modifiedBy) -
checkOrderAvailableForModification
public void checkOrderAvailableForModification(Session session, ExecutionErrorAccumulator eea, Order order, PartyPK modifiedBy) Check to see if an Order is available for modification, and if it isn't, send back an error.- Parameters:
session
- Required.eea
- Required.order
- Required.modifiedBy
- Required.
-
getOrderBillToParty
Find the BILL_TO Party for a given Order.- Parameters:
order
- Required.- Returns:
- The Party used for the BILL_TO OrderRoleType. May be null.
-
getCustomerTypeFromParty
Find the BILL_TO Party for a given Order.- Parameters:
party
- Optional.- Returns:
- The CustomerType for the Party. May be null.
-
getOrderBillToCustomerType
Find the BILL_TO Party for a given Order.- Parameters:
order
- Required.- Returns:
- The CustomerType for the BILL_TO Party. May be null.
-
getOrderShipToParty
Attempt to find a SHIP_TO Party for the Order. If none is found, and billToFallback is set to true, then attempt to find the BILL_TO Party. If a BILL_TO Party is found, copy it to the SHIP_TO.- Parameters:
order
- Required.billToFallback
- Required.createdBy
- Required if billToFallback is true.- Returns:
- The Party that is to be used for the SHIP_TO OrderRoleType. May be null.
-