DBA Data[Home] [Help]

PACKAGE BODY: APPS.AP_RECURRING_PAYMENTS_PKG

Source


1 PACKAGE BODY AP_RECURRING_PAYMENTS_PKG AS
2 /* $Header: apircupb.pls 120.7.12010000.2 2008/11/20 14:16:08 dcshanmu ship $ */
3 
4   PROCEDURE Insert_Row(X_Rowid                   IN OUT NOCOPY VARCHAR2,
5                        X_Recurring_Payment_Id    IN OUT NOCOPY NUMBER,
6                        X_Last_Update_Date               DATE,
7                        X_Last_Updated_By                NUMBER,
8                        X_Creation_Date                  DATE,
9                        X_Created_By                     NUMBER,
10                        X_Vendor_Id                      NUMBER,
11                        X_Recurring_Pay_Num              VARCHAR2,
12                        X_Vendor_Site_Id                 NUMBER,
13                        X_Rec_Pay_Period_Type            VARCHAR2,
14                        X_Num_Of_Periods                 NUMBER,
15                        X_First_Period                   VARCHAR2,
16                        X_First_Period_Num               NUMBER,
17                        X_Authorized_Total               NUMBER,
18                        X_Control_Amount                 NUMBER,
19                        X_Distribution_Set_Id            NUMBER    DEFAULT NULL,
20                        X_Terms_Id                       NUMBER,
21                        X_Set_Of_Books_Id                NUMBER,
22                        X_Amount_Applicable_To_Disc      NUMBER,
23                        X_Rem_Periods                    NUMBER   DEFAULT NULL,
24                        X_Accounting_Date                DATE     DEFAULT NULL,
25                        X_Released_Amount                NUMBER   DEFAULT NULL,
26                        X_Batch_Id                       NUMBER   DEFAULT NULL,
27                        X_Accts_Pay_Code_Comb            NUMBER   DEFAULT NULL,
28                        X_Invoice_Currency_Code          VARCHAR2,
29                        X_Payment_Currency_Code          VARCHAR2,
30                        X_Pay_Group_Lookup_Code          VARCHAR2 DEFAULT NULL,
31                        X_Tax_Amount                     NUMBER   DEFAULT NULL,
32                        X_Exchange_Rate                  NUMBER   DEFAULT NULL,
33                        X_Next_Period                    VARCHAR2 DEFAULT NULL,
34                        X_Next_Payment                   NUMBER   DEFAULT NULL,
35                        X_Increment_Percent              NUMBER   DEFAULT NULL,
36                        X_Num_Of_Periods_Rem             NUMBER   DEFAULT NULL,
37                        X_Special_Payment_Amount1        NUMBER   DEFAULT NULL,
38                        X_Special_Period_Name1           VARCHAR2 DEFAULT NULL,
39                        X_Special_Payment_Amount2        NUMBER   DEFAULT NULL,
40                        X_Special_Period_Name2           VARCHAR2 DEFAULT NULL,
41                        X_Description                    VARCHAR2 DEFAULT NULL,
42                        X_Paid_Flag1                     VARCHAR2 DEFAULT NULL,
43                        X_Paid_Flag2                     VARCHAR2 DEFAULT NULL,
44                        X_Hold_Lookup_Code               VARCHAR2 DEFAULT NULL,
45                        X_Hold_Reason                    VARCHAR2 DEFAULT NULL,
46                        X_Approved_By                    NUMBER   DEFAULT NULL,
47                        X_Expiry_Date                    DATE     DEFAULT NULL,
48                        X_Attribute_Category             VARCHAR2 DEFAULT NULL,
49                        X_Attribute1                     VARCHAR2 DEFAULT NULL,
50                        X_Attribute2                     VARCHAR2 DEFAULT NULL,
51                        X_Attribute3                     VARCHAR2 DEFAULT NULL,
52                        X_Attribute4                     VARCHAR2 DEFAULT NULL,
53                        X_Attribute5                     VARCHAR2 DEFAULT NULL,
54                        X_Exchange_Rate_Type             VARCHAR2 DEFAULT NULL,
55                        X_Payment_Cross_Rate             NUMBER,
56                        X_Exchange_Date                  DATE     DEFAULT NULL,
57                        X_Last_Update_Login              NUMBER   DEFAULT NULL,
58                        X_Tax_Name                       VARCHAR2 DEFAULT NULL,
59                        X_Attribute11                    VARCHAR2 DEFAULT NULL,
60                        X_Attribute12                    VARCHAR2 DEFAULT NULL,
61                        X_Attribute13                    VARCHAR2 DEFAULT NULL,
62                        X_Attribute14                    VARCHAR2 DEFAULT NULL,
63                        X_Attribute6                     VARCHAR2 DEFAULT NULL,
64                        X_Attribute7                     VARCHAR2 DEFAULT NULL,
65                        X_Attribute8                     VARCHAR2 DEFAULT NULL,
66                        X_Attribute9                     VARCHAR2 DEFAULT NULL,
67                        X_Attribute10                    VARCHAR2 DEFAULT NULL,
68                        X_Attribute15                    VARCHAR2 DEFAULT NULL,
69                        X_Exclusive_Payment_Flag         VARCHAR2 DEFAULT NULL,
70                        X_Awt_Group_Id                   NUMBER   DEFAULT NULL,
71                        X_Pay_Awt_Group_Id               NUMBER   DEFAULT NULL,--bug6639866
72                        X_Org_Id                         NUMBER   DEFAULT MO_GLOBAL.GET_CURRENT_ORG_ID,
73                        X_Po_Header_Id                   NUMBER   DEFAULT NULL,
74                        X_Po_Line_Id                     NUMBER   DEFAULT NULL,
75                        X_Line_Location_Id               NUMBER   DEFAULT NULL,
76                        X_External_Bank_Account_Id       NUMBER   DEFAULT NULL,
77                        X_calling_sequence         IN    VARCHAR2,
78                        X_Approval_Required_Flag         VARCHAR2,
79                     -- Removed for bug 4277744
80                     -- X_USSGL_Txn_Code                 VARCHAR2 DEFAULT NULL,
81                        X_Requester_id                   NUMBER   DEFAULT NULL,
82                        X_Po_Release_Id                  NUMBER   DEFAULT NULL,
83                        X_Item_Description               VARCHAR2 DEFAULT NULL,
84                        X_Manufacturer                   VARCHAR2 DEFAULT NULL,
85                        X_Model_Number                   VARCHAR2 DEFAULT NULL,
86 		       X_Tax_Control_Amount		NUMBER   DEFAULT NULL,
87 		       X_Taxation_Country		VARCHAR2 DEFAULT NULL,
88 		       X_Product_Fisc_Class		VARCHAR2 DEFAULT NULL,
89 		       X_User_Defined_Fisc_Class	VARCHAR2 DEFAULT NULL,
90 		       X_Trx_Bus_Category		VARCHAR2 DEFAULT NULL,
91 		       X_Primary_Intended_Use		VARCHAR2 DEFAULT NULL,
92 		       X_Legal_Entity_Id		NUMBER   DEFAULT NULL,
93                        x_PAYMENT_METHOD_CODE            varchar2 default null,
94                        x_PAYMENT_REASON_CODE            varchar2 default null,
95                        x_remittance_message1            varchar2 default null,
96                        x_remittance_message2            varchar2 default null,
97                        x_remittance_message3            varchar2 default null,
98                        x_bank_charge_bearer             varchar2 default null,
99                        x_settlement_priority            varchar2 default null,
100                        x_payment_reason_comments        varchar2 default null,
101                        x_delivery_channel_code          varchar2 default null,
102                        X_First_Amount                   NUMBER,  -- 2794958 (2774932)
103 		       X_REMIT_TO_SUPPLIER_NAME         VARCHAR2 DEFAULT NULL,
104 		       X_REMIT_TO_SUPPLIER_ID           NUMBER DEFAULT NULL,
105 		       X_REMIT_TO_SUPPLIER_SITE         VARCHAR2 DEFAULT NULL,
106 		       X_REMIT_TO_SUPPLIER_SITE_ID      NUMBER DEFAULT NULL,
107 		       X_RELATIONSHIP_ID                NUMBER DEFAULT NULL
108   ) IS
109     CURSOR C IS SELECT rowid FROM AP_RECURRING_PAYMENTS
110                  WHERE recurring_payment_id = X_Recurring_Payment_Id;
111       CURSOR C2 IS SELECT ap_recurring_payments_s.nextval FROM sys.dual;
112     current_calling_sequence VARCHAR2(2000);
113     debug_info               VARCHAR2(100);
114 
115    BEGIN
116       -- Update the calling sequence
117       --
118       current_calling_sequence :=
119         'AP_RECURRING_PAYMENTS_PKG.INSERT_ROW<-'||X_calling_sequence;
120 
121       if (X_Recurring_Payment_Id is NULL) then
122     debug_info := 'Open cursor C2';
123         OPEN C2;
124     debug_info := 'Fetch cursor C2';
125         FETCH C2 INTO X_Recurring_Payment_Id;
126     debug_info := 'Close cursor C2';
127         CLOSE C2;
128       end if;
129 
130        debug_info := 'Insert into AP_RECURRING_PAYMENTS';
131        INSERT INTO AP_RECURRING_PAYMENTS(
132               recurring_payment_id,
133               last_update_date,
134               last_updated_by,
135               creation_date,
136               created_by,
137               vendor_id,
138               recurring_pay_num,
139               vendor_site_id,
140               rec_pay_period_type,
141               num_of_periods,
142               first_period,
143               first_period_num,
144               authorized_total,
145               control_amount,
146               distribution_set_id,
147               terms_id,
148               set_of_books_id,
149               amount_applicable_to_discount,
150               rem_periods,
151               accounting_date,
152               released_amount,
153               batch_id,
154               accts_pay_code_combination_id,
155               invoice_currency_code,
156               payment_currency_code,
157               pay_group_lookup_code,
158               tax_amount,
159               exchange_rate,
160               next_period,
161               next_payment,
162               increment_percent,
163               num_of_periods_rem,
164               special_payment_amount1,
165               special_period_name1,
166               special_payment_amount2,
167               special_period_name2,
168               description,
169               paid_flag1,
170               paid_flag2,
171               hold_lookup_code,
172               hold_reason,
173               approved_by,
174               expiry_date,
175               attribute_category,
176               attribute1,
177               attribute2,
178               attribute3,
179               attribute4,
180               attribute5,
181               exchange_rate_type,
182               payment_cross_rate,
183               exchange_date,
184               last_update_login,
185               tax_name,
186               attribute11,
187               attribute12,
188               attribute13,
189               attribute14,
190               attribute6,
191               attribute7,
192               attribute8,
193               attribute9,
194               attribute10,
195               attribute15,
196               exclusive_payment_flag,
197               awt_group_id,
198               pay_awt_group_id,--bug6639866
199               po_header_id,
200               po_line_id,
201               External_Bank_Account_Id,
202               line_location_id,
203               Approval_Required_Flag,
204            -- Removed for bug 4277744
205            -- USSGL_Transaction_code,
206               org_id,
207               Requester_id,
208               Po_Release_Id,
209               Item_Description,
210               Manufacturer,
211               Model_Number,
212 	      Tax_Control_Amount,
213 	      Taxation_Country,
214 	      Product_Fisc_Classification,
215 	      User_Defined_Fisc_Class,
216 	      Trx_Business_Category,
217 	      Primary_Intended_Use,
218 	      Legal_Entity_Id,
219               PAYMENT_METHOD_CODE,
220               PAYMENT_REASON_CODE,
221               REMITTANCE_MESSAGE1,
222               REMITTANCE_MESSAGE2,
223               REMITTANCE_MESSAGE3,
224               bank_charge_bearer,
225               settlement_priority,
226               payment_reason_comments,
227               delivery_channel_code,
228               first_amount, -- 2794958 (2774932)
229 	      REMIT_TO_SUPPLIER_NAME,
230 	      REMIT_TO_SUPPLIER_ID,
231 	      REMIT_TO_SUPPLIER_SITE,
232 	      REMIT_TO_SUPPLIER_SITE_ID,
233 	      RELATIONSHIP_ID)
234        VALUES (
235               X_Recurring_Payment_Id,
236               X_Last_Update_Date,
237               X_Last_Updated_By,
238               X_Creation_Date,
239               X_Created_By,
240               X_Vendor_Id,
241               X_Recurring_Pay_Num,
242               X_Vendor_Site_Id,
243               X_Rec_Pay_Period_Type,
244               X_Num_Of_Periods,
245               X_First_Period,
246               X_First_Period_Num,
247               X_Authorized_Total,
248               X_Control_Amount,
249               X_Distribution_Set_Id,
250               X_Terms_Id,
251               X_Set_Of_Books_Id,
252               X_Amount_Applicable_To_Disc,
253               X_Rem_Periods,
254               X_Accounting_Date,
255               X_Released_Amount,
256               X_Batch_Id,
257               X_Accts_Pay_Code_Comb,
258               X_Invoice_Currency_Code,
259               X_Payment_Currency_Code,
260               X_Pay_Group_Lookup_Code,
261               X_Tax_Amount,
262               X_Exchange_Rate,
263               X_Next_Period,
264               X_Next_Payment,
265               X_Increment_Percent,
266               X_Num_Of_Periods_Rem,
267               X_Special_Payment_Amount1,
268               X_Special_Period_Name1,
269               X_Special_Payment_Amount2,
270               X_Special_Period_Name2,
271               X_Description,
272               X_Paid_Flag1,
273               X_Paid_Flag2,
274               X_Hold_Lookup_Code,
275               X_Hold_Reason,
276               X_Approved_By,
277               X_Expiry_Date,
278               X_Attribute_Category,
279               X_Attribute1,
280               X_Attribute2,
281               X_Attribute3,
282               X_Attribute4,
283               X_Attribute5,
284               X_Exchange_Rate_Type,
285               X_Payment_Cross_Rate,
286               X_Exchange_Date,
287               X_Last_Update_Login,
288               X_Tax_Name,
289               X_Attribute11,
290               X_Attribute12,
291               X_Attribute13,
292               X_Attribute14,
293               X_Attribute6,
294               X_Attribute7,
295               X_Attribute8,
296               X_Attribute9,
297               X_Attribute10,
298               X_Attribute15,
299               X_Exclusive_Payment_Flag,
300               X_Awt_Group_Id,
301               X_Pay_Awt_Group_Id,--bug6639866
302               X_Po_Header_Id,
303               X_Po_Line_Id,
304               X_External_Bank_Account_Id,
305               X_Line_Location_Id,
306               X_Approval_Required_Flag,
307            -- X_USSGL_Txn_Code,  - Bug 4277744
308               X_Org_Id,
309               X_Requester_id,
310               X_Po_Release_Id,
311               X_Item_Description,
312               X_Manufacturer,
313               X_Model_Number,
314 	      X_Tax_Control_Amount,
315 	      X_Taxation_Country,
316 	      X_Product_Fisc_Class,
317 	      X_User_Defined_Fisc_Class,
318 	      X_Trx_Bus_Category,
319 	      X_Primary_Intended_Use,
320 	      X_Legal_Entity_Id,
321               x_PAYMENT_METHOD_CODE,
322               x_PAYMENT_REASON_CODE,
323               X_REMITTANCE_MESSAGE1,
324               X_REMITTANCE_MESSAGE2,
325               X_REMITTANCE_MESSAGE3,
326               x_bank_charge_bearer,
327               x_settlement_priority,
328               x_payment_reason_comments,
329               x_delivery_channel_code,
330               X_First_Amount, -- 2794958 (2774932)
331 	      X_REMIT_TO_SUPPLIER_NAME,
332               X_REMIT_TO_SUPPLIER_ID,
333               X_REMIT_TO_SUPPLIER_SITE,
334               X_REMIT_TO_SUPPLIER_SITE_ID,
335               X_RELATIONSHIP_ID
336              );
337 
338     debug_info := 'Open cursor C';
339     OPEN C;
340     debug_info := 'Fetch cursor C';
341     FETCH C INTO X_Rowid;
342     if (C%NOTFOUND) then
343       debug_info := 'Close cursor C - ROW NOTFOUND';
344       CLOSE C;
345       Raise NO_DATA_FOUND;
346     end if;
347     debug_info := 'Close cursor C';
348     CLOSE C;
349 
350     EXCEPTION
354           FND_MESSAGE.SET_TOKEN('ERROR', SQLERRM);
351       WHEN OTHERS THEN
352         if (SQLCODE <> -20001) then
353           FND_MESSAGE.SET_NAME('SQLAP', 'AP_DEBUG');
355           FND_MESSAGE.SET_TOKEN('CALLING_SEQUENCE', current_calling_sequence);
356           FND_MESSAGE.SET_TOKEN('PARAMETERS', 'Rowid = '||X_Rowid
357                           ||', Recurring_payment_id = '||TO_CHAR(X_Recurring_Payment_Id)
358                                        );
359           FND_MESSAGE.SET_TOKEN('DEBUG_INFO', debug_info);
360         end if;
361         APP_EXCEPTION.RAISE_EXCEPTION;
362 
363 
364   END Insert_Row;
365 
366 
367   PROCEDURE Lock_Row(X_Rowid                            VARCHAR2,
368                      X_Recurring_Payment_Id             NUMBER,
369                      X_Vendor_Id                        NUMBER,
370                      X_Recurring_Pay_Num                VARCHAR2,
371                      X_Vendor_Site_Id                   NUMBER,
372                      X_Rec_Pay_Period_Type              VARCHAR2,
373                      X_Num_Of_Periods                   NUMBER,
374                      X_First_Period                     VARCHAR2,
375                      X_First_Period_Num                 NUMBER,
376                      X_Authorized_Total                 NUMBER,
377                      X_Control_Amount                   NUMBER,
378                      X_Distribution_Set_Id              NUMBER,
379                      X_Terms_Id                         NUMBER,
380                      X_Set_Of_Books_Id                  NUMBER,
381                      X_Amount_Applicable_To_Disc        NUMBER,
382                      X_Rem_Periods                      NUMBER   DEFAULT NULL,
383                      X_Accounting_Date                  DATE     DEFAULT NULL,
384                      X_Released_Amount                  NUMBER   DEFAULT NULL,
385                      X_Batch_Id                         NUMBER   DEFAULT NULL,
386                      X_Accts_Pay_Code_Comb              NUMBER   DEFAULT NULL,
387                      X_Invoice_Currency_Code            VARCHAR2,
388                      X_Payment_Currency_Code            VARCHAR2,
389                      X_Pay_Group_Lookup_Code            VARCHAR2 DEFAULT NULL,
390                      X_Tax_Amount                       NUMBER   DEFAULT NULL,
391                      X_Exchange_Rate                    NUMBER   DEFAULT NULL,
392                      X_Next_Period                      VARCHAR2 DEFAULT NULL,
393                      X_Next_Payment                     NUMBER   DEFAULT NULL,
394                      X_Increment_Percent                NUMBER   DEFAULT NULL,
395                      X_Num_Of_Periods_Rem               NUMBER   DEFAULT NULL,
396                      X_Special_Payment_Amount1          NUMBER   DEFAULT NULL,
397                      X_Special_Period_Name1             VARCHAR2 DEFAULT NULL,
398                      X_Special_Payment_Amount2          NUMBER   DEFAULT NULL,
399                      X_Special_Period_Name2             VARCHAR2 DEFAULT NULL,
400                      X_Description                      VARCHAR2 DEFAULT NULL,
401                      X_Paid_Flag1                       VARCHAR2 DEFAULT NULL,
402                      X_Paid_Flag2                       VARCHAR2 DEFAULT NULL,
403                      X_Hold_Lookup_Code                 VARCHAR2 DEFAULT NULL,
404                      X_Hold_Reason                      VARCHAR2 DEFAULT NULL,
405                      X_Approved_By                      NUMBER   DEFAULT NULL,
406                      X_Expiry_Date                      DATE     DEFAULT NULL,
407                      X_Attribute_Category               VARCHAR2 DEFAULT NULL,
408                      X_Attribute1                       VARCHAR2 DEFAULT NULL,
409                      X_Attribute2                       VARCHAR2 DEFAULT NULL,
410                      X_Attribute3                       VARCHAR2 DEFAULT NULL,
411                      X_Attribute4                       VARCHAR2 DEFAULT NULL,
412                      X_Attribute5                       VARCHAR2 DEFAULT NULL,
413                      X_Exchange_Rate_Type               VARCHAR2 DEFAULT NULL,
414                      X_Payment_Cross_Rate               NUMBER,
415                      X_Exchange_Date                    DATE     DEFAULT NULL,
416                      X_Tax_Name                         VARCHAR2 DEFAULT NULL,
417                      X_Attribute11                      VARCHAR2 DEFAULT NULL,
418                      X_Attribute12                      VARCHAR2 DEFAULT NULL,
419                      X_Attribute13                      VARCHAR2 DEFAULT NULL,
420                      X_Attribute14                      VARCHAR2 DEFAULT NULL,
421                      X_Attribute6                       VARCHAR2 DEFAULT NULL,
422                      X_Attribute7                       VARCHAR2 DEFAULT NULL,
423                      X_Attribute8                       VARCHAR2 DEFAULT NULL,
424                      X_Attribute9                       VARCHAR2 DEFAULT NULL,
425                      X_Attribute10                      VARCHAR2 DEFAULT NULL,
426                      X_Attribute15                      VARCHAR2 DEFAULT NULL,
427                      X_Exclusive_Payment_Flag           VARCHAR2 DEFAULT NULL,
428                      X_Awt_Group_Id                     NUMBER   DEFAULT NULL,
429                      X_Pay_Awt_Group_Id                     NUMBER   DEFAULT NULL,--bug6639866
430                      X_Org_Id                           NUMBER   DEFAULT MO_GLOBAL.GET_CURRENT_ORG_ID,
431                      X_Po_Header_Id                     NUMBER   DEFAULT NULL,
432                      X_Po_Line_Id                       NUMBER   DEFAULT NULL,
433                      X_Line_Location_Id                 NUMBER   DEFAULT NULL,
437                   -- Removed for bug 4277744
434                      X_External_Bank_Account_Id         NUMBER   DEFAULT NULL,
435                      X_calling_sequence              IN VARCHAR2,
436                      X_Approval_Required_Flag           VARCHAR2,
438                   -- X_USSGL_Txn_Code                   VARCHAR2 DEFAULT NULL,
439                      X_Requester_id                     NUMBER   DEFAULT NULL,
440                      X_Po_Release_Id                    NUMBER   DEFAULT NULL,
441                      X_Item_Description                 VARCHAR2 DEFAULT NULL,
442                      X_Manufacturer                     VARCHAR2 DEFAULT NULL,
443                      X_Model_Number                     VARCHAR2 DEFAULT NULL,
444 		     X_Tax_Control_Amount		NUMBER   DEFAULT NULL,
445 		     X_Taxation_Country			VARCHAR2 DEFAULT NULL,
446 		     X_Product_Fisc_Class		VARCHAR2 DEFAULT NULL,
447 		     X_User_Defined_Fisc_Class		VARCHAR2 DEFAULT NULL,
448 		     X_Trx_Bus_Category			VARCHAR2 DEFAULT NULL,
449 		     X_Primary_Intended_Use		VARCHAR2 DEFAULT NULL,
450 		     X_Legal_Entity_Id			NUMBER   DEFAULT NULL,
451                      x_PAYMENT_METHOD_CODE              varchar2 default null,
452                      x_PAYMENT_REASON_CODE              varchar2 default null,
453                      x_remittance_message1              varchar2 default null,
454                      x_remittance_message2              varchar2 default null,
455                      x_remittance_message3              varchar2 default null,
456                      x_bank_charge_bearer               varchar2 default null,
457                      x_settlement_priority              varchar2 default null,
458                      x_payment_reason_comments          varchar2 default null,
459                      x_delivery_channel_code            varchar2 default null,
460                      X_First_Amount                     NUMBER,  -- 2794958 (2774932)
461 		     X_REMIT_TO_SUPPLIER_NAME         VARCHAR2 DEFAULT NULL,
462 		     X_REMIT_TO_SUPPLIER_ID           NUMBER DEFAULT NULL,
463 		     X_REMIT_TO_SUPPLIER_SITE         VARCHAR2 DEFAULT NULL,
464 		     X_REMIT_TO_SUPPLIER_SITE_ID      NUMBER DEFAULT NULL,
465 		     X_RELATIONSHIP_ID                NUMBER DEFAULT NULL
466   ) IS
467     CURSOR C IS
468         SELECT *
469         FROM   AP_RECURRING_PAYMENTS
470         WHERE  rowid = X_Rowid
471         FOR UPDATE of Recurring_Payment_Id NOWAIT;
472     Recinfo C%ROWTYPE;
473     current_calling_sequence VARCHAR2(2000);
474     debug_info               VARCHAR2(100);
475 
476   BEGIN
477     -- Update the calling sequence
478     --
479     current_calling_sequence :=
480         'AP_RECURRING_PAYMENTS_PKG.LOCK_ROW<-'||X_calling_sequence;
481 
482     debug_info := 'Open cursor C';
483     OPEN C;
484     debug_info := 'Fetch cursor C';
485     FETCH C INTO Recinfo;
486     if (C%NOTFOUND) then
487       debug_info := 'Close cursor C - ROW NOTFOUND';
488       CLOSE C;
489       FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_DELETED');
490       APP_EXCEPTION.Raise_Exception;
491     end if;
492     debug_info := 'Close cursor C';
493     CLOSE C;
494 
495     IF (
496                (Recinfo.recurring_payment_id =  X_Recurring_Payment_Id)
497            AND (Recinfo.vendor_id =  X_Vendor_Id)
498            AND (Recinfo.recurring_pay_num =  X_Recurring_Pay_Num)
499            AND (Recinfo.vendor_site_id =  X_Vendor_Site_Id)
500            AND (Recinfo.rec_pay_period_type =  X_Rec_Pay_Period_Type)
501            AND (Recinfo.num_of_periods =  X_Num_Of_Periods)
502            AND (Recinfo.first_period =  X_First_Period)
503            AND (Recinfo.first_period_num =  X_First_Period_Num)
504            AND (Recinfo.authorized_total =  X_Authorized_Total)
505            AND (Recinfo.control_amount =  X_Control_Amount)
506            AND (   (Recinfo.distribution_set_id =  X_distribution_set_id)
507                 OR (    (Recinfo.distribution_set_id IS NULL)
508                     AND (X_distribution_set_id IS NULL)))
509            AND (Recinfo.terms_id =  X_Terms_Id)
510            AND (Recinfo.set_of_books_id =  X_Set_Of_Books_Id)
511            AND (Recinfo.amount_applicable_to_discount =  X_Amount_Applicable_To_Disc)
512            AND (   (Recinfo.rem_periods =  X_Rem_Periods)
513                 OR (    (Recinfo.rem_periods IS NULL)
514                     AND (X_Rem_Periods IS NULL)))
515            AND (   (Recinfo.accounting_date =  X_Accounting_Date)
516                 OR (    (Recinfo.accounting_date IS NULL)
517                     AND (X_Accounting_Date IS NULL)))
518            AND (   (Recinfo.released_amount =  X_Released_Amount)
519                 OR (    (Recinfo.released_amount IS NULL)
520                     AND (X_Released_Amount IS NULL)))
521            AND (   (Recinfo.batch_id =  X_Batch_Id)
522                 OR (    (Recinfo.batch_id IS NULL)
523                     AND (X_Batch_Id IS NULL)))
524            AND (   (Recinfo.accts_pay_code_combination_id =  X_Accts_Pay_Code_Comb)
525                 OR (    (Recinfo.accts_pay_code_combination_id IS NULL)
526                     AND (X_Accts_Pay_Code_Comb IS NULL)))
527            AND (Recinfo.invoice_currency_code =  X_Invoice_Currency_Code)
528            AND (Recinfo.payment_currency_code =  X_Payment_Currency_Code)
529            AND (   (Recinfo.pay_group_lookup_code =  X_Pay_Group_Lookup_Code)
530                 OR (    (Recinfo.pay_group_lookup_code IS NULL)
531                     AND (X_Pay_Group_Lookup_Code IS NULL)))
532            AND (   (Recinfo.tax_amount =  X_Tax_Amount)
533                 OR (    (Recinfo.tax_amount IS NULL)
537                     AND (X_Exchange_Rate IS NULL)))
534                     AND (X_Tax_Amount IS NULL)))
535            AND (   (Recinfo.exchange_rate =  X_Exchange_Rate)
536                 OR (    (Recinfo.exchange_rate IS NULL)
538            AND (   (Recinfo.next_period =  X_Next_Period)
539                 OR (    (Recinfo.next_period IS NULL)
540                     AND (X_Next_Period IS NULL)))
541            AND (   (Recinfo.next_payment =  X_Next_Payment)
542                 OR (    (Recinfo.next_payment IS NULL)
543                     AND (X_Next_Payment IS NULL)))
544            AND (   (Recinfo.increment_percent =  X_Increment_Percent)
545                 OR (    (Recinfo.increment_percent IS NULL)
546                     AND (X_Increment_Percent IS NULL)))
547            AND (   (Recinfo.num_of_periods_rem =  X_Num_Of_Periods_Rem)
548                 OR (    (Recinfo.num_of_periods_rem IS NULL)
549                     AND (X_Num_Of_Periods_Rem IS NULL)))
550            AND (   (Recinfo.special_payment_amount1 =  X_Special_Payment_Amount1)
551                 OR (    (Recinfo.special_payment_amount1 IS NULL)
552                     AND (X_Special_Payment_Amount1 IS NULL)))
553            AND (   (Recinfo.special_period_name1 =  X_Special_Period_Name1)
554                 OR (    (Recinfo.special_period_name1 IS NULL)
555                     AND (X_Special_Period_Name1 IS NULL)))
556            AND (   (Recinfo.special_payment_amount2 =  X_Special_Payment_Amount2)
557                 OR (    (Recinfo.special_payment_amount2 IS NULL)
558                     AND (X_Special_Payment_Amount2 IS NULL)))
559            AND (   (Recinfo.special_period_name2 =  X_Special_Period_Name2)
560                 OR (    (Recinfo.special_period_name2 IS NULL)
561                     AND (X_Special_Period_Name2 IS NULL)))
562            AND (   (Recinfo.Taxation_Country =  X_Taxation_Country)
563                 OR (    (Recinfo.Taxation_Country IS NULL)
564                     AND (X_Taxation_Country IS NULL)))
565            AND (   (Recinfo.Tax_Control_Amount =  X_Tax_Control_Amount)
566                 OR (    (Recinfo.Tax_Control_Amount IS NULL)
567                     AND (X_Tax_Control_Amount IS NULL)))
568            AND (   (Recinfo.Product_Fisc_Classification =  X_Product_Fisc_Class)
569                 OR (    (Recinfo.Product_Fisc_Classification IS NULL)
570                     AND (X_Product_Fisc_Class IS NULL)))
571            AND (   (Recinfo.User_Defined_Fisc_Class =  X_User_Defined_Fisc_Class)
572                 OR (    (Recinfo.User_Defined_Fisc_Class IS NULL)
573                     AND (X_User_Defined_Fisc_Class IS NULL)))
574            AND (   (Recinfo.Trx_Business_Category =  X_Trx_Bus_Category)
575                 OR (    (Recinfo.Trx_Business_Category IS NULL)
576                     AND (X_Trx_Bus_Category IS NULL)))
577            AND (   (Recinfo.Primary_Intended_Use =  X_Primary_Intended_Use)
578                 OR (    (Recinfo.Primary_Intended_Use IS NULL)
579                     AND (X_Primary_Intended_Use IS NULL)))
580            AND (   (Recinfo.Legal_Entity_Id =  X_Legal_Entity_Id)
581                 OR (    (Recinfo.Legal_Entity_Id IS NULL)
582                     AND (X_Legal_Entity_Id IS NULL)))
583 	   AND  (   (Recinfo.REMIT_TO_SUPPLIER_NAME = X_REMIT_TO_SUPPLIER_NAME)
584                 OR (    (Recinfo.REMIT_TO_SUPPLIER_NAME IS NULL)
585 		    AND (X_REMIT_TO_SUPPLIER_NAME IS NULL)))
586 
587            AND  (   (Recinfo.REMIT_TO_SUPPLIER_ID = X_REMIT_TO_SUPPLIER_ID)
588                 OR (    (Recinfo.REMIT_TO_SUPPLIER_ID IS NULL)
589 		    AND (X_REMIT_TO_SUPPLIER_ID IS NULL)))
590 
591            AND  (   (Recinfo.REMIT_TO_SUPPLIER_SITE = X_REMIT_TO_SUPPLIER_SITE)
592                 OR (    (Recinfo.REMIT_TO_SUPPLIER_SITE IS NULL)
593 		    AND (X_REMIT_TO_SUPPLIER_SITE IS NULL)))
594 
595            AND  (   (Recinfo.REMIT_TO_SUPPLIER_SITE_ID = X_REMIT_TO_SUPPLIER_SITE_ID)
596                 OR (    (Recinfo.REMIT_TO_SUPPLIER_SITE_ID IS NULL)
597 		    AND (X_REMIT_TO_SUPPLIER_SITE_ID IS NULL)))
598 
599            AND  (   (Recinfo.RELATIONSHIP_ID = X_RELATIONSHIP_ID)
600                 OR (    (Recinfo.RELATIONSHIP_ID IS NULL)
601 		    AND (X_RELATIONSHIP_ID IS NULL)))) then
602       null;
603     else
604       FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_CHANGED');
605       APP_EXCEPTION.Raise_Exception;
606     end if;
607 
608     if(
609      (  (Recinfo.description =  X_Description)
610                 OR (    (Recinfo.description IS NULL)
611                     AND (X_Description IS NULL)))
612            AND (   (Recinfo.paid_flag1 =  X_Paid_Flag1)
613                 OR (    (Recinfo.paid_flag1 IS NULL)
614                     AND (X_Paid_Flag1 IS NULL)))
615            AND (   (Recinfo.paid_flag2 =  X_Paid_Flag2)
616                 OR (    (Recinfo.paid_flag2 IS NULL)
617                     AND (X_Paid_Flag2 IS NULL)))
618            AND (   (Recinfo.hold_lookup_code =  X_Hold_Lookup_Code)
619                 OR (    (Recinfo.hold_lookup_code IS NULL)
620                     AND (X_Hold_Lookup_Code IS NULL)))
621            AND (   (Recinfo.hold_reason =  X_Hold_Reason)
622                 OR (    (Recinfo.hold_reason IS NULL)
623                     AND (X_Hold_Reason IS NULL)))
624            AND (   (Recinfo.approved_by =  X_Approved_By)
625                 OR (    (Recinfo.approved_by IS NULL)
626                     AND (X_Approved_By IS NULL)))
627            AND (   (Recinfo.expiry_date =  X_Expiry_Date)
628                 OR (    (Recinfo.expiry_date IS NULL)
629                     AND (X_Expiry_Date IS NULL)))
630            AND (   (Recinfo.attribute_category =  X_Attribute_Category)
634                 OR (    (Recinfo.attribute1 IS NULL)
631                 OR (    (Recinfo.attribute_category IS NULL)
632                     AND (X_Attribute_Category IS NULL)))
633            AND (   (Recinfo.attribute1 =  X_Attribute1)
635                     AND (X_Attribute1 IS NULL)))
636            AND (   (Recinfo.attribute2 =  X_Attribute2)
637                 OR (    (Recinfo.attribute2 IS NULL)
638                     AND (X_Attribute2 IS NULL)))
639            AND (   (Recinfo.attribute3 =  X_Attribute3)
640                 OR (    (Recinfo.attribute3 IS NULL)
641                     AND (X_Attribute3 IS NULL)))
642            AND (   (Recinfo.attribute4 =  X_Attribute4)
643                 OR (    (Recinfo.attribute4 IS NULL)
644                     AND (X_Attribute4 IS NULL)))
645            AND (   (Recinfo.attribute5 =  X_Attribute5)
646                 OR (    (Recinfo.attribute5 IS NULL)
647                     AND (X_Attribute5 IS NULL)))
648            AND (   (Recinfo.exchange_rate_type =  X_Exchange_Rate_Type)
649                 OR (    (Recinfo.exchange_rate_type IS NULL)
650                     AND (X_Exchange_Rate_Type IS NULL)))
651            AND (Recinfo.payment_cross_rate =  X_Payment_Cross_Rate)
652            AND (   (Recinfo.exchange_date =  X_Exchange_Date)
653                 OR (    (Recinfo.exchange_date IS NULL)
654                     AND (X_Exchange_Date IS NULL)))
655            AND (   (Recinfo.tax_name =  X_Tax_Name)
656                 OR (    (Recinfo.tax_name IS NULL)
657                     AND (X_Tax_Name IS NULL)))
658            AND (   (Recinfo.attribute11 =  X_Attribute11)
659                 OR (    (Recinfo.attribute11 IS NULL)
660                     AND (X_Attribute11 IS NULL)))
661            AND (   (Recinfo.attribute12 =  X_Attribute12)
662                 OR (    (Recinfo.attribute12 IS NULL)
663                     AND (X_Attribute12 IS NULL)))
664            AND (   (Recinfo.attribute13 =  X_Attribute13)
665                 OR (    (Recinfo.attribute13 IS NULL)
666                     AND (X_Attribute13 IS NULL)))
667            AND (   (Recinfo.attribute14 =  X_Attribute14)
668                 OR (    (Recinfo.attribute14 IS NULL)
669                     AND (X_Attribute14 IS NULL)))
670            AND (   (Recinfo.attribute6 =  X_Attribute6)
671                 OR (    (Recinfo.attribute6 IS NULL)
672                     AND (X_Attribute6 IS NULL)))
673            AND (   (Recinfo.attribute7 =  X_Attribute7)
674                 OR (    (Recinfo.attribute7 IS NULL)
675                     AND (X_Attribute7 IS NULL)))
676            AND (   (Recinfo.attribute8 =  X_Attribute8)
677                 OR (    (Recinfo.attribute8 IS NULL)
678                     AND (X_Attribute8 IS NULL)))
679            AND (   (Recinfo.attribute9 =  X_Attribute9)
680                 OR (    (Recinfo.attribute9 IS NULL)
681                     AND (X_Attribute9 IS NULL)))
682            AND (   (Recinfo.attribute10 =  X_Attribute10)
683                 OR (    (Recinfo.attribute10 IS NULL)
684                     AND (X_Attribute10 IS NULL)))
685            AND (   (Recinfo.attribute15 =  X_Attribute15)
686                 OR (    (Recinfo.attribute15 IS NULL)
687                     AND (X_Attribute15 IS NULL)))
688            AND (   (Recinfo.exclusive_payment_flag =  X_Exclusive_Payment_Flag)
689                 OR (    (Recinfo.exclusive_payment_flag IS NULL)
690                     AND (X_Exclusive_Payment_Flag IS NULL)))
691            AND (   (Recinfo.awt_group_id =  X_Awt_Group_Id)
692                 OR (    (Recinfo.awt_group_id IS NULL)
693                     AND (X_Awt_Group_Id IS NULL)))
694             AND (   (Recinfo.pay_awt_group_id =  X_Pay_Awt_Group_Id)
695                 OR (    (Recinfo.pay_awt_group_id IS NULL)
696                     AND (X_Pay_Awt_Group_Id IS NULL)))    --bug6639866
697            AND (   (Recinfo.po_header_id =  X_po_header_id)
698                 OR (    (Recinfo.po_header_id IS NULL)
699                     AND (X_po_header_id IS NULL)))
700            AND (   (Recinfo.po_line_id =  X_po_line_id)
701                 OR (    (Recinfo.po_line_id IS NULL)
702                     AND (X_po_line_id IS NULL)))
703            AND (   (Recinfo.External_Bank_Account_Id =  X_External_Bank_Account_Id)
704                  OR (    (Recinfo.External_Bank_Account_Id IS NULL)
705                     AND (X_External_Bank_Account_Id IS NULL)))
706            AND (   (Recinfo.line_location_id =  X_line_location_id)
707                 OR (    (Recinfo.line_location_id IS NULL)
708                     AND (X_line_location_id IS NULL)))
709            AND (   (Recinfo.Approval_Required_Flag =  X_Approval_Required_Flag)
710                 OR (    (Recinfo.Approval_Required_Flag IS NULL)
711                     AND (X_Approval_Required_Flag IS NULL)))
712         -- Removed for bug 4277744
713         -- AND (   (Recinfo.USSGL_Transaction_Code = X_USSGL_Txn_Code)
714         --      OR (    (Recinfo.USSGL_Transaction_Code IS NULL)
715         --          AND (X_USSGL_Txn_Code IS NULL)))
716            AND (   (Recinfo.Org_Id = X_Org_Id)
717                 OR (    (Recinfo.Org_Id IS NULL)
718                     AND (X_Org_Id IS NULL)))
719            AND (   (Recinfo.Requester_Id = X_Requester_Id)
720                 OR (    (Recinfo.Requester_Id IS NULL)
721                     AND (X_Requester_Id IS NULL)))
722            AND (   (Recinfo.Po_Release_Id = X_Po_Release_Id)
723                 OR (    (Recinfo.Po_Release_Id IS NULL)
724                     AND (X_Po_Release_Id IS NULL)))
725            AND (   (Recinfo.Item_Description = X_Item_Description)
726                 OR (    (Recinfo.Item_Description IS NULL)
727                     AND (X_Item_Description IS NULL)))
731            AND (   (Recinfo.Model_Number = X_Model_Number)
728            AND (   (Recinfo.Manufacturer = X_Manufacturer)
729                 OR (    (Recinfo.Manufacturer IS NULL)
730                     AND (X_Manufacturer IS NULL)))
732                 OR (    (Recinfo.Model_Number IS NULL)
733                     AND (X_Model_Number IS NULL)))
734       AND ((Recinfo.PAYMENT_METHOD_CODE = X_PAYMENT_METHOD_CODE)
735            OR ((Recinfo.PAYMENT_METHOD_CODE is null)
736                AND (X_PAYMENT_METHOD_CODE is null)))
737       AND ((Recinfo.PAYMENT_REASON_CODE = X_PAYMENT_REASON_CODE)
738            OR ((Recinfo.PAYMENT_REASON_CODE is null)
739                AND (X_PAYMENT_REASON_CODE is null)))
740       AND ((Recinfo.REMITTANCE_MESSAGE1 = X_REMITTANCE_MESSAGE1)
741            OR ((Recinfo.REMITTANCE_MESSAGE1 is null)
742                AND (X_REMITTANCE_MESSAGE1 is null)))
743       AND ((Recinfo.REMITTANCE_MESSAGE2 = X_REMITTANCE_MESSAGE2)
744            OR ((Recinfo.REMITTANCE_MESSAGE2 is null)
745                AND (X_REMITTANCE_MESSAGE2 is null)))
746       AND ((Recinfo.REMITTANCE_MESSAGE3 = X_REMITTANCE_MESSAGE3)
747            OR ((Recinfo.REMITTANCE_MESSAGE3 is null)
748                AND (X_REMITTANCE_MESSAGE3 is null)))
749       AND ((Recinfo.bank_charge_bearer = X_bank_charge_bearer)
750            OR ((Recinfo.bank_charge_bearer is null)
751                AND (X_bank_charge_bearer is null)))
752       AND ((Recinfo.settlement_priority = X_settlement_priority)
753            OR ((Recinfo.settlement_priority is null)
754                AND (X_settlement_priority is null)))
755       AND ((Recinfo.payment_reason_comments = X_payment_reason_comments)
756            OR ((Recinfo.payment_reason_comments is null)
757                AND (X_payment_reason_comments is null)))
758       AND ((Recinfo.delivery_channel_code = X_delivery_channel_code)
759            OR ((Recinfo.delivery_channel_code is null)
760                AND (X_delivery_channel_code is null)))
761       AND (   (Recinfo.First_Amount = X_First_Amount)
762             OR (    (Recinfo.First_Amount IS NULL)
763                  AND (X_First_Amount IS NULL))) -- 2794958 (2774932)
764 
765       )then
766       return;
767      else
768       FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_CHANGED');
769       APP_EXCEPTION.Raise_Exception;
770     end if;
771 
772     EXCEPTION
773       WHEN OTHERS THEN
774         if (SQLCODE <> -20001) then
775           IF (SQLCODE = -54) THEN
776             FND_MESSAGE.SET_NAME('SQLAP','AP_RESOURCE_BUSY');
777           ELSE
778             FND_MESSAGE.SET_NAME('SQLAP', 'AP_DEBUG');
779             FND_MESSAGE.SET_TOKEN('ERROR', SQLERRM);
780             FND_MESSAGE.SET_TOKEN('CALLING_SEQUENCE', current_calling_sequence);
781             FND_MESSAGE.SET_TOKEN('PARAMETERS', 'Rowid = '||X_Rowid
782                ||', Recurring_payment_id = '||TO_CHAR(X_Recurring_Payment_Id)
783                                        );
784             FND_MESSAGE.SET_TOKEN('DEBUG_INFO', debug_info);
785       END IF;
786         end if;
787         APP_EXCEPTION.RAISE_EXCEPTION;
788   END Lock_Row;
789 
790   PROCEDURE Update_Row(X_Rowid                          VARCHAR2,
791                        X_Recurring_Payment_Id           NUMBER,
792                        X_Last_Update_Date               DATE,
793                        X_Last_Updated_By                NUMBER,
794                        X_Vendor_Id                      NUMBER,
795                        X_Recurring_Pay_Num              VARCHAR2,
796                        X_Vendor_Site_Id                 NUMBER,
797                        X_Rec_Pay_Period_Type            VARCHAR2,
798                        X_Num_Of_Periods                 NUMBER,
799                        X_First_Period                   VARCHAR2,
800                        X_First_Period_Num               NUMBER,
801                        X_Authorized_Total               NUMBER,
802                        X_Control_Amount                 NUMBER,
803                        X_Distribution_Set_Id            NUMBER   DEFAULT NULL,
804                        X_Terms_Id                       NUMBER,
805                        X_Set_Of_Books_Id                NUMBER,
806                        X_Amount_Applicable_To_Disc      NUMBER,
807                        X_Rem_Periods                    NUMBER   DEFAULT NULL,
808                        X_Accounting_Date                DATE     DEFAULT NULL,
809                        X_Released_Amount                NUMBER   DEFAULT NULL,
810                        X_Batch_Id                       NUMBER   DEFAULT NULL,
811                        X_Accts_Pay_Code_Comb            NUMBER   DEFAULT NULL,
812                        X_Invoice_Currency_Code          VARCHAR2,
813                        X_Payment_Currency_Code          VARCHAR2,
814                        X_Pay_Group_Lookup_Code          VARCHAR2 DEFAULT NULL,
815                        X_Tax_Amount                     NUMBER   DEFAULT NULL,
816                        X_Exchange_Rate                  NUMBER   DEFAULT NULL,
817                        X_Next_Period                    VARCHAR2 DEFAULT NULL,
818                        X_Next_Payment                   NUMBER   DEFAULT NULL,
819                        X_Increment_Percent              NUMBER   DEFAULT NULL,
820                        X_Num_Of_Periods_Rem             NUMBER   DEFAULT NULL,
821                        X_Special_Payment_Amount1        NUMBER   DEFAULT NULL,
822                        X_Special_Period_Name1           VARCHAR2 DEFAULT NULL,
826                        X_Paid_Flag1                     VARCHAR2 DEFAULT NULL,
823                        X_Special_Payment_Amount2        NUMBER   DEFAULT NULL,
824                        X_Special_Period_Name2           VARCHAR2 DEFAULT NULL,
825                        X_Description                    VARCHAR2 DEFAULT NULL,
827                        X_Paid_Flag2                     VARCHAR2 DEFAULT NULL,
828                        X_Hold_Lookup_Code               VARCHAR2 DEFAULT NULL,
829                        X_Hold_Reason                    VARCHAR2 DEFAULT NULL,
830                        X_Approved_By                    NUMBER   DEFAULT NULL,
831                        X_Expiry_Date                    DATE     DEFAULT NULL,
832                        X_Attribute_Category             VARCHAR2 DEFAULT NULL,
833                        X_Attribute1                     VARCHAR2 DEFAULT NULL,
834                        X_Attribute2                     VARCHAR2 DEFAULT NULL,
835                        X_Attribute3                     VARCHAR2 DEFAULT NULL,
836                        X_Attribute4                     VARCHAR2 DEFAULT NULL,
837                        X_Attribute5                     VARCHAR2 DEFAULT NULL,
838                        X_Exchange_Rate_Type             VARCHAR2 DEFAULT NULL,
839                        X_Payment_Cross_Rate             NUMBER,
840                        X_Exchange_Date                  DATE     DEFAULT NULL,
841                        X_Last_Update_Login              NUMBER   DEFAULT NULL,
842                        X_Tax_Name                       VARCHAR2 DEFAULT NULL,
843                        X_Attribute11                    VARCHAR2 DEFAULT NULL,
844                        X_Attribute12                    VARCHAR2 DEFAULT NULL,
845                        X_Attribute13                    VARCHAR2 DEFAULT NULL,
846                        X_Attribute14                    VARCHAR2 DEFAULT NULL,
847                        X_Attribute6                     VARCHAR2 DEFAULT NULL,
848                        X_Attribute7                     VARCHAR2 DEFAULT NULL,
849                        X_Attribute8                     VARCHAR2 DEFAULT NULL,
850                        X_Attribute9                     VARCHAR2 DEFAULT NULL,
851                        X_Attribute10                    VARCHAR2 DEFAULT NULL,
852                        X_Attribute15                    VARCHAR2 DEFAULT NULL,
853                        X_Exclusive_Payment_Flag         VARCHAR2 DEFAULT NULL,
854                        X_Awt_Group_Id                   NUMBER   DEFAULT NULL,
855                        X_Pay_Awt_Group_Id                   NUMBER   DEFAULT NULL,--bug6639866
856                        X_Org_Id                         NUMBER   DEFAULT MO_GLOBAL.GET_CURRENT_ORG_ID,
857                        X_Po_Header_Id                   NUMBER   DEFAULT NULL,
858                        X_Po_Line_Id                     NUMBER   DEFAULT NULL,
859                        X_Line_Location_Id               NUMBER   DEFAULT NULL,
860                        X_External_Bank_Account_Id       NUMBER   DEFAULT NULL,
861                        X_calling_sequence            IN VARCHAR2,
862                        X_Approval_Required_Flag         VARCHAR2,
863                     -- Removed for bug 4277744
864                     -- X_USSGL_Txn_Code                 VARCHAR2,
865                        X_Requester_id                   NUMBER   DEFAULT NULL,
866                        X_Po_Release_Id                  NUMBER   DEFAULT NULL,
867                        X_Item_Description               VARCHAR2 DEFAULT NULL,
868                        X_Manufacturer                   VARCHAR2 DEFAULT NULL,
869                        X_Model_Number                   VARCHAR2 DEFAULT NULL,
870 		       X_Tax_Control_Amount		NUMBER   DEFAULT NULL,
871 		       X_Taxation_Country		VARCHAR2 DEFAULT NULL,
872 		       X_Product_Fisc_Class		VARCHAR2 DEFAULT NULL,
873 		       X_User_Defined_Fisc_Class	VARCHAR2 DEFAULT NULL,
874 		       X_Trx_Bus_Category		VARCHAR2 DEFAULT NULL,
875 		       X_Primary_Intended_Use		VARCHAR2 DEFAULT NULL,
876 		       X_Legal_Entity_Id		NUMBER   DEFAULT NULL,
877                        x_PAYMENT_METHOD_CODE            varchar2 default null,
878                        x_PAYMENT_REASON_CODE            varchar2 default null,
879                        x_remittance_message1            varchar2 default null,
880                        x_remittance_message2            varchar2 default null,
881                        x_remittance_message3            varchar2 default null,
882                        x_bank_charge_bearer             varchar2 default null,
883                        x_settlement_priority            varchar2 default null,
884                        x_payment_reason_comments        varchar2 default null,
885                        x_delivery_channel_code          varchar2 default null,
886                        x_first_amount                   number, -- 2794958 (2774932)
887 		       X_REMIT_TO_SUPPLIER_NAME         VARCHAR2 DEFAULT NULL,
888 		       X_REMIT_TO_SUPPLIER_ID           NUMBER DEFAULT NULL,
889 		       X_REMIT_TO_SUPPLIER_SITE         VARCHAR2 DEFAULT NULL,
890 		       X_REMIT_TO_SUPPLIER_SITE_ID      NUMBER DEFAULT NULL,
891 		       X_RELATIONSHIP_ID                NUMBER DEFAULT NULL
892   ) IS
893 
894     current_calling_sequence VARCHAR2(2000);
895     debug_info               VARCHAR2(100);
896 
897   BEGIN
898     -- Update the calling sequence
899     --
900     current_calling_sequence :=
901         'AP_RECURRING_PAYMENTS_PKG.UPDATE_ROW<-'||X_calling_sequence;
902 
903     debug_info := 'Update AP_RECURRING_PAYMENTS';
904     UPDATE AP_RECURRING_PAYMENTS_ALL
905     SET
906        recurring_payment_id            =     X_Recurring_Payment_Id,
907        last_update_date                =     X_Last_Update_Date,
908        last_updated_by                 =     X_Last_Updated_By,
909        vendor_id                       =     X_Vendor_Id,
910        recurring_pay_num               =     X_Recurring_Pay_Num,
911        vendor_site_id                  =     X_Vendor_Site_Id,
912        rec_pay_period_type             =     X_Rec_Pay_Period_Type,
913        num_of_periods                  =     X_Num_Of_Periods,
914        first_period                    =     X_First_Period,
915        first_period_num                =     X_First_Period_Num,
916        authorized_total                =     X_Authorized_Total,
917        control_amount                  =     X_Control_Amount,
918        distribution_set_id             =     X_Distribution_Set_Id,
919        terms_id                        =     X_Terms_Id,
920        set_of_books_id                 =     X_Set_Of_Books_Id,
921        amount_applicable_to_discount   =     X_Amount_Applicable_To_Disc,
922        rem_periods                     =     X_Rem_Periods,
923        accounting_date                 =     X_Accounting_Date,
924        released_amount                 =     X_Released_Amount,
925        batch_id                        =     X_Batch_Id,
926        accts_pay_code_combination_id   =     X_Accts_Pay_Code_Comb,
927        invoice_currency_code           =     X_Invoice_Currency_Code,
928        payment_currency_code           =     X_Payment_Currency_Code,
929        pay_group_lookup_code           =     X_Pay_Group_Lookup_Code,
930        tax_amount                      =     X_Tax_Amount,
931        exchange_rate                   =     X_Exchange_Rate,
932        next_period                     =     X_Next_Period,
933        next_payment                    =     X_Next_Payment,
934        increment_percent               =     X_Increment_Percent,
935        num_of_periods_rem              =     X_Num_Of_Periods_Rem,
936        special_payment_amount1         =     X_Special_Payment_Amount1,
937        special_period_name1            =     X_Special_Period_Name1,
938        special_payment_amount2         =     X_Special_Payment_Amount2,
939        special_period_name2            =     X_Special_Period_Name2,
940        description                     =     X_Description,
941        paid_flag1                      =     X_Paid_Flag1,
942        paid_flag2                      =     X_Paid_Flag2,
943        hold_lookup_code                =     X_Hold_Lookup_Code,
944        hold_reason                     =     X_Hold_Reason,
945        approved_by                     =     X_Approved_By,
946        expiry_date                     =     X_Expiry_Date,
947        attribute_category              =     X_Attribute_Category,
948        attribute1                      =     X_Attribute1,
949        attribute2                      =     X_Attribute2,
950        attribute3                      =     X_Attribute3,
951        attribute4                      =     X_Attribute4,
952        attribute5                      =     X_Attribute5,
953        exchange_rate_type              =     X_Exchange_Rate_Type,
954        payment_cross_rate              =     X_Payment_Cross_Rate,
955        exchange_date                   =     X_Exchange_Date,
956        last_update_login               =     X_Last_Update_Login,
957        tax_name                        =     X_Tax_Name,
958        attribute11                     =     X_Attribute11,
959        attribute12                     =     X_Attribute12,
960        attribute13                     =     X_Attribute13,
961        attribute14                     =     X_Attribute14,
962        attribute6                      =     X_Attribute6,
963        attribute7                      =     X_Attribute7,
964        attribute8                      =     X_Attribute8,
965        attribute9                      =     X_Attribute9,
966        attribute10                     =     X_Attribute10,
967        attribute15                     =     X_Attribute15,
968        exclusive_payment_flag          =     X_Exclusive_Payment_Flag,
969        awt_group_id                    =     X_Awt_Group_Id,
970        pay_awt_group_id                =     X_Pay_Awt_Group_Id,--bug6639866
971        po_header_id                    =     X_Po_Header_Id,
972        po_line_id                      =     X_Po_Line_Id,
973        External_Bank_Account_Id        =     X_External_Bank_Account_Id,
974        line_location_id                =     X_Line_Location_Id,
975        Approval_Required_Flag           =     X_Approval_Required_Flag,
976     -- Removed for bug 4277744
977     -- USSGL_Transaction_Code          =     X_USSGL_Txn_Code,
978        org_id                          =     X_org_id,
979        requester_id                    =     X_Requester_id,
980        po_release_id                   =     X_Po_Release_Id,
981        Item_Description                =     X_Item_Description,
982        Manufacturer                    =     X_Manufacturer,
983        Model_Number                    =     X_Model_Number,
984        Tax_Control_Amount	       =     X_Tax_Control_Amount,
985        Taxation_Country		       =     X_Taxation_Country,
986        Product_Fisc_Classification     =     X_Product_Fisc_Class,
987        User_Defined_Fisc_Class         =     X_User_Defined_Fisc_Class,
988        Trx_Business_Category           =     X_Trx_Bus_Category,
989        Primary_Intended_Use            =     X_Primary_Intended_Use,
990        Legal_Entity_Id		       =     X_Legal_Entity_Id,
991        PAYMENT_METHOD_CODE             =     x_PAYMENT_METHOD_CODE,
992        PAYMENT_REASON_CODE             =     x_PAYMENT_REASON_CODE,
993        REMITTANCE_MESSAGE1             =     X_REMITTANCE_MESSAGE1,
994        REMITTANCE_MESSAGE2             =     X_REMITTANCE_MESSAGE2,
995        REMITTANCE_MESSAGE3             =     X_REMITTANCE_MESSAGE3,
996        bank_charge_bearer              =     x_bank_charge_bearer,
997        settlement_priority             =     x_settlement_priority,
998        payment_reason_comments         =     x_payment_reason_comments,
999        delivery_channel_code           =     x_delivery_channel_code,
1000        first_amount                    =     x_first_amount, -- 2794958 (2774932)
1001        REMIT_TO_SUPPLIER_NAME          =     X_REMIT_TO_SUPPLIER_NAME,
1002        REMIT_TO_SUPPLIER_ID            =     X_REMIT_TO_SUPPLIER_ID,
1003        REMIT_TO_SUPPLIER_SITE          =     X_REMIT_TO_SUPPLIER_SITE,
1004        REMIT_TO_SUPPLIER_SITE_ID       =     X_REMIT_TO_SUPPLIER_SITE_ID,
1005        RELATIONSHIP_ID                 =     X_RELATIONSHIP_ID
1006     WHERE rowid = X_Rowid;
1007 
1008     if (SQL%NOTFOUND) then
1009       Raise NO_DATA_FOUND;
1010     end if;
1011 
1012     EXCEPTION
1013       WHEN OTHERS THEN
1014         if (SQLCODE <> -20001) then
1015           FND_MESSAGE.SET_NAME('SQLAP', 'AP_DEBUG');
1016           FND_MESSAGE.SET_TOKEN('ERROR', SQLERRM);
1017           FND_MESSAGE.SET_TOKEN('CALLING_SEQUENCE', current_calling_sequence);
1018           FND_MESSAGE.SET_TOKEN('PARAMETERS', 'Rowid = '||X_Rowid
1019                           ||', Recurring_payment_id = '||TO_CHAR(X_Recurring_Payment_Id)
1020                                        );
1021           FND_MESSAGE.SET_TOKEN('DEBUG_INFO', debug_info);
1022         end if;
1023         APP_EXCEPTION.RAISE_EXCEPTION;
1024 
1025   END Update_Row;
1026 
1027   PROCEDURE Delete_Row(X_Rowid                 VARCHAR2,
1028                X_calling_sequence    IN    VARCHAR2) IS
1029 
1030     current_calling_sequence VARCHAR2(2000);
1031     debug_info               VARCHAR2(100);
1032 
1033   BEGIN
1034 
1035     -- Update the calling sequence
1036     --
1037     current_calling_sequence :=
1038         'AP_RECURRING_PAYMENTS_PKG.DELETE_ROW<-'||X_calling_sequence;
1039 
1040     debug_info := 'Delete from AP_RECURRING_PAYMENTS';
1041     DELETE FROM AP_RECURRING_PAYMENTS_ALL
1042     WHERE rowid = X_Rowid;
1043 
1044     if (SQL%NOTFOUND) then
1045       Raise NO_DATA_FOUND;
1046     end if;
1047 
1048     EXCEPTION
1049       WHEN OTHERS THEN
1050         if (SQLCODE <> -20001) then
1051           FND_MESSAGE.SET_NAME('SQLAP', 'AP_DEBUG');
1052           FND_MESSAGE.SET_TOKEN('ERROR', SQLERRM);
1053           FND_MESSAGE.SET_TOKEN('CALLING_SEQUENCE', current_calling_sequence);
1054           FND_MESSAGE.SET_TOKEN('PARAMETERS', 'Rowid = '||X_Rowid);
1055           FND_MESSAGE.SET_TOKEN('DEBUG_INFO', debug_info);
1056         end if;
1057         APP_EXCEPTION.RAISE_EXCEPTION;
1058 
1059   END Delete_Row;
1060 
1061 END AP_RECURRING_PAYMENTS_PKG;