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: --8891266

Line 66: from ap_invoices AI,

62: AI.payment_currency_code,
63: AI.payment_cross_rate,
64: nvl(AI.amount_paid,0), --bug 8891266
65: nvl(AI.pay_curr_invoice_amount, AI.invoice_amount)
66: from ap_invoices AI,
67: ap_system_parameters SP
68: where invoice_id = X_invoice_id;
69:
70: -- If we're adding a new payment schedule and not adjusting

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

149: l_recouped_amount := AP_MATCHING_UTILS_PKG.Get_Inv_Line_Recouped_Amount
150: (P_Invoice_Id => X_invoice_id,
151: P_Invoice_Line_Number => Null);
152:
153: if (ap_invoices_pkg.get_encumbered_flag(X_invoice_id) = 'Y') then
154: -- Cannot change the invoice_amount as it is encumbered
155: fnd_message.set_name('SQLAP','AP_INV_ALL_DISTS_ENCUMB');
156: app_exception.raise_exception;
157: elsif (ap_invoices_pkg.get_posting_status(X_invoice_id) = 'Y') then

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

153: if (ap_invoices_pkg.get_encumbered_flag(X_invoice_id) = 'Y') then
154: -- Cannot change the invoice_amount as it is encumbered
155: fnd_message.set_name('SQLAP','AP_INV_ALL_DISTS_ENCUMB');
156: app_exception.raise_exception;
157: elsif (ap_invoices_pkg.get_posting_status(X_invoice_id) = 'Y') then
158: -- Cannot change the invoice_amount as it is posted
159: fnd_message.set_name('SQLAP','AP_INV_ALL_DIST_POSTED');
160: app_exception.raise_exception;
161: elsif (ap_invoices_pkg.selected_for_payment_flag(

Line 161: elsif (ap_invoices_pkg.selected_for_payment_flag(

157: elsif (ap_invoices_pkg.get_posting_status(X_invoice_id) = 'Y') then
158: -- Cannot change the invoice_amount as it is posted
159: fnd_message.set_name('SQLAP','AP_INV_ALL_DIST_POSTED');
160: app_exception.raise_exception;
161: elsif (ap_invoices_pkg.selected_for_payment_flag(
162: X_invoice_id) = 'Y') then
163: -- Cannot change the amount as it is selected for payment
164: fnd_message.set_name('SQLAP','AP_INV_SELECTED_INVOICE');
165: app_exception.raise_exception;

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

255: -- Update the payment schedule.
256: --
257: -- NOTE: This is non-standard to have an update to another table
258: -- called from the pre_update trigger. We anticipate no problems
259: -- in this case because the table ap_invoices was marked already
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: --

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

489: IS
490: l_wt_amt_to_subtract number :=0;
491: BEGIN
492: select nvl(ap_utilities_pkg.ap_round_currency(
493: ap_invoices_pkg.get_amount_withheld(ai.invoice_id)*
494: ai.payment_cross_rate,X_currency_code),0)*
495: X_gross_amount/decode(ai.pay_curr_invoice_amount, 0, 1,
496: nvl(ai.pay_curr_invoice_amount, 1))
497: into l_wt_amt_to_subtract

Line 498: from ap_invoices ai

494: ai.payment_cross_rate,X_currency_code),0)*
495: X_gross_amount/decode(ai.pay_curr_invoice_amount, 0, 1,
496: nvl(ai.pay_curr_invoice_amount, 1))
497: into l_wt_amt_to_subtract
498: from ap_invoices ai
499: where ai.invoice_id=X_invoice_id;
500: return l_wt_amt_to_subtract;
501: END get_amt_withheld_per_sched;
502:

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

516: BEGIN
517:
518: -- bug 3484292 Added the select stmt below.
519: select nvl(ap_utilities_pkg.ap_round_currency(
520: ap_invoices_pkg.get_amount_withheld(ai.invoice_id)*
521: ai.payment_cross_rate,X_currency_code),0)*
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

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 558: FROM ap_invoices_ready_to_pay_v air, ap_system_parameters_all asp

554: l_wt_amt_to_subtract,
555: 0)))),
556: X_currency_code),0) --Bug7717053, added the decode
557: INTO l_discount_available
558: FROM ap_invoices_ready_to_pay_v air, ap_system_parameters_all asp
559: WHERE invoice_id = X_invoice_id
560: AND payment_num = X_payment_num
561: AND air.org_id = asp.org_id; --Added for bug #8506044;
562: ELSE l_discount_available := 0;

Line 589: FROM ap_invoices_ready_to_pay_v

585: -1, second_discount_date,
586: DECODE(SIGN(X_check_date - NVL(third_discount_date,sysdate-9000)-1),
587: -1, third_discount_date, due_date))))
588: INTO l_discount_date
589: FROM ap_invoices_ready_to_pay_v
590: WHERE invoice_id = X_invoice_id
591: AND payment_num = X_payment_num;
592:
593: RETURN l_discount_date;