1 PACKAGE PO_PDOI_PARAMS AUTHID CURRENT_USER AS
2 /* $Header: PO_PDOI_PARAMS.pls 120.9.12020000.3 2013/02/10 19:27:24 vegajula ship $ */
3
4
5 -- Record type to store request parameters
6 TYPE request_param_rec_type IS RECORD
7 ( calling_module VARCHAR2(30),
8 validation_level NUMBER,
9 commit_work VARCHAR2(1),
10 batch_id NUMBER,
11 batch_size NUMBER,
12 buyer_id NUMBER,
13 document_type VARCHAR2(25),
14 document_subtype VARCHAR2(25),
15 create_items VARCHAR2(1),
16 create_sourcing_rules_flag VARCHAR2(1),
17 rel_gen_method VARCHAR2(25),
18 sourcing_level VARCHAR2(25),
19 sourcing_inv_org_id NUMBER,
20 approved_status VARCHAR2(25),
21 process_code VARCHAR2(25),
22 interface_header_id NUMBER,
23 org_id NUMBER,
24 ga_flag VARCHAR2(1),
25 submit_dft_flag VARCHAR2(1),
26 role VARCHAR2(10),
27 catalog_to_expire VARCHAR2(255),
28 err_lines_tolerance NUMBER,
29 clm_flag VARCHAR2(1) --CLM PDOI Project
30 );
31
32 -- Record type to store system parameters
33 TYPE sys_param_rec_type IS RECORD
34 ( currency_code GL_SETS_OF_BOOKS.currency_code%TYPE,
35 coa_id GL_SETS_OF_BOOKS.chart_of_accounts_id%TYPE,
36 po_encumbrance_flag FINANCIALS_SYSTEM_PARAMETERS.purch_encumbrance_flag%TYPE,
37 req_encumbrance_flag FINANCIALS_SYSTEM_PARAMETERS.req_encumbrance_flag%TYPE,
38 sob_id FINANCIALS_SYSTEM_PARAMETERS.set_of_books_id%TYPE,
39 ship_to_location_id FINANCIALS_SYSTEM_PARAMETERS.ship_to_location_id%TYPE,
40 bill_to_location_id FINANCIALS_SYSTEM_PARAMETERS.bill_to_location_id%TYPE,
41 fob_lookup_code FINANCIALS_SYSTEM_PARAMETERS.fob_lookup_code%TYPE,
42 freight_terms_lookup_code FINANCIALS_SYSTEM_PARAMETERS.freight_terms_lookup_code%TYPE,
43 terms_id FINANCIALS_SYSTEM_PARAMETERS.terms_id%TYPE,
44 default_rate_type PO_SYSTEM_PARAMETERS.default_rate_type%TYPE,
45 taxable_flag PO_SYSTEM_PARAMETERS.taxable_flag%TYPE,
46 receiving_flag PO_SYSTEM_PARAMETERS.receiving_flag%TYPE,
47 line_type_id PO_SYSTEM_PARAMETERS.line_type_id%TYPE,
48 manual_po_num_type PO_SYSTEM_PARAMETERS.manual_po_num_type%TYPE,
49 user_defined_po_num_code PO_SYSTEM_PARAMETERS.user_defined_po_num_code%TYPE,
50 price_type_lookup_code PO_SYSTEM_PARAMETERS.price_type_lookup_code%TYPE,
51 def_inv_org_id FINANCIALS_SYSTEM_PARAMETERS.inventory_organization_id%TYPE,
52 min_rel_amount PO_SYSTEM_PARAMETERS.min_release_amount%TYPE,
53 def_quote_warning_delay PO_SYSTEM_PARAMETERS.default_quote_warning_delay%TYPE,
54 inspection_required_flag PO_SYSTEM_PARAMETERS.inspection_required_flag%TYPE,
55 user_defined_quote_num_code PO_SYSTEM_PARAMETERS.user_defined_quote_num_code%TYPE,
56 manual_quote_num_type PO_SYSTEM_PARAMETERS.manual_quote_num_type%TYPE,
57 ship_via_lookup_code FINANCIALS_SYSTEM_PARAMETERS.ship_via_lookup_code%TYPE,
58 qty_rcv_tolerance RCV_PARAMETERS.qty_rcv_tolerance%TYPE,
59 price_break_lookup_code PO_SYSTEM_PARAMETERS.price_break_lookup_code%TYPE,
60 invoice_close_tolerance PO_SYSTEM_PARAMETERS.invoice_close_tolerance%TYPE,
61 receive_close_tolerance PO_SYSTEM_PARAMETERS.receive_close_tolerance%TYPE,
62 expense_accrual_code PO_SYSTEM_PARAMETERS.expense_accrual_code%TYPE,
63 master_inv_org_id MTL_PARAMETERS.organization_id%TYPE,
64 enforce_ship_to_loc RCV_PARAMETERS.enforce_ship_to_location_code%TYPE,
65 allow_substitutes RCV_PARAMETERS.allow_substitute_receipts_flag%TYPE,
66 routing_id RCV_PARAMETERS.receiving_routing_id%TYPE,
67 qty_rcv_exception RCV_PARAMETERS.qty_rcv_exception_code%TYPE,
68 days_early_receipt RCV_PARAMETERS.days_early_receipt_allowed%TYPE,
69 days_late_receipt RCV_PARAMETERS.days_late_receipt_allowed%TYPE,
70 rcv_days_exception RCV_PARAMETERS.receipt_days_exception_code%TYPE,
71 supplier_auth_acc PO_SYSTEM_PARAMETERS.supplier_authoring_acceptance%TYPE,
72 cat_admin_auth_acc PO_SYSTEM_PARAMETERS.cat_admin_authoring_acceptance%TYPE,
73 invoice_match_option FINANCIALS_SYSTEM_PARAMETERS.match_option%TYPE,
74 when_to_archive_blanket PO_DOCUMENT_TYPES.archive_external_revision_code%TYPE,
75 when_to_archive_std_po PO_DOCUMENT_TYPES.archive_external_revision_code%TYPE,
76 def_business_group_id FINANCIALS_SYSTEM_PARAMETERS.business_group_id%TYPE,
77 def_structure_id MTL_CATEGORY_SETS.structure_id%TYPE,
78 def_cat_set_id MTL_CATEGORY_SETS.category_set_id%TYPE,
79 def_category_id MTL_CATEGORY_SETS.default_category_id%TYPE,
80 is_federal_instance VARCHAR2(1),
81 acceptance_required_flag PO_SYSTEM_PARAMETERS.acceptance_required_flag%TYPE /* Bug 7518967 : Default Acceptance Required Check ER */
82 );
83
84 -- Record type to store profile options
85 TYPE profile_param_rec_type IS RECORD
86 ( pdoi_write_to_file VARCHAR2(2000),
87 service_uom_class VARCHAR2(2000),
88 federal_instance VARCHAR2(2000), -- TODO: This profile is no longer at use
89 pdoi_archive_on_approval VARCHAR2(2000),
90 override_funds VARCHAR2(2000),
91 xbg VARCHAR2(2000),
92 po_price_update_tolerance VARCHAR2(2000),
93 allow_tax_rate_override VARCHAR2(2000),
94 allow_tax_code_override VARCHAR2(2000)
95 );
96
97 TYPE product_param_rec_type IS RECORD
98 ( wip_installed VARCHAR2(1),
99 inv_installed VARCHAR2(1),
100 project_11510_installed VARCHAR2(1),
101 pa_installed VARCHAR2(1),
102 gms_enabled VARCHAR2(1),
103 project_cwk_installed VARCHAR2(1)
104 );
105
106 -- Record type to store out paramters
107 TYPE out_param_rec_type IS RECORD
108 ( processed_lines_count NUMBER,
109 rejected_lines_count NUMBER,
110 err_tolerance_exceeded VARCHAR2(1)
111 );
112
113 -- Record type to store additional document information
114 TYPE doc_info_rec_type IS RECORD
115 ( number_of_processed_lines NUMBER,
116 number_of_errored_lines NUMBER,
117 -- number_of_valid_lines will only be maintained on line level, as long as the line itself is valid,
118 -- we increment the value by 1. Price break and price diff level errors will not affect this value.
119 number_of_valid_lines NUMBER,
120 err_tolerance_exceeded VARCHAR2(1),
121 has_errors VARCHAR2(1),
122 has_lines_to_notify VARCHAR2(1),
123 has_lines_updated VARCHAR2(1),
124 new_draft VARCHAR2(1) -- bug5129752 - Indicates whether the draft is created by this request
125 );
126
127 TYPE doc_info_tbl_type IS TABLE OF doc_info_rec_type INDEX BY BINARY_INTEGER;
128
129 -- instances of the record structures defined above
130 g_request request_param_rec_type;
131 g_sys sys_param_rec_type;
132 g_profile profile_param_rec_type;
133 g_product product_param_rec_type;
134 g_out out_param_rec_type;
135
136 -- Associative array to store extra information for a document. The information
137 -- will be populated through PDOI processing and are used to drive logic,
138 -- especially during post processing. Each record is associated to a record
139 -- in po_headers_interface by interface_header_id.
140 g_docs_info doc_info_tbl_type;
141
142 -- bug4662687 START
143
144 TYPE errored_lines_tbl_type IS TABLE OF VARCHAR2(1) INDEX BY BINARY_INTEGER;
145
146 -- This associative arry tracks the lines that have errors at price break level.
147 -- In catalog upload scenario, if user tries to upload a price break and it
148 -- has error, the error does not cause the line to be rejected; however, we
149 -- still need to report the error as line error. So we need to track the
150 -- lines that have errors and add the numbers to the number of errored lines
151 -- at the header level
152 g_errored_lines errored_lines_tbl_type;
153
154 -- bug4662687 END
155
156
157
158 -- parameters that do not belong to any structure.
159
160 -- Usage of Processing ID:
161 -- This id is used to identify the records in the interface table that will
162 -- be processed in this current PDOI run. Each PDOI run has its own processing
163 -- id, and this id is stamped to the records in interface table at all levels,
164 -- if the record is expected to be processed sometime during the current PDOI
165 -- run.
166 -- In case the record gets rejected, processing_id on the interface record
167 -- will be negated so that it won't be processed further down.
168 g_processing_id NUMBER;
169
170 -- Usage of Original Doc Processed Flag:
171 -- This flag is to indicate whether there are new documents to be imported as
172 -- new documents (identified by action = 'ORIGINAL' in headers interface).
173 -- During header grouping we are separating records with action
174 -- 'ORIGINAL' from records with some other actions, and we first process all
175 -- records with action = 'ORIGINAL'. Once all the records with action
176 -- 'ORIGINAL' are processed, this flag will be set to FND_API.G_TRUE to
177 -- indicate that PDOI can process records with other actions in the coming
178 -- round
179 g_original_doc_processed VARCHAR2(1);
180
181
182 -- Usage of current round num:
183 -- Current Round Num indicates how many iterations this current PDOI run has
184 -- gone through to process records. We separate header records to be processed
185 -- in multiple rounds, mainly to resolve conflicts between them. For records
186 -- that can be processed in the current round, they will be stamped to have
187 -- processing_round_num = current_round_num, meaning that they will be processed
188 -- in the current round. At each round this number will be incremented by 1,
189 -- and unprocessed records will be re-evaluated and see if they can be included
190 -- in the new round.
191 g_current_round_num NUMBER;
192
193
194 END PO_PDOI_PARAMS;