1 PACKAGE BODY JE_ZZ_INVOICE_CREATE as
2 /* $Header: jezzricb.pls 120.1 2004/12/22 14:23:34 arimai ship $ */
3
4 /*----------------------------------------------------------------------------*
5 | PUBLIC FUNCTIONS/PROCEDURES |
6 *----------------------------------------------------------------------------*/
7
8 /*----------------------------------------------------------------------------*
9 | FUNCTION |
10 | validate_gdff |
11 | |
12 | DESCRIPTION |
13 | |
14 | PARAMETERS |
15 | INPUT |
16 | p_request_id Number -- Concurrent Request_id |
17 | |
18 | RETURNS |
19 | 0 Number -- Validation Fails, if there is any |
20 | exceptional case which is handled |
21 | in WHEN OTHERS |
22 | 1 Number -- Validation Succeeds |
23 | Although this package was really meant for validation we can 'bend' its |
24 | use to insert the HU data we want and pass back to the JG package |
25 | indicating that everything passes validation. |
26 *----------------------------------------------------------------------------*/
27 PG_DEBUG varchar2(1);
28
29 FUNCTION validate_gdff (p_request_id IN NUMBER) RETURN NUMBER IS
30
31 return_code NUMBER (1);
32 l_country_code VARCHAR2(2);
33
34
35 ------------------------------------------------------------
36 -- Main function body. --
37 ------------------------------------------------------------
38 BEGIN
39 PG_DEBUG := NVL(FND_PROFILE.value('MSC_ATP_DEBUG'), 'N');
40 IF PG_DEBUG in ('Y', 'C') THEN
41 arp_standard.debug('JE_ZZ_INVOICE_CREATE.validate_gdff()+');
42 END IF;
43
44 return_code := 1;
45 l_country_code := fnd_profile.value ('JGZZ_COUNTRY_CODE');
46
47 IF PG_DEBUG in ('Y', 'C') THEN
48 arp_standard.debug('validate_gdff: ' || '-- Country Code: '||l_country_code);
49 arp_standard.debug('validate_gdff: ' || '-- Request Id: '||to_char(p_request_id));
50 END IF;
51
52 ------------------------------------------------------------
53 -- Check for HU country code, if present then we want to --
54 -- enter the context and attribute1 data --
55 ------------------------------------------------------------
56
57 IF l_country_code = 'HU' THEN
58
59
60 IF PG_DEBUG in ('Y', 'C') THEN
61 arp_standard.debug('validate_gdff: ' || '-- Inserting HU specific GDF data');
62 END IF;
63
64 update ar_trx_header_gt
65 set GLOBAL_ATTRIBUTE_CATEGORY = 'JE.HU.ARXTWMAI.TAX_DATE'
66 ,GLOBAL_ATTRIBUTE1= fnd_date.date_to_canonical(GL_DATE)
67 where request_id = p_request_id ;
68
69
70 ------------------------------------------------------------
71 -- Check for PL country code, if present then we want to --
72 -- enter the context and attribute1 data --
73 ------------------------------------------------------------
74
75 ELSIF l_country_code = 'PL' THEN
76
77
78 IF PG_DEBUG in ('Y', 'C') THEN
79 arp_standard.debug('validate_gdff: ' || '-- Inserting PL specific GDF data');
80 END IF;
81
82 update ar_trx_header_gt
83 set GLOBAL_ATTRIBUTE_CATEGORY = 'JE.PL.ARXTWMAI.TAX_DATE'
84 , GLOBAL_ATTRIBUTE1 = fnd_date.date_to_canonical(GL_DATE)
85 where request_id = p_request_id ;
86
87 ------------------------------------------------------------
88 -- Check for CZ country code, if present then we want to --
89 -- enter the context and attribute1 data --
90 -- Czech requirements are that the tax date should be: --
91 -- Tax Date : = Booking date of Sales Order if item is --
92 -- not shippable or the oldest Ship Confirm date from all --
93 -- item lines if item is ship. --
94 --------------------------------------------------------------
95
96
97 ELSIF l_country_code = 'CZ' THEN
98
99 IF PG_DEBUG in ('Y', 'C') THEN
100 arp_standard.debug('validate_gdff: ' || '-- Inserting CZ specific GDF data');
101 END IF;
102
103 update ar_trx_header_gt
104 set GLOBAL_ATTRIBUTE_CATEGORY = 'JE.CZ.ARXTWMAI.TAX_DATE'
105 , GLOBAL_ATTRIBUTE1 = fnd_date.date_to_canonical(GL_DATE)
106 where request_id = p_request_id ;
107
108
109
110 END IF;
111
112
113 RETURN return_code;
114
115 EXCEPTION
116 WHEN OTHERS THEN
117
118 IF PG_DEBUG in ('Y', 'C') THEN
119 arp_standard.debug('validate_gdff: ' || '-- Return From Exception when others');
120 arp_standard.debug('validate_gdff: ' || '-- Return Code: 0');
121 arp_standard.debug('JE_ZZ_INVOICE_CREATE.validate_gdff()-');
122 END IF;
123
124 RETURN 0;
125
126 END validate_gdff;
127
128
129 END JE_ZZ_INVOICE_CREATE;