1 PACKAGE BODY POA_CUSTOMIZATION_PKG AS
2 /* $Header: poacustb.pls 120.0 2005/06/01 23:05:43 appldev noship $ */
3
4
5 -- ========================================================================
6 -- Purchase_Classification_Code
7 --
8 -- This API can be customized for classification of purchases,
9 -- for example: for Production or Non-Production items.
10 -- It serves as a gateway where customers can define their own
11 -- purchase classifications to meet their business needs.
12 --
13 -- A new user updateable lookup, Purchase Classification, has been
14 -- defined for this purpose. It currently is seeded with the lookup
15 -- codes for Production, and Non-Production.
16 -- Users can define new lookup codes for their purchase classification
17 -- through the application.
18 -- The lookup codes reside in the PO_LOOKUP_CODES table.
19 --
20 -- Parameters: p_primary_key_id
21 -- p_primary_key_type
22 --
23 -- where p_primary_key_type refers to the base table of the entity
24 -- and p_primary_key_id refers to the primary key id of the base table
25 -- entity.
26 --
27 -- Called by:
28
29 -- Facts p_primary_key_type p_primary_key_id
30 -- -------------------- --------------------- ---------------------
31 -- Supplier Performance PO_LINE_LOCATIONS_ALL line_location_id
32 -- PO Distributions PO_DISTRIBUTIONS_ALL po_distribution_id
33 -- Receiving RCV_TRANSACTIONS transaction_id
34 --
35 -- Return: the lookup_code in the PO_LOOKUP_CODES table
36 -- corresponding to the purchase classification type,
37 -- where the lookup_type is 'PURCHASE CLASSIFICATION.
38 --
39 -- select lookup_code
40 -- from po_lookup_codes
41 -- where lookup_type = 'PURCHASE CLASSIFICATION'
42 -- ========================================================================
43
44 Function Purchase_Classification_Code (
45 p_primary_key_id in NUMBER,
46 p_primary_key_type in VARCHAR2) return VARCHAR2 IS
47
48 l_code VARCHAR2(240) := NULL;
49
50 BEGIN
51 /* Here could be some conditional statements to call other
52 functions from customers defining the classification. */
53
54 return (l_code);
55
56 EXCEPTION when others then
57 return NULL;
58 END Purchase_Classification_Code;
59
60
61
62 -- ========================================================================
63 -- Get_Target_Price
64 --
65 -- This API can be customized for calculating the unit target price for the
66 -- item in the purchase shipment line.
67 --
68 -- The target price measure is normally used for calculating
69 -- a supplier' price score.
70 --
71 -- Parameters: p_line_location_id
72 --
73 -- where p_line_location_id refers to the line_location_id of the record
74 -- in PO_LINE_LOCATIONS_ALL table
75 --
76 -- Called by: Supplier Performance fact source view for its
77 -- target price measure.
78 --
79 -- Return: target price expressed in the purchase transaction
80 -- currency
81 -- ========================================================================
82
83 FUNCTION Get_Target_Price(p_line_location_id NUMBER)
84 RETURN NUMBER
85 IS
86 v_target_price NUMBER := NULL;
87 BEGIN
88
89 -- Currently default to the best price found
90
91 v_target_price := poa_edw_supperf.find_best_price(p_line_location_id);
92
93 RETURN(v_target_price);
94
95 EXCEPTION
96 WHEN NO_DATA_FOUND THEN
97 RETURN(v_target_price);
98 WHEN OTHERS THEN
99 RAISE;
100
101 END Get_Target_Price;
102
103
104
105 END POA_CUSTOMIZATION_PKG;