DBA Data[Home] [Help]

PACKAGE BODY: APPS.JG_ZZ_AUDIT_AP_PKG

Source


1 PACKAGE BODY JG_ZZ_AUDIT_AP_PKG
2 -- $Header: jgzzauditapb.pls 120.5 2008/01/23 10:54:56 anusaxen ship $
3 -- +======================================================================+
4 -- | Copyright (c) 1996 Oracle Corporation Redwood Shores, California, USA|
5 -- |                       All rights reserved.                           |
6 -- +======================================================================+
7 -- NAME:        JG_ZZ_AUDIT_AP_PKG
8 --
9 -- DESCRIPTION: This Package is the default Package containing the Procedures
10 --              used by AUDIT-AP Extract
11 --
12 -- NOTES:
13 --
14 -- Change Record:
15 -- ===============
16 -- Version   Date        Author                     Remarks
17 -- =======  ===========  =========================  =======================+
18 -- DRAFT 1A 04-Feb-2006  Amit Basu                  Initial draft version
19 -- DRAFT 1B 21-Feb-2006  Amit Basu                  Updated with Review
20 --                                                  comments from IDC
21 -- 120.2    13/06/2006   Bhavik Rathod              Bug: 5308160.  Please refer bug for details regarding the changes done.
22 -- 120.3    04-Aug-2005  Venkataramanan S           Bug 5194991 : Incorporated the reprint functionality
23 -- +=======================================================================+
24 AS
25 
26   -- Declare global variables
27 
28   l_func_curr_code       VARCHAR2(10);
29   l_rep_entity_name      VARCHAR2(100);
30   l_legal_entity_id      NUMBER;
31   l_taxpayer_id          VARCHAR2(50);
32   l_tax_registration     VARCHAR2(50);
33   l_period_start_date    DATE;
34   l_period_end_date      DATE;
35   l_status               VARCHAR2(50);
36   l_company_name         VARCHAR2(100);
37   l_registration_number  VARCHAR2(50);
38   l_country              VARCHAR2(50);
39   l_address1             VARCHAR2(100);
40   l_address2             VARCHAR2(100);
41   l_address3             VARCHAR2(100);
42   l_address4             VARCHAR2(100);
43   l_city                 VARCHAR2(50);
44   l_postal_code          VARCHAR2(15);
45   l_contact              VARCHAR2(100);
46   l_phone_number         VARCHAR2(15);
47       -- Added for Glob-006 ER
48   l_province                      VARCHAR2(120);
49   l_comm_num                      VARCHAR2(30);
50   l_vat_reg_num                   VARCHAR2(50);
51 
52   FUNCTION beforeReport RETURN BOOLEAN
53   IS
54   BEGIN
55   -- Calling Common Package
56     IF p_debug_flag = 'Y' THEN
57       fnd_file.put_line(fnd_file.log,'Calling jg_zz_common_pkg.funct_curr_legal');
58     END IF;
59 
60    JG_ZZ_COMMON_PKG.FUNCT_CURR_LEGAL(x_func_curr_code      => l_func_curr_code
61                                    ,x_rep_entity_name     => l_rep_entity_name
62                                    ,x_legal_entity_id     => l_legal_entity_id
63                                    ,x_taxpayer_id         => l_taxpayer_id
64                                    ,pn_vat_rep_entity_id  => p_vat_rep_entity_id
65                                    ,pv_period_name        => p_period_name
66                                    ,pn_period_year        => p_period_year
67                                    );
68 
69   fnd_file.put_line(fnd_file.log,'Calling jg_zz_common_pkg.tax_registration');
70   JG_ZZ_COMMON_PKG.TAX_REGISTRATION(x_tax_registration    => l_tax_registration
71                                   ,x_period_start_date   => l_period_start_date
72                                   ,x_period_end_date     => l_period_end_date
73                                   ,x_status              => l_status
74                                   ,pn_vat_rep_entity_id  => p_vat_rep_entity_id
75                                   ,pv_period_name        => p_period_name
76                                   ,pn_period_year        => p_period_year
77                                   ,pv_source             => 'AP'
78                                   );
79 
80   fnd_file.put_line(fnd_file.log,'Calling jg_zz_common_pkg.company_detail');
81  /* JG_ZZ_COMMON_PKG.COMPANY_DETAIL (x_company_name         => l_company_name
82                                  ,x_registration_number  => l_registration_number
83                                  ,x_country              => l_country
84                                  ,x_address1             => l_address1
85                                  ,x_address2             => l_address2
86                                  ,x_address3             => l_address3
87                                  ,x_address4             => l_address4
88                                  ,x_city                 => l_city
89                                  ,x_postal_code          => l_postal_code
90                                  ,x_contact              => l_contact
91                                  ,x_phone_number         => l_phone_number
92                                  ,pn_legal_entity_id     => l_legal_entity_id
93                                  );
94 */
95 
96   jg_zz_common_pkg.company_detail(x_company_name            => l_company_name
97                                   ,x_registration_number    => l_registration_number
98                                   ,x_country                => l_country
99                                   ,x_address1               => l_address1
100                                   ,x_address2               => l_address2
101                                   ,x_address3               => l_address3
102                                   ,x_address4               => l_address4
103                                   ,x_city                   => l_city
104                                   ,x_postal_code            => l_postal_code
105                                   ,x_contact                => l_contact
106                                   ,x_phone_number           => l_phone_number
107                                   ,x_province               => l_province
108                                   ,x_comm_number            => l_comm_num
109                                   ,x_vat_reg_num            => l_vat_reg_num
110                                   ,pn_legal_entity_id       => l_legal_entity_id
111                                   ,p_vat_reporting_entity_id =>p_vat_rep_entity_id) ;
112 
113     l_status := JG_ZZ_VAT_REP_UTILITY.get_period_status(pn_vat_reporting_entity_id => p_vat_rep_entity_id
114                                                                  ,pv_tax_calendar_period => p_period_name
115                                                                  ,pv_tax_calendar_year => p_period_year
116                                                                  ,pv_source => NULL
117                                                                  ,pv_report_name => p_report_name);
118     INSERT INTO jg_zz_vat_trx_gt
119             (
120               jg_info_v1      -- Func Currency
121              ,jg_info_v2      -- LE Entity Name
122              ,jg_info_n1      -- LE Id
123              ,jg_info_v3      -- LE Tax Payer ID
124              ,jg_info_v4      -- LE Tax Registration Number
125              ,jg_info_d1      -- Period Start Date
126              ,jg_info_d2      -- Period End Date
127              ,jg_info_v5      -- Status
128              ,jg_info_v6      -- Company Name
129              ,jg_info_v16     -- Registration Number --brathod, using jg_info_v16  instead of jg_info_n2
130              ,jg_info_v7      -- Country
131              ,jg_info_v8      -- Address1
132              ,jg_info_v9      -- Address2
133              ,jg_info_v10     -- Address3
134              ,jg_info_v11     -- Address4
135              ,jg_info_v12     -- City
136              ,jg_info_v13     -- Postal Code
137              ,jg_info_v14     -- Contact Person
138              ,jg_info_v15     -- Phone Number
139              ,jg_info_v30
140              )
141       VALUES(
142               l_func_curr_code
143              ,l_company_name  ----l_rep_entity_name changed for bug # 5494424
144              ,l_legal_entity_id
145              ,l_registration_number ---l_taxpayer_id changed for bug # 5494424
146              ,l_tax_registration
147              ,l_period_start_date
148              ,l_period_end_date
149              ,l_status
150              ,l_company_name
151              ,l_registration_number
152              ,l_country
153              ,l_address1
154              ,l_address2
155              ,l_address3
156              ,l_address4
157              ,l_city
158              ,l_postal_code
159              ,l_contact
160              ,l_phone_number
161              ,'H'
162              );
163 RETURN (TRUE);
164  EXCEPTION
165   WHEN OTHERS THEN
166     fnd_file.put_line(fnd_file.log,'Error while processing Before Report Trigger' || SQLCODE || SUBSTR(SQLERRM,1,200));
167    RETURN (FALSE);
168    END beforeReport;
169   END JG_ZZ_AUDIT_AP_PKG;