DBA Data[Home] [Help]

APPS.AP_PAYMENT_SCHEDULES_PKG dependencies on AP_PAYMENT_SCHEDULES

Line 1: PACKAGE BODY AP_PAYMENT_SCHEDULES_PKG AS

1: PACKAGE BODY AP_PAYMENT_SCHEDULES_PKG AS
2: /* $Header: apipascb.pls 120.7.12010000.7 2009/10/06 05:41:54 rseeta ship $ */
3:
4: -----------------------------------------------------------------------
5: -- PROCEDURE adjust_pay_schedule adjusts the payment schedule of

Line 32: l_payment_status_flag ap_payment_schedules.payment_status_flag%TYPE;

28: l_original_invoice_amount number;
29: l_net_amount_to_adjust number;
30: l_payment_num_to_add number;
31: l_amount_remaining number;
32: l_payment_status_flag ap_payment_schedules.payment_status_flag%TYPE;
33: l_allow_paid_invoice_adjust
34: ap_system_parameters.allow_paid_invoice_adjust%TYPE;
35: l_add_new_payment_schedule varchar2(1) := 'Y';
36: l_sum_ps_amount_remaining number;

Line 51: FROM ap_payment_schedules

47: l_amount_paid NUMBER;
48:
49: cursor message1_cursor is
50: SELECT 'AP_PAY_WARN_DISC_UPDATE'
51: FROM ap_payment_schedules
52: WHERE invoice_id = X_invoice_id
53: AND payment_num = l_current_payment_num
54: AND (NVL(discount_amount_available, 0) <> 0
55: OR NVL(second_disc_amt_available, 0) <> 0

Line 82: FROM ap_payment_schedules

78: cursor pay_sched_adjust_cursor is
79: SELECT payment_num,
80: amount_remaining,
81: payment_status_flag
82: FROM ap_payment_schedules
83: WHERE invoice_id = X_invoice_id
84: AND (l_add_new_payment_schedule='Y' OR
85: payment_status_flag <> 'Y')
86: ORDER BY due_date desc, payment_num desc;

Line 90: FROM ap_payment_schedules

86: ORDER BY due_date desc, payment_num desc;
87:
88: cursor payment_num_to_add_cursor is
89: SELECT nvl((MAX(payment_num)+1),1)
90: FROM ap_payment_schedules
91: WHERE invoice_id = X_invoice_id;
92:
93: cursor c_inv_curr_sched_total IS
94: SELECT SUM(nvl(inv_curr_gross_amount, gross_amount))

Line 95: FROM ap_payment_schedules

91: WHERE invoice_id = X_invoice_id;
92:
93: cursor c_inv_curr_sched_total IS
94: SELECT SUM(nvl(inv_curr_gross_amount, gross_amount))
95: FROM ap_payment_schedules
96: WHERE invoice_id = X_Invoice_Id;
97:
98: BEGIN
99: current_calling_sequence :=

Line 100: 'AP_PAYMENT_SCHEDULES_PKG.ADJUST_PAY_SCHEDULE<-' ||

96: WHERE invoice_id = X_Invoice_Id;
97:
98: BEGIN
99: current_calling_sequence :=
100: 'AP_PAYMENT_SCHEDULES_PKG.ADJUST_PAY_SCHEDULE<-' ||
101: X_calling_sequence;
102:
103: -- Determine the original invoice_amount
104: -- The precondition of this procedure is that it is being called

Line 246: debug_info := 'Delete AP_PAYMENT_SCHEDULES payment_num '||

242: --
243: if ((l_amount_remaining + l_current_amount_to_adjust = 0) and
244: l_payment_status_flag not in ('Y','P')) then
245:
246: debug_info := 'Delete AP_PAYMENT_SCHEDULES payment_num '||
247: l_current_payment_num;
248:
249: delete from ap_payment_schedules
250: where invoice_id = X_invoice_id

Line 249: delete from ap_payment_schedules

245:
246: debug_info := 'Delete AP_PAYMENT_SCHEDULES payment_num '||
247: l_current_payment_num;
248:
249: delete from ap_payment_schedules
250: where invoice_id = X_invoice_id
251: and payment_num = l_current_payment_num;
252:
253: else

Line 264: debug_info := 'Update AP_PAYMENT_SCHEDULES payment_num '||

260: -- when the commit was invoked. (See the update_liability trigger.)
261: -- Usual locking order is invoices then pay lines,
262: -- so this is consistent.
263: --
264: debug_info := 'Update AP_PAYMENT_SCHEDULES payment_num '||
265: l_current_payment_num;
266:
267: UPDATE ap_payment_schedules
268: SET gross_amount = NVL(gross_amount, 0)+l_current_amount_to_adjust,

Line 267: UPDATE ap_payment_schedules

263: --
264: debug_info := 'Update AP_PAYMENT_SCHEDULES payment_num '||
265: l_current_payment_num;
266:
267: UPDATE ap_payment_schedules
268: SET gross_amount = NVL(gross_amount, 0)+l_current_amount_to_adjust,
269: inv_curr_gross_amount = (
270: SELECT DECODE(F.minimum_accountable_unit,NULL,
271: ROUND( ((NVL(gross_amount, 0)+

Line 303: debug_info := 'Select from AP_PAYMENT_SCHEDULES';

299: -- discount which may need adjustment
300: -- Message to display is AP_PAY_WARN_DISC_UPDATE
301: --
302: if (X_Message1 is null) then
303: debug_info := 'Select from AP_PAYMENT_SCHEDULES';
304:
305: open message1_cursor;
306: debug_info := 'Fetch message1_cursor';
307: fetch message1_cursor into X_Message1;

Line 352: debug_info:= 'Update ap_payment_schedules - set inv_curr_gross_amount';

348: -- Adjust inv_curr_gross_amount for rounding errors
349: --
350: IF (l_inv_curr_sched_total <> X_invoice_amount) THEN
351: --
352: debug_info:= 'Update ap_payment_schedules - set inv_curr_gross_amount';
353: UPDATE AP_PAYMENT_SCHEDULES
354: SET inv_curr_gross_amount = inv_curr_gross_amount
355: + X_Invoice_Amount
356: - l_inv_curr_sched_total

Line 353: UPDATE AP_PAYMENT_SCHEDULES

349: --
350: IF (l_inv_curr_sched_total <> X_invoice_amount) THEN
351: --
352: debug_info:= 'Update ap_payment_schedules - set inv_curr_gross_amount';
353: UPDATE AP_PAYMENT_SCHEDULES
354: SET inv_curr_gross_amount = inv_curr_gross_amount
355: + X_Invoice_Amount
356: - l_inv_curr_sched_total
357: WHERE invoice_id = X_Invoice_Id

Line 359: FROM ap_payment_schedules

355: + X_Invoice_Amount
356: - l_inv_curr_sched_total
357: WHERE invoice_id = X_Invoice_Id
358: AND payment_num = (SELECT MAX(payment_num)
359: FROM ap_payment_schedules
360: WHERE invoice_id = X_Invoice_Id);
361: --
362: END IF;
363: end if;

Line 377: debug_info := 'Insert into AP_PAYMENT_SCHEDULES';

373: fetch payment_num_to_add_cursor into l_payment_num_to_add;
374: debug_info := 'Close payment_num_to_add_cursor';
375: close payment_num_to_add_cursor;
376:
377: debug_info := 'Insert into AP_PAYMENT_SCHEDULES';
378:
379: -- Insert the new payment schedule
380: INSERT INTO ap_payment_schedules(
381: invoice_id, payment_num, due_date,

Line 380: INSERT INTO ap_payment_schedules(

376:
377: debug_info := 'Insert into AP_PAYMENT_SCHEDULES';
378:
379: -- Insert the new payment schedule
380: INSERT INTO ap_payment_schedules(
381: invoice_id, payment_num, due_date,
382: last_update_date, last_updated_by,
383: last_update_login, creation_date, created_by,
384: payment_cross_rate,

Line 420: FROM ap_payment_schedules P

416: p.remit_to_supplier_id,
417: p.remit_to_supplier_site,
418: p.remit_to_supplier_site_id,
419: p.relationship_id
420: FROM ap_payment_schedules P
421: WHERE P.invoice_id = X_invoice_id
422: AND P.payment_num = l_current_payment_num;
423:
424: x_revalidate_ps := 'Y';

Line 445: FROM ap_payment_schedules

441: -- Check if we need to change the payment_status_flag
442: --
443: SELECT sum(amount_remaining)
444: INTO l_sum_ps_amount_remaining
445: FROM ap_payment_schedules
446: WHERE invoice_id = X_invoice_id;
447:
448: if (l_sum_ps_amount_remaining <> 0) then
449: X_payment_status_flag := 'P';

Line 526: from ap_invoices ai,ap_payment_schedules aps

522: aps.gross_amount/decode(ai.pay_curr_invoice_amount, 0, 1,
523: nvl(ai.pay_curr_invoice_amount, 1)),
524: aps.gross_amount -- BUG 3741934
525: into l_wt_amt_to_subtract, l_gross_amount
526: from ap_invoices ai,ap_payment_schedules aps
527: where ai.invoice_id=aps.invoice_id
528: and aps.payment_num=X_payment_num
529: and ai.invoice_id=X_invoice_id;
530:

Line 672: FROM ap_payment_schedules

668: X_Relationship_Id NUMBER
669: ) IS
670: CURSOR C IS
671: SELECT *
672: FROM ap_payment_schedules
673: WHERE invoice_id = X_Invoice_Id
674: AND payment_num = X_Payment_Num
675: FOR UPDATE of invoice_id NOWAIT;
676: Recinfo C%ROWTYPE;

Line 686: 'AP_PAYMENT_SCHEDULES_PKG.LOCK_ROW<-'||X_calling_sequence;

682: BEGIN
683: -- Update the calling sequence
684: --
685: current_calling_sequence :=
686: 'AP_PAYMENT_SCHEDULES_PKG.LOCK_ROW<-'||X_calling_sequence;
687:
688: debug_info := 'Open cursor C';
689: OPEN C;
690: debug_info := 'Fetch cursor C';

Line 943: END AP_PAYMENT_SCHEDULES_PKG;

939: APP_EXCEPTION.RAISE_EXCEPTION;
940:
941: END Lock_Row;
942:
943: END AP_PAYMENT_SCHEDULES_PKG;