DBA Data[Home] [Help]

PACKAGE: APPS.PO_PDOI_PARAMS

Source


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