DBA Data[Home] [Help]

PACKAGE: APPS.OKL_INTERNAL_BILLING_PVT

Source


1 PACKAGE OKL_INTERNAL_BILLING_PVT AUTHID CURRENT_USER AS
2 /* $Header: OKLRIARS.pls 120.1.12010000.4 2010/04/07 17:07:09 sachandr ship $ */
3  ----------------------------------------------------------------------------
4  -- GLOBAL VARIABLES
5  ----------------------------------------------------------------------------
6  G_PKG_NAME             CONSTANT VARCHAR2(200) := 'OKL_INTERNAL_BILLING_PVT';
7  G_APP_NAME             CONSTANT VARCHAR2(3)   :=  OKL_API.G_APP_NAME;
8 
9  G_RET_STS_SUCCESS		 CONSTANT VARCHAR2(1) 	:= OKL_API.G_RET_STS_SUCCESS;
10  G_RET_STS_UNEXP_ERROR		 CONSTANT VARCHAR2(1) 	:= OKL_API.G_RET_STS_UNEXP_ERROR;
11  G_RET_STS_ERROR		 CONSTANT VARCHAR2(1) 	:= OKL_API.G_RET_STS_ERROR;
12  G_EXCEPTION_ERROR		 EXCEPTION;
13  G_EXCEPTION_UNEXPECTED_ERROR	 EXCEPTION;
14 
15  G_UNEXPECTED_ERROR           CONSTANT VARCHAR2(30) := 'OKL_UNEXPECTED_ERROR';
16  G_SQLERRM_TOKEN              CONSTANT VARCHAR2(30) := 'OKL_SQLERRM';
17  G_SQLCODE_TOKEN              CONSTANT VARCHAR2(30) := 'OKL_SQLCODE';
18 
19  G_EXC_NAME_OTHERS	        CONSTANT VARCHAR2(6) := 'OTHERS';
20  G_API_TYPE	CONSTANT VARCHAR(4) := '_PVT';
21  G_UI_DATE_MASK      VARCHAR2(15) := fnd_profile.value('ICX_DATE_FORMAT_MASK');
22  G_OKL_LLA_INVALID_DATE_FORMAT CONSTANT VARCHAR2(30) := 'OKL_LLA_INVALID_DATE_FORMAT';
23  G_NOT_UNIQUE                 CONSTANT VARCHAR2(30) := 'OKL_LLA_NOT_UNIQUE';
24  G_REQUIRED_VALUE             CONSTANT VARCHAR2(30) := 'OKL_REQUIRED_VALUE';
25  G_LLA_RANGE_CHECK            CONSTANT VARCHAR2(30) := 'OKL_LLA_RANGE_CHECK';
26  G_INVALID_VALUE              CONSTANT VARCHAR2(30) := OKL_API.G_INVALID_VALUE;
27  G_COL_NAME_TOKEN             CONSTANT VARCHAR2(30) := OKL_API.G_COL_NAME_TOKEN;
28 
29  ----------------------------------------------------------------------------
30  -- Data Structures
31  ----------------------------------------------------------------------------
32  ----------------------------------------------------------------------------
33  -- Global Exception
34  ----------------------------------------------------------------------------
35  G_EXCEPTION_HALT_VALIDATION	EXCEPTION;
36 
37  ----------------------------------------------------------------------------
38  -- Procedures and Functions
39  ------------------------------------------------------------------------------
40 ----------------------------------------------------------------------------------
41 -- Start of comments
42 --
43 -- Procedure Name  : CREATE_BILLING_TRX
44 -- Description     : wrapper api to create internal billing transactions
45 -- Business Rules  :
46 --                 Usage:
47 --                 (1) Caller pass 3 layers of billing data:
48 --                 -----------------------------------------
49 --
50 --                       If caller pass the following parameters with data,
51 --                       ,p_taiv_rec                     IN  okl_tai_pvt.taiv_rec_type
52 --                       ,p_tilv_tbl                     IN  okl_til_pvt.tilv_tbl_type
53 --                       ,p_tldv_tbl                     IN  okl_tld_pvt.tldv_tbl_type
54 --                       then system assume caller is intend to create stream based (with stream element)
55 --                       internal billing transactions.
56 --
57 --                       In this scenario, the following rules applied:
58 --                 R1): If p_tilv_tbl(n).TXL_AR_LINE_NUMBER exists, but p_tldv_tbl(n).TXL_AR_LINE_NUMBER
59 --                      doesn't exists, throw error.
60 --                 R2): If p_tldv_tbl(n).TXL_AR_LINE_NUMBER exists, but p_tilv_tbl(n).TXL_AR_LINE_NUMBER
61 --                      doesn't exists, throw error.
62 --
63 --                 Note:
64 --                 p_tilv_tbl(n).TXL_AR_LINE_NUMBER :
65 --                 User key to link between p_tilv_rec and p_tldv_tbl
66 --
67 --                 p_tldv_tbl(n).TXL_AR_LINE_NUMBER :
68 --                 User key to link between p_tldv_rec and p_tilv_rec
69 --
70 --                 Note: In order to process this API properly, you need to pass user enter TXL_AR_LINE_NUMBER
71 --                 to link between p_tilv_rec and p_tldv_tbl.
72 --
73 --                 (2) Caller pass 2 layers of billing data:
74 --                 -----------------------------------------
75 --
76 --                       If caller pass the following parameters with data,
77 --                       ,p_taiv_rec                     IN  okl_tai_pvt.taiv_rec_type
78 --                       ,p_tilv_tbl                     IN  okl_til_pvt.tilv_tbl_type
79 --                       then system assume caller is intend to create non-stream based (without stream element)
80 --                       internal billing transactions.
81 --
82 --                       In this scenario, p_tilv_tbl(n).TXL_AR_LINE_NUMBER is not a required attribute.
83 --                       If user does pass p_tilv_tbl(n).TXL_AR_LINE_NUMBER, system will assume this is a
84 --                       redundant data.
85 --                       System will copy the major attributes (STY_ID, AMOUNT, etc) from p_tilv_rec to
86 --                       create record in OKL_TXD_AR_LN_DTLS_b/tl table (Internal billing invoice/invoce line)
87 --
88 --                 (3) Caller pass 1 layer of billing data:
89 --                 -----------------------------------------
90 --                       If p_tilv_tbl.count = 0, throw error.
91 --
92 --                 Note: 1. Assume all calling API will validate attributes before make the call. This is
93 --                       the current architecture and we will adopt all validation logic from calling API
94 --                       to this central API in the future.
95 -- Parameters      :
96 --
97 --                 p_taiv_rec: Internal billing contract transaction header (okl_trx_ar_invoices_v)
98 --                 p_tilv_tbl: Internal billing contract transaction line (OKL_TXL_AR_INV_LNS_V)
99 --                 p_tldv_tbl: Internal billing invoice/invoce line (OKL_TXD_AR_LN_DTLS_V)
100 -- Version         : 1.0
101 -- End of comments
102 ----------------------------------------------------------------------------------
103  PROCEDURE CREATE_BILLING_TRX(
104     p_api_version                  IN NUMBER
105    ,p_init_msg_list                IN VARCHAR2 DEFAULT OKL_API.G_FALSE
106    ,x_return_status                OUT NOCOPY VARCHAR2
107    ,x_msg_count                    OUT NOCOPY NUMBER
108    ,x_msg_data                     OUT NOCOPY VARCHAR2
109    ,p_taiv_rec                     IN  okl_tai_pvt.taiv_rec_type
110    ,p_tilv_tbl                     IN  okl_til_pvt.tilv_tbl_type
111    ,p_tldv_tbl                     IN  okl_tld_pvt.tldv_tbl_type
112    ,x_taiv_rec                     OUT NOCOPY okl_tai_pvt.taiv_rec_type
113    ,x_tilv_tbl                     OUT NOCOPY okl_til_pvt.tilv_tbl_type
114    ,x_tldv_tbl                     OUT NOCOPY okl_tld_pvt.tldv_tbl_type
115    ,p_cpl_id                       IN  NUMBER DEFAULT NULL
116  );
117 
118 ----------------------------------------------------------------------------------
119 -- Start of comments
120 --
121 -- Procedure Name  : Get_Invoice_format
122 -- Description     : wrapper api to retrieve OKL invoice format type and
123 --                   invoice format line type
124 -- Business Rules  :
125 --  1. If passed in inf_id and sty_id matches, get the invoice_format_type and
126 --     invoice format line type
127 --  2. If passed in inf_id matches, but stream is missing, get the defaulted
128 --     invoice_format_type and invoice format line type
129 --  3 If passed in inf_id and sty_id are null, assign null to the
130 --    invoice_format_type and invoice format line type
131 -- Parameters      :
132 --
133 -- Version         : 1.0
134 -- End of comments
135 ----------------------------------------------------------------------------------
136  PROCEDURE Get_Invoice_format(
137     p_api_version                  IN NUMBER
138    ,p_init_msg_list                IN VARCHAR2 DEFAULT OKL_API.G_FALSE
139    ,x_return_status                OUT NOCOPY VARCHAR2
140    ,x_msg_count                    OUT NOCOPY NUMBER
141    ,x_msg_data                     OUT NOCOPY VARCHAR2
142    ,p_inf_id                       IN NUMBER DEFAULT NULL
143    ,p_sty_id                       IN NUMBER DEFAULT NULL
144    ,x_invoice_format_type          OUT NOCOPY VARCHAR2
145    ,x_invoice_format_line_type     OUT NOCOPY VARCHAR2
146  );
147 
148 -- Start of comments
149 
150   -- API name       : update_manual_invoice
151   -- Pre-reqs       : None
152   -- Function       :  It is Used to Update header in TAI and Insert/Update line
153   --                    in TIL/TLD. And if the trx_status_code is submitted then
154   --                    make a accounting call for all TLD records.
155   -- Parameters     :
156   -- IN             : p_api_version - Standard input parameter
157   --                  p_init_msg_list - Standard input parameter
158   --                  p_taiv_rec - Record type for OKL_TRX_AR_INVOICES_B.
159   --                  p_tilv_tbl -- Table type for OKL_TXL_AR_INV_LNS_B.
160   -- Version        : 1.0
161   -- History        : gkhuntet created.
162   -- End of comments
163 
164 PROCEDURE  update_manual_invoice(
165     p_api_version                  IN NUMBER
166    ,p_init_msg_list                IN VARCHAR2 DEFAULT OKL_API.G_FALSE
167    ,x_return_status                OUT NOCOPY VARCHAR2
168    ,x_msg_count                    OUT NOCOPY NUMBER
169    ,x_msg_data                     OUT NOCOPY VARCHAR2
170    ,p_taiv_rec                     IN  okl_tai_pvt.taiv_rec_type
171    ,p_tilv_tbl                     IN  okl_til_pvt.tilv_tbl_type
172    ,x_taiv_rec                     OUT NOCOPY okl_tai_pvt.taiv_rec_type
173    ,x_tilv_tbl                     OUT NOCOPY okl_til_pvt.tilv_tbl_type
174    ,x_tldv_tbl                     OUT NOCOPY okl_tld_pvt.tldv_tbl_type
175 );
176 
177 
178 
179 PROCEDURE  delete_manual_invoice(
180                                  p_api_version                  IN NUMBER
181                                  ,p_init_msg_list                IN VARCHAR2 DEFAULT OKL_API.G_FALSE
182                                  ,x_return_status                OUT NOCOPY VARCHAR2
183                                  ,x_msg_count                    OUT NOCOPY NUMBER
184                                  ,x_msg_data                     OUT NOCOPY VARCHAR2
185                                  ,p_taiv_id                      NUMBER
186                                  ,p_tilv_id                      NUMBER
187                                  );
188 
189 PROCEDURE create_accounting_dist(
190     p_api_version                  IN NUMBER
191    ,p_init_msg_list                IN VARCHAR2 DEFAULT OKL_API.G_FALSE
192    ,x_return_status                OUT NOCOPY VARCHAR2
193    ,x_msg_count                    OUT NOCOPY NUMBER
194    ,x_msg_data                     OUT NOCOPY VARCHAR2
195    ,p_tldv_tbl                     IN  okl_tld_pvt.tldv_tbl_type
196    ,p_tai_id                       IN  OKL_TRX_AR_INVOICES_B.ID%TYPE
197 );
198 
199 
200 
201 
202 
203 
204 END OKL_INTERNAL_BILLING_PVT;