-----------------------------------------------------------------------------
--
--  Logical unit: PurchaseOrder
--  Component:    PURCH
--
--  IFS Developer Studio Template Version 3.0
--
--  Date    Sign        History
--  ------  ------      ---------------------------------------------------------
--  250904  HoiKalshA   Added
--  250904  HoiKalshA   Uplifting a part of C_G1570751-1 PO Printout issues
-----------------------------------------------------------------------------

layer Cust;

-------------------- PUBLIC DECLARATIONS ------------------------------------


-------------------- PRIVATE DECLARATIONS -----------------------------------


-------------------- LU SPECIFIC IMPLEMENTATION METHODS ---------------------


-------------------- LU SPECIFIC PRIVATE METHODS ----------------------------


-------------------- LU SPECIFIC PROTECTED METHODS --------------------------


-------------------- LU SPECIFIC PUBLIC METHODS -----------------------------


-------------------- LU CUST NEW METHODS -------------------------------------

--(+) 150826 C_G1570751-1 PO Printout issues(START)
FUNCTION Get_C_Ordered_for (
   order_no_ IN VARCHAR2 ) RETURN VARCHAR2

IS
  CURSOR get_values IS

      SELECT DISTINCT Purchase_Requisition_API.Get_Receiver(a.requisition_no) order_for
      FROM PURCHASE_ORDER_LINE_NOPART a
      WHERE a.order_no = order_no_
      UNION
      SELECT Purchase_Requisition_API.Get_Receiver(b.requisition_no)
      FROM PURCHASE_ORDER_LINE_PART b
      WHERE b.order_no = order_no_;
  order_for_ VARCHAR2(1000);
BEGIN

   FOR rec_ IN get_values LOOP
     order_for_ :=  order_for_  || ', ' || rec_.order_for;
   END LOOP;
   RETURN substr(order_for_,3,length(order_for_));
END Get_C_Ordered_for;
--(+) 150826 C_G1570751-1 PO Printout issues(FINISH)