[Home] [Help]
PACKAGE: APPS.INL_TAX_PVT
Source
1 PACKAGE INL_TAX_PVT AUTHID CURRENT_USER AS
2 /* $Header: INLVTAXS.pls 120.6.12010000.9 2009/08/17 19:10:20 aicosta ship $ */
3
4 G_ENTITY_CODE zx_evnt_cls_mappings.entity_code%TYPE;
5 G_MODULE_NAME CONSTANT VARCHAR2(200) := 'INL.PLSQL.INL_TAX_PVT.';
6 G_PKG_NAME CONSTANT VARCHAR2(30):='INL_TAX_PVT';
7 CURSOR Shipment_Lines(p_ship_header_id number) IS
8 SELECT bill_from_party_id
9 ,bill_from_party_site_id
10 ,bill_to_location_id
11 ,bill_to_organization_id
12 ,currency_code
13 ,currency_conversion_date
14 ,currency_conversion_rate
15 ,currency_conversion_type
16 ,intended_use
17 ,inventory_item_id
18 ,line_qty
19 ,party_id
20 ,party_site_id
21 ,poa_party_id
22 ,poa_party_site_id
23 ,poo_location_id
24 ,poo_organization_id
25 ,product_category
26 ,product_fiscal_class
27 ,product_type
28 ,ship_from_party_id
29 ,ship_from_party_site_id
30 ,ship_header_id
31 ,ship_line_id
32 ,ship_line_num
33 ,ship_to_location_id
34 ,ship_to_organization_id
35 ,source
36 ,src_id
37 ,src_type_code
38 ,tax_already_calculated_flag
39 ,tax_classification_code
40 ,trx_business_category
41 ,unit_price
42 ,uom_code
43 ,user_def_fiscal_class
44 FROM inl_ebtax_lines_v
45 WHERE ship_header_id = p_ship_header_id
46 AND adjustment_num = 0;
47 TYPE ship_Lines_Tab_Type IS TABLE OF Shipment_Lines%ROWTYPE;
48 l_ship_line_list ship_Lines_Tab_Type;
49
50 CURSOR Shipment_Header(p_ship_header_id number) IS
51 SELECT -- all fields could be used by hook
52 ship_header_id
53 ,ship_num
54 ,ship_date
55 ,ship_type_id
56 ,ship_status_code
57 ,pending_matching_flag
58 ,legal_entity_id
59 ,organization_id
60 ,location_id
61 ,org_id
62 ,taxation_country
63 ,document_sub_type
64 ,ship_header_int_id
65 ,interface_source_code
66 ,interface_source_table
67 ,interface_source_line_id
68 ,adjustment_num
69 ,created_by
70 ,creation_date
71 ,last_updated_by
72 ,last_update_date
73 ,last_update_login
74 ,program_id
75 ,program_update_date
76 ,program_application_id
77 ,request_id
78 ,attribute_category
79 ,attribute1
80 ,attribute2
81 ,attribute3
82 ,attribute4
83 ,attribute5
84 ,attribute6
85 ,attribute7
86 ,attribute8
87 ,attribute9
88 ,attribute10
89 ,attribute11
90 ,attribute12
91 ,attribute13
92 ,attribute14
93 ,attribute15
94 ,rcv_enabled_flag
95 FROM inl_ship_headers
96 WHERE ship_header_id = p_ship_header_id;
97 l_ship_header_rec Shipment_Header%ROWTYPE;
98
99 -- Record to keep Tax Line info.
100 TYPE tax_ln_rec IS RECORD(
101 tax_code VARCHAR2(30),
102 ship_header_id NUMBER,
103 source_parent_table_name VARCHAR2(30),
104 source_parent_table_id NUMBER,
105 tax_amt NUMBER,
106 nrec_tax_amt NUMBER,
107 currency_code VARCHAR2(15),
108 currency_conversion_type VARCHAR2(30),
109 currency_conversion_date DATE,
110 currency_conversion_rate NUMBER,
111 tax_amt_included_flag VARCHAR2(1),
112 -- Association attributes
113 to_parent_table_name VARCHAR2(30),
114 to_parent_table_id NUMBER
115 );
116
117 TYPE tax_ln_tbl IS TABLE OF tax_ln_rec INDEX BY BINARY_INTEGER;
118
119 CURSOR charge_ln (p_ship_header_id number) IS
120 SELECT
121 assoc.to_parent_table_name,
122 assoc.to_parent_table_id,
123 assoc.allocation_basis,
124 assoc.allocation_uom_code,
125 cl.*
126 FROM inl_adj_charge_lines_v cl,
127 inl_associations assoc
128 WHERE assoc.from_parent_table_name = 'INL_CHARGE_LINES'
129 AND assoc.from_parent_table_id = cl.charge_line_id
130 AND assoc.ship_header_id = p_ship_header_id
131 order by assoc.to_parent_table_name,
132 assoc.to_parent_table_id,
133 cl.charge_line_id
134 ;
135
136 TYPE charge_ln_tbl_tp IS TABLE OF charge_ln%ROWTYPE INDEX BY BINARY_INTEGER;
137 TYPE sh_group_ln_tbl_tp IS TABLE OF inl_ship_line_groups%ROWTYPE INDEX BY BINARY_INTEGER;
138 TYPE ship_ln_tbl_tp IS TABLE OF inl_adj_ship_lines_v%ROWTYPE INDEX BY BINARY_INTEGER;
139
140 PROCEDURE Generate_Taxes(
141 p_api_version IN NUMBER,
142 p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
143 p_commit IN VARCHAR2 := FND_API.G_FALSE,
144 p_ship_header_id IN NUMBER,
145 p_source IN VARCHAR2 := 'PO',
146 x_return_status OUT NOCOPY VARCHAR2,
147 x_msg_count OUT NOCOPY NUMBER,
148 x_msg_data OUT NOCOPY VARCHAR2
149 );
150
151 PROCEDURE Calculate_Tax(
152 p_api_version IN NUMBER,
153 p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
154 p_commit IN VARCHAR2 := FND_API.G_FALSE,
155 p_ship_header_id IN NUMBER,
156 x_return_status OUT NOCOPY VARCHAR2,
157 x_msg_count OUT NOCOPY NUMBER,
158 x_msg_data OUT NOCOPY VARCHAR2
159 );
160
161 PROCEDURE Get_DefaultTaxDetAttribs(
162 p_api_version IN NUMBER,
163 p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
164 p_commit IN VARCHAR2 := FND_API.G_FALSE,
165 p_application_id IN NUMBER,
166 p_entity_code IN VARCHAR2,
167 p_event_class_code IN VARCHAR2,
168 p_org_id IN VARCHAR2,
169 p_item_id IN NUMBER,
170 p_country_code IN VARCHAR2,
171 p_effective_date IN DATE,
172 p_source_type_code IN VARCHAR2,
173 p_po_line_location_id IN NUMBER,
174 x_return_status OUT NOCOPY VARCHAR2,
175 x_msg_count OUT NOCOPY NUMBER,
176 x_msg_data OUT NOCOPY VARCHAR2,
177 x_trx_biz_category OUT NOCOPY VARCHAR2,
178 x_intended_use OUT NOCOPY VARCHAR2,
179 x_prod_category OUT NOCOPY VARCHAR2,
180 x_prod_fisc_class_code OUT NOCOPY VARCHAR2,
181 x_product_type OUT NOCOPY VARCHAR2
182 );
183
184 END INL_TAX_PVT;