DBA Data[Home] [Help]

PACKAGE: APPS.JAI_AP_DTC_PREPAYMENTS_PKG

Source


1 PACKAGE jai_ap_dtc_prepayments_pkg AS
2 /* $Header: jai_ap_dtc_ppay.pls 120.3.12020000.1 2013/03/18 01:52:56 vkaranam noship $ */
3 
4 /* ----------------------------------------------------------------------------
5  FILENAME      : jai_ap_dtc_prepayemnts_pkg.sql
6 
7  Created By    :
8 
9  Created Date  : 07-Feb-2012
10 
11  Bug           :
12 
13  Purpose       : Implementation of prepayment functionality for TDS.
14 
15  Called from   : Trigger ja_in_ap_aia_after_trg
16                  Trigger ja_in_ap_aida_after_trg
17 
18  CHANGE HISTORY:
19  -------------------------------------------------------------------------------
20  S.No      Date         Author and Details
21  -------------------------------------------------------------------------------
22  1.        03/03/2005   Zhhou for #13359892. version. TDS Clean Up.
23 
24                         Created this package for implementing the TDS prepayment
25                         functionality onto AP invoice.
26 
27 
28 ---------------------------------------------------------------------------- */
29 
30   procedure process_prepayment
31   (
32     p_event                              in                 varchar2 default null,    --Added for Bug 8431516
33     p_invoice_id                         in                 number,
34     p_invoice_distribution_id            in                 number,
35     p_prepay_distribution_id             in                 number,
36     p_parent_reversal_id                 in                 number,
37     p_prepay_amount                      in                 number,
38     p_vendor_id                          in                 number,
39     p_vendor_site_id                     in                 number,
40     p_accounting_date                    in                 date,
41     p_invoice_currency_code              in                 varchar2,
42     p_exchange_rate                      in                 number,
43     p_set_of_books_id                    in                 number,
44     p_org_id                             in                 number,
45     -- Bug 5722028. Added by CSahoo
46     p_creation_date                      in                 date,
47     p_process_flag                       out     nocopy     varchar2,
48     p_process_message                    out     nocopy     varchar2,
49     p_codepath                           in out  nocopy     varchar2
50   );
51 
52 
53   procedure process_unapply
54   (
55     p_event                              in                 varchar2,   --Added for Bug 8431516
56     p_invoice_id                         in                 number,
57     p_invoice_distribution_id            in                 number, /* PREPAY UNAPPLY distribution */
58     p_parent_distribution_id             in                 number, /* parent PREPAY APPLY distribution */
59     p_prepay_distribution_id             in                 number, /* Distribution id of prepay line - Bug 5751783*/
60     p_prepay_amount                      in                 number,
61     p_vendor_id                          in                 number,
62     p_vendor_site_id                     in                 number,
63     p_accounting_date                    in                 date,
64     p_invoice_currency_code              in                 varchar2,
65     p_exchange_rate                      in                 number,
66     p_set_of_books_id                    in                 number,
67     p_org_id                             in                 number,
68     -- Bug 5722028. Added by CSahoo
69     p_creation_date                      in                 date,
70     p_process_flag                       out     nocopy     varchar2,
71     p_process_message                    out     nocopy     varchar2,
72     p_codepath                           in out  nocopy     varchar2
73   );
74 
75 /* --Commented by Chong for DTC ER START, all these thress procedures are be replaced by new procedures
76   procedure allocate_prepayment
77   (
78     p_invoice_id                         in                     number,
79     p_invoice_distribution_id            in                     number, \* Of the PREPAY line *\
80     p_prepay_amount                      in                     number,
81     p_process_flag                       out     nocopy         varchar2,
82     p_process_message                    out     nocopy         varchar2,
83     p_codepath                           in out  nocopy         varchar2
84   );
85 
86   procedure populate_section_tax
87   (
88     p_invoice_id                         in                 number,
89     p_invoice_distribution_id            in                 number, \* Of the PREPAY line in the SI*\
90     p_prepay_distribution_id             in                 number, \*Distribution id of the PP invoice *\
91     p_process_flag                       out     nocopy     varchar2,
92     p_process_message                    out     nocopy     varchar2,
93     p_codepath                           in out  nocopy     varchar2
94   );
95 
96   procedure process_tds_invoices
97   (
98     p_event                              in                     varchar2,     --Added for Bug 8431516
99     p_invoice_id                         in                     number,
100     p_invoice_distribution_id            in                     number,
101     p_prepay_distribution_id             in                     number,
102     p_prepay_amount                      in                     number,
103     p_vendor_id                          in                     number,
104     p_vendor_site_id                     in                     number,
105     p_accounting_date                    in                     date,
106     p_invoice_currency_code              in                     varchar2,
107     p_exchange_rate                      in                     number,
108     p_set_of_books_id                    in                     number,
109     p_org_id                             in                     number,
110     -- Bug 5722028. Added by CSahoo
111     p_creation_date                      in                 date,
112     p_process_flag                       out     nocopy         varchar2,
113     p_process_message                    out     nocopy         varchar2,
114     p_codepath                           in out  nocopy         varchar2
115   );
116 */  --Commented by Chong for DTC ER END 20121011
117   procedure process_old_transaction
118   (
119     p_invoice_id                          in                  number,
120     p_invoice_distribution_id             in                  number,
121     p_prepay_distribution_id              in                  number,
122     p_amount                              in                  number,
123     p_last_updated_by                     in                  number,
124     p_last_update_date                    in                  date,
125     p_created_by                          in                  number,
126     p_creation_date                       in                  date,
127     p_org_id                              in                  number,
128     p_process_flag                        out   nocopy         varchar2,
129     p_process_message                     out   nocopy         varchar2
130   );
131 
132 procedure allocate_prepay_section
133   (
134     p_invoice_id                         in                     number,
135     p_invoice_distribution_id            in                     number, /* Of the PREPAY line */
136     p_prepay_amount                      in                     number,
137     p_prepay_distribution_id             in                     number, /* Distribution id of the PP invoice */
138     p_process_flag                       out     nocopy         varchar2,
139     p_process_message                    out     nocopy         varchar2,
140     p_codepath                           in out  nocopy         varchar2
141   );
142 
143 procedure generate_rtn
144   (
145     p_event                              in                     varchar2,
146     p_invoice_id                         in                     number,
147     p_invoice_distribution_id            in                     number,
148     p_prepay_distribution_id             in                     number,
149     p_prepay_amount                      in                     number,
150 /*    p_vendor_id                          in                     number,
151     p_vendor_site_id                     in                     number,
152 */    p_accounting_date                    in                     date,
153     p_invoice_currency_code              in                     varchar2,
154     p_exchange_rate                      in                     number,
155     p_set_of_books_id                    in                     number,
156     p_org_id                             in                     number,
157     p_creation_date                      in                     date,
158     p_process_flag                       out     nocopy         varchar2,
159     p_process_message                    out     nocopy         varchar2,
160     p_codepath                           in out  nocopy         varchar2
161   );
162 
163 PROCEDURE get_prepay_invoice_gl_date
164   (
165     p_prepay_inv_dist_id  NUMBER,
166     p_prepay_gl_date      OUT NOCOPY DATE
167    );
168 
169 FUNCTION wct_essi_applicable(cn_invoice_id NUMBER, cn_distribution_id NUMBER, cv_section_type VARCHAR2)
170 RETURN VARCHAR2;
171 
172 
173 FUNCTION get_tax_category(cn_distribution_id NUMBER)
174 RETURN NUMBER;
175 
176 
177 END jai_ap_dtc_prepayments_pkg;