[Home] [Help]
PACKAGE: APPS.JAI_PA_TAX_PKG
Source
1 package jai_pa_tax_pkg as
2 /* $Header: jai_pa_tax_pkg.pls 120.0.12000000.1 2007/10/24 18:20:45 rallamse noship $ */
3
4 /*----------------------------------------------------------------------------------------
5 Change History
6 S.No. DATE Description
7 ------------------------------------------------------------------------------------------
8
9 1 24/04/1005 cbabu for bug#6012570 (5876390) Version: 120.0
10 Projects Billing Enh.
11 forward ported from R11i to R12
12
13 ---------------------------------------------------------------------------------------- */
14
15
16 -- process_success -- responsible for stating process execution success .....
17 -- process_fail -- responsible for stating process execution failure .....
18 process_success constant varchar2(20) := 'SUCCESS';
19 process_fail constant varchar2(20) := 'FAIL';
20
21
22 --------------------------------------------------------------------------------------------------------------------------
23 -- procedure name -- tax_defaultation
24 -- global procedure to call by trigger
25 -- it is called by trigger to do either defaultation of taxes or recalculation of taxes according to event send by trigger
26 ------parameter details---------------------------------------------------------------------------------------------------
27 -- pn_request_id - request id of projects table pa_draft_invoices_all for concurrent
28 -- pn_project_id - project id
29 -- pn_draft_invoice_num - draft invoice number
30 -- pv_event - either defaultation of taxes of recalculate taxes
31 -- jai_constants.default_taxes
32 -- jai_constants.recalculate_taxes
33
34 --------------------------------------------------------------------------------------------
35 procedure calc_taxes_for_invoices
36 (
37 err_buf out nocopy varchar2 ,
38 retcode out nocopy varchar2 ,
39 pn_request_id in pa_draft_invoices_all.request_id%type ,
40 pn_project_id in pa_draft_invoices_all.project_id%type ,
41 pn_draft_invoice_num in pa_draft_invoices_all.draft_invoice_num%type ,
42 pv_event in varchar2
43 ) ;
44
45 ---------------------------------------------------------------------------------------------------------------
46 -- procedure name -- tax_defaultation
47 -- procedure is responsible for calculate taxes for header level information in projects
48 --------------------------------------------------------------------------------------------
49
50 procedure dflt_taxes_for_invoice_lines(
51 r_new in pa_draft_invoices_all%rowtype,
52 pv_action in varchar2,
53 pv_process_message out nocopy varchar2,
54 pv_process_flag out nocopy varchar2
55 ) ;
56
57
58 ---------------------------------------------------------------------------------------------------------------
59 -- procedure name -- calculate_taxes
60 -- this procedure decides whether to call defaulting routine or call recalculating routine on basis of
61 -- pv_action
62 -- if pv_action is default_taxes then it will go for defaultation of taxes
63 -- if pv_action is recalculate_taxes then it will go for recalculation of taxes
64 --------------------------------------------------------------------------------------------
65 procedure calculate_taxes(
66 r_new in pa_draft_invoice_items%rowtype,
67 pv_action in varchar2,
68 pv_process_message out nocopy varchar2,
69 pv_process_flag out nocopy varchar2
70 ) ;
71
72
73 ---------------------------------------------------------------------------------------------------------------
74 -- procedure name -- tax_defaultation_line
75 --- three operation
76 ---- 1. getting tax category
77 ---- 2. inserting header and detail information into india localization tables
78 ---- 3. default taxes for these information
79 --------------------------------------------------------------------------------------------
80
81 procedure tax_defaultation_line(
82 r_new in pa_draft_invoice_items%rowtype,
83 pv_action in varchar2,
84 pv_process_message out nocopy varchar2,
85 pv_process_flag out nocopy varchar2
86 ) ;
87
88 ---------------------------------------------------------------------------------------------------------------
89 -- procedure name -- tax_recalculate_line
90 --- purpose -- responsibility for reaclculating taxes
91 ---------------------------------------------------------------------------------------------------------------
92 procedure tax_recalculate_line(
93 r_new in pa_draft_invoice_items%rowtype,
94 pv_action in varchar2,
95 pv_process_message out nocopy varchar2,
96 pv_process_flag out nocopy varchar2
97 ) ;
98 ------------------------------------------------------------------------------------------------------------------
99
100 ---------------------------------------------------------------------------------------------------------------
101 -- procedure name -- get_tax_category
102 --- purpose -- responsible for returning tax category to calling object for further operation
103 ---------------------------------------------------------------------------------------------------------------
104 procedure get_tax_category(
105 pn_project_id in pa_draft_invoices_all.project_id%type ,
106 pn_draft_invoice_num in pa_draft_invoices_all.draft_invoice_num%type ,
107 pn_line_num in pa_draft_invoice_items.line_num%type ,
108 pn_event_task_id in pa_draft_invoice_items.event_task_id%type,
109 pn_event_num in pa_draft_invoice_items.event_num%type,
110 pv_action in varchar2,
111 pv_process_message out nocopy varchar2,
112 pv_process_flag out nocopy varchar2,
113 pn_tax_category_id out nocopy JAI_CMN_TAX_CTGS_ALL.tax_category_id%type
114 ) ;
115 ---------------------------------------------------------------------------------------------------------------
116 -- procedure name -- get_event_tax_category
117 --- purpose -- responsible for returning tax category for event types
118 ---------------------------------------------------------------------------------------------------------------
119 procedure get_event_tax_category (
120 pn_project_id in pa_draft_invoices_all.project_id%type ,
121 pn_draft_invoice_num in pa_draft_invoices_all.draft_invoice_num%type ,
122 pn_line_num in pa_draft_invoice_items.line_num%type ,
123 pn_event_task_id in pa_draft_invoice_items.event_task_id%type,
124 pn_event_num in pa_draft_invoice_items.event_num%type,
125 pn_tax_category_id out nocopy JAI_CMN_TAX_CTGS_ALL.tax_category_id%type ,
126 pv_process_status out nocopy varchar2 ,
127 pv_process_message out nocopy varchar2,
128 pv_process_flag out nocopy varchar2
129 );
130
131 ---------------------------------------------------------------------------------------------------------------
132 -- procedure name -- get_project_tax_category
133 --- purpose -- responsible for returning tax category for project type
134 ---------------------------------------------------------------------------------------------------------------
135
136 procedure get_project_tax_category
137 (
138 pn_project_id in pa_draft_invoices_all.project_id%type ,
139 pn_draft_invoice_num in pa_draft_invoices_all.draft_invoice_num%type ,
140 pn_line_num in pa_draft_invoice_items.line_num%type ,
141 pn_tax_category_id out nocopy JAI_CMN_TAX_CTGS_ALL.tax_category_id%type ,
142 pv_process_status out nocopy varchar2 ,
143 pv_process_message out nocopy varchar2,
144 pv_process_flag out nocopy varchar2
145 );
146
147 ---------------------------------------------------------------------------------------------------------------
148 -- procedure name -- get_cust_tax_category
149 --- purpose -- responsible for returning tax category for customer - site or customer - null site combination
150 ---------------------------------------------------------------------------------------------------------------
151
152 procedure get_cust_tax_category
153 ( pn_project_id in pa_draft_invoices_all.project_id%type ,
154 pn_draft_invoice_num in pa_draft_invoices_all.draft_invoice_num%type ,
155 pn_line_num in pa_draft_invoice_items.line_num%type ,
156 pn_tax_category_id out nocopy JAI_CMN_TAX_CTGS_ALL.tax_category_id%type ,
157 pv_process_status out nocopy varchar2 ,
158 pv_process_message out nocopy varchar2,
159 pv_process_flag out nocopy varchar2
160 );
161 ---------------------------------------------------------------------------------------------------------------
162 -- procedure name -- get_expn_tax_category
163 --- purpose -- responsible for returning tax category for expenditure type
164 ---------------------------------------------------------------------------------------------------------------
165 procedure get_expn_tax_category
166 ( pn_project_id in pa_draft_invoices_all.project_id%type ,
167 pn_draft_invoice_num in pa_draft_invoices_all.draft_invoice_num%type ,
168 pn_line_num in pa_draft_invoice_items.line_num%type ,
169 pn_tax_category_id out nocopy JAI_CMN_TAX_CTGS_ALL.tax_category_id%type ,
170 pv_process_status out nocopy varchar2 ,
171 pv_process_message out nocopy varchar2,
172 pv_process_flag out nocopy varchar2
173 );
174 ---------------------------------------------------------------------------------------------------------------
175 -- procedure name -- insert_line_info
176 --- purpose -- responsible for inserting information in to india localizations tables
177 ---------------------------------------------------------------------------------------------------------------
178 procedure insert_line_info (
179 r_new in pa_draft_invoice_items%rowtype,
180 pn_tax_category_id in JAI_CMN_TAX_CTGS_ALL.tax_category_id%type ,
181 pv_action in varchar2,
182 pn_draft_invoice_id out nocopy jai_pa_draft_invoice_lines.draft_invoice_id%type ,
183 pn_draft_invoice_line_id out nocopy jai_pa_draft_invoice_lines.draft_invoice_line_id%type ,
184 pv_process_message out nocopy varchar2,
185 pv_process_flag out nocopy varchar2
186 ) ;
187 ---------------------------------------------------------------------------------------------------------------
188 -- procedure name -- default_taxes
189 --- purpose -- responsible for defaulting of taxes ..............
190 ---------------------------------------------------------------------------------------------------------------
191 procedure default_taxes (
192 pn_tax_category_id number ,
193 pn_draft_invoice_id number ,
194 pn_draft_invoice_line_id number ,
195 pn_line_amount number ,
196 pv_called_from varchar2 default null,
197 pn_tax_amount out nocopy number ,
198 pv_process_message out nocopy varchar2,
199 pv_process_flag out nocopy varchar2
200 ) ;
201
202 ------------------------------------------------------------------------------------------------------------------
203 ---------------------------------------------------------------------------------------------------------------
204 -- procedure name -- sync_deletion
205 --- purpose -- responsible for sync. of draft invoice deletion in projects ..............
206 ---------------------------------------------------------------------------------------------------------------
207 procedure sync_deletion (
208 pn_project_id number ,
209 pn_draft_invoice_num number ,
210 pv_process_message out nocopy varchar2,
211 pv_process_flag out nocopy varchar2
212 ) ;
213
214 ------------------------------------------------------------------------------------------------------------------
215 ---------------------------------------------------------------------------------------------------------------
216 -- procedure name -- initialize_variable
217 --- purpose -- responsible for initilize for global package variable ..............
218 ---------------------------------------------------------------------------------------------------------------
219 procedure initialize_variable ( pn_project_id number ,
220 pn_draft_invoice_num number ,
221 pv_process_message out nocopy varchar2,
222 pv_process_flag out nocopy varchar2 );
223 ------------------------------------------------------------------------------------------------------------------
224
225 END jai_pa_tax_pkg;