DBA Data[Home] [Help]

PACKAGE: APPS.ZX_PRODUCT_INTEGRATION_PKG

Source


1 PACKAGE ZX_PRODUCT_INTEGRATION_PKG AS
2 /* $Header: zxdiprodintgpkgs.pls 120.9.12010000.2 2008/11/12 12:23:29 spasala ship $ */
3 
4 MTHD_LATIN CONSTANT VARCHAR2(10) := 'LTE';
5 TAX_TYPE_INACTIVE CONSTANT NUMBER := 0;
6 TAX_TYPE_LOCATION CONSTANT NUMBER := 1;
7 TAX_TYPE_SALES    CONSTANT NUMBER := 2;
8 TAX_TYPE_VAT      CONSTANT NUMBER := 3;
9 
10 TAX_SUCCESS       CONSTANT VARCHAR2(1) := '0';
11 TAX_NO_VENDOR 	  CONSTANT VARCHAR2(1) := '1';
12 TAX_RC_NO_RATE    CONSTANT VARCHAR2(1) := '2';
13 TAX_RC_OERR       CONSTANT VARCHAR2(1) := '9';
14 TAX_RC_SYSERR     CONSTANT VARCHAR2(2) := '10';
15 
16 /*-----------------------------------------------------------------------*/
17 /*       User Defined Exceptions                                         */
18 /*-----------------------------------------------------------------------*/
19 AR_TAX_EXCEPTION	EXCEPTION;	/* General Exception raised for all Tax errors  */
20 TAX_NO_RATE		EXCEPTION;	/* Could not deduce tax rate for line */
21 TAX_NO_CODE		EXCEPTION;	/* Could not deduce tax code for line */
22 TAX_NO_AMOUNT		EXCEPTION;	/* Amount in RA_INTERFACE_LINES was null */
23 TAX_NO_PRECISION	EXCEPTION;	/* Precision is null, no rate returned */
24 TAX_NO_DATA		EXCEPTION;	/* Sales Tax compounding was unable to find any data */
25 TAX_NEED_POSTAL		EXCEPTION;	/* Postal Code was not found, could not deduce Sales tax rate */
26 TAX_CODE_INACTIVE	EXCEPTION;	/* Tax code passed is Inactive for the trx date */
27 TAX_BAD_DATA		EXCEPTION;	/* Fatal Data Error - Sales Tax Calculation aborted */
28 TAX_OERR		EXCEPTION;	/* Oracle Error */
29 
30 /*-----------------------------------------------------------------------*/
31 /*       Table/Record Types                                              */
32 /*-----------------------------------------------------------------------*/
33 
34 TYPE VARCHAR2_30_tab_type IS TABLE OF
35         VARCHAR2(30) INDEX BY BINARY_INTEGER;
36 
37 TYPE system_info_rec_type IS RECORD
38 (
39   --
40   -- This record holds general information used by the Tax Entity handler
41   -- and its associated functions.
42   --
43 	sysparam		 ar_system_parameters%ROWTYPE,
44 	/* nipatel added for eTax uptake */
45 	ar_product_options_rec zx_product_options_all%ROWTYPE,
46 	pa_product_options_rec zx_product_options_all%ROWTYPE,
47         tax_enforce_account_flag VARCHAR2(1),
48 	chart_of_accounts_id	 gl_sets_of_books.chart_of_accounts_id%TYPE,
49 	base_precision		 fnd_currencies.precision%TYPE,
50 	func_precision		 fnd_currencies.precision%TYPE,
51 	min_accountable_unit	 fnd_currencies.minimum_accountable_unit%TYPE,
52 	insert_tax_lines	 CHAR,	/* If 'N', no inserts or Autoaccounting calls will be made */
53 	call_auto_acctng	 CHAR,	/* If 'N', Autoaccounting will not be called, 'N' when called from 'C' */
54 	tax_view_set		 VARCHAR2(2),	/* Tax view Name space. '_A' for Taxware, '_V' for Vertex etc. NULL for Oracle Tax views */
55 	appl_short_name		 VARCHAR2(30),	/* AR or OE */
56 	func_short_name		 VARCHAR2(30),	/* GL_ACCT_FIRST, ACCT_RULES or ACCT_DIST */
57 	base_currency_code	 fnd_currencies.currency_code%TYPE, /* functional currency code */
58 	allow_multiple_inclusive CHAR, /* If 'N', multiple inclusive taxes are not allowed */
59 	search_hierarchy_tab     VARCHAR2_30_tab_type, /* Tax defaulting hierarchy table */
60 	search_pa_hierarchy_tab  VARCHAR2_30_tab_type  /* PA Tax defaulting hierarchy table */
61 );
62 
63 sysinfo	system_info_rec_type;
64 
65 
66 TYPE profile_info_rec_type IS RECORD
67 (
68   --
69   -- This record holds profile information used by the Tax Entity Handlers
70   -- and its associated functions.
71   --
72 	application_id		BINARY_INTEGER,
73 	user_id			BINARY_INTEGER,
74 	so_organization_id	BINARY_INTEGER
75 );
76 
77 profinfo profile_info_rec_type;
78 
79 
80 TYPE tax_info_rec_type IS RECORD
81 (
82 
83 -- This record holds general information used by the tax engine about
84 -- each transaction, transaction line and tax line. Records in this
85 -- global can change on each row returned from any of the tax views.
86 --
87 
88 /*-----------------------------------------------------------------------*/
89 /*       Transaction Header Data                                         */
90 /*-----------------------------------------------------------------------*/
91 
92 bill_to_cust_id                  ra_customer_trx.bill_to_customer_id%TYPE,
93 ship_to_cust_id                  ra_customer_trx.ship_to_customer_id%TYPE,
94 
95 customer_trx_id                  NUMBER,
96 
97 trx_number			 ra_customer_trx.trx_number%TYPE,
98 bill_to_customer_number		 hz_cust_accounts.account_number%TYPE,
99 ship_to_customer_number		 hz_cust_accounts.account_number%TYPE,
100 bill_to_customer_name		 hz_parties.party_name%TYPE,
101 ship_to_customer_name		 hz_parties.party_name%TYPE,
102 previous_customer_trx_id	 ra_customer_trx_lines.previous_customer_trx_id%TYPE,
103 previous_trx_number		 ra_customer_trx.trx_number%TYPE,
104 trx_date                         ra_customer_trx.trx_date%TYPE,
105 gl_date				 ra_cust_trx_line_gl_dist.gl_date%TYPE,
106 ship_to_site_use_id              hz_cust_site_uses.site_use_id%TYPE,
107 bill_to_site_use_id              hz_cust_site_uses.site_use_id%TYPE,
108 ship_to_postal_code              hz_locations.postal_code%TYPE,
109 bill_to_postal_code              hz_locations.postal_code%TYPE,
110 ship_to_location_id              NUMBER,
111 bill_to_location_id              NUMBER,
112 invoicing_rule_id                ra_customer_trx.invoicing_rule_id%TYPE,
113 fob_point                        ra_customer_trx.fob_point%TYPE,
114 trx_currency_code                ra_customer_trx.invoice_currency_code%TYPE,
115 trx_exchange_rate                ra_customer_trx.exchange_rate%TYPE,
116 minimum_accountable_unit         fnd_currencies.minimum_accountable_unit%TYPE,
117 precision                        fnd_currencies.precision%TYPE,
118 tax_header_level_flag            hz_cust_accounts.tax_header_level_flag%TYPE,
119 tax_rounding_rule                hz_cust_accounts.tax_rounding_rule%TYPE,
120 /*-----------------------------------------------------------------------*/
121 /*       Release 11 Transaction header data                              */
122 /*-----------------------------------------------------------------------*/
123 trx_type_id                	 ra_cust_trx_types.cust_trx_type_id%TYPE,
124 ship_from_warehouse_id           NUMBER,
125 payment_term_id                	 ra_customer_trx.term_id%TYPE,
126 
127 
128 /*-----------------------------------------------------------------------*/
129 /*       Transaction Line Data                                           */
130 /*-----------------------------------------------------------------------*/
131 customer_trx_line_id             NUMBER,
132 
133 previous_customer_trx_line_id    ra_customer_trx_lines.previous_customer_trx_line_id%TYPE,
134 link_to_cust_trx_line_id         ra_customer_trx_lines.link_to_cust_trx_line_id%TYPE,
135 memo_line_id                     ra_customer_trx_lines.memo_line_id%TYPE,
136 taxed_quantity                   ra_customer_trx_lines.quantity_invoiced%TYPE,
137 inventory_item_id                mtl_system_items.inventory_item_id%TYPE,
138 extended_amount                  ra_customer_trx_lines.extended_amount%TYPE,
139 entered_amount			 ra_customer_trx_lines.extended_amount%TYPE,
140 
141 tax_code                         ar_vat_tax.tax_code%TYPE,
142 vat_tax_id                       ar_vat_tax.vat_tax_id%TYPE,
143 tax_exemption_id                 ra_tax_exemptions.tax_exemption_id%TYPE,
144 item_exception_rate_id           ra_item_exception_rates.item_exception_rate_id%TYPE,
145 tax_rate                         ar_vat_tax.tax_rate%TYPE,
146 
147 default_ussgl_transaction_code   ra_customer_trx_lines.default_ussgl_transaction_code%TYPE,
148 default_ussgl_trx_code_context   ra_customer_trx_lines.default_ussgl_trx_code_context%TYPE,
149 /*-----------------------------------------------------------------------*/
150 /*       Release 11 Transaction Line data                                */
151 /*-----------------------------------------------------------------------*/
152 amount_includes_tax_flag         CHAR,           /* 'Y' if line amount includes tax */
153 taxable_basis         		 VARCHAR2(30),   /* Taxable basis */
154 tax_calculation_plsql_block      VARCHAR2(2000), /* Tax rules */
155 payment_terms_discount_percent   NUMBER, 	 /* Discount Percent */
156 
157 
158 /*-----------------------------------------------------------------------*/
159 /*       Tax Extension Parameters, these are defined specifically to     */
160 /*                       support AVP(tm) and Vertex(tm)                  */
161 /*-----------------------------------------------------------------------*/
162 
163 audit_flag			 CHAR,	 	  /* 'Y' if this record should be audited */
164 qualifier                        VARCHAR2(30),    /* LOCATION_QUALIFIER */
165 ship_from_code                   VARCHAR2(30),    /* SHIP_FROM_CODE */
166 ship_to_code                     VARCHAR2(30),    /* SHIP_TO_CODE */
167 poo_code                         VARCHAR2(30),    /* Point of Order Origin */
168 poa_code                         VARCHAR2(30),    /* Point of Order Acceptance */
169 
170 vdrctrl_exempt                   VARCHAR(30),    /* Vendor Control of Tax Exmeptions */
171 
172 tax_control                      ra_customer_trx_lines.tax_exempt_flag%TYPE,
173 xmpt_cert_no                     ra_tax_exemptions.customer_exemption_number%TYPE,
174 xmpt_reason                      ra_tax_exemptions.reason_code%TYPE,
175 xmpt_percent                     ra_tax_exemptions.percent_exempt%TYPE,
176 
177 trx_line_type			 VARCHAR2(30),   /* Sale / Service / Purchase / Rental */
178 part_no                          VARCHAR2(40),   /* Part Number as understood by Vendor */
179 division_code			 VARCHAR2(30),	 /* Organization Attributes */
180 company_code			 VARCHAR2(30),
181 
182 
183 /*-----------------------------------------------------------------------*/
184 /*       Release 11 has 5 more character and numeric attributes.         */
185 /*-----------------------------------------------------------------------*/
186 userf1                           VARCHAR2(80),    /* User Defined Strings */
187 userf2                           VARCHAR2(80),
188 userf3                           VARCHAR2(80),
189 userf4                           VARCHAR2(80),
190 userf5                           VARCHAR2(80),
191 userf6                           VARCHAR2(80),
192 userf7                           VARCHAR2(80),
193 userf8                           VARCHAR2(80),
194 userf9                           VARCHAR2(80),
195 userf10                          VARCHAR2(80),
196 
197 usern1                           NUMBER,         /* User Defined Numbers */
198 usern2                           NUMBER,
199 usern3                           NUMBER,
200 usern4                           NUMBER,
201 usern5                           NUMBER,
202 usern6                           NUMBER,
203 usern7                           NUMBER,
204 usern8                           NUMBER,
205 usern9                           NUMBER,
206 usern10                          NUMBER,
207 
208 calculate_tax                    CHAR,           /* if 'Y' calculate tax, else add only */
209                                                  /* taxable amount                      */
210 
211 /*-----------------------------------------------------------------------*/
212 /*       Tax Line Data                                                   */
213 /*-----------------------------------------------------------------------*/
214 
215 status                           NUMBER,
216 credit_memo_flag           	 BOOLEAN, /* If TRUE, the tax engine will copy the tax rates as passed without validation for Adhoc Tax Codes */
217 tax_type                         NUMBER,          /* Internal flags */
218 
219 sales_tax_id                     NUMBER,
220 location_segment_id              NUMBER,
221 tax_line_number                  ra_customer_trx_lines.line_number%TYPE,
222 tax_amount                       ra_customer_trx_lines.extended_amount%TYPE,
223 tax_vendor_return_code           ra_customer_trx_lines.tax_vendor_return_code%TYPE,
224 tax_precedence                   ra_customer_trx_lines.tax_precedence%TYPE,
225 compound_amount                  NUMBER,           /* Amount of Compounded Tax already held in extended_amount */
226 effective_tax_rate		NUMBER,		/* Effective tax rate to be used to calculate tax. */
227 
228 
229 /*-----------------------------------------------------------------------*/
230 /*       Global Descriptive Flexfields                                   */
231 /*-----------------------------------------------------------------------*/
232 global_attribute1		varchar2(150),
233 global_attribute2		varchar2(150),
234 global_attribute3		varchar2(150),
235 global_attribute4		varchar2(150),
236 global_attribute5		varchar2(150),
237 global_attribute6		varchar2(150),
238 global_attribute7		varchar2(150),
239 global_attribute8		varchar2(150),
240 global_attribute9		varchar2(150),
241 global_attribute10		varchar2(150),
242 global_attribute11		varchar2(150),
243 global_attribute12		varchar2(150),
244 global_attribute13		varchar2(150),
245 global_attribute14		varchar2(150),
246 global_attribute15		varchar2(150),
247 global_attribute16		varchar2(150),
248 global_attribute17		varchar2(150),
249 global_attribute18		varchar2(150),
250 global_attribute19		varchar2(150),
251 global_attribute20		varchar2(150),
252 global_attribute_category	varchar2(30),
253 
254 
255 /*---------------------------------------*/
256 /* added for R11.5                       */
257 /*---------------------------------------*/
258 customer_trx_charge_line_id     NUMBER(15),
259 poo_id                          NUMBER(15),
260 poa_id                          NUMBER(15),
261 taxable_amount			NUMBER,
262 override_tax_rate               NUMBER
263 
264 /*---------------------------------------*/
265 /* CRM releated changes                  */
266 /*---------------------------------------*/
267 --crm
268 , party_flag                    VARCHAR2(1) -- 'Y' if address info is from party
269                                             -- instead of customer
270 ,cm_type                        VARCHAR2(20),
271 
272 
273 /*----------------------------------------*/
274 /* columns added for eTax integration     */
275 /*----------------------------------------*/
276  internal_organization_id               number,
277  internal_org_location_id               number,
278  application_id           		number,
279  entity_code 				varchar2(30),
280  event_class_code                	varchar2(30),
281  ledger_id                              number,
282  legal_entity_id                 	number,
283  rounding_ship_to_party_id              number,
284  rounding_bill_to_party_id        	number,
285  rndg_ship_to_party_site_id             number,
286  rndg_bill_to_party_site_id             number,
287  establishment_id                       number,
288  default_taxation_country               varchar2(2),
289  currency_conversion_date               date,
290  currency_conversion_type               varchar2(30),
291  currency_conversion_rate               number,
292  trx_communicated_date                  date,
293  batch_source_id                        number,
294  batch_source_name                      varchar2(150),
295  doc_seq_id                             number,
296  doc_seq_name                           varchar2(150),
297  doc_seq_value                          varchar2(240),
298  trx_due_date                           date,
299  trx_type_description                   varchar2(240),
300  billing_trading_partner_name           varchar2(150),
301  billing_trading_partner_number         varchar2(150),
302  billing_tp_tax_reporting_flg           varchar2(1),
303  billing_tp_taxpayer_id                 varchar2(80),
304  document_sub_type                      varchar2(240),
305  tax_invoice_date                       date,
306  tax_invoice_number                     varchar2(150),
307  doc_event_status                       varchar2(30),
308  trx_level_type				varchar2(30),
309  line_class				varchar2(30),
310  trx_shipping_date			date,
311  trx_receipt_date			date,
312 -- already present  trx_line_type				varchar2(30),
313  trx_line_date				date,
314  trx_business_category			varchar2(240),
315  line_intended_use			varchar2(240),
316  user_defined_fisc_class		varchar2(30),
317  line_amt_includes_tax_flg		varchar2(1),
318  unit_price				number,
319  cash_discount				number,
320  volume_discount			number,
321  trading_discount			number,
322  transfer_charge			number,
323  transportation_charge			number,
324  insurance_charge			number,
325  other_charge				number,
326  product_id				number,
327  product_fisc_classification		varchar2(240),
328  product_org_id				number,
329  uom_code				varchar2(30),
330  product_type				varchar2(240),
331  product_code			        ZX_LINES_DET_FACTORS.PRODUCT_CODE%TYPE,
332  product_category			varchar2(240),
333  trx_sic_code				varchar2(150),
334 --  already present    fob_point				varchar2(30),
335  ship_to_party_id			number,
336  ship_from_party_id			number,
337  poa_party_id				number,
338  poo_party_id				number,
339  bill_to_party_id			number,
340  bill_from_party_id			number,
341  merchant_party_id			number,
342  ship_to_party_site_id			number,
343  ship_from_party_site_id		number,
344  poa_party_site_id			number,
345  poo_party_site_id			number,
346  bill_to_party_site_id			number,
347  bill_from_party_site_id		number,
348 --  already present   ship_to_location_id			number,
349  ship_from_location_id			number,
350  poa_location_id			number,
351  poo_location_id			number,
352 --  already present   bill_to_location_id			number,
353  bill_from_location_id			number,
354  account_ccid				number,
355  account_string				varchar2(2000),
356  adjusted_doc_application_id            number,
357  adjusted_doc_entity_code               varchar2(30),
358  adjusted_doc_event_class_code          varchar2(30),
359  adjusted_doc_trx_id                    number,
360  adj_doc_hdr_trx_user_key1              varchar2(150),
361  adj_doc_hdr_trx_user_key2              varchar2(150),
362  adj_doc_hdr_trx_user_key3              varchar2(150),
363  adj_doc_hdr_trx_user_key4              varchar2(150),
364  adj_doc_hdr_trx_user_key5              varchar2(150),
365  adj_doc_hdr_trx_user_key6              varchar2(150),
366  adjusted_doc_line_id			number,
367  adj_doc_lin_trx_user_key1		varchar2(150),
368  adj_doc_lin_trx_user_key2		varchar2(150),
369  adj_doc_lin_trx_user_key3		varchar2(150),
370  adj_doc_lin_trx_user_key4		varchar2(150),
371  adj_doc_lin_trx_user_key5		varchar2(150),
372  adj_doc_lin_trx_user_key6		varchar2(150),
373  adjusted_doc_number			varchar2(150),
374  adjusted_doc_date			date,
375  --
376  -- bug#5350983- add below columns
377  --
378  adjusted_doc_tax_line_id               number,
379  adjusted_doc_trx_level_type            varchar2(30),
380 
381  related_doc_application_id             number,
382  related_doc_entity_code                varchar2(30),
383  related_doc_event_class_code           varchar2(30),
384  related_doc_trx_id                     number,
385  --related_doc_trx_level_type             varchar2(30),
386  rel_doc_hdr_trx_user_key1              varchar2(150),
387  rel_doc_hdr_trx_user_key2              varchar2(150),
388  rel_doc_hdr_trx_user_key3              varchar2(150),
389  rel_doc_hdr_trx_user_key4              varchar2(150),
390  rel_doc_hdr_trx_user_key5              varchar2(150),
391  rel_doc_hdr_trx_user_key6              varchar2(150),
392  related_doc_number                     varchar2(150),
393  related_doc_date                       date,
394  -- end of bug#5350983
395 
396  assessable_value			number,
397  tax_classification_code		varchar2(30),
398  trx_id_level2				number,
399  trx_id_level3				number,
400  trx_id_level4				number,
401  trx_id_level5				number,
402  trx_id_level6				number,
403 
404  trx_line_number			number,
405  historical_flg				varchar2(1),
406  trx_line_description			varchar2(240),
407  product_description			varchar2(240),
408  trx_waybill_number			varchar2(50),
409 --  already present   trx_line_gl_date			date,
410  paying_party_id			number,
411  own_hq_party_id			number,
412  trading_hq_party_id			number,
413  poi_party_id				number,
414  pod_party_id				number,
415  title_transfer_party_id		number,
416  paying_party_site_id			number,
417  own_hq_party_site_id			number,
418  trading_hq_party_site_id		number,
419  poi_party_site_id			number,
420  pod_party_site_id			number,
421  title_transfer_party_site_id		number,
422  paying_location_id			number,
423  own_hq_location_id			number,
424  trading_hq_location_id			number,
425  poc_location_id			number,
426  poi_location_id			number,
427  pod_location_id			number,
428  title_transfer_location_id		number,
429  banking_tp_taxpayer_id			varchar2(80),
430 
431 -- Output tax line columns
432 
433  tax_regime_code           varchar2(30),
434  tax                       varchar2(30),
435  tax_rate_code             varchar2(30) ,
436  tax_status_code           varchar2(30) ,
437 --jur bug
438  tax_jurisdiction_code     varchar2(30) ,
439  tax_regime_id             number,
440  tax_id			   number,
441  tax_rate_id               number,
442  tax_status_id             number,
443 
444 -- Columns added for LTE integration with eTax
445  tax_currency_code                      fnd_currencies.currency_code%TYPE,
446  tax_currency_conversion_date		date,
447  tax_currency_conversion_type		varchar2(30),
448  tax_currency_conversion_rate		number,
449  tax_apportionment_line_number		number,
450  tax_base_modifier_rate			number,
451  unrounded_taxable_amt			number,
452  unrounded_tax_amt			number,
453  tax_date				date,
454  tax_determine_date			date,
455  tax_point_date				date,
456  tax_type_code				varchar2(30),
457  rounding_level_code			varchar2(30),
458  rounding_rule_code			varchar2(30),
459  rounding_lvl_party_tax_prof_id		number,
460  rounding_lvl_party_type		varchar2(30),
461  cal_tax_amt				number,
462  cancel_flag				varchar2(1),
463  purge_flag				varchar2(1),
464  delete_flag				varchar2(1),
465  tax_amt_included_flag			varchar2(1),
466  self_assessed_flag			varchar2(1),
467  overridden_flag			varchar2(1),
468  manually_entered_flag			varchar2(1),
469  reporting_only_flag			varchar2(1),
470  freeze_until_overridden_flag		varchar2(1),
471  copied_from_other_doc_flag		varchar2(1),
472  recalc_required_flag			varchar2(1),
473  settlement_flag			varchar2(1),
474  item_dist_changed_flag			varchar2(1),
475  associated_child_frozen_flag		varchar2(1),
476  compounding_dep_tax_flag		varchar2(1),
477  legal_justification_text1		varchar2(240),
478  legal_justification_text2		varchar2(240),
479  legal_justification_text3		varchar2(240),
480  ctrl_total_line_tx_amt			number,
481 
482  mrc_tax_line_flag                      varchar2(1),
483  offset_flag                            varchar2(1),
484  process_for_recovery_flag              varchar2(1),
485  compounding_tax_flag                   varchar2(1),
486  historical_flag                        varchar2(1),
487  tax_apportionment_flag                 varchar2(1),
488  tax_only_line_flag                     varchar2(1),
489  enforce_from_natural_acct_flag         varchar2(1)
490 );
491 
492 
493 tax_info_rec tax_info_rec_type;
494 
495 /*-----------------------------------------------------------------------*/
496 /* Control flags, initialised by this package once, and used on each     */
497 /* subsequent invocation.                                                */
498 /*-----------------------------------------------------------------------*/
499 TYPE tax_gbl_rec_type IS RECORD
500 (
501 dump_cache_stats                 BOOLEAN,     /* If true Cache Size information will be dumped to AFWRT_LOG */
502 
503 called_by_order_entry            BOOLEAN,     /* TRUE if OE is the calling application */
504 
505 insert_tax_lines                 BOOLEAN,     /* If False no inserts or auto-accounting */
506                                               /* calls will be made when generating tax */
507                                               /* lines */
508 /* BugFix 645089 */
509 get_adhoc                        BOOLEAN,     /* True if this call is for an update and */
510                                               /* the adhoc tax rate/amount should be    */
511                                               /* retrieved from the original tax line   */
512 
513 tax_no_rate                      NUMBER,      /* Number of Transaction lines found with */
514                                               /* no code or rate information */
515 
516 total_tax_amount                 NUMBER,      /* Cumulated Tax amount for this call     */
517                                               /* used by the "SALESTAX SUMMARY API"     */
518 
519 one_err_msg_flag                 CHAR,        /* Y: means displays only one message and */
520                                               /*    the message has not yet displayed   */
521                                               /* D: means display only one message and  */
522                                               /*    the message has been displayed      */
523                                               /* N: means could display more than one   */
524 
525 trx_line_id                      NUMBER,      /* Trx Line ID used for Error reporting   */
526 trx_line_number                  VARCHAR(40), /* Line Number usable for Error reporting */
527 
528 total_taxable_amount             NUMBER,                    /* caculates the total taxable amount   */
529 
530 /*-----------------------------------------------------------------------*/
531 /*       Data used by Calculate and its supporting functions             */
532 /*-----------------------------------------------------------------------*/
533 tax_accnt_column		VARCHAR2(50),		   /* Stores the segment column name of the Tax account qualifier */
534 natural_acct_column             VARCHAR2(30),              /* Stores the segment column name of the Natural account */
535 loc_tax_code_count		NUMBER(3) 		   /* Stores the no. of Location tax codes */
536 );
537 
538 tax_gbl_rec tax_gbl_rec_type;
539 
540 TYPE tax_rec_tbl_type is TABLE of RA_CUSTOMER_TRX_LINES%ROWTYPE index by
541   binary_integer;
542 
543 TYPE tax_info_rec_tbl_type is TABLE of tax_info_rec_type index by
544   binary_integer;
545 
546 tax_rec_tbl 		tax_rec_tbl_type;
547 tax_info_rec_tbl	tax_info_rec_tbl_type;
548 tax_info_out_rec_tbl	tax_info_rec_tbl_type;
549 old_line_rec		ra_customer_trx_lines%rowtype;
550 new_line_rec		ra_customer_trx_lines%rowtype;
551 /*
552 TYPE om_tax_out_rec_type IS RECORD
553 (vat_tax_id             ar_vat_tax.vat_tax_id%type,
554  extended_amount        ra_customer_trx_lines.extended_amount%TYPE,
555  tax_rate               ar_vat_tax.tax_rate%TYPE);*/
556 
557    TYPE trx_type_tbl_type IS TABLE OF ra_cust_trx_types.type%type index by binary_integer;
558    trx_type_tbl      trx_type_tbl_type;
559 
560 PROCEDURE INITIALIZE_TAX_INFO_REC;
561 
562 PROCEDURE initialize(
563   p_event_class_rec   IN   zx_api_pub.event_class_rec_type,
564   x_return_status     OUT NOCOPY  VARCHAR2
565 );
566 
567 PROCEDURE  dump_tax_info_rec(p_IO_flag  IN  VARCHAR2 );
568 
569 FUNCTION tax_curr_round( p_amount  	     IN NUMBER,
570 			 p_trx_currency_code IN VARCHAR2,
571 			 p_precision 	     IN NUMBER,
572 			 p_min_acct_unit     IN NUMBER,
573 			 p_rounding_rule     IN VARCHAR2,
574 			 p_autotax_flag      IN VARCHAR2 )
575                  RETURN NUMBER;
576 
577 PROCEDURE calculate_tax (
578   p_event_class_rec     IN  zx_api_pub.event_class_rec_type,
579   x_return_status       OUT NOCOPY VARCHAR2
580 );
581 
582 PROCEDURE import_document_with_tax (
583   p_event_class_rec     IN OUT NOCOPY zx_api_pub.event_class_rec_type,
584   x_return_status       OUT NOCOPY VARCHAR2
585 );
586 
587 procedure copy_lte_gdfs(
588   x_return_status       OUT NOCOPY VARCHAR2);
589 
590 END ZX_PRODUCT_INTEGRATION_PKG;
591