DBA Data[Home] [Help]

PACKAGE: APPS.AP_IMPORT_INVOICES_PKG

Source


1 PACKAGE AP_IMPORT_INVOICES_PKG AS
2 /* $Header: apiimpts.pls 120.32.12010000.5 2008/11/25 12:26:25 dcshanmu ship $ */
3 
4 -- Declaring the global variables
5 g_pa_allows_overrides            VARCHAR2(30) := 'N';
6 g_source                         VARCHAR2(80);
7 g_debug_switch                   VARCHAR2(1) := 'N';
8 g_inv_sysdate                    DATE;
9 g_program_application_id         NUMBER;
10 g_program_id                     NUMBER;
11 g_conc_request_id                NUMBER;
12 g_invoices_table                 VARCHAR2(30);
13 g_invoice_lines_table            VARCHAR2(30);
14 g_instructions_table             VARCHAR2(30);
15 g_segment_delimiter              VARCHAR2(10); -- 6349739 - for RETEK
16 
17 -- Added for Payment Requests
18 g_invoice_id                     NUMBER;
19 
20 
21 -- For Period_name in            Get_item_line_info/
22 --                               Get_non_item_line_info
23 lg_many_controller               fnd_plsql_cache.cache_1tom_controller_type;
24 lg_generic_storage               fnd_plsql_cache.generic_cache_values_type;
25 
26 -- For fnd_flex.validate_segs in v_check_line_project_info/
27 --                               v_check_line_account_info
28 lg_many_controller1              fnd_plsql_cache.cache_1tom_controller_type;
29 lg_generic_storage1              fnd_plsql_cache.generic_cache_values_type;
30 
31 -- For gl_code_combinations in   get_item_line_info/
32 --                               insert_from_dis_sets/
33 --                               overlay_for_po_matched/
34 --                               get_non_item_line_info/
35 --                               prorate_dists
36 lg_many_controller2              fnd_plsql_cache.cache_1tom_controller_type;
37 lg_generic_storage2              fnd_plsql_cache.generic_cache_values_type;
38 
39 -- Bug 5572876
40 lg_incometax_controller          fnd_plsql_cache.cache_1tom_controller_type;
41 lg_incometax_storage             fnd_plsql_cache.generic_cache_values_type;
42 
43 -- Bug 5572876
44 lg_incometaxr_controller         fnd_plsql_cache.cache_1tom_controller_type;
45 lg_incometaxr_storage            fnd_plsql_cache.generic_cache_values_type;
46 
47 TYPE r_invoice_info_rec IS RECORD (
48 invoice_id               AP_INVOICES_INTERFACE.invoice_id%TYPE,
49 invoice_num              AP_INVOICES_INTERFACE.invoice_num%TYPE,
50 invoice_type_lookup_code
51           AP_INVOICES_INTERFACE.invoice_type_lookup_code%TYPE,
52 invoice_date             AP_INVOICES_INTERFACE.invoice_date%TYPE,
53 po_number                AP_INVOICES_INTERFACE.po_number%TYPE,
54 vendor_id                AP_INVOICES_INTERFACE.vendor_id%TYPE,
55 vendor_num               AP_INVOICES_INTERFACE.vendor_num%TYPE,
56 vendor_name              AP_INVOICES_INTERFACE.vendor_name%TYPE,
57 vendor_site_id           AP_INVOICES_INTERFACE.vendor_site_id%TYPE,
58 vendor_site_code         AP_INVOICES_INTERFACE.vendor_site_code%TYPE,
59 invoice_amount           AP_INVOICES_INTERFACE.invoice_amount%TYPE,
60 invoice_currency_code    AP_INVOICES_INTERFACE.invoice_currency_code%TYPE,
61 exchange_rate            AP_INVOICES_INTERFACE.exchange_rate%TYPE,
62 exchange_rate_type       AP_INVOICES_INTERFACE.exchange_rate_type%TYPE,
63 exchange_date            AP_INVOICES_INTERFACE.exchange_date%TYPE,
64 terms_id                 AP_INVOICES_INTERFACE.terms_id%TYPE,
65 terms_name               AP_INVOICES_INTERFACE.terms_name%TYPE,
66 terms_date               AP_INVOICES_INTERFACE.terms_date%TYPE,
67 description              AP_INVOICES_INTERFACE.description%TYPE,
68 awt_group_id             AP_INVOICES_INTERFACE.awt_group_id%TYPE,
69 awt_group_name           AP_INVOICES_INTERFACE.awt_group_name%TYPE,
70 pay_awt_group_id             AP_INVOICES_INTERFACE.pay_awt_group_id%TYPE,--bug6639866
71 pay_awt_group_name           AP_INVOICES_INTERFACE.pay_awt_group_name%TYPE,--bug6639866
72 amount_applicable_to_discount
73           AP_INVOICES_INTERFACE.amount_applicable_to_discount%TYPE,
74 last_update_date         AP_INVOICES_INTERFACE.last_update_date%TYPE,
75 last_updated_by          AP_INVOICES_INTERFACE.last_updated_by%TYPE,
76 last_update_login        AP_INVOICES_INTERFACE.last_update_login%TYPE,
77 creation_date            AP_INVOICES_INTERFACE.creation_date%TYPE,
78 created_by               AP_INVOICES_INTERFACE.created_by%TYPE,
79 status                   AP_INVOICES_INTERFACE.status%TYPE,
80 attribute_category       AP_INVOICES_INTERFACE.attribute_category%TYPE,
81 attribute1               AP_INVOICES_INTERFACE.attribute1%TYPE,
82 attribute2               AP_INVOICES_INTERFACE.attribute2%TYPE,
83 attribute3               AP_INVOICES_INTERFACE.attribute3%TYPE,
84 attribute4               AP_INVOICES_INTERFACE.attribute4%TYPE,
85 attribute5               AP_INVOICES_INTERFACE.attribute5%TYPE,
86 attribute6               AP_INVOICES_INTERFACE.attribute6%TYPE,
87 attribute7               AP_INVOICES_INTERFACE.attribute7%TYPE,
88 attribute8               AP_INVOICES_INTERFACE.attribute8%TYPE,
89 attribute9               AP_INVOICES_INTERFACE.attribute9%TYPE,
90 attribute10              AP_INVOICES_INTERFACE.attribute10%TYPE,
91 attribute11              AP_INVOICES_INTERFACE.attribute11%TYPE,
92 attribute12              AP_INVOICES_INTERFACE.attribute12%TYPE,
93 attribute13              AP_INVOICES_INTERFACE.attribute13%TYPE,
94 attribute14              AP_INVOICES_INTERFACE.attribute14%TYPE,
95 attribute15              AP_INVOICES_INTERFACE.attribute15%TYPE,
96 global_attribute_category
97           AP_INVOICES_INTERFACE.global_attribute_category%TYPE,
98 global_attribute1        AP_INVOICES_INTERFACE.global_attribute1%TYPE,
99 global_attribute2        AP_INVOICES_INTERFACE.global_attribute2%TYPE,
100 global_attribute3        AP_INVOICES_INTERFACE.global_attribute3%TYPE,
101 global_attribute4        AP_INVOICES_INTERFACE.global_attribute4%TYPE,
102 global_attribute5        AP_INVOICES_INTERFACE.global_attribute5%TYPE,
103 global_attribute6        AP_INVOICES_INTERFACE.global_attribute6%TYPE,
104 global_attribute7        AP_INVOICES_INTERFACE.global_attribute7%TYPE,
105 global_attribute8        AP_INVOICES_INTERFACE.global_attribute8%TYPE,
106 global_attribute9        AP_INVOICES_INTERFACE.global_attribute9%TYPE,
107 global_attribute10       AP_INVOICES_INTERFACE.global_attribute10%TYPE,
108 global_attribute11       AP_INVOICES_INTERFACE.global_attribute11%TYPE,
109 global_attribute12       AP_INVOICES_INTERFACE.global_attribute12%TYPE,
110 global_attribute13       AP_INVOICES_INTERFACE.global_attribute13%TYPE,
111 global_attribute14       AP_INVOICES_INTERFACE.global_attribute14%TYPE,
112 global_attribute15       AP_INVOICES_INTERFACE.global_attribute15%TYPE,
113 global_attribute16       AP_INVOICES_INTERFACE.global_attribute16%TYPE,
114 global_attribute17       AP_INVOICES_INTERFACE.global_attribute17%TYPE,
115 global_attribute18       AP_INVOICES_INTERFACE.global_attribute18%TYPE,
116 global_attribute19       AP_INVOICES_INTERFACE.global_attribute19%TYPE,
117 global_attribute20       AP_INVOICES_INTERFACE.global_attribute20%TYPE,
118 payment_currency_code    AP_INVOICES_INTERFACE.payment_currency_code%TYPE,
119 payment_cross_rate       AP_INVOICES_INTERFACE.payment_cross_rate%TYPE,
120 payment_cross_rate_type  AP_INVOICES_INTERFACE.payment_cross_rate_type%TYPE,
121 payment_cross_rate_date  AP_INVOICES_INTERFACE.payment_cross_rate_date%TYPE,
122 doc_category_code        AP_INVOICES_INTERFACE.doc_category_code%TYPE,
123 voucher_num              AP_INVOICES_INTERFACE.voucher_num%TYPE,
124 payment_method_code
125           AP_INVOICES_INTERFACE.payment_method_code%TYPE,
126 pay_group_lookup_code    AP_INVOICES_INTERFACE.pay_group_lookup_code%TYPE,
127 goods_received_date      AP_INVOICES_INTERFACE.goods_received_date%TYPE,
128 invoice_received_date    AP_INVOICES_INTERFACE.invoice_received_date%TYPE,
129 gl_date                  AP_INVOICES_INTERFACE.gl_date%TYPE,
130 accts_pay_code_combination_id
131           AP_INVOICES_INTERFACE.accts_pay_code_combination_id%TYPE,
132 -- bug 6509776 - added field
133 accts_pay_code_concatenated
134           AP_INVOICES_INTERFACE.accts_pay_code_concatenated%TYPE,
135 
136 --Removed for bug 4277744
137 --ussgl_transaction_code AP_INVOICES_INTERFACE.ussgl_transaction_code%TYPE,
138 exclusive_payment_flag   AP_INVOICES_INTERFACE.exclusive_payment_flag%TYPE,
139 prepay_num               AP_INVOICES_INTERFACE.prepay_num%TYPE,
140 prepay_line_num          AP_INVOICES_INTERFACE.prepay_line_num%TYPE,
141 prepay_apply_amount      AP_INVOICES_INTERFACE.prepay_apply_amount%TYPE,
142 prepay_gl_date           AP_INVOICES_INTERFACE.prepay_gl_date%TYPE,
143 invoice_includes_prepay_flag
144           AP_INVOICES_INTERFACE.invoice_includes_prepay_flag%TYPE,
145 no_xrate_base_amount     AP_INVOICES_INTERFACE.no_xrate_base_amount%TYPE,
146 requester_id             AP_INVOICES_INTERFACE.requester_id%TYPE,
147 org_id                   AP_INVOICES_INTERFACE.org_id%TYPE,
148 operating_unit           AP_INVOICES_INTERFACE.operating_unit%TYPE,
149 source                   AP_INVOICES_INTERFACE.source%TYPE,
150 group_id                 AP_INVOICES_INTERFACE.group_id%TYPE,
151 request_id               AP_INVOICES_INTERFACE.request_id%TYPE,
152 workflow_flag            AP_INVOICES_INTERFACE.workflow_flag%TYPE,
153 vendor_email_address     AP_INVOICES_INTERFACE.vendor_email_address%TYPE,
154 calc_tax_during_import_flag
155   AP_INVOICES_INTERFACE.calc_tax_during_import_flag%TYPE,
156 control_amount AP_INVOICES_INTERFACE.control_amount%TYPE,
157 add_tax_to_inv_amt_flag AP_INVOICES_INTERFACE.add_tax_to_inv_amt_flag%TYPE,
158 tax_related_invoice_id AP_INVOICES_INTERFACE.tax_related_invoice_id%TYPE,
159 taxation_country AP_INVOICES_INTERFACE.taxation_country%TYPE,
160 document_sub_type AP_INVOICES_INTERFACE.document_sub_type%TYPE,
161 supplier_tax_invoice_number
162   AP_INVOICES_INTERFACE.supplier_tax_invoice_number%TYPE,
163 supplier_tax_invoice_date
164   AP_INVOICES_INTERFACE.supplier_tax_invoice_date%TYPE,
165 supplier_tax_exchange_rate
166   AP_INVOICES_INTERFACE.supplier_tax_exchange_rate%TYPE,
167 tax_invoice_recording_date
168   AP_INVOICES_INTERFACE.tax_invoice_recording_date%TYPE,
169 tax_invoice_internal_seq
170   AP_INVOICES_INTERFACE.tax_invoice_internal_seq%TYPE,
171 legal_entity_id AP_INVOICES_INTERFACE.legal_entity_id%TYPE,
172 set_of_books_id AP_SYSTEM_PARAMETERS_ALL.set_of_books_id%TYPE,
173 tax_only_rcv_matched_flag VARCHAR2(1),
174 tax_only_flag VARCHAR2(1),
175 apply_advances_flag      AP_INVOICES_INTERFACE.apply_advances_flag%TYPE,
176 application_id	AP_INVOICES_INTERFACE.application_id%TYPE,
177 product_table	AP_INVOICES_INTERFACE.product_table%TYPE,
178 reference_key1  AP_INVOICES_INTERFACE.reference_key1%TYPE,
179 reference_key2  AP_INVOICES_INTERFACE.reference_key2%TYPE,
180 reference_key3  AP_INVOICES_INTERFACE.reference_key3%TYPE,
181 reference_key4  AP_INVOICES_INTERFACE.reference_key4%TYPE,
182 reference_key5  AP_INVOICES_INTERFACE.reference_key5%TYPE,
183 reference_1	AP_INVOICES_INTERFACE.reference_1%TYPE,
184 reference_2	AP_INVOICES_INTERFACE.reference_2%TYPE,
185 net_of_retainage_flag AP_INVOICES_INTERFACE.net_of_retainage_flag%TYPE,
186 cust_registration_code AP_INVOICES_INTERFACE.cust_registration_code%TYPE,
187 cust_registration_number AP_INVOICES_INTERFACE.cust_registration_number%TYPE,
188 paid_on_behalf_employee_id AP_INVOICES_INTERFACE.paid_on_behalf_employee_id%TYPE,
189 party_id                   AP_INVOICES_INTERFACE.party_id%TYPE,
190 party_site_id              AP_INVOICES_INTERFACE.party_site_id%TYPE,
191 pay_proc_trxn_type_code    AP_INVOICES_INTERFACE.pay_proc_trxn_type_code%TYPE,
192 payment_function           AP_INVOICES_INTERFACE.payment_function%TYPE,
193 payment_priority           AP_INVOICES_INTERFACE.payment_priority%TYPE,
194 BANK_CHARGE_BEARER         AP_INVOICES_INTERFACE.BANK_CHARGE_BEARER%TYPE,
195 REMITTANCE_MESSAGE1        AP_INVOICES_INTERFACE.REMITTANCE_MESSAGE1%TYPE,
196 REMITTANCE_MESSAGE2        AP_INVOICES_INTERFACE.REMITTANCE_MESSAGE2%TYPE,
197 REMITTANCE_MESSAGE3        AP_INVOICES_INTERFACE.REMITTANCE_MESSAGE3%TYPE,
198 UNIQUE_REMITTANCE_IDENTIFIER
199                      AP_INVOICES_INTERFACE.UNIQUE_REMITTANCE_IDENTIFIER%TYPE,
200 URI_CHECK_DIGIT            AP_INVOICES_INTERFACE.URI_CHECK_DIGIT%TYPE,
201 SETTLEMENT_PRIORITY        AP_INVOICES_INTERFACE.SETTLEMENT_PRIORITY%TYPE,
202 PAYMENT_REASON_CODE        AP_INVOICES_INTERFACE.PAYMENT_REASON_CODE%TYPE,
203 PAYMENT_REASON_COMMENTS    AP_INVOICES_INTERFACE.PAYMENT_REASON_COMMENTS%TYPE,
204 DELIVERY_CHANNEL_CODE      AP_INVOICES_INTERFACE.DELIVERY_CHANNEL_CODE%TYPE,
205 EXTERNAL_BANK_ACCOUNT_ID   AP_INVOICES_INTERFACE.EXTERNAL_BANK_ACCOUNT_ID %TYPE,
206 --Bug 7357218 Quick Pay and Dispute Resolution Project
207 ORIGINAL_INVOICE_AMOUNT    AP_INVOICES_INTERFACE.ORIGINAL_INVOICE_AMOUNT%TYPE,
208 DISPUTE_REASON             AP_INVOICES_INTERFACE.DISPUTE_REASON%TYPE,
209 --Third party payments
210 REMIT_TO_SUPPLIER_NAME	AP_INVOICES_INTERFACE.REMIT_TO_SUPPLIER_NAME%TYPE,
211 REMIT_TO_SUPPLIER_ID	 	AP_INVOICES_INTERFACE.REMIT_TO_SUPPLIER_ID%TYPE,
212 REMIT_TO_SUPPLIER_SITE	AP_INVOICES_INTERFACE.REMIT_TO_SUPPLIER_SITE%TYPE,
213 REMIT_TO_SUPPLIER_SITE_ID	AP_INVOICES_INTERFACE.REMIT_TO_SUPPLIER_SITE_ID%TYPE,
214 RELATIONSHIP_ID			AP_INVOICES_INTERFACE.RELATIONSHIP_ID%TYPE,
215 REMIT_TO_SUPPLIER_NUM	AP_INVOICES_INTERFACE.REMIT_TO_SUPPLIER_NUM%TYPE
216  );
217 
218 -- Retropricing
219 TYPE t_invoice_table is TABLE of r_invoice_info_rec
220                  index by BINARY_INTEGER;
221 -- Retropricing
222 TYPE r_line_info_rec IS RECORD (
223 row_id                   ROWID,
224 invoice_line_id          AP_INVOICE_LINES_INTERFACE.invoice_line_id%TYPE,
225 line_type_lookup_code    AP_INVOICE_LINES_INTERFACE.line_type_lookup_code%TYPE,
226 line_number              AP_INVOICE_LINES_INTERFACE.line_number%TYPE,
227 line_group_number        AP_INVOICE_LINES_INTERFACE.line_group_number%TYPE,
228 amount                   AP_INVOICE_LINES_INTERFACE.amount%TYPE,
229 base_amount              AP_INVOICE_LINES_INTERFACE.amount%TYPE,
230 accounting_date          AP_INVOICE_LINES_INTERFACE.accounting_date%TYPE,
231 period_name              AP_INVOICE_LINES.period_name%TYPE,
232 deferred_acctg_flag      AP_INVOICE_LINES_INTERFACE.deferred_acctg_flag%TYPE,
233 def_acctg_start_date     AP_INVOICE_LINES_INTERFACE.def_acctg_start_date%TYPE,
234 def_acctg_end_date       AP_INVOICE_LINES_INTERFACE.def_acctg_end_date%TYPE,
235 def_acctg_number_of_periods
236           AP_INVOICE_LINES_INTERFACE.def_acctg_number_of_periods%TYPE,
237 def_acctg_period_type    AP_INVOICE_LINES_INTERFACE.def_acctg_period_type%TYPE,
238 description              AP_INVOICE_LINES_INTERFACE.description%TYPE,
239 prorate_across_flag      AP_INVOICE_LINES_INTERFACE.prorate_across_flag%TYPE,
240 match_type               AP_INVOICE_LINES.MATCH_TYPE%TYPE,
241 po_header_id             AP_INVOICE_LINES_INTERFACE.po_header_id%TYPE,
242 po_number                AP_INVOICE_LINES_INTERFACE.po_number%TYPE,
243 po_line_id               AP_INVOICE_LINES_INTERFACE.po_line_id%TYPE,
244 po_line_number           AP_INVOICE_LINES_INTERFACE.po_line_number%TYPE,
245 po_release_id            AP_INVOICE_LINES_INTERFACE.po_release_id%TYPE,
246 release_num              AP_INVOICE_LINES_INTERFACE.release_num%TYPE,
247 po_line_location_id      AP_INVOICE_LINES_INTERFACE.po_line_location_id%TYPE,
248 po_shipment_num          AP_INVOICE_LINES_INTERFACE.po_shipment_num%TYPE,
249 po_distribution_id       AP_INVOICE_LINES_INTERFACE.po_distribution_id%TYPE,
250 po_distribution_num      AP_INVOICE_LINES_INTERFACE.po_distribution_num%TYPE,
251 unit_of_meas_lookup_code
252           AP_INVOICE_LINES_INTERFACE.unit_of_meas_lookup_code%TYPE,
253 inventory_item_id        AP_INVOICE_LINES_INTERFACE.inventory_item_id%TYPE,
257 unit_price               AP_INVOICE_LINES_INTERFACE.unit_price%TYPE,
254 item_description         AP_INVOICE_LINES_INTERFACE.item_description%TYPE,
255 quantity_invoiced        AP_INVOICE_LINES_INTERFACE.quantity_invoiced%TYPE,
256 ship_to_location_code    AP_INVOICE_LINES_INTERFACE.ship_to_location_code%TYPE,
258 final_match_flag         AP_INVOICE_LINES_INTERFACE.final_match_flag%TYPE,
259 distribution_set_id      AP_INVOICE_LINES_INTERFACE.distribution_set_id%TYPE,
260 distribution_set_name    AP_INVOICE_LINES_INTERFACE.distribution_set_name%TYPE,
261 partial_segments         VARCHAR2(1),
262 dist_code_concatenated   AP_INVOICE_LINES_INTERFACE.dist_code_concatenated%TYPE,
263 dist_code_combination_id
264           AP_INVOICE_LINES_INTERFACE.dist_code_combination_id%TYPE,
265 awt_group_id             AP_INVOICE_LINES_INTERFACE.awt_group_id%TYPE,
266 awt_group_name           AP_INVOICE_LINES_INTERFACE.awt_group_name%TYPE,
267 pay_awt_group_id         AP_INVOICE_LINES_INTERFACE.pay_awt_group_id%TYPE,--bug6639866
268 pay_awt_group_name       AP_INVOICE_LINES_INTERFACE.pay_awt_group_name%TYPE,--bug6639866
269 balancing_segment        AP_INVOICE_LINES_INTERFACE.balancing_segment%TYPE,
270 cost_center_segment      AP_INVOICE_LINES_INTERFACE.cost_center_segment%TYPE,
271 account_segment          AP_INVOICE_LINES_INTERFACE.account_segment%TYPE,
272 attribute_category       AP_INVOICE_LINES_INTERFACE.attribute_category%TYPE,
273 attribute1               AP_INVOICE_LINES_INTERFACE.attribute1%TYPE,
274 attribute2               AP_INVOICE_LINES_INTERFACE.attribute2%TYPE,
275 attribute3               AP_INVOICE_LINES_INTERFACE.attribute3%TYPE,
276 attribute4               AP_INVOICE_LINES_INTERFACE.attribute4%TYPE,
277 attribute5               AP_INVOICE_LINES_INTERFACE.attribute5%TYPE,
278 attribute6               AP_INVOICE_LINES_INTERFACE.attribute6%TYPE,
279 attribute7               AP_INVOICE_LINES_INTERFACE.attribute7%TYPE,
280 attribute8               AP_INVOICE_LINES_INTERFACE.attribute8%TYPE,
281 attribute9               AP_INVOICE_LINES_INTERFACE.attribute9%TYPE,
282 attribute10              AP_INVOICE_LINES_INTERFACE.attribute10%TYPE,
283 attribute11              AP_INVOICE_LINES_INTERFACE.attribute11%TYPE,
284 attribute12              AP_INVOICE_LINES_INTERFACE.attribute12%TYPE,
285 attribute13              AP_INVOICE_LINES_INTERFACE.attribute13%TYPE,
286 attribute14              AP_INVOICE_LINES_INTERFACE.attribute14%TYPE,
287 attribute15              AP_INVOICE_LINES_INTERFACE.attribute15%TYPE,
288 global_attribute_category
289           AP_INVOICE_LINES_INTERFACE.global_attribute_category%TYPE,
290 global_attribute1        AP_INVOICE_LINES_INTERFACE.global_attribute1%TYPE,
291 global_attribute2        AP_INVOICE_LINES_INTERFACE.global_attribute2%TYPE,
292 global_attribute3        AP_INVOICE_LINES_INTERFACE.global_attribute3%TYPE,
293 global_attribute4        AP_INVOICE_LINES_INTERFACE.global_attribute4%TYPE,
294 global_attribute5        AP_INVOICE_LINES_INTERFACE.global_attribute5%TYPE,
295 global_attribute6        AP_INVOICE_LINES_INTERFACE.global_attribute6%TYPE,
296 global_attribute7        AP_INVOICE_LINES_INTERFACE.global_attribute7%TYPE,
297 global_attribute8        AP_INVOICE_LINES_INTERFACE.global_attribute8%TYPE,
298 global_attribute9        AP_INVOICE_LINES_INTERFACE.global_attribute9%TYPE,
299 global_attribute10       AP_INVOICE_LINES_INTERFACE.global_attribute10%TYPE,
300 global_attribute11       AP_INVOICE_LINES_INTERFACE.global_attribute11%TYPE,
301 global_attribute12       AP_INVOICE_LINES_INTERFACE.global_attribute12%TYPE,
302 global_attribute13       AP_INVOICE_LINES_INTERFACE.global_attribute13%TYPE,
303 global_attribute14       AP_INVOICE_LINES_INTERFACE.global_attribute14%TYPE,
304 global_attribute15       AP_INVOICE_LINES_INTERFACE.global_attribute15%TYPE,
305 global_attribute16       AP_INVOICE_LINES_INTERFACE.global_attribute16%TYPE,
306 global_attribute17       AP_INVOICE_LINES_INTERFACE.global_attribute17%TYPE,
307 global_attribute18       AP_INVOICE_LINES_INTERFACE.global_attribute18%TYPE,
308 global_attribute19       AP_INVOICE_LINES_INTERFACE.global_attribute19%TYPE,
309 global_attribute20       AP_INVOICE_LINES_INTERFACE.global_attribute20%TYPE,
310 project_id               AP_INVOICE_LINES_INTERFACE.project_id%TYPE,
311 task_id                  AP_INVOICE_LINES_INTERFACE.task_id%TYPE,
312 award_id                 AP_INVOICE_LINES_INTERFACE.award_id%TYPE,
313 expenditure_type         AP_INVOICE_LINES_INTERFACE.expenditure_type%TYPE,
314 expenditure_item_date    AP_INVOICE_LINES_INTERFACE.expenditure_item_date%TYPE,
315 expenditure_organization_id
316           AP_INVOICE_LINES_INTERFACE.expenditure_organization_id%TYPE,
317 pa_addition_flag         AP_INVOICE_LINES_INTERFACE.pa_addition_flag%TYPE,
318 pa_quantity              AP_INVOICE_LINES_INTERFACE.pa_quantity%TYPE,
319 --Removed for bug 4277744
320 --ussgl_transaction_code AP_INVOICE_LINES_INTERFACE.ussgl_transaction_code%TYPE,
321 stat_amount              AP_INVOICE_LINES_INTERFACE.stat_amount%TYPE,
322 type_1099                AP_INVOICE_LINES_INTERFACE.type_1099%TYPE,
323 income_tax_region        AP_INVOICE_LINES_INTERFACE.income_tax_region%TYPE,
324 assets_tracking_flag     AP_INVOICE_LINES_INTERFACE.assets_tracking_flag%TYPE,
325 asset_book_type_code     AP_INVOICE_LINES_INTERFACE.asset_book_type_code%TYPE,
326 asset_category_id        AP_INVOICE_LINES_INTERFACE.asset_category_id%TYPE,
327 serial_number            AP_INVOICE_LINES_INTERFACE.serial_number%TYPE,
328 manufacturer             AP_INVOICE_LINES_INTERFACE.manufacturer%TYPE,
329 model_number             AP_INVOICE_LINES_INTERFACE.model_number%TYPE,
330 warranty_number          AP_INVOICE_LINES_INTERFACE.warranty_number%TYPE,
331 price_correction_flag    AP_INVOICE_LINES_INTERFACE.price_correction_flag%TYPE,
332 price_correct_inv_num    AP_INVOICE_LINES_INTERFACE.price_correct_inv_num%TYPE,
333 corrected_inv_id         AP_INVOICE_LINES_ALL.corrected_inv_id%TYPE,
337 receipt_line_number      AP_INVOICE_LINES_INTERFACE.receipt_line_number%TYPE,
334 price_correct_inv_line_num
335           AP_INVOICE_LINES_INTERFACE.price_correct_inv_line_num%TYPE,
336 receipt_number           AP_INVOICE_LINES_INTERFACE.receipt_number%TYPE,
338 rcv_transaction_id       AP_INVOICE_LINES_INTERFACE.rcv_transaction_id%TYPE,
339 -- bug 7344899 - added field
340 rcv_shipment_line_id	 AP_INVOICE_LINES.RCV_SHIPMENT_LINE_ID%TYPE,
341 match_option             AP_INVOICE_LINES_INTERFACE.match_option%TYPE,
342 packing_slip             AP_INVOICE_LINES_INTERFACE.packing_slip%TYPE,
343 vendor_item_num          AP_INVOICE_LINES_INTERFACE.vendor_item_num%TYPE,
344 taxable_flag             AP_INVOICE_LINES_INTERFACE.taxable_flag%TYPE,
345 pa_cc_ar_invoice_id      AP_INVOICE_LINES_INTERFACE.pa_cc_ar_invoice_id%TYPE,
346 pa_cc_ar_invoice_line_num
347           AP_INVOICE_LINES_INTERFACE.pa_cc_ar_invoice_line_num%TYPE,
348 pa_cc_processed_code     AP_INVOICE_LINES_INTERFACE.pa_cc_processed_code%TYPE,
349 reference_1              AP_INVOICE_LINES_INTERFACE.reference_1%TYPE,
350 reference_2              AP_INVOICE_LINES_INTERFACE.reference_2%TYPE,
351 credit_card_trx_id       AP_INVOICE_LINES_INTERFACE.credit_card_trx_id%TYPE,
352 requester_id             AP_INVOICE_LINES_INTERFACE.requester_id%TYPE,
353 org_id                   AP_INVOICE_LINES_INTERFACE.org_id%TYPE,
354 program_application_id   AP_INVOICE_LINES.PROGRAM_APPLICATION_ID%TYPE,
355 program_id               AP_INVOICE_LINES.PROGRAM_ID%TYPE,
356 request_id               AP_INVOICE_LINES.REQUEST_ID%TYPE,
357 program_update_date      AP_INVOICE_LINES.PROGRAM_UPDATE_DATE%TYPE,
358 control_amount           AP_INVOICE_LINES_INTERFACE.control_amount%TYPE,
359 assessable_value         AP_INVOICE_LINES_INTERFACE.assessable_value%TYPE,
360 default_dist_ccid        AP_INVOICE_LINES_INTERFACE.default_dist_ccid%TYPE,
361 primary_intended_use     AP_INVOICE_LINES_INTERFACE.primary_intended_use%TYPE,
362 ship_to_location_id      AP_INVOICE_LINES_INTERFACE.ship_to_location_id%TYPE,
363 product_type             AP_INVOICE_LINES_INTERFACE.product_type%TYPE,
364 product_category         AP_INVOICE_LINES_INTERFACE.product_category%TYPE,
365 product_fisc_classification
366   AP_INVOICE_LINES_INTERFACE.product_fisc_classification%TYPE,
367 user_defined_fisc_class  AP_INVOICE_LINES_INTERFACE.user_defined_fisc_class%TYPE,
368 trx_business_category    AP_INVOICE_LINES_INTERFACE.trx_business_category%TYPE,
369 tax_regime_code          AP_INVOICE_LINES_INTERFACE.tax_regime_code%TYPE,
370 tax                      AP_INVOICE_LINES_INTERFACE.tax%TYPE,
371 tax_jurisdiction_code    AP_INVOICE_LINES_INTERFACE.tax_jurisdiction_code%TYPE,
372 tax_status_code          AP_INVOICE_LINES_INTERFACE.tax_status_code%TYPE,
373 tax_rate_id              AP_INVOICE_LINES_INTERFACE.tax_rate_id%TYPE,
374 tax_rate_code            AP_INVOICE_LINES_INTERFACE.tax_rate_code%TYPE,
375 tax_rate                 AP_INVOICE_LINES_INTERFACE.tax_rate%TYPE,
376 incl_in_taxable_line_flag
377   AP_INVOICE_LINES_INTERFACE.incl_in_taxable_line_flag%TYPE,
378 application_id	AP_INVOICE_LINES_INTERFACE.application_id%TYPE,
379 product_table	AP_INVOICE_LINES_INTERFACE.product_table%TYPE,
380 reference_key1  AP_INVOICE_LINES_INTERFACE.reference_key1%TYPE,
381 reference_key2  AP_INVOICE_LINES_INTERFACE.reference_key2%TYPE,
382 reference_key3  AP_INVOICE_LINES_INTERFACE.reference_key3%TYPE,
383 reference_key4  AP_INVOICE_LINES_INTERFACE.reference_key4%TYPE,
384 reference_key5  AP_INVOICE_LINES_INTERFACE.reference_key5%TYPE,
385 purchasing_category_id AP_INVOICE_LINES_INTERFACE.purchasing_category_id%TYPE,
386 purchasing_category   VARCHAR2(2000),
387 cost_factor_id  AP_INVOICE_LINES_INTERFACE.cost_factor_id%TYPE,
388 cost_factor_name AP_INVOICE_LINES_INTERFACE.cost_factor_name%TYPE,
389 source_application_id   AP_INVOICE_LINES_INTERFACE.source_application_id%TYPE,
390 source_entity_code      AP_INVOICE_LINES_INTERFACE.source_entity_code%TYPE,
391 source_event_class_code AP_INVOICE_LINES_INTERFACE.source_event_class_code%TYPE,
392 source_trx_id           AP_INVOICE_LINES_INTERFACE.source_trx_id%TYPE,
393 source_line_id          AP_INVOICE_LINES_INTERFACE.source_line_id%TYPE,
394 source_trx_level_type   AP_INVOICE_LINES_INTERFACE.source_trx_level_type%TYPE,
395 tax_classification_code AP_INVOICE_LINES_INTERFACE.tax_classification_code%TYPE,
396 retained_amount		AP_INVOICE_LINES_ALL.retained_amount%TYPE,
397 amount_includes_tax_flag AP_INVOICE_LINES_INTERFACE.amount_includes_tax_flag%TYPE,
398 --Bug6167068 starts Added the following columns to record
399 CC_REVERSAL_FLAG                AP_INVOICE_LINES_INTERFACE.CC_REVERSAL_FLAG%TYPE,
400 COMPANY_PREPAID_INVOICE_ID	AP_INVOICE_LINES_INTERFACE.COMPANY_PREPAID_INVOICE_ID%TYPE,
401 EXPENSE_GROUP                   AP_INVOICE_LINES_INTERFACE.EXPENSE_GROUP%TYPE,
402 JUSTIFICATION                   AP_INVOICE_LINES_INTERFACE.JUSTIFICATION%TYPE,
403 MERCHANT_DOCUMENT_NUMBER        AP_INVOICE_LINES_INTERFACE.MERCHANT_DOCUMENT_NUMBER%TYPE,
404 MERCHANT_NAME                   AP_INVOICE_LINES_INTERFACE.MERCHANT_NAME%TYPE,
405 MERCHANT_REFERENCE              AP_INVOICE_LINES_INTERFACE.MERCHANT_REFERENCE%TYPE,
406 MERCHANT_TAXPAYER_ID            AP_INVOICE_LINES_INTERFACE.MERCHANT_TAXPAYER_ID%TYPE,
407 MERCHANT_TAX_REG_NUMBER         AP_INVOICE_LINES_INTERFACE.MERCHANT_TAX_REG_NUMBER%TYPE,
408 RECEIPT_CONVERSION_RATE         AP_INVOICE_LINES_INTERFACE.RECEIPT_CONVERSION_RATE%TYPE,
409 RECEIPT_CURRENCY_AMOUNT         AP_INVOICE_LINES_INTERFACE.RECEIPT_CURRENCY_AMOUNT%TYPE,
410 RECEIPT_CURRENCY_CODE           AP_INVOICE_LINES_INTERFACE.RECEIPT_CURRENCY_CODE%TYPE,
411 COUNTRY_OF_SUPPLY               AP_INVOICE_LINES_INTERFACE.COUNTRY_OF_SUPPLY%TYPE
412 --Bug6167068 ends
413 );
414 
415 
416 TYPE t_lines_table is TABLE of r_line_info_rec
417                  index by BINARY_INTEGER;
418 
419 
423    reject_lookup_code   AP_INTERFACE_REJECTIONS.reject_lookup_code%TYPE);
420 TYPE rejection_rec_type IS RECORD
421   (parent_table         AP_INTERFACE_REJECTIONS.parent_table%TYPE,
422    parent_id            AP_INTERFACE_REJECTIONS.parent_id%TYPE,
424 
425 TYPE rejection_tab_type IS TABLE OF rejection_rec_type
426                  index by BINARY_INTEGER;
427 
428 -- Bug 5448579. Following new variables are added
429 TYPE moac_ou_rec_type IS RECORD
430   (org_id                  HR_OPERATING_UNITS.Organization_Id%TYPE,
431    org_name                HR_OPERATING_UNITS.Name%TYPE);
432 
433 TYPE moac_ou_tab_type IS TABLE OF moac_ou_rec_type
434                 index by BINARY_INTEGER;
435 
436 TYPE fsp_org_rec_type IS RECORD
437   (org_id                  FINANCIALS_SYSTEM_PARAMS_ALL.Org_Id%TYPE);
438 
439 TYPE fsp_org_tab_type IS TABLE OF fsp_org_rec_type
440                 index by BINARY_INTEGER;
441 
442 TYPE pay_group_rec_type IS RECORD
443   (pay_group          PO_LOOKUP_CODES.Lookup_Code%Type);
444 
445 TYPE pay_group_tab_type IS TABLE OF pay_group_rec_type
446                 index by BINARY_INTEGER;
447 
448 TYPE payment_method_rec_type IS RECORD
449   (payment_method          IBY_PAYMENT_METHODS_VL.Payment_Method_Code%Type);
450 
451 TYPE payment_method_tab_type IS TABLE OF payment_method_rec_type
452                 index by BINARY_INTEGER;
453 
454 TYPE fnd_currency_rec_type IS RECORD
455   (currency_code           FND_CURRENCIES.currency_code%TYPE,
456    start_date_active       FND_CURRENCIES.start_date_active%TYPE,
457    end_date_active         FND_CURRENCIES.end_date_active%TYPE,
458    minimum_accountable_unit FND_CURRENCIES.minimum_accountable_unit%TYPE,
459    precision               FND_CURRENCIES.precision%TYPE,
460    enabled_flag            FND_CURRENCIES.enabled_flag%TYPE);
461 
462 TYPE fnd_currency_tab_type IS TABLE OF fnd_currency_rec_type
463                 index by BINARY_INTEGER;
464 
465 g_moac_ou_tab              moac_ou_tab_type;
466 g_fsp_ou_tab               fsp_org_tab_type;
467 g_pay_group_tab            pay_group_tab_type;
468 g_payment_method_tab       payment_method_tab_type;
469 g_fnd_currency_tab         fnd_currency_tab_type;
470 g_structure_id             mtl_default_sets_view.structure_id%TYPE;
471 
472 FUNCTION IMPORT_INVOICES(
473     p_batch_name           IN             VARCHAR2,
474     p_gl_date              IN             DATE,
475     p_hold_code            IN             VARCHAR2,
476     p_hold_reason          IN             VARCHAR2,
477     p_commit_cycles        IN             NUMBER,
478     p_source               IN             VARCHAR2,
479     p_group_id             IN             VARCHAR2,
480     p_conc_request_id      IN             NUMBER,
481     p_debug_switch         IN             VARCHAR2,
482     p_org_id               IN             NUMBER,
483     p_batch_error_flag        OUT NOCOPY  VARCHAR2,
484     p_invoices_fetched        OUT NOCOPY  NUMBER,
485     p_invoices_created        OUT NOCOPY  NUMBER,
486     p_total_invoice_amount    OUT NOCOPY  NUMBER,
487     p_print_batch             OUT NOCOPY  VARCHAR2,
488     p_calling_sequence     IN             VARCHAR2,
489     p_invoice_interface_id IN             NUMBER DEFAULT NULL,
490     p_needs_invoice_approval  IN          VARCHAR2 DEFAULT 'N',
491     p_commit                  IN          VARCHAR2 DEFAULT 'Y') RETURN BOOLEAN;
492 
493 
494 FUNCTION IMPORT_PURGE(
495     p_source               IN             VARCHAR2,
496     p_group_id             IN             VARCHAR2,
497     p_org_id               IN             NUMBER,
498     p_commit_cycles        IN             NUMBER,
499     p_calling_sequence     IN             VARCHAR2) RETURN BOOLEAN;
500 
501 FUNCTION XML_IMPORT_PURGE(
502     p_group_id             IN             VARCHAR2,
503     p_calling_sequence     IN             VARCHAR2) RETURN BOOLEAN;
504 
505 
506 PROCEDURE SUBMIT_PAYMENT_REQUEST(
507     p_api_version             IN          VARCHAR2 DEFAULT '1.0',
508     p_invoice_interface_id    IN          NUMBER,
509     p_budget_control          IN          VARCHAR2 DEFAULT 'Y',
510     p_needs_invoice_approval  IN          VARCHAR2 DEFAULT 'N',
511     p_invoice_id              OUT NOCOPY  NUMBER,
512     x_return_status           OUT NOCOPY  VARCHAR2,
513     x_msg_count               OUT NOCOPY  NUMBER,
514     x_msg_data                OUT NOCOPY  VARCHAR2,
515     x_rejection_list          OUT NOCOPY  rejection_tab_type,
516     p_calling_sequence        IN          VARCHAR2,
517     p_commit                  IN          VARCHAR2 DEFAULT 'Y');
518 
519 
520 END AP_IMPORT_INVOICES_PKG;