1 PACKAGE po_auto_dist_process_pvt AUTHID CURRENT_USER AS
2 /* $Header: PO_AUTO_DIST_PROCESS_PVT.pls 120.3 2011/12/09 14:35:56 snelloru ship $ */
3
4
5 /* ----------------------------------------------------
6 ----------------- PUBLIC PROCEDURES -------------------
7 ---------------------------------------------------- */
8
9
10 /* ============================================================================
11 NAME: derive_and_default_dists
12 DESC: Peform derivation logic on distributions.
13
14 The derived attributes include:
15
16 - distribution_num
17 - distribution_id
18
19 ARGS: IN OUT : x_dists PO_AUTOCREATE_TYPES.distributions_rec_type -Record variable to hold the distributions info
20
21 NOTE: Use the following procedures to derive the distribution attributes
22 -PO_INTERFACE_S.create_distributions
23 CALLER OF THE PROCEDURE
24 -PO_AUTOCREATE_MAINPROC_PVT.process_distributions
25
26 ==============================================================================*/
27
28 PROCEDURE derive_and_default_dists( p_lines IN PO_AUTOCREATE_TYPES.lines_rec_type);
29
30 /* ============================================================================
31 Name: create_payitem_dists
32 Pre-reqs:
33 PO Payitems have all been created.
34 Modifies:
35 PO_DISTRIBUTIONS_ALL
36 Locks:
37 None.
38 Function:
39 Create all distributions for all payitems for a PO Line.
40 Parameters:
41 IN:
42 p_lines PO_AUTOCREATE_TYPES.lines_rec_type
43 OUT:
44 None.
45 Notes:
46 None
47 Testing:
48 None
49 End of Comments
50 ==============================================================================*/
51
52 PROCEDURE create_payitem_dists( p_lines IN PO_AUTOCREATE_TYPES.lines_rec_type ) ;
53
54 --ACRN
55 PROCEDURE Default_Acrn_Values;
56
57 /* ============================================================================
58 Name: update_award_distributions
59 Pre-reqs:
60 None
61 Modifies:
62 PO_DISTRIBUTIONS_INTERFACE
63 GMS_AWARD_DISTRIBUTIONS
64 Locks:
65 None
66 Function:
67 Calls Grants Accounting API to create new award distributions lines
68 when a requisition with distributions that reference awards is
69 autocreated into a PO.
70 Parameters:
71 <Complex Work R12>: Add p_table_type and p_po_line_id
72 p_table_type(IN)
73 'INTERFACE' - query/update interface tables (default)
74 'ALL - query/update _ALL tables
75 p_po_line_id(IN)
76 Only necessary if p_table_type = 'ALL', this is the line for
77 which to update the award distributions for.
78 p_intf_header_id (IN) the interface_header_id
79 p_intf_line_id the (IN) interface_line_id
80 Both the above parameters are Used when p_table_type is INTERFACE.
81 Returns:
82 None
83 Testing:
84 None
85 Caller of the Procedure:
86 -derive_and_default_dists
87 -create_payitem_dists
88 ==============================================================================*/
89
90 PROCEDURE update_award_distributions( p_intf_header_id IN NUMBER ,
91 p_intf_line_id IN NUMBER ,
92 p_table_type IN VARCHAR2 DEFAULT 'INTERFACE' ,
93 p_po_line_id IN NUMBER DEFAULT NULL ); --<GRANTS FPJ>
94 /* ----------------------------------------------------------------------------
95 --Start of Comments
96 --Name: calibrate_last_dist_amount
97 --Pre-reqs:
98 -- None.
99 --Modifies:
100 -- PO_DISTRIBUTIONS_DRAFT_ALL.AMOUNT_ORDERED
101 --Locks:
102 -- None.
103 --Function:
104 -- This procedure is used to calibrate the amount of the last distribution
105 -- belonging to a particular PO Shipment. After going through UOM/currency
106 -- conversion and rounding, there is a chance that the sum of the distribution
107 -- amounts will not add up to the shipment amount, causing submission checks
108 -- to fail. To correct this, we will recalculate the last distribution
109 -- amount as the difference between the shipment amount and the sum of
110 -- all other distribution amounts.
111 --Parameters:
112 --IN:
113 --p_line_location_id
114 -- ID belonging to parent shipment of the distributions which need to be
115 -- calibrated.
116 --Testing:
117 -- None.
118 --Caller of the Procedure
119 -create_payitem_dists
120 --End of Comments
121 -------------------------------------------------------------------------------*/
122 PROCEDURE calibrate_last_dist_amount(p_line_location_id IN NUMBER );
123
124 /* -------------------------------------------------------------------------------
125 --Start of Comments
126 --Name: calibrate_last_dist_quantity
127 --Pre-reqs:
128 -- None.
129 --Modifies:
130 -- PO_DISTRIBUTIONS_DRAFT_ALL.QUANTITY_ORDERED
131 --Locks:
132 -- None.
133 --Function:
134 -- This procedure is used to calibrate the quantity of the last distribution
135 -- belonging to a particular PO Shipment. After going through UOM/currency
136 -- conversion and rounding, there is a chance that the sum of the distribution
137 -- quantitiess will not add up to the shipment qty, causing submission checks
138 -- to fail. To correct this, we will recalculate the last distribution
139 -- quantity as the difference between the shipment quantity and the sum of
140 -- all other distribution quantities.
141 --Parameters:
142 --IN:
143 --p_line_location_id
144 -- ID belonging to parent shipment of the distributions which need to be
145 -- calibrated.
146 --Testing:
147 -- None.
148 --Caller of the Procedure
149 -create_payitem_dists
150 --End of Comments
151 -------------------------------------------------------------------------------*/
152 PROCEDURE calibrate_last_dist_quantity(p_line_location_id IN NUMBER );
153
154 END PO_AUTO_DIST_PROCESS_PVT;