Class PurchaseOrderLogic
java.lang.Object
com.echothree.util.server.control.BaseLogic
com.echothree.model.control.order.server.logic.BaseOrderLogic
com.echothree.model.control.purchase.server.logic.PurchaseOrderLogic
-
Field Summary
Fields inherited from class com.echothree.util.server.control.BaseLogic
coreControl -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckOrderAvailableForModification(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.createPurchaseOrder(Session session, ExecutionErrorAccumulator eea, UserVisit userVisit, Party vendorParty, Boolean holdUntilComplete, Boolean allowBackorders, Boolean allowSubstitutions, Boolean allowCombiningShipments, String reference, Term term, FreeOnBoard freeOnBoard, String workflowEntranceName, Party createdByParty) Create a new Purchase Order using appropriate defaults where possible for Optional parameters.createPurchaseOrder(Session session, ExecutionErrorAccumulator eea, UserVisit userVisit, String vendorName, String termName, String strHoldUntilComplete, String strAllowBackorders, String strAllowSubstitutions, String strAllowCombiningShipments, String reference, String freeOnBoardName, String workflowEntranceName, Party createdByParty) getCancellationPolicy(ExecutionErrorAccumulator eea, VendorType vendorType, Vendor billToVendor) static PurchaseOrderLogicgetOrderBillToParty(Order order) Find the BILL_TO Party for a given Order.getOrderBillToVendorType(Order order) Find the VendorType for 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.getPurchaseOrderStatusChoices(String defaultOrderStatusChoice, Language language, boolean allowNullChoice, Order order, PartyPK partyPK) getReturnPolicy(ExecutionErrorAccumulator eea, VendorType vendorType, Vendor billToVendor) getVendorTypeFromParty(Party party) Find the VendorType for a given Party.booleanisOrderInWorkflowSteps(ExecutionErrorAccumulator eea, EntityInstance entityInstance, String... workflowStepNames) booleanisOrderInWorkflowSteps(ExecutionErrorAccumulator eea, Order order, String... workflowStepNames) voidsetPurchaseOrderStatus(Session session, ExecutionErrorAccumulator eea, Order order, String orderStatusChoice, PartyPK modifiedBy) voidvalidatePurchaseOrderReference(ExecutionErrorAccumulator eea, String reference, Vendor vendor) Methods inherited from class com.echothree.model.control.order.server.logic.BaseOrderLogic
checkItemAgainstOrderPaymentPreferences, checkItemAgainstShippingMethod, createOrder, createOrderPaymentPreference, getItemsFromOrder, getOrderAliasTypeByName, getOrderByName, getOrderByNameForUpdate, getOrderCurrency, getOrderName, getOrderPaymentPreferenceByName, getOrderPaymentPreferenceByNameForUpdate, getOrderRoleTypeByName, getOrderSequence, getOrderSequenceType, getOrderTypeByNameMethods inherited from class com.echothree.util.server.control.BaseLogic
addExecutionError, addSecurityMessage, getEntityInstanceByBaseEntity, getEntityInstanceByBasePK, getSession, handleExecutionError, handleSecurityMessage, hasExecutionErrors
-
Constructor Details
-
PurchaseOrderLogic
protected PurchaseOrderLogic()
-
-
Method Details
-
getInstance
-
validatePurchaseOrderReference
public void validatePurchaseOrderReference(ExecutionErrorAccumulator eea, String reference, Vendor vendor) -
getCancellationPolicy
public CancellationPolicy getCancellationPolicy(ExecutionErrorAccumulator eea, VendorType vendorType, Vendor billToVendor) -
getReturnPolicy
public ReturnPolicy getReturnPolicy(ExecutionErrorAccumulator eea, VendorType vendorType, Vendor billToVendor) -
createPurchaseOrder
public Order createPurchaseOrder(Session session, ExecutionErrorAccumulator eea, UserVisit userVisit, Party vendorParty, Boolean holdUntilComplete, Boolean allowBackorders, Boolean allowSubstitutions, Boolean allowCombiningShipments, String reference, Term term, FreeOnBoard freeOnBoard, String workflowEntranceName, Party createdByParty) Create a new Purchase Order using appropriate defaults where possible for Optional parameters.- Parameters:
session- Required.eea- Required.userVisit- Required.vendorParty- Required.holdUntilComplete- Optional.allowBackorders- Optional.allowSubstitutions- Optional.allowCombiningShipments- Optional.reference- Optional.term- Optional.workflowEntranceName- Optional.createdByParty- Required.- Returns:
- The newly created Order, or null if there was an error.
-
createPurchaseOrder
public Order createPurchaseOrder(Session session, ExecutionErrorAccumulator eea, UserVisit userVisit, String vendorName, String termName, String strHoldUntilComplete, String strAllowBackorders, String strAllowSubstitutions, String strAllowCombiningShipments, String reference, String freeOnBoardName, 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) -
getPurchaseOrderStatusChoices
public PurchaseOrderStatusChoicesBean getPurchaseOrderStatusChoices(String defaultOrderStatusChoice, Language language, boolean allowNullChoice, Order order, PartyPK partyPK) -
setPurchaseOrderStatus
public void setPurchaseOrderStatus(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.
-
getVendorTypeFromParty
Find the VendorType for a given Party.- Parameters:
party- Optional.- Returns:
- The VendorType for the Party. May be null.
-
getOrderBillToVendorType
Find the VendorType for the BILL_TO Party for a given Order.- Parameters:
order- Required.- Returns:
- The VendorType 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.
-