1 package body jai_populate_attribute as
2 /* $Header: jai_populate_attribute.plb 120.1.12020000.2 2013/04/08 09:05:04 amandali ship $ */
3 function default_value_check return varchar2
4 is
5 default_flag varchar2(1);
6 begin
7 /* CHANGE THE VALUE FOR DEFAULT_FLAG TO 'Y' WHEN YOU WANT THE DEFAULT TAX
8 CODES TO BE SHOWN IN THE DFF ONCE THE INVOICE DISTRIBUTION IS SAVED*/
9
10 default_flag := 'N' ;
11
12 return default_flag;
13 exception
14 when others then
15 -- Add your exception handler here, if required.
16 null;
17
18 end default_value_check;
19
20 /* Added the below function for bug 16606774 */
21 function is_legacy_invoice(p_invoice_id IN NUMBER) return varchar2
22 is
23 cursor c_check_invoice is
24 select 'Y' from ap_invoices_all
25 where invoice_id=p_invoice_id
26 and source='LEGACY'
27 and invoice_type_lookup_code='PREPAYMENT';
28
29 enable_customization varchar2(1);
30 is_legacy varchar2(1);
31
32 begin
33 /* CHANGE THE VALUE FOR enable_customization TO 'Y' WHEN YOU WANT THE LEGACY PREPAYMENT INVOICES
34 TO BYPASS VALIDATION OF TDS DURING APPLICATION*/
35
36 enable_customization := 'N' ;
37 if enable_customization='Y' then
38 is_legacy :='N';
39 open c_check_invoice;
40 fetch c_check_invoice into is_legacy;
41 close c_check_invoice;
42 end if;
43 return is_legacy;
44 exception
45 when others then
46 -- Add your exception handler here, if required.
47 null;
48
49 end is_legacy_invoice;
50
51 end jai_populate_attribute;