Package org.openbravo.materialmgmt
Class ReservationUtils
- java.lang.Object
-
- org.openbravo.materialmgmt.ReservationUtils
-
public class ReservationUtils extends Object
-
-
Constructor Summary
Constructors Constructor Description ReservationUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Reservation
createReserveFromSalesOrderLine(OrderLine soLine, boolean doProcess)
static boolean
existsReservationForStock(StorageDetail storageDetail)
Returns true if there are any reservations created against the given Storage Detailstatic Reservation
getReservationFromOrder(OrderLine salesOrderLine)
Returns a non closed reservation from given Sales Order Line.static List<ReservationStock>
getReservationStockFromStorageDetail(StorageDetail storageDetail)
Returns a list of related Reservations Stock for a given Storage Detailstatic OBError
processReserve(Reservation reservation, String action)
Allowed actions: PR Process RE Reactivate HO Put on Hold UNHO Unhold CL Closestatic OBError
reallocateStock(Reservation reservation, Locator storageBin, AttributeSetInstance asi, BigDecimal quantity)
Function to reallocate given reservation stock on given attributes and storage bin.static OBError
reserveStockAuto(Reservation reservation)
static ReservationStock
reserveStockManual(Reservation reservation, BaseOBObject obObject, BigDecimal quantity, String allocated)
Function to reserve in allocated or not allocated given stock or purchase order line.
-
-
-
Method Detail
-
createReserveFromSalesOrderLine
public static Reservation createReserveFromSalesOrderLine(OrderLine soLine, boolean doProcess) throws OBException
- Throws:
OBException
-
reserveStockAuto
public static OBError reserveStockAuto(Reservation reservation) throws OBException
- Throws:
OBException
-
reserveStockManual
public static ReservationStock reserveStockManual(Reservation reservation, BaseOBObject obObject, BigDecimal quantity, String allocated) throws OBException
Function to reserve in allocated or not allocated given stock or purchase order line. Available OBObject are:
- StorageDetail: reserves stock in the warehouse.
- OrderLine: reserves stock pending to receipt purchase order line.- Throws:
OBException
-
processReserve
public static OBError processReserve(Reservation reservation, String action) throws OBException
Allowed actions:- PR Process
- RE Reactivate
- HO Put on Hold
- UNHO Unhold
- CL Close
- Throws:
OBException
-
getReservationFromOrder
public static Reservation getReservationFromOrder(OrderLine salesOrderLine)
Returns a non closed reservation from given Sales Order Line. If no reservation exists it creates a new one in draft status.- Parameters:
salesOrderLine
- Sales Order Line owner of the reservation.- Returns:
- a Reservation related to the Sales Order Line
-
reallocateStock
public static OBError reallocateStock(Reservation reservation, Locator storageBin, AttributeSetInstance asi, BigDecimal quantity) throws OBException
Function to reallocate given reservation stock on given attributes and storage bin.- Throws:
OBException
-
existsReservationForStock
public static boolean existsReservationForStock(StorageDetail storageDetail)
Returns true if there are any reservations created against the given Storage Detail- Parameters:
storageDetail
- A StorageDetail object that contains the information about the Stock- Returns:
- true if there are Reservations created against this Stock, false otherwise
-
getReservationStockFromStorageDetail
public static List<ReservationStock> getReservationStockFromStorageDetail(StorageDetail storageDetail)
Returns a list of related Reservations Stock for a given Storage Detail- Parameters:
storageDetail
- A StorageDetail object that contains the information about the Stock- Returns:
- a list of related Reservations Stock
-
-