1 package PA_FUNDS_CONTROL_PKG1 as
2 -- $Header: PABCPKTS.pls 120.8.12000000.2 2007/10/30 17:20:51 vchilla ship $
3 ----------------------------------------------------------------------------------------
4 -- This Api gets the Start and End date based on amount type and boundary code
5 -- set up for the project. funds availability will be checked based on this
6 -- start and end dates.
7 -- The following combinations are supported
8 -- Amount Type Boundary Code
9 -- ============== ==============
10 -- Project Project to Date
11 -- Project Year to Date
12 -- Project Period to Date
13 -- Year Year to Date
14 -- Year Period to Date
15 -- Period Period to Date
16 -- ========================================
17 PROCEDURE setup_start_end_date (
18 p_packet_id IN NUMBER,
19 p_bc_packet_id IN NUMBER,
20 p_project_id IN pa_bc_packets.project_id%TYPE,
21 p_budget_version_id IN pa_bc_packets.budget_version_id%TYPE,
22 p_time_phase_type_code IN pa_budget_entry_methods.time_phased_type_code%TYPE,
23 p_expenditure_item_date IN DATE,
24 p_amount_type IN pa_budgetary_control_options.amount_type%TYPE,
25 p_boundary_code IN pa_budgetary_control_options.boundary_code%TYPE,
26 p_set_of_books_id IN pa_bc_packets.set_of_books_id%TYPE,
27 x_start_date OUT NOCOPY DATE,
28 x_end_date OUT NOCOPY DATE,
29 x_error_code OUT NOCOPY NUMBER,
30 x_err_buff OUT NOCOPY VARCHAR2,
31 x_return_status OUT NOCOPY VARCHAR2,
32 x_result_code OUT NOCOPY VARCHAR2 ) ;
33
34
35 -----------------------------------------------------------------------------------------------------------------
36 --This Api copies the project related records from gl_bc_packets to pa_bc_packets for document type AP,PO,REQ,
37 --CONTRACT PAYMENTS. For the document types CONTRACT COMMITMENT it copies records from
38 --IGC_CC_INTERFACE table , for the document type = EXP records are inserted into pa bc packets during costing
39 ------------------------------------------------------------------------------------------------------------------
40
41 -- R12 Funds Management Uptake : Renamed procedure populate_plsql_tabs to copy_gl_pkt_to_pa_pkt. This procedure
42 -- will be fired from Main GL budgetary control API.
43
44 PROCEDURE create_proj_encumbrance_events (p_application_id IN NUMBER ,
45 p_partial_flag IN VARCHAR2 DEFAULT 'N',
46 p_bc_mode IN VARCHAR2 DEFAULT 'C',
47 x_return_code OUT NOCOPY VARCHAR2 );
48
49 ---------------------------------------------------------------------
50 -- this api creates the burden lines for the purchase order and
51 -- supplier invoice lines in pa_bc_packets
52 ---------------------------------------------------------------------
53 FUNCTION create_ap_po_bdn_lines
54 (p_packet_id IN NUMBER,
55 p_bc_packet_id IN NUMBER,
56 p_burden_type IN VARCHAR2,
57 P_entered_dr IN NUMBER,
58 P_entered_cr IN NUMBER,
59 P_period_name IN VARCHAR2,
60 p_doc_type IN VARCHAR2,
61 p_related_link IN VARCHAR2,
62 p_exp_type IN VARCHAR2,
63 p_accounted_dr IN NUMBER,
64 p_accounted_cr IN NUMBER,
65 p_compiled_multiplier IN NUMBER
66 ) RETURN boolean ;
67 ------------------------------------------------------------------------------------------------------------------
68 --This Api insert new records into pa bc packets if the project type is burdened.If the PO is based on REQ, or
69 --Invoice is based on PO then it takes the burden amount for the REQ or PO from pa_bc_commitments table
70 --and ensures that for req or po the old burden amount is used when reversing lines are passed in gl_bc_packets
71 ------------------------------------------------------------------------------------------------------------------
72 PROCEDURE Populate_burden_cost
73 (p_packet_id IN NUMBER
74 ,p_calling_module IN VARCHAR2
75 ,x_return_status OUT NOCOPY VARCHAR2
76 ,x_err_msg_code OUT NOCOPY VARCHAR2
77 ) ;
78
79 -------------------------------------------------------------------------------------------------------
80 --This api copies the unreserved transaction into to the packet.
81 -- when the calling mode is unreserved then copy all the transactions from pa_bc_packets
82 -- for the old packet id(which is funds cheked and approved) to new packet by swapping the amount
83 -- columns and all other columns values remain same. Approve the packets with status Approved
84 -- donot create encumbrance liquidation as GL funds checker will create reversing lines
85 -- for the old packet id and donot populate burden rows / donot check for the unreserved packet
86 --------------------------------------------------------------------------------------------------------
87 FUNCTION create_unrsvd_lines
88 ( x_packet_id IN OUT NOCOPY NUMBER
89 ,p_mode IN VARCHAR2
90 ,p_calling_module IN VARCHAR2
91 ,p_reference1 IN varchar2 default null
92 ,p_reference2 IN varchar2 default null
93 ) RETURN BOOLEAN ;
94 -----------------------------------------------------------------------------------------------------
95
96 -- R12:Funds Managment Uptake: Deleting obsolete function get_period_name definition
97
98 /** This api returns the start date or end date for the given amount type boundary code
99 * conditions, this in turn make calls the setup_start_end_date api
100 * if p_type param is START_DATE then this api returns start-date
101 * if p_type param is END_DATE then this api returns end date
102 */
103
104 FUNCTION get_start_or_end_date(
105 p_packet_id IN NUMBER,
106 p_bc_packet_id IN NUMBER,
107 p_project_id IN pa_bc_packets.project_id%TYPE,
108 p_budget_version_id IN pa_bc_packets.budget_version_id%TYPE,
109 p_time_phase_type_code IN pa_budget_entry_methods.time_phased_type_code%TYPE,
110 p_expenditure_item_date IN DATE,
111 p_amount_type IN pa_budgetary_control_options.amount_type%TYPE,
112 p_boundary_code IN pa_budgetary_control_options.boundary_code%TYPE,
113 p_set_of_books_id IN pa_bc_packets.set_of_books_id%TYPE,
114 p_type IN varchar2 -- START_DATE or END_DATE
115 ) return DATE ;
116
117 -- R12:Funds Managment Uptake: Deleting obsolete PROCEDURE checkCWKbdExp definition
118
119
120 /* This api will update the summary level flag, compiled multiplier etc
121 * attributes required for contingent worker related transactions
122 */
123 PROCEDURE upd_cwk_attributes(p_calling_module varchar2
124 ,p_packet_id number
125 ,p_mode varchar2
126 ,p_reference varchar2
127 ,x_return_status OUT NOCOPY varchar2 );
128
129 --PRAGMA RESTRICT_REFERENCES (get_start_or_end_date, WNDS);
130
131 PROCEDURE check_exp_of_cost_base(p_task_id IN number,
132 p_exp_type IN varchar2,
133 p_ei_date IN date,
134 p_sch_type IN varchar2 default 'C',
135 x_base OUT NOCOPY varchar2,
136 x_cp_structure OUT NOCOPY varchar2,
137 x_return_status OUT NOCOPY varchar2,
138 x_error_msg_code OUT NOCOPY varchar2);
139
140 /* The APi will return the compiled multiplier that needs to be stamped on the summary
141 * record line for the contingent worker transactions
142 */
143 FUNCTION get_cwk_multiplier(p_project_id IN Number
144 ,p_task_id IN Number
145 ,p_budget_version_id IN Number
146 ,p_document_line_id IN Number
147 ,p_document_type IN Varchar2
148 ,p_expenditure_type IN Varchar2
149 ,p_bd_disp_method IN Varchar2
150 ,p_reference IN Varchar2 default 'GL'
151 ) Return Number ;
152
153
154 -- R12 Funds Management Uptake : This tieback procedure is called from PSA_BC_XLA_PVT.Budgetary_control
155 -- if SLA accounting fails.This API will mark the pa_bc_packet records to failed status.
156 PROCEDURE TIEBACK_FAILED_ACCT_STATUS (p_bc_mode IN VARCHAR2 DEFAULT 'C');
157
158 -- R12 Funds Management Uptake : This Procedure is called from "PRC: Generate Cost accounting events"
159 -- Process. After events are generated for BTC/TBC actuals which are eligible to get interfaced to SLA ,
160 -- The below procedure stamps these events on the associated commitments .
161
162 PROCEDURE INTERFACE_TBC_BTC_COMT_UPDATE (p_calling_module IN VARCHAR2,
163 P_request_id IN NUMBER ,
164 x_result_code OUT NOCOPY VARCHAR2);
165
166
167 -- ----------------------------------------------------------------------------+
168 -- Function get_ration will determine the burden to raw ratio.
169 -- This is used in cursor po_amounts and pkt_po_amounts in procedure
170 -- populate_burden_cost
171 -- ----------------------------------------------------------------------------+
172 Function get_ratio(p_document_header_id in number,
173 p_document_distribution_id in number,
174 p_document_type in varchar2,
175 p_mode in varchar2,
176 p_dr_cr in varchar2)
177 return number;
178
179 ----------------------------------------------------------------------
180 -- Created the following two Procedures POPULATE_PLSQL_TABS_CBC and
181 -- CREATE_CBC_PKT_LINES for Contract Commitments Enhancement.
182 ----------------------------------------------------------------------
183 -------->6599207 ------As part of CC Enhancements
184 PROCEDURE populate_plsql_tabs_CBC
185 (p_packet_id IN number
186 ,p_calling_module IN varchar2
187 ,p_reference1 IN varchar2
188 ,p_reference2 IN varchar2
189 ,p_mode IN varchar2);
190
191 PROCEDURE create_CBC_pkt_lines(p_calling_module IN varchar2,
192 p_packet_id IN number
193 ,p_reference1 IN VARCHAR2
194 ,p_reference2 IN VARCHAR2
195 ,p_mode IN varchar2);
196 -------->6599207 ------END
197 ----------------------------------------------------------------------
198
199 END PA_FUNDS_CONTROL_PKG1;