DBA Data[Home] [Help]

APPS.AP_ACCOUNTING_EVENTS_PKG dependencies on AP_PAYMENT_HISTORY

Line 1735: FROM ap_payment_history

1731: CURSOR c_unacct_pmt_events IS
1732: SELECT accounting_date,
1733: accounting_event_id,
1734: transaction_type
1735: FROM ap_payment_history
1736: WHERE check_id = p_check_id
1737: AND posted_flag <> 'Y'
1738: AND transaction_type IN (PAYMENT_MATURTY_RVRSL_TRX_TYPE, PAYMENT_MATURTY_TRX_TYPE,
1739: PAYMENT_MATURITY_ADJUSTED_TYPE, PAYMENT_CLEARED_TRX_TYPE,

Line 1825: from AP_PAYMENT_HISTORY APH

1821: IF p_event_type = PAYMENT_CANCELLED_TYPE THEN
1822:
1823: select count(*)
1824: into l_matured_events_count
1825: from AP_PAYMENT_HISTORY APH
1826: where check_id = P_check_id
1827: and transaction_type = PAYMENT_MATURTY_TRX_TYPE;
1828:
1829:

Line 1840: from ap_payment_history APH

1836: END IF;
1837:
1838: select count(*)
1839: into l_unmatured_events_count
1840: from ap_payment_history APH
1841: where check_id = p_check_id
1842: and transaction_type = PAYMENT_MATURTY_RVRSL_TRX_TYPE;
1843:
1844: l_log_msg := 'l_unmatured_events_count = '

Line 2305: FROM ap_invoice_payments AIP, ap_payment_history_all APH

2301: -- Payment Adjustment Events.
2302: CURSOR l_invoice_payments_cur IS --bug 7042296
2303: SELECT distinct(AIP.check_id),
2304: APH.accounting_event_id
2305: FROM ap_invoice_payments AIP, ap_payment_history_all APH
2306: WHERE AIP.invoice_id = p_invoice_id
2307: AND AIP.accounting_event_id IS NOT NULL
2308: and AIP.check_id = APH.check_id
2309: and APH.accounting_event_id is not null

Line 3480: l_log_msg := 'Right before insert into ap_payment_history table';

3476: G_MODULE_NAME || l_procedure_name,
3477: l_log_msg);
3478: END IF;
3479:
3480: l_log_msg := 'Right before insert into ap_payment_history table';
3481: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL ) THEN
3482: FND_LOG.STRING(G_LEVEL_STATEMENT,
3483: G_MODULE_NAME || l_procedure_name,
3484: l_log_msg);

Line 3489: INSERT INTO ap_payment_history_all

3485: END IF;
3486:
3487: BEGIN
3488:
3489: INSERT INTO ap_payment_history_all
3490: ( payment_history_id,
3491: check_id,
3492: accounting_date,
3493: transaction_type,

Line 3527: ap_payment_history_s.NEXTVAL, -- payment_history_id

3523: request_id,
3524: org_id,
3525: related_event_id ) -- Bug 5015973 -- Bug 5658623: Adding hint
3526: ( select /*+ Leading(xeg) index(ac ap_checks_u1) */
3527: ap_payment_history_s.NEXTVAL, -- payment_history_id
3528: ac.check_id, -- check_id
3529: trunc(p_accounting_date), -- accounting_date bug6602676
3530: l_event_type, -- transaction_type
3531: 'N', -- posted_flag

Line 3573: FROM ap_payment_history_all aph,

3569: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL ) THEN
3570:
3571: SELECT COUNT(*)
3572: INTO l_count
3573: FROM ap_payment_history_all aph,
3574: ap_checks_all ac
3575: WHERE aph.check_id = ac.check_id
3576: AND ac.completed_pmts_group_id = p_completed_pmts_group_id
3577: AND ac.org_id = p_org_id;

Line 3589: FROM ap_payment_history_all aph,

3585: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL ) THEN
3586:
3587: SELECT accounting_event_id
3588: INTO l_count
3589: FROM ap_payment_history_all aph,
3590: ap_checks_all ac
3591: WHERE aph.check_id = ac.check_id
3592: AND ac.completed_pmts_group_id = p_completed_pmts_group_id
3593: AND ac.org_id = p_org_id

Line 3604: l_log_msg := 'unknown exception when try to insert ap_payment_history table';

3600: END IF;
3601:
3602: EXCEPTION
3603: WHEN OTHERS THEN
3604: l_log_msg := 'unknown exception when try to insert ap_payment_history table';
3605: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL ) THEN
3606: FND_LOG.STRING(G_LEVEL_STATEMENT,
3607: G_MODULE_NAME || l_procedure_name,
3608: l_log_msg);

Line 3612: l_log_msg := 'After insert ap_payment_history_table and end the procedure';

3608: l_log_msg);
3609: END IF;
3610: END;
3611:
3612: l_log_msg := 'After insert ap_payment_history_table and end the procedure';
3613: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL ) THEN
3614: FND_LOG.STRING(G_LEVEL_STATEMENT,
3615: G_MODULE_NAME || l_procedure_name,
3616: l_log_msg);

Line 4476: FROM AP_Payment_History APH

4472: AND NVL(AIP.reversal_flag, 'N') <> 'Y'
4473: AND AIP.reversal_inv_pmt_id IS NULL
4474: -- Bug 6890810. Added the subquery
4475: AND NOT EXISTS (SELECT 'Upgraded Payment'
4476: FROM AP_Payment_History APH
4477: WHERE APH.Check_ID = AIP.Check_ID
4478: AND NVL(APH.Historical_Flag, 'N') = 'Y');
4479:
4480:

Line 4485: FROM ap_payment_history APH,

4481: /* BUG # 7560346 added DISTINCT keyword */
4482: CURSOR l_payment_clearings_cur IS
4483: SELECT DISTINCT APH.check_id,
4484: APH.accounting_date
4485: FROM ap_payment_history APH,
4486: ap_invoice_payments AIP
4487: WHERE AIP.invoice_id = p_invoice_id
4488: AND AIP.check_id = APH.check_id
4489: AND APH.transaction_type = 'PAYMENT CLEARING'

Line 4498: FROM ap_payment_history APH1

4494: AND APH.posted_flag = 'Y'
4495: /* bug # 7604906 End */
4496: AND NVL(APH.Historical_Flag, 'N') <> 'Y' -- Bug 6890810
4497: AND NOT EXISTS( SELECT 'PAYMENT UNCLEARING EXISTS'
4498: FROM ap_payment_history APH1
4499: WHERE APH1.rev_pmt_hist_id = APH.payment_history_id
4500: AND APH1.transaction_type = 'PAYMENT UNCLEARING');
4501:
4502: /* BUG # 7560346 added DISTINCT keyword */

Line 4506: FROM ap_payment_history APH,

4502: /* BUG # 7560346 added DISTINCT keyword */
4503: CURSOR l_payment_maturities_cur IS
4504: SELECT DISTINCT APH.check_id,
4505: APH.accounting_date
4506: FROM ap_payment_history APH,
4507: ap_invoice_payments AIP
4508: WHERE AIP.invoice_id = p_invoice_id
4509: AND AIP.check_id = APH.check_id
4510: AND APH.transaction_type = 'PAYMENT MATURITY'

Line 4514: FROM ap_payment_history APH1

4510: AND APH.transaction_type = 'PAYMENT MATURITY'
4511: AND AIP.posted_flag = 'Y'
4512: AND NVL(APH.Historical_Flag, 'N') <> 'Y' -- Bug 6890810
4513: AND NOT EXISTS( SELECT 'PAYMENT MATURITY REVERSAL EXISTS'
4514: FROM ap_payment_history APH1
4515: WHERE APH1.rev_pmt_hist_id = APH.payment_history_id
4516: AND APH1.transaction_type = 'PAYMENT MATURITY REVERSAL');
4517:
4518: -- add cursor for bug fix 5694577

Line 4569: l_bank_curr_code ap_payment_history_all.bank_currency_code%TYPE; ---7337949

4565:
4566: l_event_type xla_events.event_type_code%TYPE;
4567: l_pay_type ap_checks_all.payment_type_flag%TYPE;
4568: l_automatic_offsets_flag ap_system_parameters_all.automatic_offsets_flag%TYPE; ---7209263
4569: l_bank_curr_code ap_payment_history_all.bank_currency_code%TYPE; ---7337949
4570:
4571:
4572: BEGIN
4573:

Line 4844: FROM ap_payment_history_all APH

4840: ---added to pick bank_currency_code from payment clearing for bug 7337949
4841:
4842: SELECT aph.bank_currency_code
4843: INTO l_bank_curr_code
4844: FROM ap_payment_history_all APH
4845: WHERE APH.check_id = l_pay_clear_check_ids(i)
4846: AND APH.transaction_type = 'PAYMENT CLEARING'
4847: --added for bug 7614505
4848: AND NOT EXISTS( SELECT 'PAYMENT UNCLEARING EXISTS'

Line 4849: FROM ap_payment_history_all APH1

4845: WHERE APH.check_id = l_pay_clear_check_ids(i)
4846: AND APH.transaction_type = 'PAYMENT CLEARING'
4847: --added for bug 7614505
4848: AND NOT EXISTS( SELECT 'PAYMENT UNCLEARING EXISTS'
4849: FROM ap_payment_history_all APH1
4850: WHERE APH1.rev_pmt_hist_id = APH.payment_history_id
4851: AND APH1.transaction_type = 'PAYMENT UNCLEARING'
4852: AND APH1.check_id = APH.check_id);
4853:

Line 5564: FROM ap_payment_history APH

5560:
5561: /* Get the accounting date of 'clearing' payment history */
5562: SELECT APH.accounting_date
5563: INTO l_accounting_date
5564: FROM ap_payment_history APH
5565: WHERE APH.payment_history_id =
5566: (SELECT max(payment_history_id)
5567: FROM ap_payment_history APH2
5568: WHERE APH2.check_id = p_check_id

Line 5567: FROM ap_payment_history APH2

5563: INTO l_accounting_date
5564: FROM ap_payment_history APH
5565: WHERE APH.payment_history_id =
5566: (SELECT max(payment_history_id)
5567: FROM ap_payment_history APH2
5568: WHERE APH2.check_id = p_check_id
5569: AND APH2.posted_flag = 'N'
5570: AND APH2.transaction_type = 'PAYMENT CLEARING');
5571:

Line 5606: FROM ap_payment_history APH

5602: ELSIF (p_event_type_code = PAYMENT_MATURITY_REVERSED_TYPE) THEN
5603:
5604: SELECT APH.accounting_date
5605: INTO l_accounting_date
5606: FROM ap_payment_history APH
5607: WHERE payment_history_id =
5608: (SELECT max(payment_history_id)
5609: FROM ap_payment_history APH2
5610: WHERE APH2.check_id = p_check_id

Line 5609: FROM ap_payment_history APH2

5605: INTO l_accounting_date
5606: FROM ap_payment_history APH
5607: WHERE payment_history_id =
5608: (SELECT max(payment_history_id)
5609: FROM ap_payment_history APH2
5610: WHERE APH2.check_id = p_check_id
5611: AND APH2.posted_flag = 'N'
5612: AND APH2.transaction_type = 'PAYMENT MATURITY');
5613:

Line 5793: ap_payment_history_all APH,

5789: WHERE AIP.check_id = APH.check_id
5790: AND ROWNUM = 1
5791: ) ledger_id
5792: FROM
5793: ap_payment_history_all APH,
5794: ap_checks_all AC
5795: WHERE
5796: APH.check_id = AC.check_id
5797: AND AP_UTILITIES_PKG.GET_CURRENT_GL_DATE(TRUNC(APH.accounting_date), aph.org_id) --bug5956469

Line 5832: ap_payment_history_all APH,

5828: WHERE AIP.check_id = APH.check_id
5829: AND ROWNUM = 1
5830: ) ledger_id
5831: FROM
5832: ap_payment_history_all APH,
5833: ap_checks_all AC
5834: WHERE
5835: APH.check_id = AC.check_id
5836: AND APH.accounting_date BETWEEN p_from_date AND p_to_date

Line 6242: FROM ap_payment_history_all APH,

6238: FROM ap_invoice_payments_all AIP
6239: WHERE AIP.check_id = APH.check_id
6240: AND ROWNUM = 1
6241: ) ledger_id
6242: FROM ap_payment_history_all APH,
6243: ap_checks_all AC
6244: WHERE APH.check_id = AC.check_id
6245: AND APH.org_id = AC.org_id
6246: AND AP_UTILITIES_PKG.GET_CURRENT_GL_DATE(TRUNC(APH.accounting_date), aph.org_id) --bug5956469

Line 6261: FROM ap_payment_history_all APH,

6257: FROM ap_invoice_payments_all AIP
6258: WHERE AIP.check_id = APH.check_id
6259: AND ROWNUM = 1
6260: ) ledger_id
6261: FROM ap_payment_history_all APH,
6262: ap_checks_all AC
6263: WHERE APH.check_id = AC.check_id
6264: AND APH.org_id = AC.org_id
6265: AND APH.accounting_date BETWEEN p_from_date AND p_to_date