DBA Data[Home] [Help]

APPS.AP_WITHHOLDING_PKG dependencies on AP_SELECTED_INVOICES_ALL

Line 552: FROM ap_selected_invoices_all

548: END IF;
549:
550: SELECT DISTINCT payment_exchange_rate /* Bug 9666111 added distinct */
551: INTO l_exchange_rate
552: FROM ap_selected_invoices_all
553: WHERE invoice_id = P_Invoice_Id;
554: ELSE
555: debug_info := 'Inside VALIDATION';
556: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN

Line 2948: FROM ap_SELECTed_invoices_all ASI,

2944: IS
2945: SELECT invoice_id
2946: , vendor_id
2947: , payment_num
2948: FROM ap_SELECTed_invoices_all ASI,
2949: ap_system_parameters_all asp
2950: WHERE checkrun_name = l_checkrun_name
2951: AND original_invoice_id IS NULL
2952: AND asp.org_id = asi.org_id

Line 3014: UPDATE ap_SELECTed_invoices_all

3010:
3011: -- DO Withholding for all OK to pay SELECTed invoices in thIS checkrun
3012: -- that have No Manual AWT dists
3013:
3014: UPDATE ap_SELECTed_invoices_all
3015: SET ok_to_pay_flag = 'Y',
3016: proposed_payment_amount = invoice_amount * payment_cross_rate,
3017: -- We cannot round the proposed_payment_amount here since we don't
3018: -- have payment_currency_code. We will round it later.

Line 3042: FROM ap_SELECTed_invoices_all ASI,

3038: , AI.payment_currency_code
3039: , NVL(asp.awt_include_discount_amt, 'N') include_discount_amt
3040: , asp.base_currency_code
3041: , NVL(ASI.payment_exchange_rate,1) payment_exchange_rate --bug 8590059
3042: FROM ap_SELECTed_invoices_all ASI,
3043: ap_invoices_all AI,
3044: ap_system_parameters_all asp
3045: WHERE ASI.checkrun_name = l_checkrun_name
3046: AND asi.checkrun_id = l_checkrun_id

Line 3156: FROM ap_selected_invoices_all

3152: END IF;
3153:
3154: SELECT /*invoice_amount,*/ amount_remaining /*Bug 14530960*/
3155: INTO /*l_invoice_amount,*/ l_amount_remaining /*Bug 14530960*/
3156: FROM ap_selected_invoices_all
3157: WHERE invoice_id = rec_ok_sel_invs.invoice_id
3158: AND checkrun_name = p_checkrun_name
3159: and checkrun_id = p_checkrun_id
3160: AND payment_num = rec_ok_sel_invs.payment_num;

Line 3191: FROM ap_SELECTed_invoices_all

3187: --Get the total amount of the invoices SELECTed in the batch.
3188: SELECT SUM(NVL(payment_amount,0)) +
3189: SUM((-1) * NVL(withholding_amount,0))
3190: INTO l_total_amount
3191: FROM ap_SELECTed_invoices_all
3192: WHERE checkrun_name = p_checkrun_name
3193: and checkrun_id = p_checkrun_id
3194: AND NVL(ok_to_pay_flag,'Y') in ( 'Y','F');
3195:

Line 3199: FROM ap_selected_invoices_all

3195:
3196: --Get the count of credit AND debit memos in the batch.
3197: Select COUNT(*)
3198: INTO l_count
3199: FROM ap_selected_invoices_all
3200: WHERE checkrun_name = p_checkrun_name
3201: and checkrun_id = p_checkrun_id
3202: AND NVL(ok_to_pay_flag,'Y') IN ( 'Y','F')
3203: AND invoice_amount < 0;

Line 3217: FROM ap_selected_invoices_all

3213:
3214: SELECT (-1) * (SUM(NVL(payment_amount,0) +
3215: NVL(ABS(withholding_amount),0)))
3216: INTO l_subject_amount
3217: FROM ap_selected_invoices_all
3218: WHERE payment_amount > 0
3219: AND NVL(ok_to_pay_flag,'Y') in ( 'Y','F')
3220: AND checkrun_name = p_checkrun_name
3221: and checkrun_id = p_checkrun_id;

Line 3230: FROM ap_selected_invoices_all

3226: IF l_count > 1 THEN
3227: SELECT (-1) * (SUM(NVL(ABS(payment_amount),0) +
3228: NVL(withholding_amount,0)))
3229: INTO l_amountapplied
3230: FROM ap_selected_invoices_all
3231: WHERE NVL(withholding_amount,0) > 0
3232: AND NVL(ok_to_pay_flag,'Y') in ( 'Y','F')
3233: AND checkrun_name = p_checkrun_name
3234: and checkrun_id = p_checkrun_id;

Line 3324: UPDATE ap_selected_invoices_all ASI

3320: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
3321: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||DBG_Loc,debug_info);
3322: END IF;
3323:
3324: UPDATE ap_selected_invoices_all ASI
3325: SET /*ASI.proposed_payment_amount =
3326: ap_utilities_pkg.ap_round_currency(
3327: ASI.proposed_payment_amount,rec_ok_sel_invs.payment_currency_code) -
3328: l_withholding_amount

Line 3348: UPDATE ap_SELECTed_invoices_all ASI

3344: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
3345: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||DBG_Loc,debug_info);
3346: END IF;
3347:
3348: UPDATE ap_SELECTed_invoices_all ASI
3349: SET ASI.ok_to_pay_flag = 'N',
3350: ASI.dont_pay_reason_code = 'AWT ERROR',
3351: ASI.dont_pay_description = substr(l_awt_success, 1, 255)
3352: WHERE current of c_ok_sel_invs;

Line 3424: FROM ap_selected_invoices_all ASI,

3420: CURSOR c_ok_sel_invs IS
3421: SELECT ASI.invoice_id,
3422: ASI.payment_num,
3423: p_check_date payment_date
3424: FROM ap_selected_invoices_all ASI,
3425: iby_fd_docs_payable_v ibydocs
3426: WHERE ASI.checkrun_name = p_checkrun_name
3427: AND ASI.original_invoice_id IS NULL
3428: and asi.checkrun_id = p_checkrun_id

Line 3550: FROM ap_SELECTed_invoices_all ASI

3546: IS
3547: SELECT ASI.invoice_id
3548: , ASI.payment_num
3549: , AI.vendor_id
3550: FROM ap_SELECTed_invoices_all ASI
3551: , ap_invoices_all AI
3552: WHERE ASI.checkrun_name = l_checkrun_name
3553: AND AI.invoice_id = ASI.invoice_id
3554: and asi.checkrun_id = l_checkrun_id;

Line 3562: FROM ap_SELECTed_invoices_all ASI

3558: CURSOR C_sel_invs is
3559: SELECT ASI.invoice_id
3560: , ASI.payment_num
3561: , AI.vendor_id
3562: FROM ap_SELECTed_invoices_all ASI
3563: , ap_invoices_all AI
3564: , iby_fd_docs_payable_v ibydocs
3565: WHERE ASI.checkrun_name = p_checkrun_name
3566: AND AI.invoice_id = ASI.invoice_id

Line 4029: /* Bug 12433018 Moved updates to ap_selected_invoices_all and the delete

4025: END IF;
4026:
4027: CLOSE c_temp;
4028:
4029: /* Bug 12433018 Moved updates to ap_selected_invoices_all and the delete
4030: outside the loop */
4031: IF (P_Calling_Module = 'AUTOSELECT') THEN
4032: debug_info := 'Update ap selected invoices';
4033: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN

Line 4037: /* Note the withholding_amount in ap_selected_invoices_all is already in the

4033: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
4034: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||DBG_Loc,debug_info);
4035: END IF;
4036:
4037: /* Note the withholding_amount in ap_selected_invoices_all is already in the
4038: payment currency. See ap_withhold_autoslect where it is updated.
4039: ap_undo_temp_withholding is also called at the beginning of the
4040: ap_withhold_autoselect procedure so it also has to properly handle the case
4041: where no withholding has been calculated yet. */

Line 4042: UPDATE ap_selected_invoices_all si

4038: payment currency. See ap_withhold_autoslect where it is updated.
4039: ap_undo_temp_withholding is also called at the beginning of the
4040: ap_withhold_autoselect procedure so it also has to properly handle the case
4041: where no withholding has been calculated yet. */
4042: UPDATE ap_selected_invoices_all si
4043: SET proposed_payment_amount = nvl(proposed_payment_amount,0) + NVL(withholding_amount,0)
4044: , payment_amount = nvl(proposed_payment_amount,0) + NVL(withholding_amount,0)
4045: , withholding_amount = 0
4046: WHERE checkrun_name = p_checkrun_name