[Home] [Help]
PACKAGE: APPS.AP_WEB_EXPORT_ER
Source
1 PACKAGE AP_WEB_EXPORT_ER AS
2 /* $Header: apwexpts.pls 120.11.12010000.2 2008/08/26 10:05:42 stalasil ship $ */
3
4 g_debug_switch VARCHAR2(1) := 'N';
5 g_last_updated_by NUMBER;
6 g_last_update_login NUMBER;
7 ------------------------------------------------------------------------
8 -- Table Types for Expenses Headers
9 ------------------------------------------------------------------------
10 TYPE InvoiceInfoRecType IS RECORD(
11 report_header_id ap_expense_report_headers.report_header_id%TYPE,
12 employee_id ap_expense_report_headers.employee_id%TYPE,
13 employee_number per_all_people_f.employee_number%TYPE,
14 week_end_date ap_expense_report_headers.week_end_date%TYPE,
15 invoice_num ap_expense_report_headers.invoice_num%TYPE,
16 total ap_expense_report_headers.total%TYPE,
17 description ap_expense_report_headers.description%TYPE,
18 name per_all_people_f.full_name%TYPE,
19 location_code hr_locations.location_code%TYPE,
20 address_line_1 hr_locations.address_line_1%TYPE,
21 address_line_2 hr_locations.address_line_2%TYPE,
22 address_line_3 hr_locations.address_line_3%TYPE,
23 city hr_locations.town_or_city%TYPE,
24 state hr_locations.region_2%TYPE,
25 postal_code hr_locations.postal_code%TYPE,
26 province hr_locations.region_1%TYPE,
27 county hr_locations.region_1%TYPE,
28 country hr_locations.country%TYPE,
29 vendor_id ap_suppliers.vendor_id%TYPE,
30 header_vendor_id ap_expense_report_headers.vendor_id%TYPE,
31 --hold_lookup_code ap_expense_report_headers.hold_lookup_code%TYPE,
32 --nls_hold_code ap_lookup_codes.displayed_field%TYPE,
33 --hold_description ap_lookup_codes.description%TYPE,
34 created_by ap_expense_report_headers.created_by%TYPE,
35 default_currency_code ap_expense_report_headers.default_currency_code%TYPE,
36 default_exchange_rate_type ap_expense_report_headers.default_exchange_rate_type%TYPE,
37 default_exchange_rate ap_expense_report_headers.default_exchange_rate%TYPE,
38 default_exchange_date ap_expense_report_headers.default_exchange_date%TYPE,
39 accts_pay_ccid ap_expense_report_headers.accts_pay_code_combination_id%TYPE,
40 set_of_books_id ap_expense_report_headers.set_of_books_id%TYPE,
41 accounting_date ap_expense_report_headers.accounting_date%TYPE,
42 header_vendor_site_id ap_expense_report_headers.vendor_site_id%TYPE,
43 apply_advances_flag ap_expense_report_headers.apply_advances_default%TYPE,
44 advance_invoice_to_apply ap_expense_report_headers.advance_invoice_to_apply%TYPE,
45 amount_want_to_apply ap_expense_report_headers.maximum_amount_to_apply%TYPE,
46 home_or_office ap_expense_report_headers.expense_check_address_flag%TYPE,
47 current_emp_id ap_expense_report_headers.employee_id%TYPE,
48 voucher_num ap_expense_report_headers.voucher_num%TYPE,
49 base_amount ap_expense_report_headers.total%TYPE,
50 doc_category_code ap_expense_report_headers.doc_category_code%TYPE,
51 reference_1 ap_expense_report_headers.reference_1%TYPE,
52 reference_2 ap_expense_report_headers.reference_2%TYPE,
53 awt_group_id ap_expense_report_headers.awt_group_id%TYPE,
54 global_attribute1 ap_expense_report_headers.global_attribute1%TYPE,
55 global_attribute2 ap_expense_report_headers.global_attribute2%TYPE,
56 global_attribute3 ap_expense_report_headers.global_attribute3%TYPE,
57 global_attribute4 ap_expense_report_headers.global_attribute4%TYPE,
58 global_attribute5 ap_expense_report_headers.global_attribute5%TYPE,
59 global_attribute6 ap_expense_report_headers.global_attribute6%TYPE,
60 global_attribute7 ap_expense_report_headers.global_attribute7%TYPE,
61 global_attribute8 ap_expense_report_headers.global_attribute8%TYPE,
62 global_attribute9 ap_expense_report_headers.global_attribute9%TYPE,
63 global_attribute10 ap_expense_report_headers.global_attribute10%TYPE,
64 global_attribute11 ap_expense_report_headers.global_attribute11%TYPE,
65 global_attribute12 ap_expense_report_headers.global_attribute12%TYPE,
66 global_attribute13 ap_expense_report_headers.global_attribute13%TYPE,
67 global_attribute14 ap_expense_report_headers.global_attribute14%TYPE,
68 global_attribute15 ap_expense_report_headers.global_attribute15%TYPE,
69 global_attribute16 ap_expense_report_headers.global_attribute16%TYPE,
70 global_attribute17 ap_expense_report_headers.global_attribute17%TYPE,
71 global_attribute18 ap_expense_report_headers.global_attribute18%TYPE,
72 global_attribute19 ap_expense_report_headers.global_attribute19%TYPE,
73 global_attribute20 ap_expense_report_headers.global_attribute20%TYPE,
74 global_attribute_category ap_expense_report_headers.global_attribute_category%TYPE,
75 attribute1 ap_expense_report_headers.attribute1%TYPE,
76 attribute2 ap_expense_report_headers.attribute2%TYPE,
77 attribute3 ap_expense_report_headers.attribute3%TYPE,
78 attribute4 ap_expense_report_headers.attribute4%TYPE,
79 attribute5 ap_expense_report_headers.attribute5%TYPE,
80 attribute6 ap_expense_report_headers.attribute6%TYPE,
81 attribute7 ap_expense_report_headers.attribute7%TYPE,
82 attribute8 ap_expense_report_headers.attribute8%TYPE,
83 attribute9 ap_expense_report_headers.attribute9%TYPE,
84 attribute10 ap_expense_report_headers.attribute10%TYPE,
85 attribute11 ap_expense_report_headers.attribute11%TYPE,
86 attribute12 ap_expense_report_headers.attribute12%TYPE,
87 attribute13 ap_expense_report_headers.attribute13%TYPE,
88 attribute14 ap_expense_report_headers.attribute14%TYPE,
89 attribute15 ap_expense_report_headers.attribute15%TYPE,
90 attribute_category ap_expense_report_headers.attribute_category%TYPE,
91 payment_currency_code ap_expense_report_headers.payment_currency_code%TYPE,
92 payment_cross_rate_type ap_expense_report_headers.payment_cross_rate_type%TYPE,
93 payment_cross_rate_date ap_expense_report_headers.payment_cross_rate_date%TYPE,
94 payment_cross_rate ap_expense_report_headers.payment_cross_rate%TYPE,
95 prepay_num ap_expense_report_headers.prepay_num%TYPE,
96 prepay_dist_num ap_expense_report_headers.prepay_dist_num%TYPE,
97 prepay_gl_date ap_expense_report_headers.prepay_gl_date%TYPE,
98 paid_on_behalf_employee_id ap_expense_report_headers.paid_on_behalf_employee_id%TYPE,
99 amt_due_employee ap_expense_report_headers.amt_due_employee%TYPE,
100 amt_due_ccard_company ap_expense_report_headers.amt_due_ccard_company%TYPE,
101 per_information18_19 per_all_people_f.per_information18%TYPE,
102 per_information_category per_all_people_f.per_information_category%TYPE,
103 source ap_expense_report_headers.source%TYPE,
104 group_id ap_invoices_interface.group_id%TYPE,
105 style hr_locations.style%TYPE,
106 org_id ap_expense_report_headers_all.org_id%TYPE,
107 invoice_id ap_invoices_interface.invoice_id%TYPE,
108 invoice_type_lookup_code ap_invoices_interface.invoice_type_lookup_code%TYPE,
109 gl_date ap_invoices_interface.gl_date%TYPE,
110 alternate_name per_all_people_f.full_name%TYPE,
111 amount_app_to_discount ap_invoices_interface.amount_applicable_to_discount%TYPE,
112 payment_method_code ap_suppliers.payment_method_lookup_code%TYPE);
113
114 -----------------------------------------------------------------------
115 -- Table Types for Expense Lines
116 -----------------------------------------------------------------------
117
118 TYPE InvoiceLinesInfoRecType IS RECORD(
119 report_header_id ap_expense_report_lines.report_header_id%TYPE,
120 report_line_id ap_expense_report_lines.report_line_id%TYPE,
121 code_combination_id ap_expense_report_lines.code_combination_id%TYPE,
122 line_type_lookup_code ap_lookup_codes.lookup_code%TYPE,
123 line_vat_code ap_expense_report_lines.vat_code%TYPE,
124 line_tax_code_id ap_expense_report_lines.tax_code_id%TYPE,
125 distribution_amount_sign NUMBER,
126 stat_amount_sign NUMBER,
127 stat_amount ap_expense_report_lines.stat_amount%TYPE,
128 line_set_of_books_id ap_expense_report_lines.set_of_books_id%TYPE,
129 distribution_amount ap_expense_report_lines.amount%TYPE,
130 item_description ap_expense_report_lines.item_description%TYPE,
131 db_line_type ap_expense_report_lines.line_type_lookup_code%TYPE,
132 distribution_line_number ap_expense_report_lines.distribution_line_number%TYPE,
133 base_amount ap_expense_report_lines.amount%TYPE,
134 assets_tracking_flag VARCHAR2(2),
135 attribute1 ap_expense_report_lines.attribute1%TYPE,
136 attribute2 ap_expense_report_lines.attribute2%TYPE,
137 attribute3 ap_expense_report_lines.attribute3%TYPE,
138 attribute4 ap_expense_report_lines.attribute4%TYPE,
139 attribute5 ap_expense_report_lines.attribute5%TYPE,
140 attribute6 ap_expense_report_lines.attribute6%TYPE,
141 attribute7 ap_expense_report_lines.attribute7%TYPE,
142 attribute8 ap_expense_report_lines.attribute8%TYPE,
143 attribute9 ap_expense_report_lines.attribute9%TYPE,
144 attribute10 ap_expense_report_lines.attribute10%TYPE,
145 attribute11 ap_expense_report_lines.attribute11%TYPE,
146 attribute12 ap_expense_report_lines.attribute12%TYPE,
147 attribute13 ap_expense_report_lines.attribute13%TYPE,
148 attribute14 ap_expense_report_lines.attribute14%TYPE,
149 attribute15 ap_expense_report_lines.attribute15%TYPE,
150 attribute_category ap_expense_report_lines.attribute_category%TYPE,
151 pa_context ap_expense_report_lines.project_accounting_context%TYPE,
152 project_id ap_expense_report_lines.project_id%TYPE,
153 task_id ap_expense_report_lines.task_id%TYPE,
154 exp_org_id ap_expense_report_lines.expenditure_organization_id%TYPE,
155 expenditure_type ap_expense_report_lines.expenditure_type%TYPE,
156 expenditure_item_date ap_expense_report_lines.expenditure_item_date%TYPE,
157 pa_quantity ap_expense_report_lines.pa_quantity%TYPE,
158 reference_1 ap_expense_report_lines.reference_1%TYPE,
159 reference_2 ap_expense_report_lines.reference_2%TYPE,
160 awt_group_id ap_expense_report_lines.awt_group_id%TYPE,
161 amount_includes_tax_flag ap_expense_report_lines.amount_includes_tax_flag%TYPE,
162 tax_Code_Overide_flag VARCHAR2(2),
163 tax_recovery_rate VARCHAR2(50),
164 tax_recovery_override_flag VARCHAR2(2),
165 tax_recoverable_flag VARCHAR2(2),
166 global_attribute1 ap_expense_report_lines.global_attribute1%TYPE,
167 global_attribute2 ap_expense_report_lines.global_attribute2%TYPE,
168 global_attribute3 ap_expense_report_lines.global_attribute3%TYPE,
169 global_attribute4 ap_expense_report_lines.global_attribute4%TYPE,
170 global_attribute5 ap_expense_report_lines.global_attribute5%TYPE,
171 global_attribute6 ap_expense_report_lines.global_attribute6%TYPE,
172 global_attribute7 ap_expense_report_lines.global_attribute7%TYPE,
173 global_attribute8 ap_expense_report_lines.global_attribute8%TYPE,
174 global_attribute9 ap_expense_report_lines.global_attribute9%TYPE,
175 global_attribute10 ap_expense_report_lines.global_attribute10%TYPE,
176 global_attribute11 ap_expense_report_lines.global_attribute11%TYPE,
177 global_attribute12 ap_expense_report_lines.global_attribute12%TYPE,
178 global_attribute13 ap_expense_report_lines.global_attribute13%TYPE,
179 global_attribute14 ap_expense_report_lines.global_attribute14%TYPE,
180 global_attribute15 ap_expense_report_lines.global_attribute15%TYPE,
181 global_attribute16 ap_expense_report_lines.global_attribute16%TYPE,
182 global_attribute17 ap_expense_report_lines.global_attribute17%TYPE,
183 global_attribute18 ap_expense_report_lines.global_attribute18%TYPE,
184 global_attribute19 ap_expense_report_lines.global_attribute19%TYPE,
185 global_attribute20 ap_expense_report_lines.global_attribute20%TYPE,
186 global_attribute_category ap_expense_report_lines.global_attribute_category%TYPE,
187 receipt_verified_flag ap_expense_report_lines.receipt_verified_flag%TYPE,
188 receipt_required_flag ap_expense_report_lines.receipt_required_flag%TYPE,
189 receipt_missing_flag ap_expense_report_lines.receipt_missing_flag%TYPE,
190 justification ap_expense_report_lines.justification%TYPE,
191 expense_group ap_expense_report_lines.expense_group%TYPE,
192 start_expense_date ap_expense_report_lines.start_expense_date%TYPE,
193 start_expense_date2 ap_expense_report_lines.start_expense_date%TYPE,
194 end_expense_date ap_expense_report_lines.end_expense_date%TYPE,
195 merchant_document_number ap_expense_report_lines.merchant_document_number%TYPE,
196 merchant_name ap_expense_report_lines.merchant_name%TYPE,
197 merchant_reference ap_expense_report_lines.merchant_reference%TYPE,
198 merchant_tax_reg_number ap_expense_report_lines.merchant_tax_reg_number%TYPE,
199 merchant_taxpayer_id ap_expense_report_lines.merchant_taxpayer_id%TYPE,
200 country_of_supply ap_expense_report_lines.country_of_supply%TYPE,
201 receipt_currency_code ap_expense_report_lines.receipt_currency_code%TYPE,
202 receipt_conversion_rate ap_expense_report_lines.receipt_conversion_rate%TYPE,
203 receipt_currency_amount ap_expense_report_lines.receipt_currency_amount%TYPE,
204 daily_amount ap_expense_report_lines.daily_amount%TYPE,
205 web_parameter_id ap_expense_report_lines.web_parameter_id%TYPE,
206 adjustment_reason ap_expense_report_lines.adjustment_reason%TYPE,
207 credit_card_trx_id ap_expense_report_lines.credit_card_trx_id%TYPE,
208 company_prepaid_invoice_id ap_expense_report_lines.company_prepaid_invoice_id%TYPE,
209 created_by ap_expense_report_lines.created_by%TYPE,
210 pa_addition_flag ap_invoice_lines_interface.pa_addition_flag%TYPE,
211 type_1099 ap_invoice_lines_interface.type_1099%TYPE,
212 income_tax_region ap_invoice_lines_interface.income_tax_region%TYPE,
213 award_id ap_invoice_lines_interface.award_id%TYPE,
214 invoice_id ap_invoice_lines_interface.invoice_id%TYPE,
215 accounting_date ap_invoice_lines_interface.accounting_date%TYPE,
216 org_id ap_expense_report_lines_all.org_id%TYPE);
217
218 TYPE InvoiceLinesRecTabType is TABLE of InvoiceLinesInfoRecType index by BINARY_INTEGER;
219
220 TYPE VendorInfoRecType IS RECORD(
221 vendor_id ap_suppliers.vendor_id%TYPE,
222 vendor_site_id ap_supplier_sites.vendor_site_id%TYPE,
223 employee_id ap_expense_report_headers.employee_id%TYPE,
224 party_id ap_suppliers.party_id%TYPE,
225 party_site_id ap_supplier_sites.party_site_id%TYPE,
226 home_or_office VARCHAR2(2),
227 terms_date_basis ap_suppliers.terms_date_basis%TYPE,
228 terms_id ap_suppliers.terms_id%TYPE,
229 pay_group ap_suppliers.pay_group_lookup_code%TYPE,
230 payment_priority ap_suppliers.payment_priority%TYPE,
231 liab_acc ap_suppliers.accts_pay_code_combination_id%TYPE,
232 prepay_ccid ap_suppliers.prepay_code_combination_id%TYPE,
233 always_take_disc_flag ap_suppliers.always_take_disc_flag%TYPE,
234 pay_date_basis ap_suppliers.pay_date_basis_lookup_code%TYPE,
235 vendor_name ap_suppliers.vendor_name%TYPE,
236 vendor_num ap_suppliers.segment1%TYPE,
237 allow_awt_flag ap_supplier_sites.allow_awt_flag%TYPE,
238 org_id ap_expense_report_headers.org_id%TYPE,
239 address_line_1 hr_locations.address_line_1%TYPE,
240 address_line_2 hr_locations.address_line_2%TYPE,
244 postal_code hr_locations.postal_code%TYPE,
241 address_line_3 hr_locations.address_line_3%TYPE,
242 city hr_locations.town_or_city%TYPE,
243 state hr_locations.region_2%TYPE,
245 province hr_locations.region_1%TYPE,
246 county hr_locations.region_1%TYPE,
247 country hr_locations.country%TYPE,
248 style hr_locations.style%TYPE);
249
250 ------------------------------------------------------------------------
251 PROCEDURE UpdateDistsWithReceiptInfo(p_report_header_id IN NUMBER,
252 p_debug_switch IN VARCHAR2);
253 ------------------------------------------------------------------------
254 PROCEDURE ExportERtoAP(errbuf OUT NOCOPY VARCHAR2,
255 retcode OUT NOCOPY NUMBER,
256 p_batch_name IN VARCHAR2,
257 p_source IN VARCHAR2,
258 p_transfer_flag IN VARCHAR2,
259 p_gl_date IN VARCHAR2,
260 p_group_id IN VARCHAR2,
261 p_commit_cycles IN NUMBER,
262 p_debug_switch IN VARCHAR2,
263 p_org_id IN NUMBER,
264 p_role_name IN VARCHAR2);
265 ------------------------------------------------------------------------
266 FUNCTION ValidateERLines(p_report_header_id IN NUMBER,
267 p_invoice_id IN NUMBER,
268 p_transfer_flag IN VARCHAR2,
269 p_base_currency IN VARCHAR2,
270 p_set_of_books_id IN NUMBER,
271 p_source IN VARCHAR2,
272 p_enable_recoverable_flag IN VARCHAR2,
273 p_invoice_lines_rec_tab OUT NOCOPY InvoiceLinesRecTabType,
274 p_reject_code OUT NOCOPY VARCHAR2)
275 RETURN BOOLEAN;
276 ------------------------------------------------------------------------
277 PROCEDURE InsertInvoiceInterface(p_invoice_rec InvoiceInfoRecType,
278 p_vendor_rec VendorInfoRecType);
279 ------------------------------------------------------------------------
280 --Bug: 6809570
281 PROCEDURE InsertInvoiceLinesInterface(p_report_header_id IN NUMBER,
282 p_invoice_id IN NUMBER,
283 p_transfer_flag IN VARCHAR2,
284 p_base_currency IN VARCHAR2,
285 p_enable_recoverable_flag IN VARCHAR2);
286 ------------------------------------------------------------------------
287 FUNCTION GetVendorinfo(p_vendor_rec IN OUT NOCOPY VendorInfoRecType,
288 p_reject_code OUT NOCOPY VARCHAR2) RETURN BOOLEAN;
289 ------------------------------------------------------------------------
290 FUNCTION CreatePayee(p_party_id IN ap_suppliers.party_id%TYPE,
291 p_org_id IN ap_expense_report_headers.org_id%TYPE,
292 p_reject_code OUT NOCOPY VARCHAR2) RETURN BOOLEAN;
293 ------------------------------------------------------------------------
294
295 END AP_WEB_EXPORT_ER;