DBA Data[Home] [Help]

APPS.AP_PAYMENT_SCHEDULES_PKG dependencies on AP_INVOICES

Line 9: -- stored procedure call ap_invoices_pkg.invoice_pre_update()

5: -- PROCEDURE adjust_pay_schedule adjusts the payment schedule of
6: -- a paid or partially paid invoice
7: --
8: -- PRECONDITION: Called from the invoice block in PRE-UPDATE via
9: -- stored procedure call ap_invoices_pkg.invoice_pre_update()
10: -----------------------------------------------------------------------
11: PROCEDURE adjust_pay_schedule (X_invoice_id IN number,
12: X_invoice_amount IN number,
13: X_payment_status_flag IN OUT NOCOPY varchar2,

Line 37: l_payment_currency_code ap_invoices.payment_currency_code%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;
37: l_payment_currency_code ap_invoices.payment_currency_code%TYPE;
38: l_invoice_currency_code ap_invoices.invoice_currency_code%TYPE;
39: l_payment_cross_rate ap_invoices.payment_cross_rate%TYPE;
40: l_pay_curr_invoice_amount ap_invoices.pay_curr_invoice_amount%TYPE;
41: l_pay_curr_orig_inv_amt ap_invoices.pay_curr_invoice_amount%TYPE;

Line 38: l_invoice_currency_code ap_invoices.invoice_currency_code%TYPE;

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;
37: l_payment_currency_code ap_invoices.payment_currency_code%TYPE;
38: l_invoice_currency_code ap_invoices.invoice_currency_code%TYPE;
39: l_payment_cross_rate ap_invoices.payment_cross_rate%TYPE;
40: l_pay_curr_invoice_amount ap_invoices.pay_curr_invoice_amount%TYPE;
41: l_pay_curr_orig_inv_amt ap_invoices.pay_curr_invoice_amount%TYPE;
42: l_pay_curr_net_amt_to_adj number;

Line 39: l_payment_cross_rate ap_invoices.payment_cross_rate%TYPE;

35: l_add_new_payment_schedule varchar2(1) := 'Y';
36: l_sum_ps_amount_remaining number;
37: l_payment_currency_code ap_invoices.payment_currency_code%TYPE;
38: l_invoice_currency_code ap_invoices.invoice_currency_code%TYPE;
39: l_payment_cross_rate ap_invoices.payment_cross_rate%TYPE;
40: l_pay_curr_invoice_amount ap_invoices.pay_curr_invoice_amount%TYPE;
41: l_pay_curr_orig_inv_amt ap_invoices.pay_curr_invoice_amount%TYPE;
42: l_pay_curr_net_amt_to_adj number;
43: l_inv_curr_sched_total number;

Line 40: l_pay_curr_invoice_amount ap_invoices.pay_curr_invoice_amount%TYPE;

36: l_sum_ps_amount_remaining number;
37: l_payment_currency_code ap_invoices.payment_currency_code%TYPE;
38: l_invoice_currency_code ap_invoices.invoice_currency_code%TYPE;
39: l_payment_cross_rate ap_invoices.payment_cross_rate%TYPE;
40: l_pay_curr_invoice_amount ap_invoices.pay_curr_invoice_amount%TYPE;
41: l_pay_curr_orig_inv_amt ap_invoices.pay_curr_invoice_amount%TYPE;
42: l_pay_curr_net_amt_to_adj number;
43: l_inv_curr_sched_total number;
44:

Line 41: l_pay_curr_orig_inv_amt ap_invoices.pay_curr_invoice_amount%TYPE;

37: l_payment_currency_code ap_invoices.payment_currency_code%TYPE;
38: l_invoice_currency_code ap_invoices.invoice_currency_code%TYPE;
39: l_payment_cross_rate ap_invoices.payment_cross_rate%TYPE;
40: l_pay_curr_invoice_amount ap_invoices.pay_curr_invoice_amount%TYPE;
41: l_pay_curr_orig_inv_amt ap_invoices.pay_curr_invoice_amount%TYPE;
42: l_pay_curr_net_amt_to_adj number;
43: l_inv_curr_sched_total number;
44:
45: cursor message1_cursor is

Line 61: from ap_invoices AI,

57: AI.invoice_currency_code,
58: AI.payment_currency_code,
59: AI.payment_cross_rate,
60: nvl(AI.pay_curr_invoice_amount, AI.invoice_amount)
61: from ap_invoices AI,
62: ap_system_parameters SP
63: where invoice_id = X_invoice_id;
64:
65: -- If we're adding a new payment schedule and not adjusting

Line 142: if (ap_invoices_pkg.get_encumbered_flag(X_invoice_id) = 'Y') then

138: -- updates to the invoice (liability) amount in certain cases,
139: -- we want to ensure that these rules are enforced server-side
140: -- as well.
141:
142: if (ap_invoices_pkg.get_encumbered_flag(X_invoice_id) = 'Y') then
143: -- Cannot change the invoice_amount as it is encumbered
144: fnd_message.set_name('SQLAP','AP_INV_ALL_DISTS_ENCUMB');
145: app_exception.raise_exception;
146: elsif (ap_invoices_pkg.get_posting_status(X_invoice_id) = 'Y') then

Line 146: elsif (ap_invoices_pkg.get_posting_status(X_invoice_id) = 'Y') then

142: if (ap_invoices_pkg.get_encumbered_flag(X_invoice_id) = 'Y') then
143: -- Cannot change the invoice_amount as it is encumbered
144: fnd_message.set_name('SQLAP','AP_INV_ALL_DISTS_ENCUMB');
145: app_exception.raise_exception;
146: elsif (ap_invoices_pkg.get_posting_status(X_invoice_id) = 'Y') then
147: -- Cannot change the invoice_amount as it is posted
148: fnd_message.set_name('SQLAP','AP_INV_ALL_DIST_POSTED');
149: app_exception.raise_exception;
150: elsif (ap_invoices_pkg.selected_for_payment_flag(

Line 150: elsif (ap_invoices_pkg.selected_for_payment_flag(

146: elsif (ap_invoices_pkg.get_posting_status(X_invoice_id) = 'Y') then
147: -- Cannot change the invoice_amount as it is posted
148: fnd_message.set_name('SQLAP','AP_INV_ALL_DIST_POSTED');
149: app_exception.raise_exception;
150: elsif (ap_invoices_pkg.selected_for_payment_flag(
151: X_invoice_id) = 'Y') then
152: -- Cannot change the amount as it is selected for payment
153: fnd_message.set_name('SQLAP','AP_INV_SELECTED_INVOICE');
154: app_exception.raise_exception;

Line 246: -- in this case because the table ap_invoices was marked already

242: -- Update the payment schedule.
243: --
244: -- NOTE: This is non-standard to have an update to another table
245: -- called from the pre_update trigger. We anticipate no problems
246: -- in this case because the table ap_invoices was marked already
247: -- when the commit was invoked. (See the update_liability trigger.)
248: -- Usual locking order is invoices then pay lines,
249: -- so this is consistent.
250: --

Line 480: ap_invoices_pkg.get_amount_withheld(ai.invoice_id)*

476: IS
477: l_wt_amt_to_subtract number :=0;
478: BEGIN
479: select nvl(ap_utilities_pkg.ap_round_currency(
480: ap_invoices_pkg.get_amount_withheld(ai.invoice_id)*
481: ai.payment_cross_rate,X_currency_code),0)*
482: X_gross_amount/decode(ai.pay_curr_invoice_amount, 0, 1,
483: nvl(ai.pay_curr_invoice_amount, 1))
484: into l_wt_amt_to_subtract

Line 485: from ap_invoices ai

481: ai.payment_cross_rate,X_currency_code),0)*
482: X_gross_amount/decode(ai.pay_curr_invoice_amount, 0, 1,
483: nvl(ai.pay_curr_invoice_amount, 1))
484: into l_wt_amt_to_subtract
485: from ap_invoices ai
486: where ai.invoice_id=X_invoice_id;
487: return l_wt_amt_to_subtract;
488: END get_amt_withheld_per_sched;
489:

Line 507: ap_invoices_pkg.get_amount_withheld(ai.invoice_id)*

503: BEGIN
504:
505: -- bug 3484292 Added the select stmt below.
506: select nvl(ap_utilities_pkg.ap_round_currency(
507: ap_invoices_pkg.get_amount_withheld(ai.invoice_id)*
508: ai.payment_cross_rate,X_currency_code),0)*
509: aps.gross_amount/decode(ai.pay_curr_invoice_amount, 0, 1,
510: nvl(ai.pay_curr_invoice_amount, 1)),
511: aps.gross_amount -- BUG 3741934

Line 513: from ap_invoices ai,ap_payment_schedules aps

509: aps.gross_amount/decode(ai.pay_curr_invoice_amount, 0, 1,
510: nvl(ai.pay_curr_invoice_amount, 1)),
511: aps.gross_amount -- BUG 3741934
512: into l_wt_amt_to_subtract, l_gross_amount
513: from ap_invoices ai,ap_payment_schedules aps
514: where ai.invoice_id=aps.invoice_id
515: and aps.payment_num=X_payment_num
516: and ai.invoice_id=X_invoice_id;
517:

Line 545: FROM ap_invoices_ready_to_pay_v air, ap_system_parameters asp

541: l_wt_amt_to_subtract,
542: 0)))),
543: X_currency_code),0) --Bug7717053, added the decode
544: INTO l_discount_available
545: FROM ap_invoices_ready_to_pay_v air, ap_system_parameters asp
546: WHERE invoice_id = X_invoice_id
547: AND payment_num = X_payment_num;
548: ELSE l_discount_available := 0;
549: END IF;

Line 575: FROM ap_invoices_ready_to_pay_v

571: -1, second_discount_date,
572: DECODE(SIGN(X_check_date - NVL(third_discount_date,sysdate-9000)-1),
573: -1, third_discount_date, due_date))))
574: INTO l_discount_date
575: FROM ap_invoices_ready_to_pay_v
576: WHERE invoice_id = X_invoice_id
577: AND payment_num = X_payment_num;
578:
579: RETURN l_discount_date;