DBA Data[Home] [Help]

PACKAGE BODY: APPS.CE_FORECAST_ROWS2_PKG

Source


1 PACKAGE BODY CE_FORECAST_ROWS2_PKG AS
2 /* $Header: cefrow2b.pls 120.0 2002/08/24 02:36:14 appldev noship $ 	*/
3 
4 --
5 -- Package
6 --   CE_FORECAST_ROWS2_PKG
7 -- Purpose
8 --   To group all the procedures/functions for table handling of the
9 --   ce_forecast_rows table.
10 -- History
11 --   07.10.96   C. Kawamoto   Created
12 --   07.28.97   E. Lau        Added org_payment_method_id
13 
14   FUNCTION body_revision RETURN VARCHAR2 IS
15   BEGIN
16 
17     RETURN '$Revision: 120.0 $';
18 
19   END body_revision;
20 
21   FUNCTION spec_revision RETURN VARCHAR2 IS
22   BEGIN
23 
24     RETURN G_spec_revision;
25 
26   END spec_revision;
27 
28   --
29   -- Procedure
30   --   Update_Row
31   -- Purpose
32   --   To update ce_forecast_rows with changes made.
33   -- History
34   --   07.10.96   C. Kawamoto   Created
35   -- Example
36   --   CE_FORECAST_ROWS2_PKG.Update_Row(...)
37   -- Notes
38   --
39 
40   PROCEDURE Update_Row(
41 		X_rowid				VARCHAR2,
42 		X_forecast_row_id		NUMBER,
43 		X_forecast_header_id		NUMBER,
44 		X_row_number			NUMBER,
45 		X_trx_type			VARCHAR2,
46 		X_lead_time			NUMBER,
47 		X_forecast_method		VARCHAR2,
48 		X_discount_option		VARCHAR2,
49 		X_order_status			VARCHAR2,
50 		X_order_date_type		VARCHAR2,
51 		X_code_combination_id		NUMBER,
52 		X_set_of_books_id		NUMBER,
53 		X_org_id			NUMBER,
54 		X_chart_of_accounts_id		NUMBER,
55 		X_budget_name			VARCHAR2,
56 		X_budget_version_id		NUMBER,
57 		X_encumbrance_type_id		NUMBER,
58 		X_roll_forward_type		VARCHAR2,
59 		X_roll_forward_period		NUMBER,
60 		X_customer_profile_class_id	NUMBER,
61 		X_include_dispute_flag 		VARCHAR2,
62 		X_sales_stage_id		NUMBER,
63 		X_channel_code			VARCHAR2,
64 		X_win_probability		NUMBER,
65                 X_sales_forecast_status	 	VARCHAR2,
66 		X_receipt_method_id		NUMBER,
67 		X_bank_account_id		NUMBER,
68 		X_payment_method		VARCHAR2,
69 		X_pay_group			VARCHAR2,
70 		X_payment_priority		NUMBER,
71 		X_vendor_type			VARCHAR2,
72 		X_authorization_status		VARCHAR2,
73 		X_type				VARCHAR2,
74 		X_budget_type			VARCHAR2,
75 		X_budget_version		VARCHAR2,
76 		X_include_hold_flag		VARCHAR2,
77 		X_include_net_cash_flag		VARCHAR2,
78 		X_created_by			NUMBER,
79 		X_creation_date			DATE,
80 		X_last_updated_by		NUMBER,
81 		X_last_update_date		DATE,
82 		X_last_update_login		NUMBER,
83 		X_org_payment_method_id		NUMBER,
84 		X_xtr_bank_account		VARCHAR2,
85 		X_exclude_indic_exp		VARCHAR2,
86 		X_company_code			VARCHAR2,
87 		X_attribute_category		VARCHAR2,
88 		X_attribute1			VARCHAR2,
89 		X_attribute2			VARCHAR2,
90 		X_attribute3			VARCHAR2,
91 		X_attribute4			VARCHAR2,
92 		X_attribute5			VARCHAR2,
93 		X_attribute6			VARCHAR2,
94 		X_attribute7			VARCHAR2,
95 		X_attribute8			VARCHAR2,
96 		X_attribute9			VARCHAR2,
97 		X_attribute10			VARCHAR2,
98 		X_attribute11			VARCHAR2,
99 		X_attribute12			VARCHAR2,
100 		X_attribute13			VARCHAR2,
101 		X_attribute14			VARCHAR2,
102 		X_attribute15			VARCHAR2,
103 		X_description			VARCHAR2,
104                 X_payroll_id                    NUMBER,
105                 X_external_source_type          VARCHAR2,
106                 X_criteria_category             VARCHAR2,
107                 X_criteria1                     VARCHAR2,
108                 X_criteria2                     VARCHAR2,
109                 X_criteria3                     VARCHAR2,
110                 X_criteria4                     VARCHAR2,
111                 X_criteria5                     VARCHAR2,
112                 X_criteria6                     VARCHAR2,
113                 X_criteria7                     VARCHAR2,
114                 X_criteria8                     VARCHAR2,
115                 X_criteria9                     VARCHAR2,
116                 X_criteria10                    VARCHAR2,
117                 X_criteria11                    VARCHAR2,
118                 X_criteria12                    VARCHAR2,
119                 X_criteria13                    VARCHAR2,
120                 X_criteria14                    VARCHAR2,
121                 X_criteria15                    VARCHAR2,
122                 X_use_average_payment_days      VARCHAR2,
123                 X_period                        NUMBER,
124                 X_order_type_id                 NUMBER,
125                 X_use_payment_terms             VARCHAR2
126 	) IS
127   BEGIN
128 	UPDATE ce_forecast_rows
129 	SET
130 		forecast_row_id		= X_forecast_row_id,
131 		forecast_header_id 	= X_forecast_header_id,
132 		row_number		= X_row_number,
133 		trx_type		= X_trx_type,
134 		lead_time		= X_lead_time,
135 		forecast_method		= X_forecast_method,
136 		discount_option		= X_discount_option,
137 		order_status		= X_order_status,
138 		order_date_type		= X_order_date_type,
139 		code_combination_id	= X_code_combination_id,
140 		set_of_books_id		= X_set_of_books_id,
141 		org_id			= X_org_id,
142 		chart_of_accounts_id	= X_chart_of_accounts_id,
143 		budget_name		= X_budget_name,
144 		budget_version_id	= X_budget_version_id,
145 		encumbrance_type_id	= X_encumbrance_type_id,
146 		roll_forward_type	= X_roll_forward_type,
147 		roll_forward_period	= X_roll_forward_period,
148 		customer_profile_class_id
149 					= X_customer_profile_class_id,
150 		include_dispute_flag	= X_include_dispute_flag,
151 		sales_stage_id		= X_sales_stage_id,
152 		channel_code		= X_channel_code,
153 		win_probability		= X_win_probability,
154                 sales_forecast_status   = X_sales_forecast_status,
155 		receipt_method_id	= X_receipt_method_id,
156 		bank_account_id		= X_bank_account_id,
157 		payment_method		= X_payment_method,
158 		pay_group		= X_pay_group,
159 		payment_priority	= X_payment_priority,
160 		vendor_type		= X_vendor_type,
161 		authorization_status	= X_authorization_status,
162 		type			= X_type,
163 		budget_type 		= X_budget_type,
164 		budget_version		= X_budget_version,
165 		include_hold_flag	= X_include_hold_flag,
166 		include_net_cash_flag	= X_include_net_cash_flag,
167 		created_by		= X_created_by,
168 		creation_date		= X_creation_date,
169 		last_updated_by		= X_last_updated_by,
170 		last_update_date	= X_last_update_date,
171 		last_update_login	= X_last_update_login,
172 		org_payment_method_id	= X_org_payment_method_id,
173 		xtr_bank_account	= X_xtr_bank_account,
174 		exclude_indic_exp	= X_exclude_indic_exp,
175 		company_code		= X_company_code,
176 		attribute_category	= X_attribute_category,
177 		attribute1		= X_attribute1,
178 		attribute2		= X_attribute2,
179 		attribute3		= X_attribute3,
180 		attribute4		= X_attribute4,
181 		attribute5		= X_attribute5,
182 		attribute6		= X_attribute6,
183 		attribute7		= X_attribute7,
184 		attribute8		= X_attribute8,
185 		attribute9		= X_attribute9,
186 		attribute10		= X_attribute10,
187 		attribute11		= X_attribute11,
188 		attribute12		= X_attribute12,
189 		attribute13		= X_attribute13,
190 		attribute14		= X_attribute14,
191 		attribute15		= X_attribute15,
192 		description		= X_description,
193                 payroll_id		= X_payroll_id,
194                 external_source_type	= X_external_source_type,
195                 criteria_category	= X_criteria_category,
196                 criteria1		= X_criteria1,
197                 criteria2		= X_criteria2,
198                 criteria3		= X_criteria3,
199                 criteria4		= X_criteria4,
200                 criteria5		= X_criteria5,
201                 criteria6		= X_criteria6,
202                 criteria7		= X_criteria7,
203                 criteria8		= X_criteria8,
204                 criteria9		= X_criteria9,
205                 criteria10		= X_criteria10,
206                 criteria11		= X_criteria11,
207                 criteria12		= X_criteria12,
208                 criteria13		= X_criteria13,
209                 criteria14		= X_criteria14,
210                 criteria15		= X_criteria15,
211 		use_average_payment_days
212 					= X_use_average_payment_days,
213 		period			= X_period,
214                 order_type_id           = X_order_type_id,
215                 use_payment_terms       = X_use_payment_terms
216 	WHERE rowid = X_rowid;
217 	if (SQL%NOTFOUND) then
218 		Raise NO_DATA_FOUND;
219 	end if;
220   END Update_Row;
221 
222   --
223   -- Procedure
224   --   Delete_Row
225   -- Purpose
226   --   To delete a  row from ce_forecast_rows.
227   -- History
228   --   07.10.96   C. Kawamoto   Created
229   -- Example
230   --   CE_FORECAST_ROWS2_PKG.Delete_Row(...)
231   -- Notes
232   --
233 
234   PROCEDURE Delete_Row(X_rowid VARCHAR2) IS
235   BEGIN
236 	DELETE FROM ce_forecast_rows
237 	WHERE rowid = X_rowid;
238 	if (SQL%NOTFOUND) then
239 		Raise NO_DATA_FOUND;
240 	end if;
241   END Delete_Row;
242 
243 
244   PROCEDURE Delete_Forecast_Cells(X_rowid VARCHAR2) IS
245         p_forecast_header_id    NUMBER;
246 	p_forecast_row_id	NUMBER;
247   BEGIN
248   --
249   -- delete all forecast cells that belong to the template row
250   --
251         SELECT     forecast_header_id, forecast_row_id
252         INTO       p_forecast_header_id, p_forecast_row_id
253         FROM       CE_FORECAST_ROWS
254         WHERE      rowid = X_rowid;
255 
256         DELETE FROM CE_FORECAST_CELLS
257         WHERE       forecast_header_id = p_forecast_header_id AND
258 		    forecast_row_id    = p_forecast_row_id;
259 
260   END Delete_Forecast_Cells;
261 
262 
263 END CE_FORECAST_ROWS2_PKG;