DBA Data[Home] [Help]

PACKAGE: APPS.AP_WEB_EXPORT_ER

Source


1 PACKAGE AP_WEB_EXPORT_ER AUTHID CURRENT_USER AS
2   /* $Header: apwexpts.pls 120.11.12010000.5 2009/12/16 12:57:21 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        iby_payment_methods_vl.payment_method_code%TYPE,
113     is_contingent	       VARCHAR2(2));
114 
115   -----------------------------------------------------------------------
116   -- Table Types for Expense Lines
117   -----------------------------------------------------------------------
118 
119   TYPE InvoiceLinesInfoRecType IS RECORD(
120     report_header_id           ap_expense_report_lines.report_header_id%TYPE,
121     report_line_id             ap_expense_report_lines.report_line_id%TYPE,
122     code_combination_id        ap_expense_report_lines.code_combination_id%TYPE,
123     line_type_lookup_code      ap_lookup_codes.lookup_code%TYPE,
124     line_vat_code              ap_expense_report_lines.vat_code%TYPE,
125     line_tax_code_id           ap_expense_report_lines.tax_code_id%TYPE,
126     distribution_amount_sign   NUMBER,
127     stat_amount_sign           NUMBER,
128     stat_amount                ap_expense_report_lines.stat_amount%TYPE,
129     line_set_of_books_id       ap_expense_report_lines.set_of_books_id%TYPE,
130     distribution_amount        ap_expense_report_lines.amount%TYPE,
131     item_description           ap_expense_report_lines.item_description%TYPE,
132     db_line_type               ap_expense_report_lines.line_type_lookup_code%TYPE,
133     distribution_line_number   ap_expense_report_lines.distribution_line_number%TYPE,
134     base_amount                ap_expense_report_lines.amount%TYPE,
135     assets_tracking_flag       VARCHAR2(2),
136     attribute1                 ap_expense_report_lines.attribute1%TYPE,
137     attribute2                 ap_expense_report_lines.attribute2%TYPE,
138     attribute3                 ap_expense_report_lines.attribute3%TYPE,
139     attribute4                 ap_expense_report_lines.attribute4%TYPE,
140     attribute5                 ap_expense_report_lines.attribute5%TYPE,
141     attribute6                 ap_expense_report_lines.attribute6%TYPE,
142     attribute7                 ap_expense_report_lines.attribute7%TYPE,
143     attribute8                 ap_expense_report_lines.attribute8%TYPE,
144     attribute9                 ap_expense_report_lines.attribute9%TYPE,
145     attribute10                ap_expense_report_lines.attribute10%TYPE,
146     attribute11                ap_expense_report_lines.attribute11%TYPE,
147     attribute12                ap_expense_report_lines.attribute12%TYPE,
148     attribute13                ap_expense_report_lines.attribute13%TYPE,
149     attribute14                ap_expense_report_lines.attribute14%TYPE,
150     attribute15                ap_expense_report_lines.attribute15%TYPE,
151     attribute_category         ap_expense_report_lines.attribute_category%TYPE,
152     pa_context                 ap_expense_report_lines.project_accounting_context%TYPE,
153     project_id                 ap_expense_report_lines.project_id%TYPE,
154     task_id                    ap_expense_report_lines.task_id%TYPE,
155     exp_org_id                 ap_expense_report_lines.expenditure_organization_id%TYPE,
156     expenditure_type           ap_expense_report_lines.expenditure_type%TYPE,
157     expenditure_item_date      ap_expense_report_lines.expenditure_item_date%TYPE,
158     pa_quantity                ap_expense_report_lines.pa_quantity%TYPE,
159     reference_1                ap_expense_report_lines.reference_1%TYPE,
160     reference_2                ap_expense_report_lines.reference_2%TYPE,
161     awt_group_id               ap_expense_report_lines.awt_group_id%TYPE,
162     amount_includes_tax_flag   ap_expense_report_lines.amount_includes_tax_flag%TYPE,
163     tax_Code_Overide_flag      VARCHAR2(2),
164     tax_recovery_rate          VARCHAR2(50),
165     tax_recovery_override_flag VARCHAR2(2),
166     tax_recoverable_flag       VARCHAR2(2),
167     global_attribute1          ap_expense_report_lines.global_attribute1%TYPE,
168     global_attribute2          ap_expense_report_lines.global_attribute2%TYPE,
169     global_attribute3          ap_expense_report_lines.global_attribute3%TYPE,
170     global_attribute4          ap_expense_report_lines.global_attribute4%TYPE,
171     global_attribute5          ap_expense_report_lines.global_attribute5%TYPE,
172     global_attribute6          ap_expense_report_lines.global_attribute6%TYPE,
173     global_attribute7          ap_expense_report_lines.global_attribute7%TYPE,
174     global_attribute8          ap_expense_report_lines.global_attribute8%TYPE,
175     global_attribute9          ap_expense_report_lines.global_attribute9%TYPE,
176     global_attribute10         ap_expense_report_lines.global_attribute10%TYPE,
177     global_attribute11         ap_expense_report_lines.global_attribute11%TYPE,
178     global_attribute12         ap_expense_report_lines.global_attribute12%TYPE,
179     global_attribute13         ap_expense_report_lines.global_attribute13%TYPE,
180     global_attribute14         ap_expense_report_lines.global_attribute14%TYPE,
181     global_attribute15         ap_expense_report_lines.global_attribute15%TYPE,
182     global_attribute16         ap_expense_report_lines.global_attribute16%TYPE,
183     global_attribute17         ap_expense_report_lines.global_attribute17%TYPE,
184     global_attribute18         ap_expense_report_lines.global_attribute18%TYPE,
185     global_attribute19         ap_expense_report_lines.global_attribute19%TYPE,
186     global_attribute20         ap_expense_report_lines.global_attribute20%TYPE,
187     global_attribute_category  ap_expense_report_lines.global_attribute_category%TYPE,
188     receipt_verified_flag      ap_expense_report_lines.receipt_verified_flag%TYPE,
189     receipt_required_flag      ap_expense_report_lines.receipt_required_flag%TYPE,
190     receipt_missing_flag       ap_expense_report_lines.receipt_missing_flag%TYPE,
191     justification              ap_expense_report_lines.justification%TYPE,
192     expense_group              ap_expense_report_lines.expense_group%TYPE,
193     start_expense_date         ap_expense_report_lines.start_expense_date%TYPE,
194     start_expense_date2        ap_expense_report_lines.start_expense_date%TYPE,
195     end_expense_date           ap_expense_report_lines.end_expense_date%TYPE,
196     merchant_document_number   ap_expense_report_lines.merchant_document_number%TYPE,
197     merchant_name              ap_expense_report_lines.merchant_name%TYPE,
198     merchant_reference         ap_expense_report_lines.merchant_reference%TYPE,
199     merchant_tax_reg_number    ap_expense_report_lines.merchant_tax_reg_number%TYPE,
200     merchant_taxpayer_id       ap_expense_report_lines.merchant_taxpayer_id%TYPE,
201     country_of_supply          ap_expense_report_lines.country_of_supply%TYPE,
202     receipt_currency_code      ap_expense_report_lines.receipt_currency_code%TYPE,
203     receipt_conversion_rate    ap_expense_report_lines.receipt_conversion_rate%TYPE,
204     receipt_currency_amount    ap_expense_report_lines.receipt_currency_amount%TYPE,
205     daily_amount               ap_expense_report_lines.daily_amount%TYPE,
206     web_parameter_id           ap_expense_report_lines.web_parameter_id%TYPE,
207     adjustment_reason          ap_expense_report_lines.adjustment_reason%TYPE,
208     credit_card_trx_id         ap_expense_report_lines.credit_card_trx_id%TYPE,
209     company_prepaid_invoice_id ap_expense_report_lines.company_prepaid_invoice_id%TYPE,
210     created_by                 ap_expense_report_lines.created_by%TYPE,
211     pa_addition_flag           ap_invoice_lines_interface.pa_addition_flag%TYPE,
212     type_1099                  ap_invoice_lines_interface.type_1099%TYPE,
213     income_tax_region          ap_invoice_lines_interface.income_tax_region%TYPE,
214     award_id                   ap_invoice_lines_interface.award_id%TYPE,
215     invoice_id                 ap_invoice_lines_interface.invoice_id%TYPE,
216     accounting_date            ap_invoice_lines_interface.accounting_date%TYPE,
217     org_id                     ap_expense_report_lines_all.org_id%TYPE);
218 
219   TYPE InvoiceLinesRecTabType is TABLE of InvoiceLinesInfoRecType index by BINARY_INTEGER;
220 
221   TYPE VendorInfoRecType IS RECORD(
222     vendor_id              ap_suppliers.vendor_id%TYPE,
223     vendor_site_id         ap_supplier_sites.vendor_site_id%TYPE,
224     employee_id            ap_expense_report_headers.employee_id%TYPE,
225     party_id               ap_suppliers.party_id%TYPE,
226     party_site_id          ap_supplier_sites.party_site_id%TYPE,
227     home_or_office         VARCHAR2(2),
228     terms_date_basis       ap_suppliers.terms_date_basis%TYPE,
229     terms_id               ap_suppliers.terms_id%TYPE,
230     pay_group              ap_suppliers.pay_group_lookup_code%TYPE,
231     payment_priority       ap_suppliers.payment_priority%TYPE,
232     liab_acc               ap_suppliers.accts_pay_code_combination_id%TYPE,
233     prepay_ccid            ap_suppliers.prepay_code_combination_id%TYPE,
234     always_take_disc_flag  ap_suppliers.always_take_disc_flag%TYPE,
235     pay_date_basis         ap_suppliers.pay_date_basis_lookup_code%TYPE,
236     vendor_name            ap_suppliers.vendor_name%TYPE,
237     vendor_num             ap_suppliers.segment1%TYPE,
238     allow_awt_flag         ap_supplier_sites.allow_awt_flag%TYPE,
239     org_id                 ap_expense_report_headers.org_id%TYPE,
240     address_line_1         hr_locations.address_line_1%TYPE,
241     address_line_2         hr_locations.address_line_2%TYPE,
242     address_line_3         hr_locations.address_line_3%TYPE,
243     city                   hr_locations.town_or_city%TYPE,
244     state                  hr_locations.region_2%TYPE,
245     postal_code            hr_locations.postal_code%TYPE,
246     province               hr_locations.region_1%TYPE,
247     county                 hr_locations.region_1%TYPE,
248     country                hr_locations.country%TYPE,
249     style                  hr_locations.style%TYPE);
250 
251   ------------------------------------------------------------------------
252   PROCEDURE UpdateDistsWithReceiptInfo(p_report_header_id IN NUMBER,
253                                        p_debug_switch  IN VARCHAR2);
254   ------------------------------------------------------------------------
255   PROCEDURE ExportERtoAP(errbuf          OUT NOCOPY VARCHAR2,
256                          retcode         OUT NOCOPY NUMBER,
257                          p_batch_name    IN VARCHAR2,
258                          p_source        IN VARCHAR2,
259                          p_transfer_flag IN VARCHAR2,
260                          p_gl_date       IN VARCHAR2,
261                          p_group_id      IN VARCHAR2,
262                          p_commit_cycles IN NUMBER,
263                          p_debug_switch  IN VARCHAR2,
264                          p_org_id        IN NUMBER,
265                          p_role_name     IN VARCHAR2,
266                          p_transfer_attachments IN VARCHAR2); --Bug#2823530 : Transfer Attachments to AP
267   ------------------------------------------------------------------------
268   FUNCTION ValidateERLines(p_report_header_id        IN NUMBER,
269                            p_invoice_id              IN NUMBER,
270                            p_transfer_flag           IN VARCHAR2,
271                            p_base_currency           IN VARCHAR2,
272                            p_set_of_books_id         IN NUMBER,
273                            p_source                  IN VARCHAR2,
274                            p_enable_recoverable_flag IN VARCHAR2,
275                            p_invoice_lines_rec_tab   OUT NOCOPY InvoiceLinesRecTabType,
276                            p_reject_code             OUT NOCOPY VARCHAR2)
277     RETURN BOOLEAN;
278   ------------------------------------------------------------------------
279   PROCEDURE InsertInvoiceInterface(p_invoice_rec InvoiceInfoRecType,
280                                    p_vendor_rec  VendorInfoRecType);
281   ------------------------------------------------------------------------
282   --Bug: 6809570
283   PROCEDURE InsertInvoiceLinesInterface(p_report_header_id        IN NUMBER,
284                            p_invoice_id              IN NUMBER,
285                            p_transfer_flag           IN VARCHAR2,
286                            p_base_currency           IN VARCHAR2,
287                            p_enable_recoverable_flag IN VARCHAR2);
288   ------------------------------------------------------------------------
289   FUNCTION GetVendorinfo(p_vendor_rec  IN OUT NOCOPY VendorInfoRecType,
290                          p_reject_code OUT NOCOPY VARCHAR2) RETURN BOOLEAN;
291   ------------------------------------------------------------------------
292   FUNCTION CreatePayee(p_party_id  IN ap_suppliers.party_id%TYPE,
293                        p_org_id    IN ap_expense_report_headers.org_id%TYPE,
294                        p_reject_code OUT NOCOPY VARCHAR2) RETURN BOOLEAN;
295   ------------------------------------------------------------------------
296 
297 END AP_WEB_EXPORT_ER;