DBA Data[Home] [Help]

PACKAGE: APPS.OKL_PAY_INVOICES_DISB_PVT

Source


1 PACKAGE OKL_PAY_INVOICES_DISB_PVT AUTHID CURRENT_USER AS
2 /* $Header: OKLRPIDS.pls 120.4 2007/04/17 19:21:09 rkuttiya noship $ */
3  ------------------------------------------------------------------------------
4  -- Global Variables
5  ------------------------------------------------------------------------------
6  G_PKG_NAME             CONSTANT VARCHAR2(200) := 'OKL_PAY_INVOICES_DISB_PVT';
7  G_APP_NAME             CONSTANT VARCHAR2(3)   :=  OKL_API.G_APP_NAME;
8  G_UNEXPECTED_ERROR     CONSTANT VARCHAR2(200) := 'OKL_CONTRACTS_UNEXPECTED_ERROR';
9  G_SQLERRM_TOKEN        CONSTANT VARCHAR2(200) := 'SQLERRM';
10  G_SQLCODE_TOKEN        CONSTANT VARCHAR2(200) := 'SQLCODE';
11  G_commit_after_records CONSTANT NUMBER := 500;
12  G_commit_count         NUMBER := 0;
13  ------------------------------------------------------------------------------
14  -- Record Type
15  ------------------------------------------------------------------------------
16  --rkuttiya R12 B Billing Architecture changed the following record type
17  TYPE disb_rec_type IS RECORD (
18     cnr_id NUMBER,
19     --consolidated_invoice_number okl_cnsld_ar_hdrs_b.consolidated_invoice_number%type,
20     receivables_invoice_number okl_bpd_ar_inv_lines_v.receivables_invoice_number%type,
21     --set_of_books_id okl_cnsld_ar_hdrs_b.set_of_books_id%type,
22     set_of_books_id okl_trx_ar_invoices_b.set_of_books_id%type,
23     --org_id okl_cnsld_ar_hdrs_b.org_id%type,
24     org_id okl_trx_ar_invoices_b.org_id%type,
25     --transaction_date okl_cnsld_ar_hdrs_b.date_consolidated%type,
26     transaction_date okl_bpd_ar_invoices_v.date_consolidated%type,
27     --currency_code okl_cnsld_ar_hdrs_b.currency_code%type,
28     currency_code okl_bpd_ar_invoices_v.currency_code%type,
29     --khr_id okl_cnsld_ar_strms_b.khr_id%type,
30     khr_id okl_trx_ar_invoices_b.khr_id%type,
31     --kle_id okl_cnsld_ar_strms_b.kle_id%type,
32     kle_id okl_txl_ar_inv_lns_b.kle_id%type,
33     --amount okl_cnsld_ar_strms_b.amount%type,
34     amount okl_bpd_ar_inv_lines_v.amount%type,
35     --sty_id okl_cnsld_ar_strms_b.sty_id%type,
36     sty_id okl_bpd_ar_inv_lines_v.sty_id%type,
37     --lsm_id okl_cnsld_ar_strms_b.id%type,
38     tld_id okl_txd_ar_ln_dtls_b.id%type,
39    -- receivables_invoice_id okl_cnsld_ar_strms_b.receivables_invoice_id%type,
40     receivables_invoice_id okl_bpd_ar_inv_lines_v.receivables_invoice_id%type,
41     sel_id okl_strm_elements.id%type,
42     pph_id okl_party_payment_hdr.id%type,
43     passthru_stream_type_id okl_party_payment_hdr.passthru_stream_type_id%type,
44     payout_basis okl_party_payment_hdr.payout_basis%type,
45     payout_basis_formula okl_party_payment_hdr.payout_basis_formula%type,
46     contract_number okc_k_headers_b.contract_number%type,
47  -- 31-OCT-2006 ANSETHUR  R12B - Legal Entity
48     legal_entity_id                okl_k_headers.legal_entity_id%TYPE := OKL_API.G_MISS_NUM
49 
50     );
51 
52  TYPE lsm_rcpt_rec_type IS RECORD (
53   --rkuttiya R12 B Billing Architecture commented out following
54     --lsm_id okl_cnsld_ar_strms_b.id%type,
55     tld_id  okl_txd_ar_ln_dtls_b.id%type,
56   --
57     receivable_application_id ar_receivable_applications_all.receivable_application_id%type);
58 
59  TYPE disb_tbl_type IS TABLE OF disb_rec_type
60         INDEX BY BINARY_INTEGER;
61 
62  TYPE lsm_rcpt_tbl_type IS TABLE OF lsm_rcpt_rec_type
63         INDEX BY BINARY_INTEGER;
64 
65  ---------------------------------------------------------------------------
66  -- Procedures and Functions
67  ---------------------------------------------------------------------------
68 PROCEDURE auto_disbursement(p_api_version		IN  NUMBER
69 	,p_init_msg_list	IN  VARCHAR2	DEFAULT OKL_API.G_FALSE
70 	,x_return_status	OUT NOCOPY VARCHAR2
71 	,x_msg_count		OUT NOCOPY NUMBER
72 	,x_msg_data		    OUT NOCOPY VARCHAR2
73 	,p_from_date	    IN  DATE	DEFAULT NULL
74 	,p_to_date		    IN  DATE	DEFAULT NULL
75   ,p_contract_number IN VARCHAR2 DEFAULT NULL);
76 
77 PROCEDURE invoice_disbursement (
78     p_api_version   IN NUMBER,
79     p_init_msg_list IN VARCHAR2,
80     x_return_status OUT NOCOPY  VARCHAR2,
81     x_msg_count     OUT NOCOPY NUMBER,
82     x_msg_data      OUT NOCOPY  VARCHAR2,
83     p_disb_rec      IN disb_rec_type)	;
84 
85 FUNCTION credit_check(p_api_version		IN  NUMBER
86 	,p_init_msg_list	IN  VARCHAR2	DEFAULT OKL_API.G_FALSE
87 	,x_return_status	OUT NOCOPY VARCHAR2
88 	,x_msg_count		OUT NOCOPY NUMBER
89 	,x_msg_data		    OUT NOCOPY VARCHAR2
90 	,p_creditline_id   IN  NUMBER
91 	,p_credit_max       IN  NUMBER
92     ,P_trx_date         IN DATE DEFAULT SYSDATE)
93     RETURN NUMBER;
94 
95 FUNCTION receipt_amount(p_customer_trx_id IN NUMBER) RETURN NUMBER;
96 
97 FUNCTION partial_receipt_amount(p_customer_trx_id IN NUMBER) RETURN NUMBER;
98 
99 FUNCTION receipt_date(p_customer_trx_id IN NUMBER) RETURN DATE;
100 
101 FUNCTION partial_receipt_date(p_customer_trx_id IN NUMBER) RETURN DATE;
102 
103 FUNCTION get_next_pymt_date(p_start_date IN Date
104                            ,p_frequency IN VARCHAR2
105                   	       ,p_offset_date IN DATE DEFAULT SYSDATE) RETURN DATE;
106 
107 FUNCTION get_kle_party_pmt_hdr(p_khr_id IN NUMBER
108                               ,p_kle_id IN Number
109                               ,p_lyt_code IN VARCHAR2
110                               ,p_term IN VARCHAR2) RETURN NUMBER;
111 
112 PRAGMA RESTRICT_REFERENCES(receipt_amount, WNDS, WNPS);
113 PRAGMA RESTRICT_REFERENCES(partial_receipt_amount, WNDS, WNPS);
114 PRAGMA RESTRICT_REFERENCES(receipt_date, WNDS, WNPS);
115 PRAGMA RESTRICT_REFERENCES(partial_receipt_date, WNDS, WNPS);
116 PRAGMA RESTRICT_REFERENCES(get_kle_party_pmt_hdr, WNDS, WNPS);
117 
118 END OKL_PAY_INVOICES_DISB_PVT;