Class ReservationUtils


  • public class ReservationUtils
    extends Object
    • Constructor Detail

      • ReservationUtils

        public ReservationUtils()
    • Method Detail

      • 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
      • 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
      • 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