DBA Data[Home] [Help]

PACKAGE BODY: APPS.PA_AGREEMENTS_PKG

Source


4   PROCEDURE Insert_Row(
1 PACKAGE BODY PA_AGREEMENTS_PKG as
2 /* $Header: PAINAGRB.pls 120.4 2007/02/07 10:46:05 rgandhi ship $ */
3 
5              X_Rowid                      IN OUT   NOCOPY VARCHAR2,/*file.sql.39*/
6              X_Agreement_Id               IN OUT   NOCOPY NUMBER,/*file.sql.39*/
7              X_Customer_Id                IN       NUMBER,
8              X_Agreement_Num              IN       VARCHAR2,
9              X_Agreement_Type             IN       VARCHAR2,
10              X_Last_Update_Date           IN       DATE,
11              X_Last_Updated_By            IN       NUMBER,
12              X_Creation_Date              IN       DATE,
13              X_Created_By                 IN       NUMBER,
14              X_Last_Update_Login          IN       NUMBER,
15              X_Owned_By_Person_Id         IN       NUMBER,
16              X_Term_Id                    IN       NUMBER,
17              X_Revenue_Limit_Flag         IN       VARCHAR2,
18              X_Amount                     IN       NUMBER,
19              X_Description                IN       VARCHAR2,
23              X_Attribute2                 IN       VARCHAR2,
20              X_Expiration_Date            IN       DATE,
21              X_Attribute_Category         IN       VARCHAR2,
22              X_Attribute1                 IN       VARCHAR2,
24              X_Attribute3                 IN       VARCHAR2,
25              X_Attribute4                 IN       VARCHAR2,
26              X_Attribute5                 IN       VARCHAR2,
27              X_Attribute6                 IN       VARCHAR2,
28              X_Attribute7                 IN       VARCHAR2,
29              X_Attribute8                 IN       VARCHAR2,
30              X_Attribute9                 IN       VARCHAR2,
31              X_Attribute10                IN       VARCHAR2,
32              X_Template_Flag              IN       VARCHAR2,
33              X_Pm_agreement_reference     IN       VARCHAR2,
34              X_Pm_Product_Code            IN       VARCHAR2,
35              X_owning_organization_id     IN       NUMBER,
36              x_agreement_currency_code    IN       VARCHAR2,
37              x_invoice_limit_flag         IN       VARCHAR2,
38 	     X_Org_id                     IN       NUMBER,
39 /*Federal*/
40 	     X_customer_order_number      IN       VARCHAR2 DEFAULT NULL,
41 	     X_ADVANCE_REQUIRED           IN       VARCHAR2 DEFAULT 'N',
42 	     X_start_date                 IN       DATE     DEFAULT NULL,
43 	     X_Billing_sequence           IN       NUMBER   DEFAULT NULL,
44 	     X_line_of_account            IN       VARCHAR2 DEFAULT NULL,
45 	     X_payment_set_id             IN       NUMBER   DEFAULT NULL,
46 	     X_advance_amount             IN       NUMBER   DEFAULT NULL,
47 	     X_attribute11                IN       VARCHAR2 DEFAULT NULL,
48 	     X_attribute12                IN       VARCHAR2 DEFAULT NULL,
49 	     X_attribute13                IN       VARCHAR2 DEFAULT NULL,
50 	     X_attribute14                IN       VARCHAR2 DEFAULT NULL,
51 	     X_attribute15                IN       VARCHAR2 DEFAULT NULL,
52 	     X_attribute16                IN       VARCHAR2 DEFAULT NULL,
53 	     X_attribute17                IN       VARCHAR2 DEFAULT NULL,
54 	     X_attribute18                IN       VARCHAR2 DEFAULT NULL,
55 	     X_attribute19                IN       VARCHAR2 DEFAULT NULL,
56 	     X_attribute20                IN       VARCHAR2 DEFAULT NULL,
57 	     X_attribute21                IN       VARCHAR2 DEFAULT NULL,
58 	     X_attribute22                IN       VARCHAR2 DEFAULT NULL,
59 	     X_attribute23                IN       VARCHAR2 DEFAULT NULL,
60 	     X_attribute24                IN       VARCHAR2 DEFAULT NULL,
61 	     X_attribute25                IN       VARCHAR2 DEFAULT NULL
62   ) IS
63     CURSOR C IS SELECT rowid FROM PA_AGREEMENTS
64                  WHERE agreement_id = X_Agreement_Id;
65       CURSOR C2 IS SELECT pa_agreements_s.nextval FROM sys.dual;
66 
67       l_Agreement_Id  NUMBER := X_Agreement_Id; /*File.sql.39*/
68    BEGIN
69       if (X_Agreement_Id is NULL) then
70         OPEN C2;
71         FETCH C2 INTO X_Agreement_Id;
72         CLOSE C2;
73       end if;
74 
75        INSERT INTO PA_AGREEMENTS_ALL(
76               agreement_id,
77               customer_id,
78               agreement_num,
79               agreement_type,
80               last_update_date,
81               last_updated_by,
82               creation_date,
83               created_by,
84               last_update_login,
85               owned_by_person_id,
86               term_id,
87               revenue_limit_flag,
88               amount,
89               description,
90               expiration_date,
91               attribute_category,
92               attribute1,
93               attribute2,
94               attribute3,
95               attribute4,
96               attribute5,
97               attribute6,
98               attribute7,
99               attribute8,
100               attribute9,
101               attribute10,
102 	      template_flag,
103               pm_agreement_reference,
104               pm_product_code,
105               owning_organization_id,
106               agreement_currency_code,
107               invoice_limit_flag,
108 	      org_id,
109 /*Federal*/
110 	      customer_order_number,
111 	      advance_required,
112 	      start_date,
113 	      billing_sequence,
114 	      line_of_account,
115 	      payment_set_id,
116 	      advance_amount,
117 	      attribute11,
118 	      attribute12,
119 	      attribute13,
120 	      attribute14,
121 	      attribute15,
122 	      attribute16,
123 	      attribute17,
124 	      attribute18,
125 	      attribute19,
126 	      attribute20,
127 	      attribute21,
128 	      attribute22,
129 	      attribute23,
130 	      attribute24,
131 	      attribute25
132              ) VALUES (
133               X_Agreement_Id,
134               X_Customer_Id,
135               X_Agreement_Num,
136               X_Agreement_Type,
137               X_Last_Update_Date,
138               X_Last_Updated_By,
139               X_Creation_Date,
140               X_Created_By,
141               X_Last_Update_Login,
142               X_Owned_By_Person_Id,
143               X_Term_Id,
144               X_Revenue_Limit_Flag,
145               X_Amount,
146               X_Description,
147               X_Expiration_Date,
148               X_Attribute_Category,
149               X_Attribute1,
150               X_Attribute2,
156               X_Attribute8,
151               X_Attribute3,
152               X_Attribute4,
153               X_Attribute5,
154               X_Attribute6,
155               X_Attribute7,
157               X_Attribute9,
158               X_Attribute10,
159 	      X_Template_Flag,
160               X_pm_agreement_reference,
161               X_pm_product_code,
162               x_owning_organization_id,
163               x_agreement_currency_code,
164               x_invoice_limit_flag,
165 	      x_org_id,
166 /*Federal*/
167 	      x_customer_order_number,
168 	      x_advance_required,
169 	      x_start_date,
170 	      x_billing_sequence,
171 	      x_line_of_account,
172 	      x_payment_set_id,
173 	      x_advance_amount,
174 	      x_attribute11,
175 	      x_attribute12,
176 	      x_attribute13,
177 	      x_attribute14,
178 	      x_attribute15,
179 	      x_attribute16,
180 	      x_attribute17,
181 	      x_attribute18,
182 	      x_attribute19,
183 	      x_attribute20,
184 	      x_attribute21,
185 	      x_attribute22,
186 	      x_attribute23,
187 	      x_attribute24,
188 	      x_attribute25
189              );
190 
191     OPEN C;
192     FETCH C INTO X_Rowid;
193     if (C%NOTFOUND) then
194       CLOSE C;
195       Raise NO_DATA_FOUND;
196     end if;
197     CLOSE C;
198 /*Added exception for File.sql.39*/
199 
200 EXCEPTION
201  WHEN OTHERS THEN
202    x_rowid :=NULL;
203    X_Agreement_Id := l_Agreement_Id;
204    raise;
205 END Insert_Row;
206 
207 
208   PROCEDURE Lock_Row(
209              X_Rowid                      IN       VARCHAR2,
210              X_Agreement_Id               IN       NUMBER,
211              X_Customer_Id                IN       NUMBER,
212              X_Agreement_Num              IN       VARCHAR2,
213              X_Agreement_Type             IN       VARCHAR2,
214              X_Owned_By_Person_Id         IN       NUMBER,
215              X_Term_Id                    IN       NUMBER,
216              X_Revenue_Limit_Flag         IN       VARCHAR2,
217              X_Amount                     IN       NUMBER,
218              X_Description                IN       VARCHAR2,
219              X_Expiration_Date            IN       DATE,
220              X_Attribute_Category         IN       VARCHAR2,
221              X_Attribute1                 IN       VARCHAR2,
222              X_Attribute2                 IN       VARCHAR2,
223              X_Attribute3                 IN       VARCHAR2,
224              X_Attribute4                 IN       VARCHAR2,
225              X_Attribute5                 IN       VARCHAR2,
226              X_Attribute6                 IN       VARCHAR2,
227              X_Attribute7                 IN       VARCHAR2,
228              X_Attribute8                 IN       VARCHAR2,
229              X_Attribute9                 IN       VARCHAR2,
230              X_Attribute10                IN       VARCHAR2,
231              X_Template_Flag              IN       VARCHAR2,
232              X_Pm_agreement_reference     IN       VARCHAR2,
233              X_Pm_Product_Code            IN       VARCHAR2,
234              X_owning_organization_id     IN       NUMBER,
235              x_agreement_currency_code    IN       VARCHAR2,
236              x_invoice_limit_flag         IN       VARCHAR2,
237 /*Federal*/
238              X_customer_order_number      IN       VARCHAR2 DEFAULT NULL,
239              X_ADVANCE_REQUIRED           IN       VARCHAR2 DEFAULT NULL,
240              X_start_date                 IN       DATE     DEFAULT NULL,
241              X_Billing_sequence           IN       NUMBER   DEFAULT NULL,
242              X_line_of_account            IN       VARCHAR2 DEFAULT NULL,
246              X_attribute12                IN       VARCHAR2 DEFAULT NULL,
243              X_payment_set_id             IN       NUMBER   DEFAULT NULL,
244              X_advance_amount             IN       NUMBER   DEFAULT NULL,
245              X_attribute11                IN       VARCHAR2 DEFAULT NULL,
247              X_attribute13                IN       VARCHAR2 DEFAULT NULL,
248              X_attribute14                IN       VARCHAR2 DEFAULT NULL,
249              X_attribute15                IN       VARCHAR2 DEFAULT NULL,
250              X_attribute16                IN       VARCHAR2 DEFAULT NULL,
251              X_attribute17                IN       VARCHAR2 DEFAULT NULL,
252              X_attribute18                IN       VARCHAR2 DEFAULT NULL,
253              X_attribute19                IN       VARCHAR2 DEFAULT NULL,
254              X_attribute20                IN       VARCHAR2 DEFAULT NULL,
255              X_attribute21                IN       VARCHAR2 DEFAULT NULL,
256              X_attribute22                IN       VARCHAR2 DEFAULT NULL,
257              X_attribute23                IN       VARCHAR2 DEFAULT NULL,
258              X_attribute24                IN       VARCHAR2 DEFAULT NULL,
259              X_attribute25                IN       VARCHAR2 DEFAULT NULL
260   ) IS
261     CURSOR C IS
262         SELECT *
263         FROM   PA_AGREEMENTS
264         WHERE  rowid = X_Rowid
265         FOR UPDATE of Agreement_Id NOWAIT;
266     Recinfo C%ROWTYPE;
267 
268 
269   BEGIN
270     OPEN C;
271     FETCH C INTO Recinfo;
272     if (C%NOTFOUND) then
273       CLOSE C;
274       FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_DELETED');
275       APP_EXCEPTION.Raise_Exception;
276     end if;
277     CLOSE C;
278     if (
279 
280                (Recinfo.agreement_id =  X_Agreement_Id)
281            AND (Recinfo.customer_id =  X_Customer_Id)
282            AND (Recinfo.agreement_num =  X_Agreement_Num)
283            AND (Recinfo.agreement_type =  X_Agreement_Type)
284            AND (Recinfo.owned_by_person_id =  X_Owned_By_Person_Id)
285            AND (Recinfo.term_id =  X_Term_Id)
286            AND (Recinfo.revenue_limit_flag =  X_Revenue_Limit_Flag)
287            AND (Recinfo.amount =  X_Amount)
288            AND (   (Recinfo.description =  X_Description)
289                 OR (    (Recinfo.description IS NULL)
290                     AND (X_Description IS NULL)))
291            AND (   (Recinfo.expiration_date =  X_Expiration_Date)
292                 OR (    (Recinfo.expiration_date IS NULL)
293                     AND (X_Expiration_Date IS NULL)))
294            AND (   (Recinfo.attribute_category =  X_Attribute_Category)
295                 OR (    (Recinfo.attribute_category IS NULL)
296                     AND (X_Attribute_Category IS NULL)))
297            AND (   (Recinfo.attribute1 =  X_Attribute1)
298                 OR (    (Recinfo.attribute1 IS NULL)
302                     AND (X_Attribute2 IS NULL)))
299                     AND (X_Attribute1 IS NULL)))
300            AND (   (Recinfo.attribute2 =  X_Attribute2)
301                 OR (    (Recinfo.attribute2 IS NULL)
303            AND (   (Recinfo.attribute3 =  X_Attribute3)
304                 OR (    (Recinfo.attribute3 IS NULL)
305                     AND (X_Attribute3 IS NULL)))
306            AND (   (Recinfo.attribute4 =  X_Attribute4)
307                 OR (    (Recinfo.attribute4 IS NULL)
308                     AND (X_Attribute4 IS NULL)))
309            AND (   (Recinfo.attribute5 =  X_Attribute5)
310                 OR (    (Recinfo.attribute5 IS NULL)
311                     AND (X_Attribute5 IS NULL)))
312            AND (   (Recinfo.attribute6 =  X_Attribute6)
313                 OR (    (Recinfo.attribute6 IS NULL)
314                     AND (X_Attribute6 IS NULL)))
315            AND (   (Recinfo.attribute7 =  X_Attribute7)
316                 OR (    (Recinfo.attribute7 IS NULL)
317                     AND (X_Attribute7 IS NULL)))
318            AND (   (Recinfo.attribute8 =  X_Attribute8)
319                 OR (    (Recinfo.attribute8 IS NULL)
320                     AND (X_Attribute8 IS NULL)))
321            AND (   (Recinfo.attribute9 =  X_Attribute9)
322                 OR (    (Recinfo.attribute9 IS NULL)
323                     AND (X_Attribute9 IS NULL)))
324            AND (   (Recinfo.attribute10 =  X_Attribute10)
325                 OR (    (Recinfo.attribute10 IS NULL)
326                     AND (X_Attribute10 IS NULL)))
327            AND (   (Recinfo.template_flag =  X_Template_Flag)
328                 OR (    (Recinfo.template_flag IS NULL)
332                     AND (X_pm_agreement_reference IS NULL)))
329                     AND (X_Template_Flag IS NULL)))
330            AND (   (Recinfo.pm_agreement_reference =  X_pm_agreement_reference)
331                 OR (    (Recinfo.pm_agreement_reference IS NULL)
333            AND (   (Recinfo.pm_product_code =  X_pm_product_code)
334                 OR (    (Recinfo.pm_product_code IS NULL)
335                     AND (X_pm_product_code IS NULL)))
336            AND (   (Recinfo.owning_organization_id =  X_owning_organization_id)
337                 OR (    (Recinfo.owning_organization_id IS NULL)
338                     AND (X_owning_organization_id IS NULL)))
339            AND (   (Recinfo.agreement_currency_code =  X_agreement_currency_code)
340                 OR (    (Recinfo.agreement_currency_code IS NULL)
341                     AND (X_agreement_currency_code IS NULL)))
342            AND (Recinfo.invoice_limit_flag =  X_invoice_Limit_Flag)
343 /*Federal*/
344            AND (   (Recinfo.customer_order_number =  X_customer_order_number)
345                 OR (    (Recinfo.customer_order_number IS NULL)
346                     AND (X_customer_order_number IS NULL)))
347            AND (   (Recinfo.advance_required =  X_advance_required)
348                 OR (    (Recinfo.advance_required IS NULL)
349                     AND (X_advance_required IS NULL)))
350            AND (   (Recinfo.start_date =  X_start_date)
351                 OR (    (Recinfo.start_date IS NULL)
352                     AND (X_start_date IS NULL)))
353            AND (   (Recinfo.billing_sequence =  X_billing_sequence)
354                 OR (    (Recinfo.billing_sequence IS NULL)
355                     AND (X_billing_sequence IS NULL)))
356            AND (   (Recinfo.line_of_account =  X_line_of_account)
357                 OR (    (Recinfo.line_of_account IS NULL)
358                     AND (X_line_of_account IS NULL)))
359            AND (   (Recinfo.payment_set_id =  X_payment_set_id)
360                 OR (    (Recinfo.payment_set_id IS NULL)
361                     AND (X_payment_set_id IS NULL)))
362            AND (   (Recinfo.advance_amount =  X_advance_amount)
363                 OR (    (Recinfo.advance_amount IS NULL)
364                     AND (X_advance_amount IS NULL)))
365            AND (   (Recinfo.attribute11 =  X_attribute11)
366                 OR (    (Recinfo.attribute11 IS NULL)
367                     AND (X_attribute11 IS NULL)))
368            AND (   (Recinfo.attribute12 =  X_attribute12)
369                 OR (    (Recinfo.attribute12 IS NULL)
370                     AND (X_attribute12 IS NULL)))
371            AND (   (Recinfo.attribute13 =  X_attribute13)
372                 OR (    (Recinfo.attribute13 IS NULL)
373                     AND (X_attribute13 IS NULL)))
374            AND (   (Recinfo.attribute14 =  X_attribute14)
375                 OR (    (Recinfo.attribute14 IS NULL)
376                     AND (X_attribute14 IS NULL)))
377            AND (   (Recinfo.attribute15 =  X_attribute15)
378                 OR (    (Recinfo.attribute15 IS NULL)
379                     AND (X_attribute15 IS NULL)))
380            AND (   (Recinfo.attribute16 =  X_attribute16)
381                 OR (    (Recinfo.attribute16 IS NULL)
382                     AND (X_attribute16 IS NULL)))
383            AND (   (Recinfo.attribute17 =  X_attribute17)
384                 OR (    (Recinfo.attribute17 IS NULL)
385                     AND (X_attribute17 IS NULL)))
386            AND (   (Recinfo.attribute18 =  X_attribute18)
387                 OR (    (Recinfo.attribute18 IS NULL)
388                     AND (X_attribute18 IS NULL)))
389            AND (   (Recinfo.attribute19 =  X_attribute19)
390                 OR (    (Recinfo.attribute19 IS NULL)
391                     AND (X_attribute19 IS NULL)))
392            AND (   (Recinfo.attribute20 =  X_attribute20)
393                 OR (    (Recinfo.attribute20 IS NULL)
394                     AND (X_attribute20 IS NULL)))
395            AND (   (Recinfo.attribute21 =  X_attribute21)
396                 OR (    (Recinfo.attribute21 IS NULL)
397                     AND (X_attribute21 IS NULL)))
398            AND (   (Recinfo.attribute22 =  X_attribute22)
399                 OR (    (Recinfo.attribute22 IS NULL)
400                     AND (X_attribute22 IS NULL)))
401            AND (   (Recinfo.attribute23 =  X_attribute23)
402                 OR (    (Recinfo.attribute23 IS NULL)
403                     AND (X_attribute23 IS NULL)))
404            AND (   (Recinfo.attribute24 =  X_attribute24)
405                 OR (    (Recinfo.attribute24 IS NULL)
406                     AND (X_attribute24 IS NULL)))
407            AND (   (Recinfo.attribute25 =  X_attribute25)
408                 OR (    (Recinfo.attribute25 IS NULL)
409                     AND (X_attribute25 IS NULL)))
410       ) then
411       return;
412     else
413       FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_CHANGED');
414       APP_EXCEPTION.Raise_Exception;
415     end if;
416   END Lock_Row;
417 
418 
419 
420   PROCEDURE Update_Row(
421 X_Rowid                    IN       VARCHAR2,
422 X_Agreement_Id             IN       NUMBER,
423 X_Customer_Id              IN       NUMBER,
424 X_Agreement_Num            IN       VARCHAR2,
425 X_Agreement_Type           IN       VARCHAR2,
426 X_Last_Update_Date         IN       DATE,
427 X_Last_Updated_By          IN       NUMBER,
428 X_Last_Update_Login        IN       NUMBER,
429 X_Owned_By_Person_Id       IN       NUMBER,
430 X_Term_Id                  IN       NUMBER,
431 X_Revenue_Limit_Flag       IN       VARCHAR2,
432 X_Amount                   IN       NUMBER,
433 X_Description              IN       VARCHAR2,
434 X_Expiration_Date          IN       DATE,
438 X_Attribute3               IN       VARCHAR2,
435 X_Attribute_Category       IN       VARCHAR2,
436 X_Attribute1               IN       VARCHAR2,
437 X_Attribute2               IN       VARCHAR2,
439 X_Attribute4               IN       VARCHAR2,
440 X_Attribute5               IN       VARCHAR2,
441 X_Attribute6               IN       VARCHAR2,
442 X_Attribute7               IN       VARCHAR2,
443 X_Attribute8               IN       VARCHAR2,
444 X_Attribute9               IN       VARCHAR2,
445 X_Attribute10              IN       VARCHAR2,
446 X_Template_Flag            IN       VARCHAR2,
447 X_Pm_agreement_reference   IN       VARCHAR2,
448 X_Pm_Product_Code          IN       VARCHAR2,
449 X_owning_organization_id   IN       NUMBER,
450 x_agreement_currency_code  IN       VARCHAR2,
451 x_invoice_limit_flag       IN       VARCHAR2,
452 /*Federal*/
453 x_customer_order_number    IN       VARCHAR2   := PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,
454 x_advance_required         IN       VARCHAR2   := PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,
455 x_start_date               IN       DATE       := PA_INTERFACE_UTILS_PUB.G_PA_MISS_DATE,
456 x_Billing_sequence         IN       NUMBER     := PA_INTERFACE_UTILS_PUB.G_PA_MISS_NUM,
457 x_line_of_account          IN       VARCHAR2   := PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,
458 x_payment_set_id           IN       NUMBER     := PA_INTERFACE_UTILS_PUB.G_PA_MISS_NUM,
459 x_advance_amount           IN       NUMBER     := PA_INTERFACE_UTILS_PUB.G_PA_MISS_NUM,
460 x_attribute11              IN       VARCHAR2   := PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,
461 x_attribute12              IN       VARCHAR2   := PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,
462 x_attribute13              IN       VARCHAR2   := PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,
463 x_attribute14              IN       VARCHAR2   := PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,
464 x_attribute15              IN       VARCHAR2   := PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,
465 x_attribute16              IN       VARCHAR2   := PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,
466 x_attribute17              IN       VARCHAR2   := PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,
467 x_attribute18              IN       VARCHAR2   := PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,
468 x_attribute19              IN       VARCHAR2   := PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,
469 x_attribute20              IN       VARCHAR2   := PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,
470 x_attribute21              IN       VARCHAR2   := PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,
471 x_attribute22              IN       VARCHAR2   := PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,
472 x_attribute23              IN       VARCHAR2   := PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,
473 x_attribute24              IN       VARCHAR2   := PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,
474 x_attribute25              IN       VARCHAR2   := PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR
475   ) IS
476 
477    l_num  Number       := PA_INTERFACE_UTILS_PUB.G_PA_MISS_NUM;
478    l_char Varchar2(1)  := PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR;
479    l_date Date         := PA_INTERFACE_UTILS_PUB.G_PA_MISS_DATE;
480 
481   BEGIN
482     UPDATE PA_AGREEMENTS_ALL
483     SET
484        agreement_id                    =     decode(X_Agreement_Id,l_num,agreement_id,X_Agreement_Id),
485        customer_id                     =     decode(X_Customer_Id,l_num,customer_id,X_Customer_Id),
486        agreement_num                   =     decode(X_Agreement_Num,l_char,agreement_num,X_Agreement_Num),
487        agreement_type                  =     decode(X_Agreement_Type,l_char,agreement_type,X_Agreement_Type),
488        last_update_date                =     X_Last_Update_Date,
489        last_updated_by                 =     X_Last_Updated_By,
490        last_update_login               =     X_Last_Update_Login,
491        owned_by_person_id              =     X_Owned_By_Person_Id,
492        term_id                         =     decode(X_Term_Id,l_num,term_id,X_Term_Id),
493        revenue_limit_flag              =     decode(X_Revenue_Limit_Flag,l_char,revenue_limit_flag,X_Revenue_Limit_Flag),
494        amount                          =     decode(X_Amount,l_num,amount,X_Amount),
495        description                     =     decode(X_Description,l_char,description,X_Description),
496        expiration_date                 =     decode(X_Expiration_Date,l_date,expiration_date,X_Expiration_Date),
497        attribute_category              =     decode(X_Attribute_Category,l_char,attribute_category,X_Attribute_Category),
498        attribute1                      =     decode(X_Attribute1,l_char,attribute1,X_Attribute1),
499        attribute2                      =     decode(X_Attribute2,l_char,attribute2,X_Attribute2),
500        attribute3                      =     decode(X_Attribute3,l_char,attribute3,X_Attribute3),
501        attribute4                      =     decode(X_Attribute4,l_char,attribute4,X_Attribute4),
502        attribute5                      =     decode(X_Attribute5,l_char,attribute5,X_Attribute5),
503        attribute6                      =     decode(X_Attribute6,l_char,attribute6,X_Attribute6),
504        attribute7                      =     decode(X_Attribute7,l_char,attribute7,X_Attribute7),
505        attribute8                      =     decode(X_Attribute8,l_char,attribute8,X_Attribute8),
506        attribute9                      =     decode(X_Attribute9,l_char,attribute9,X_Attribute9),
507        attribute10                     =     decode(X_Attribute10,l_char,attribute10,X_Attribute10),
508        template_flag		       =     decode(X_Template_Flag,l_char,template_flag,X_Template_Flag),
509        pm_agreement_reference          =     decode(X_pm_agreement_reference,l_char,pm_agreement_reference,
510                                                                                              X_pm_agreement_reference),
511        pm_product_code                 =     decode(X_pm_product_code,l_char,pm_product_code,X_pm_product_code),
512        owning_organization_id          =     decode(x_owning_organization_id,l_num,owning_organization_id,
516        invoice_limit_flag              =     decode(x_invoice_Limit_Flag,l_char,invoice_limit_flag,x_invoice_Limit_Flag),
517 /*Federal*/
518        customer_order_number              =     decode(x_customer_order_number,l_char,customer_order_number,x_customer_order_number),
519        advance_required              =     decode(x_advance_required,l_char,advance_required,x_advance_required),
520        start_date              =     decode(x_start_date,l_date,start_date,x_start_date),
521        billing_sequence              =     decode(x_billing_sequence,l_num,billing_sequence,x_billing_sequence),
522        line_of_account              =     decode(x_line_of_account,l_char,line_of_account,x_line_of_account),
523        payment_set_id              =     decode(x_payment_set_id,l_num,payment_set_id,x_payment_set_id),
524        advance_amount              =     decode(x_advance_amount,l_num,advance_amount,x_advance_amount),
525        attribute11              =     decode(x_attribute11,l_char,attribute11,x_attribute11),
526        attribute12              =     decode(x_attribute12,l_char,attribute12,x_attribute12),
527        attribute13              =     decode(x_attribute13,l_char,attribute13,x_attribute13),
528        attribute14              =     decode(x_attribute14,l_char,attribute14,x_attribute14),
529        attribute15              =     decode(x_attribute15,l_char,attribute15,x_attribute15),
530        attribute16              =     decode(x_attribute16,l_char,attribute16,x_attribute16),
531        attribute17              =     decode(x_attribute17,l_char,attribute17,x_attribute17),
532        attribute18              =     decode(x_attribute18,l_char,attribute18,x_attribute18),
533        attribute19              =     decode(x_attribute19,l_char,attribute19,x_attribute19),
534        attribute20              =     decode(x_attribute20,l_char,attribute20,x_attribute20),
535        attribute21              =     decode(x_attribute21,l_char,attribute21,x_attribute21),
536        attribute22              =     decode(x_attribute22,l_char,attribute22,x_attribute22),
537        attribute23              =     decode(x_attribute23,l_char,attribute23,x_attribute23),
538        attribute24              =     decode(x_attribute24,l_char,attribute24,x_attribute24),
539        attribute25              =     decode(x_attribute25,l_char,attribute25,x_attribute25)
540     WHERE rowid = X_Rowid;
541 
542     if (SQL%NOTFOUND) then
543       Raise NO_DATA_FOUND;
544     end if;
545   END Update_Row;
546 
547 
548   PROCEDURE Delete_Row(X_Rowid VARCHAR2) IS
549   BEGIN
550     DELETE FROM PA_AGREEMENTS
551     WHERE rowid = X_Rowid;
552 
553     if (SQL%NOTFOUND) then
554       Raise NO_DATA_FOUND;
555     end if;
556   END Delete_Row;
557 
558 
559 END PA_AGREEMENTS_PKG;515                                                                                             x_agreement_currency_code),
513                                                                                              x_owning_organization_id),
514        agreement_currency_code         =     decode(x_agreement_currency_code,l_char,agreement_currency_code,