1 PACKAGE CN_SCA_CREDITS_BATCH_PUB AUTHID CURRENT_USER AS
2 -- $Header: cnpscabs.pls 120.3.12010000.10 2009/05/26 09:50:45 gmarwah ship $
3 /*#
4 * This package is accessed by users of the Sales Credit Allocation Module via
5 * the concurrent program. The package takes start and end dates and the
6 * Transaction Source as input and processes the transactions available in
7 * the Interface tables. After completing the processing it populates the
8 * results in the output Interface tables
9 * @rep:scope public
10 * @rep:product CN
11 * @rep:displayname Get Sales Credits Public Application Program Interface
12 * @rep:lifecycle active
13 * @rep:compatibility S
14 * @rep:category BUSINESS_ENTITY CN_COMP_PLANS
15 */
16 -- +======================================================================+
17 -- | Copyright (c) 1994 Oracle Corporation |
18 -- | Redwood Shores, California, USA |
19 -- | All rights reserved. |
20 -- +======================================================================+
21 --
22 -- Package Name
23 -- CN_SCA_CREDITS_BATCH_PUB
24 -- Purpose
25 -- This package is a public API for processing Credit Rules and associated
26 -- allocation percentages.
27 -- History
28 -- 06/26/03 Rao.Chenna Created
29 --
30
31 TYPE sub_program_id_type IS TABLE OF NUMBER;
32 g_num_workers NUMBER;
33 --
34 PROCEDURE conc_submit
35 (
36 x_conc_program IN VARCHAR2,
37 x_parent_proc_audit_id IN NUMBER,
38 x_physical_batch_id IN NUMBER,
39 x_start_date IN DATE,
40 x_end_date IN DATE,
41 p_transaction_source IN VARCHAR2,
42 p_org_id IN NUMBER,
43 x_request_id IN OUT NOCOPY NUMBER);
44 --
45 PROCEDURE conc_dispatch
46 (
47 x_parent_proc_audit_id IN NUMBER,
48 x_start_date IN DATE,
49 x_end_date IN DATE,
50 x_logical_batch_id IN NUMBER,
51 x_transaction_source IN VARCHAR2,
52 p_org_id IN NUMBER);
53 --
54 PROCEDURE split_batches
55 (
56 p_logical_batch_id IN NUMBER,
57 p_start_date IN DATE,
58 p_end_date IN DATE,
59 p_transaction_source IN VARCHAR2,
60 p_org_id IN NUMBER,
61 x_size OUT NOCOPY NUMBER);
62 --
63 /*--------------------------------------------------------------------------
64 API name : get_sales_credits
65 Type : Public
66 Pre-reqs :
67 Usage :
68 Desc :
69 Parameters
70 IN :
71 p_api_version IN NUMBER,
72 p_init_msg_list IN VARCHAR2 := FND_API.G_TRUE,
73 p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
74 p_commit IN VARCHAR2 := CN_API.G_FALSE,
75 OUT NOCOPY :
76 x_return_status OUT NOCOPY VARCHAR2,
77 x_msg_count OUT NOCOPY NUMBER,
78 x_msg_data OUT NOCOPY VARCHAR2,
79 Notes :
80 .
81 --------------------------------------------------------------------------*/
82 /*#
83 * The GET_SALES_CREDITS procedure in CN_SCA_CREDITS_BATCH_PUB is used for
84 * determining the distribution of sales credit allocation percentages among the
85 * different resources and role combinations who took part in the sales transaction.
86 * The transactions are loaded into the CN_SCA_HEADERS_INTERFACE table before calling
87 * this procedure. This procedure processes the transactions and identifies the Sales
88 * Credit Rules based on the attribute information on the transaction and results
89 * are populated into the CN_SCA_OUTPUT_LINES table.
90 * @param p_transaction_source The Sales Credit Allocation module supports multiple
91 * transaction sources. This parameter is used as a filter to identify the transactions
92 * to be processed by the Rules Engine.
93 * @param p_start_date Start Date
94 * @param p_end_date End Date
95 * @param errbuf Standard OUT parameter
96 * @param retcode Standard OUT parameter
97 * @rep:scope public
98 * @rep:lifecycle active
99 * @rep:displayname Get Sales Credits (Batch Mode)
100 */
101 PROCEDURE get_sales_credits
102 (
103 errbuf OUT NOCOPY VARCHAR2,
104 retcode OUT NOCOPY NUMBER,
105 p_transaction_source IN VARCHAR2,
106 p_start_date IN VARCHAR2,
107 p_end_date IN VARCHAR2);
108 --
109 PROCEDURE get_assignments
110 (
111 errbuf OUT NOCOPY VARCHAR2,
112 retcode OUT NOCOPY VARCHAR2,
113 p_org_id IN NUMBER,
114 p_start_date IN VARCHAR2,
115 p_end_date IN VARCHAR2,
116 p_run_mode IN VARCHAR2,
117 p_terr_id IN NUMBER DEFAULT NULL);
118 --
119 PROCEDURE batch_process_txns
120 (
121 errbuf OUT NOCOPY VARCHAR2,
122 retcode OUT NOCOPY VARCHAR2,
123 p_org_id IN NUMBER,
124 p_run_mode IN VARCHAR2,
125 p_worker_id IN NUMBER);
126 --
127 PROCEDURE batch_collect_txns
128 (
129 errbuf OUT NOCOPY VARCHAR2,
130 retcode OUT NOCOPY VARCHAR2,
131 lp_start_date IN DATE,
132 lp_end_date IN DATE,
133 p_org_id IN NUMBER,
134 p_run_mode IN VARCHAR2,
135 l_num_workers IN NUMBER,
136 p_request_id IN NUMBER);
137 --
138 PROCEDURE batch_process_winners
139 (
140 errbuf OUT NOCOPY VARCHAR2,
141 retcode OUT NOCOPY VARCHAR2,
142 p_worker_id IN NUMBER,
143 p_oic_mode IN VARCHAR2,
144 p_terr_id IN NUMBER);
145 --
146 FUNCTION convert_to_table
147 RETURN cn_sca_insert_tbl_type ;
148 --
149 END CN_SCA_CREDITS_BATCH_PUB; -- Package spec