Class CancelAndReplaceUtils
- java.lang.Object
-
- org.openbravo.erpCommon.businessUtility.CancelAndReplaceUtils
-
public class CancelAndReplaceUtils extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static String
ASSOCIATE_SHIPMENT_TO_REPLACE_TICKET
static String
CREATE_NETTING_SHIPMENT
static String
DOCTYPE_MatShipment
static String
ENABLE_STOCK_RESERVATIONS
static String
LEAVE_DELIVERY_QTY_AS_ZERO_WHEN_CANCEL_LAYAWAY
static BigDecimal
NEGATIVE_ONE
static int
PAYMENT_DOCNO_LENGTH
static String
REVERSE_PREFIX
static String
ZERO_PAYMENT_SUFIX
-
Constructor Summary
Constructors Constructor Description CancelAndReplaceUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Order
cancelAndReplaceOrder(String newOrderId, String paymentOrganizationId, org.codehaus.jettison.json.JSONObject jsonOrder, boolean useOrderDocumentNoForRelatedDocs)
Method that given an Order Id it cancels it and creates another one equal but with negative quantities.static List<Order>
cancelAndReplaceOrder(String oldOrderId, Set<String> newOrderIds, String paymentOrganizationId, org.codehaus.jettison.json.JSONObject jsonOrder, boolean useOrderDocumentNoForRelatedDocs)
Method that given an Order Id it cancels it and creates another one equal but with negative quantities.static Order
cancelAndReplaceOrder(String newOrderId, org.codehaus.jettison.json.JSONObject jsonOrder, boolean useOrderDocumentNoForRelatedDocs)
Method that given an Order Id it cancels it and creates another one equal but with negative quantities.static Order
cancelOrder(String oldOrderId, String paymentOrganizationId, org.codehaus.jettison.json.JSONObject jsonOrder, boolean useOrderDocumentNoForRelatedDocs)
Method that given an Order Id it cancels it and creates another one equal but with negative quantities.static Order
cancelOrder(String oldOrderId, org.codehaus.jettison.json.JSONObject jsonOrder, boolean useOrderDocumentNoForRelatedDocs)
Method that given an Order Id it cancels it and creates another one equal but with negative quantities.static Order
createReplacementOrder(Order oldOrder)
Process that creates a replacement order in temporary status in order to Cancel and Replace an original orderstatic List<Order>
createReplacementOrder(Order oldOrder, Map<Warehouse,Integer> warehouseMap)
Process that creates a replacement order in temporary status in order to Cancel and Replace an original orderstatic boolean
getAssociateGoodsShipmentToNewSalesOrderPreferenceValue(Order order)
Method to check if during the C&R process the shipment lines must be moved from the old order to the new order.static boolean
getCreateNettingGoodsShipmentPreferenceValue(Order order)
Method to check if a netting shipment must be generated during the C&R and CL process.static boolean
getDeliveryQtySetAsZeroWhenCancelLayaway(Order order)
Method to check if during the C&R process, the original order and reverse order's delivered quantity should be updated with ordered quantitystatic String
getNextCancelDocNo(String documentNo)
Process that generates a document number for an order which cancels another order.
-
-
-
Field Detail
-
CREATE_NETTING_SHIPMENT
public static final String CREATE_NETTING_SHIPMENT
- See Also:
- Constant Field Values
-
ASSOCIATE_SHIPMENT_TO_REPLACE_TICKET
public static final String ASSOCIATE_SHIPMENT_TO_REPLACE_TICKET
- See Also:
- Constant Field Values
-
LEAVE_DELIVERY_QTY_AS_ZERO_WHEN_CANCEL_LAYAWAY
public static final String LEAVE_DELIVERY_QTY_AS_ZERO_WHEN_CANCEL_LAYAWAY
- See Also:
- Constant Field Values
-
ENABLE_STOCK_RESERVATIONS
public static final String ENABLE_STOCK_RESERVATIONS
- See Also:
- Constant Field Values
-
REVERSE_PREFIX
public static final String REVERSE_PREFIX
- See Also:
- Constant Field Values
-
ZERO_PAYMENT_SUFIX
public static final String ZERO_PAYMENT_SUFIX
- See Also:
- Constant Field Values
-
DOCTYPE_MatShipment
public static final String DOCTYPE_MatShipment
- See Also:
- Constant Field Values
-
PAYMENT_DOCNO_LENGTH
public static final int PAYMENT_DOCNO_LENGTH
- See Also:
- Constant Field Values
-
NEGATIVE_ONE
public static final BigDecimal NEGATIVE_ONE
-
-
Method Detail
-
createReplacementOrder
public static Order createReplacementOrder(Order oldOrder)
Process that creates a replacement order in temporary status in order to Cancel and Replace an original order- Parameters:
oldOrder
- Order that will be cancelled and replaced
-
createReplacementOrder
public static List<Order> createReplacementOrder(Order oldOrder, Map<Warehouse,Integer> warehouseMap)
Process that creates a replacement order in temporary status in order to Cancel and Replace an original order- Parameters:
oldOrder
- Order that will be cancelled and replacedwarehouseMap
- Map with the list of Warehouses where the replacements will be created and the number of replacements to create in each one
-
cancelOrder
public static Order cancelOrder(String oldOrderId, org.codehaus.jettison.json.JSONObject jsonOrder, boolean useOrderDocumentNoForRelatedDocs)
Method that given an Order Id it cancels it and creates another one equal but with negative quantities.- Parameters:
oldOrderId
- Id of the Sales Order to be cancelled.jsonOrder
- Parameter with order information coming from Web POS.useOrderDocumentNoForRelatedDocs
- flag coming from Web POS. If it is true, it will set the same document of the order to netting payment.
-
cancelOrder
public static Order cancelOrder(String oldOrderId, String paymentOrganizationId, org.codehaus.jettison.json.JSONObject jsonOrder, boolean useOrderDocumentNoForRelatedDocs)
Method that given an Order Id it cancels it and creates another one equal but with negative quantities.- Parameters:
oldOrderId
- Id of the Sales Order to be cancelled.jsonOrder
- Parameter with order information coming from Web POS.useOrderDocumentNoForRelatedDocs
- flag coming from Web POS. If it is true, it will set the same document of the order to netting payment.
-
cancelAndReplaceOrder
public static Order cancelAndReplaceOrder(String newOrderId, org.codehaus.jettison.json.JSONObject jsonOrder, boolean useOrderDocumentNoForRelatedDocs)
Method that given an Order Id it cancels it and creates another one equal but with negative quantities. It also creates a new order replacing the cancelled one.- Parameters:
newOrderId
- Id of the replacement Sales Order.jsonOrder
- Parameter with order information coming from Web POSuseOrderDocumentNoForRelatedDocs
- . flag coming from Web POS. If it is true, it will set the same document of the order to netting payment.
-
cancelAndReplaceOrder
public static Order cancelAndReplaceOrder(String newOrderId, String paymentOrganizationId, org.codehaus.jettison.json.JSONObject jsonOrder, boolean useOrderDocumentNoForRelatedDocs)
Method that given an Order Id it cancels it and creates another one equal but with negative quantities. It also creates a new order replacing the cancelled one.- Parameters:
newOrderId
- Id of the replacement Sales Order.jsonOrder
- Parameter with order information coming from Web POSuseOrderDocumentNoForRelatedDocs
- . flag coming from Web POS. If it is true, it will set the same document of the order to netting payment.
-
cancelAndReplaceOrder
public static List<Order> cancelAndReplaceOrder(String oldOrderId, Set<String> newOrderIds, String paymentOrganizationId, org.codehaus.jettison.json.JSONObject jsonOrder, boolean useOrderDocumentNoForRelatedDocs)
Method that given an Order Id it cancels it and creates another one equal but with negative quantities. It also creates a new order replacing the cancelled one.- Parameters:
oldOrderId
- Id of the Sales Order to be cancelled.newOrderIds
- Set of IDs of the replacement Sales Orders.jsonOrder
- Parameter with order information coming from Web POSuseOrderDocumentNoForRelatedDocs
- . flag coming from Web POS. If it is true, it will set the same document of the order to netting payment.
-
getNextCancelDocNo
public static String getNextCancelDocNo(String documentNo)
Process that generates a document number for an order which cancels another order.- Parameters:
documentNo
- Document number of the cancelled order.- Returns:
- The new document number for the order which cancels the old order.
-
getCreateNettingGoodsShipmentPreferenceValue
public static boolean getCreateNettingGoodsShipmentPreferenceValue(Order order)
Method to check if a netting shipment must be generated during the C&R and CL process.- Parameters:
order
- The order that is being canceled.- Returns:
- True if is necessary to create the netting shipment.
-
getAssociateGoodsShipmentToNewSalesOrderPreferenceValue
public static boolean getAssociateGoodsShipmentToNewSalesOrderPreferenceValue(Order order)
Method to check if during the C&R process the shipment lines must be moved from the old order to the new order.- Parameters:
order
- The order that is being canceled.- Returns:
- True if the shipment lines must be moved to the new order.
-
getDeliveryQtySetAsZeroWhenCancelLayaway
public static boolean getDeliveryQtySetAsZeroWhenCancelLayaway(Order order)
Method to check if during the C&R process, the original order and reverse order's delivered quantity should be updated with ordered quantity- Parameters:
order
- The order that is being canceled.- Returns:
- boolean
-
-