DBA Data[Home] [Help]

APPS.AP_APPROVAL_PKG dependencies on AP_PAYMENT_SCHEDULES

Line 2277: FROM ap_payment_schedules aps

2273:
2274: SELECT DECODE(NVL((MAX(aps.last_update_date)- MIN(aps.creation_date)),0),
2275: 0,'N','Y')
2276: INTO l_diff_flag
2277: FROM ap_payment_schedules aps
2278: WHERE aps.invoice_id = l_invoice_id;
2279:
2280: IF (l_diff_flag = 'N') THEN
2281: AP_PPA_PKG.Due_Date_Sweeper(

Line 6757: from ap_payment_schedules_all

6753: where invoice_id = p_invoice_id;
6754:
6755: select count(*)
6756: into l_paid_schd_count
6757: from ap_payment_schedules_all
6758: where invoice_id = p_invoice_id
6759: and nvl(payment_status_flag,'N') <> 'N';
6760:
6761:

Line 6772: Update ap_payment_schedules_all

6768: IF (G_LEVEL_PROCEDURE >= G_CURRENT_RUNTIME_LEVEL) THEN
6769: fnd_file.put_line(FND_FILE.LOG,l_debug_info);
6770: END IF;
6771:
6772: Update ap_payment_schedules_all
6773: set due_date = due_date +(sysdate-l_old_terms_date)
6774: where invoice_id = p_invoice_id
6775: and nvl(payment_status_flag,'N') <> 'Y';
6776:

Line 8177: FROM ap_payment_schedules

8173: --
8174: -- If unapplying prepayment, we want to get the amount paid, else
8175: -- we want to get amount remaining so we won't overapply.
8176: --
8177: FROM ap_payment_schedules
8178: WHERE invoice_id = p_invoice_id
8179: AND (payment_status_flag||'' = 'P'
8180: OR payment_status_flag||'' = DECODE(p_amount_positive, 'N', 'Y', 'N'))
8181: ORDER BY DECODE(p_amount_positive,

Line 8244: UPDATE ap_payment_schedules

8240: +-----------------------------------------------------------------------*/
8241:
8242: l_debug_info := 'Update ap_payment_schedule for the invoice, case 1';
8243:
8244: UPDATE ap_payment_schedules
8245: SET amount_remaining = (amount_remaining -
8246: ap_utilities_pkg.ap_round_currency(
8247: l_apply_amount_remaining,
8248: p_payment_currency_code)),

Line 8279: UPDATE ap_payment_schedules

8275: *----------------------------------------------------------------------*/
8276:
8277: l_debug_info := 'Update ap_payment_schedule for the invoice, case 2';
8278:
8279: UPDATE ap_payment_schedules
8280: SET amount_remaining = DECODE(p_amount_positive,
8281: 'Y', 0,
8282: gross_amount),
8283: payment_status_flag = DECODE(p_amount_positive,

Line 8353: l_inv_amt_remaining ap_payment_schedules.amount_remaining%TYPE := 0;

8349: l_payment_cross_rate ap_invoices.payment_cross_rate%TYPE;
8350: l_pay_curr_code ap_invoices.payment_currency_code%TYPE;
8351: l_num_payments NUMBER := 0;
8352: l_invoice_type ap_invoices.invoice_type_lookup_code%TYPE;--1724924
8353: l_inv_amt_remaining ap_payment_schedules.amount_remaining%TYPE := 0;
8354: l_gross_amount ap_payment_schedules.gross_amount%TYPE := 0;
8355: l_debug_loc VARCHAR2(30) := 'Manual_Withhold_Tax';
8356: l_curr_calling_sequence VARCHAR2(2000);
8357:

Line 8354: l_gross_amount ap_payment_schedules.gross_amount%TYPE := 0;

8350: l_pay_curr_code ap_invoices.payment_currency_code%TYPE;
8351: l_num_payments NUMBER := 0;
8352: l_invoice_type ap_invoices.invoice_type_lookup_code%TYPE;--1724924
8353: l_inv_amt_remaining ap_payment_schedules.amount_remaining%TYPE := 0;
8354: l_gross_amount ap_payment_schedules.gross_amount%TYPE := 0;
8355: l_debug_loc VARCHAR2(30) := 'Manual_Withhold_Tax';
8356: l_curr_calling_sequence VARCHAR2(2000);
8357:
8358: BEGIN

Line 8381: FROM ap_payment_schedules

8377:
8378:
8379: SELECT sum(nvl(amount_remaining,0)), sum(nvl(gross_amount,0))
8380: INTO l_inv_amt_remaining, l_gross_amount
8381: FROM ap_payment_schedules
8382: WHERE invoice_id = p_invoice_id;
8383:
8384: SELECT payment_cross_rate,
8385: payment_currency_code,

Line 8406: update ap_payment_schedules

8402: -- BUG 4344086 : if condition added. If l_gross_amount = 0 means, the
8403: -- invoice is either cancelled or is of 0$
8404: if l_gross_amount = 0
8405: then
8406: update ap_payment_schedules
8407: set amount_remaining = 0
8408: where invoice_id = p_invoice_id;
8409:
8410: elsif ((l_inv_amt_remaining <> 0) and (nvl(l_manual_awt_amount,0) <> 0))

Line 8413: update ap_payment_schedules

8409:
8410: elsif ((l_inv_amt_remaining <> 0) and (nvl(l_manual_awt_amount,0) <> 0))
8411: then
8412:
8413: update ap_payment_schedules
8414: set amount_remaining = (amount_remaining +
8415: ap_utilities_pkg.ap_round_currency(
8416: (amount_remaining * (l_manual_awt_amount/l_inv_amt_remaining)
8417: * l_payment_cross_rate), l_pay_curr_code ) )

Line 8423: update ap_payment_schedules

8419:
8420: elsif ((l_inv_amt_remaining = 0) and (nvl(l_manual_awt_amount,0) <> 0))
8421: then
8422:
8423: update ap_payment_schedules
8424: set amount_remaining =
8425: (amount_remaining +
8426: ap_utilities_pkg.ap_round_currency(
8427: (gross_amount * (l_manual_awt_amount/l_gross_amount)

Line 8468: FROM ap_payment_schedules

8464: p_last_update_login IN NUMBER,
8465: p_calling_sequence IN VARCHAR2) IS
8466: CURSOR Update_payment_schedule IS
8467: SELECT payment_num,gross_amount,amount_remaining
8468: FROM ap_payment_schedules
8469: WHERE invoice_id=p_invoice_id;
8470: l_automatic_awt_amount ap_invoice_distributions.amount%TYPE :=0;
8471: l_payment_cross_rate ap_invoices.payment_cross_rate%TYPE;
8472: l_pay_curr_code ap_invoices.payment_currency_code%TYPE;

Line 8475: l_inv_amt_remaining ap_payment_schedules.amount_remaining%TYPE := 0;

8471: l_payment_cross_rate ap_invoices.payment_cross_rate%TYPE;
8472: l_pay_curr_code ap_invoices.payment_currency_code%TYPE;
8473: l_num_payments NUMBER := 0;
8474: l_invoice_type ap_invoices.invoice_type_lookup_code%TYPE;
8475: l_inv_amt_remaining ap_payment_schedules.amount_remaining%TYPE := 0;
8476: l_gross_amount ap_payment_schedules.gross_amount%TYPE := 0;
8477: l_payment_num ap_payment_schedules.payment_num%TYPE;
8478: l_debug_loc VARCHAR2(30) := 'Update_Pay_Sched_For_Awt';
8479: l_curr_calling_sequence VARCHAR2(2000);

Line 8476: l_gross_amount ap_payment_schedules.gross_amount%TYPE := 0;

8472: l_pay_curr_code ap_invoices.payment_currency_code%TYPE;
8473: l_num_payments NUMBER := 0;
8474: l_invoice_type ap_invoices.invoice_type_lookup_code%TYPE;
8475: l_inv_amt_remaining ap_payment_schedules.amount_remaining%TYPE := 0;
8476: l_gross_amount ap_payment_schedules.gross_amount%TYPE := 0;
8477: l_payment_num ap_payment_schedules.payment_num%TYPE;
8478: l_debug_loc VARCHAR2(30) := 'Update_Pay_Sched_For_Awt';
8479: l_curr_calling_sequence VARCHAR2(2000);
8480: l_wt_amt_to_subtract NUMBER := 0;

Line 8477: l_payment_num ap_payment_schedules.payment_num%TYPE;

8473: l_num_payments NUMBER := 0;
8474: l_invoice_type ap_invoices.invoice_type_lookup_code%TYPE;
8475: l_inv_amt_remaining ap_payment_schedules.amount_remaining%TYPE := 0;
8476: l_gross_amount ap_payment_schedules.gross_amount%TYPE := 0;
8477: l_payment_num ap_payment_schedules.payment_num%TYPE;
8478: l_debug_loc VARCHAR2(30) := 'Update_Pay_Sched_For_Awt';
8479: l_curr_calling_sequence VARCHAR2(2000);
8480: l_wt_amt_to_subtract NUMBER := 0;
8481: BEGIN

Line 8524: update ap_payment_schedules

8520: --===================================================================
8521: --Prorate the automatic AWT against the invoice amount remaining
8522: --===================================================================
8523: if l_gross_amount = 0 then
8524: update ap_payment_schedules
8525: set amount_remaining = 0
8526: where invoice_id = p_invoice_id
8527: and payment_num=l_payment_num;
8528:

Line 8532: update ap_payment_schedules

8528:
8529: elsif ((l_inv_amt_remaining <> 0) and (nvl(l_wt_amt_to_subtract,0) <> 0))
8530: then
8531:
8532: update ap_payment_schedules
8533: set amount_remaining = (amount_remaining -
8534: ap_utilities_pkg.ap_round_currency(
8535: (amount_remaining * ( l_wt_amt_to_subtract/l_inv_amt_remaining)
8536: * l_payment_cross_rate), l_pay_curr_code ) )

Line 8541: update ap_payment_schedules

8537: where invoice_id = p_invoice_id
8538: and payment_num=l_payment_num;
8539:
8540: End If;
8541: update ap_payment_schedules
8542: set payment_status_flag ='Y'
8543: where invoice_id = p_invoice_id
8544: and payment_num=l_payment_num
8545: and amount_remaining = 0

Line 8599: from ap_payment_schedules_all

8595: l_curr_calling_sequence := 'AP_APPROVAL_PKG.createPaymentSchedules <- '||P_calling_sequence;
8596:
8597: select count(*)
8598: into l_schedule_count
8599: from ap_payment_schedules_all
8600: where invoice_id = p_invoice_id;
8601:
8602: -------------------------------------------
8603: l_debug_info := 'createPaymentSchedules - payment schedule count = ' || l_schedule_count;