1 PACKAGE CN_PMTPLAN_PVT AUTHID CURRENT_USER as
2 -- $Header: cnvpplns.pls 120.5 2005/07/20 07:40:25 raramasa ship $
3
4 TYPE PmtPlan_rec_type IS RECORD
5 ( org_id cn_pmt_plans.org_id%TYPE,
6 pmt_plan_id cn_pmt_plans.pmt_plan_id%TYPE,
7 name cn_pmt_plans.name%TYPE,
8 minimum_amount cn_pmt_plans.minimum_amount%TYPE,
9 maximum_amount cn_pmt_plans.maximum_amount%TYPE,
10 min_rec_flag cn_pmt_plans.min_rec_flag%TYPE,
11 max_rec_flag cn_pmt_plans.max_rec_flag%TYPE,
12 max_recovery_amount cn_pmt_plans.max_recovery_amount%TYPE,
13 credit_type_name cn_credit_types_all_tl.name%TYPE,
14 pay_interval_type_name cn_interval_types_all_tl.name%TYPE,
15 start_date cn_pmt_plans.start_date%TYPE,
16 end_date cn_pmt_plans.end_date%TYPE,
17 object_version_number NUMBER := null,
18 recoverable_interval_type cn_interval_types_all_tl.name%TYPE,
19 pay_against_commission cn_pmt_plans.pay_against_commission%TYPE,
20 attribute_category cn_pmt_plans.attribute_category%TYPE := NULL,
21 attribute1 cn_pmt_plans.attribute1%TYPE := NULL,
22 attribute2 cn_pmt_plans.attribute2%TYPE := NULL,
23 attribute3 cn_pmt_plans.attribute3%TYPE := NULL,
24 attribute4 cn_pmt_plans.attribute4%TYPE := NULL,
25 attribute5 cn_pmt_plans.attribute5%TYPE := NULL,
26 attribute6 cn_pmt_plans.attribute6%TYPE := NULL,
27 attribute7 cn_pmt_plans.attribute7%TYPE := NULL,
28 attribute8 cn_pmt_plans.attribute8%TYPE := NULL,
29 attribute9 cn_pmt_plans.attribute9%TYPE := NULL,
30 attribute10 cn_pmt_plans.attribute10%TYPE := NULL,
31 attribute11 cn_pmt_plans.attribute11%TYPE := NULL,
32 attribute12 cn_pmt_plans.attribute12%TYPE := NULL,
33 attribute13 cn_pmt_plans.attribute13%TYPE := NULL,
34 attribute14 cn_pmt_plans.attribute14%TYPE := NULL,
35 attribute15 cn_pmt_plans.attribute15%TYPE := NULL,
36 payment_group_code cn_pmt_plans.payment_group_code%TYPE,
37 operation_mode varchar2(30)
38 );
39
40
41 g_mode VARCHAR2(30); --global to indicate if operation is insert/update
42
43 --
44 -- Start of comments
45 -- API name : Create_PmtPlan
46 -- Type : Private.
47 -- Pre-reqs : None.
48 -- Usage : Used to create a new payment plan
49 --
50 -- Desc : This procedure will validate the input for a payment plan
51 -- and create one if all validations are passed.
52 --
53 -- Parameters :
54 -- IN : p_api_version IN NUMBER Required
55 -- p_init_msg_list IN VARCHAR2 Optional
56 -- Default = FND_API.G_FALSE
57 -- p_commit IN VARCHAR2 Optional
58 -- Default = FND_API.G_FALSE
59 -- p_validation_level IN NUMBER Optional
60 -- Default = FND_API.G_VALID_LEVEL_FULL
61 -- OUT : x_return_status OUT VARCHAR2(1)
62 -- x_msg_count OUT NUMBER
63 -- x_msg_data OUT VARCHAR2(2000)
64 -- IN : p_pmt_plan_rec IN PmtPlan_rec_type
65 -- OUT : x_loading_status OUT VARCHAR2(50)
66 -- Detailed error code returned from procedure.
67 --
68 -- OUT : x_status OUT VARCHAR2(50)
69 -- Return Sql Statement Status ( VALID/INVALID)
70 --
71 -- Version : Current version 1.0
72 -- Initial version 1.0
73 --
74 -- Notes : Validations in the API are the following :
75 -- Start date less than end date
76 -- Name not missing or null
77 -- Credit type not missing or null
78 -- Start date not null
79 -- Min_rec_flag should be 'Y', 'N' or null
80 -- Max_rec_flag should be 'Y', 'N' or null
81 -- Payment plan should be unique
82 -- Credit Type should be valid
83 -- Pay intervval should be valid 'PERIOD', 'QUARTER', 'YEAR' or null
84 --
85 -- End of comments
86 --
87 PROCEDURE Create_PmtPlan
88 ( p_api_version IN NUMBER,
89 p_init_msg_list IN VARCHAR2,
90 p_commit IN VARCHAR2,
91 p_validation_level IN NUMBER,
92 x_return_status OUT NOCOPY VARCHAR2,
93 x_msg_count OUT NOCOPY NUMBER,
94 x_msg_data OUT NOCOPY VARCHAR2,
95 p_PmtPlan_rec IN OUT NOCOPY PmtPlan_rec_type,
96 x_loading_status OUT NOCOPY VARCHAR2,
97 x_status OUT NOCOPY VARCHAR2
98 );
99
100 --
101 --Start of comments
102 -- API name : Update_PmtPlan
103 -- Type : Private.
104 -- Pre-reqs : Payment plan must exist
105 -- Usage : Used to update payment plans
106 -- Desc : Procedure to update payment plans
107 -- Parameters :
108 -- IN : p_api_version IN NUMBER Require
109 -- p_init_msg_list IN VARCHAR2 Optional
110 -- Default = FND_API.G_FALSE
111 -- p_commit IN VARCHAR2 Optional
112 -- Default = FND_API.G_FALSE
113 -- p_validation_level IN NUMBER Optional
114 -- Default = FND_API.G_VALID_LEVEL_FULL
115 -- OUT : x_return_status OUT VARCHAR2(1)
116 -- x_msg_count OUT NUMBER
117 -- x_msg_data OUT VARCHAR2(2000)
118 -- IN : p_old_pmt_plan_rec IN PmtPlan_rec_type
119 -- IN : p_pmt_plan_rec IN PmtPlan_rec_type
120 --
121 -- OUT : x_loading_status OUT
122 -- Detailed Error Message
123 -- OUT : x_status OUT
124 -- RETURN SQL Status
125 -- Version : Current version 1.0
126 -- Initial version 1.0
127 -- Notes : Validations in the api are the following:
128 -- Start date cannot be updated to null
129 -- If end date is specified, it cannot be less than start date
130 -- The payment plan to be updated should already exist
131 -- If pmt plan has been assgnd, then recoverable flags can't be updated
132 -- Start and end dates can't be updated to affect existing assignemnets
133 -- Name and start date are mandatory parameters
134 -- If credit type is provided, it should be valid
135 -- If pay interval is provided, it should be valid
136 --
137 -- End of comments
138 --
139
140 PROCEDURE Update_PmtPlan
141 ( p_api_version IN NUMBER,
142 p_init_msg_list IN VARCHAR2,
143 p_commit IN VARCHAR2,
144 p_validation_level IN NUMBER,
145 x_return_status OUT NOCOPY VARCHAR2,
146 x_msg_count OUT NOCOPY NUMBER,
147 x_msg_data OUT NOCOPY VARCHAR2,
148 p_old_PmtPlan_rec IN PmtPlan_rec_type,
149 p_PmtPlan_rec IN OUT NOCOPY PmtPlan_rec_type,
150 x_status OUT NOCOPY VARCHAR2,
151 x_loading_status OUT NOCOPY VARCHAR2
152 ) ;
153
154
155 --
156 -- Start of Comments
157 --
158 -- API name : Delete_PmtPlan
159 -- Type : Private.
160 -- Pre-reqs : None.
161 -- Usage : Delete
162 -- Desc : Procedure to Delete Payment Plans
163 -- Parameters :
164 -- IN : p_api_version IN NUMBER Require
165 -- p_init_msg_list IN VARCHAR2 Optional
166 -- Default = FND_API.G_FALSE
167 -- p_commit IN VARCHAR2 Optional
168 -- Default = FND_API.G_FALSE
169 -- p_validation_level IN NUMBER Optional
170 -- Default = FND_API.G_VALID_LEVEL_FULL
171 -- OUT : x_return_status OUT VARCHAR2(1)
172 -- x_msg_count OUT NUMBER
173 -- x_msg_data OUT VARCHAR2(2000)
174 -- IN : x_PmtPlan_rec IN PmtPlan_rec_type
175 -- OUT : x_loading_status OUT
176 -- Detailed Error Message
177 -- Version : Current version 1.0
178 -- Initial version 1.0
179 -- Notes : The following validations are performed by this API
180 -- Pmt plan should exist
181 -- Pmt plan cannot be deleted if assigned to salesreps
182 --
183 -- End of comments
184 --
185 PROCEDURE Delete_PmtPlan
186 ( p_api_version IN NUMBER,
187 p_init_msg_list IN VARCHAR2,
188 p_commit IN VARCHAR2,
189 p_validation_level IN NUMBER,
190 x_return_status OUT NOCOPY VARCHAR2,
191 x_msg_count OUT NOCOPY NUMBER,
192 x_msg_data OUT NOCOPY VARCHAR2,
193 p_PmtPlan_rec IN PmtPlan_rec_type ,
194 x_status OUT NOCOPY VARCHAR2,
195 x_loading_status OUT NOCOPY VARCHAR2
196 ) ;
197
198
199 END CN_PmtPlan_PVT ;