DBA Data[Home] [Help]

APPS.AP_ACCOUNTING_EVENTS_PKG dependencies on AP_PAYMENT_HISTORY

Line 1996: FROM ap_payment_history aph

1992: CURSOR c_unacct_pmt_events IS
1993: SELECT accounting_date,
1994: accounting_event_id,
1995: transaction_type
1996: FROM ap_payment_history aph
1997: WHERE check_id = p_check_id
1998: AND posted_flag <> 'Y'
1999: AND transaction_type IN (PAYMENT_MATURTY_RVRSL_TRX_TYPE, PAYMENT_MATURTY_TRX_TYPE,
2000: PAYMENT_MATURITY_ADJUSTED_TYPE, PAYMENT_CLEARED_TRX_TYPE,

Line 2004: FROM ap_payment_history_all aphp,

2000: PAYMENT_MATURITY_ADJUSTED_TYPE, PAYMENT_CLEARED_TRX_TYPE,
2001: PAYMENT_UNCLEARED_TRX_TYPE, PAYMENT_CLEARING_ADJUSTED_TYPE)
2002: AND NOT EXISTS
2003: (SELECT 1
2004: FROM ap_payment_history_all aphp,
2005: xla_events xe,
2006: ap_system_parameters_all asp
2007: WHERE aph.check_id = aphp.check_id
2008: AND aphp.payment_history_id = aph.rev_pmt_hist_id

Line 2022: FROM ap_payment_history aph

2018: UNION
2019: SELECT accounting_date,
2020: accounting_event_id,
2021: transaction_type
2022: FROM ap_payment_history aph
2023: WHERE check_id = p_check_id
2024: AND posted_flag <> 'Y'
2025: AND transaction_type IN (PAYMENT_MATURTY_RVRSL_TRX_TYPE, PAYMENT_MATURTY_TRX_TYPE,
2026: PAYMENT_CLEARED_TRX_TYPE, PAYMENT_UNCLEARED_TRX_TYPE)

Line 2029: FROM ap_payment_history_all aphp,

2025: AND transaction_type IN (PAYMENT_MATURTY_RVRSL_TRX_TYPE, PAYMENT_MATURTY_TRX_TYPE,
2026: PAYMENT_CLEARED_TRX_TYPE, PAYMENT_UNCLEARED_TRX_TYPE)
2027: AND NOT EXISTS
2028: (SELECT 1
2029: FROM ap_payment_history_all aphp,
2030: xla_events xe
2031: WHERE aph.check_id = aphp.check_id
2032: AND aphp.payment_history_id = aph.rev_pmt_hist_id
2033: AND aphp.posted_flag = 'Y'

Line 2044: FROM ap_payment_history aph, ap_system_parameters asp

2040: CURSOR c_pmt_acct_clearing_only IS
2041: SELECT aph.accounting_date,
2042: aph.accounting_event_id,
2043: aph.transaction_type
2044: FROM ap_payment_history aph, ap_system_parameters asp
2045: WHERE aph.check_id = p_check_id
2046: AND aph.org_id = asp.org_id
2047: AND asp.when_to_account_pmt = 'CLEARING ONLY'
2048: AND aph.posted_flag <> 'Y'

Line 2138: FROM ap_payment_history_all aph

2134: WHERE ac.check_id =l_event_source_info.source_id_int_1
2135: AND ac.org_id = asp.org_id
2136: AND exists (
2137: SELECT 1
2138: FROM ap_payment_history_all aph
2139: WHERE ac.check_id = aph.check_id
2140: AND aph.transaction_type = PAYMENT_MATURTY_TRX_TYPE
2141: )
2142: AND(

Line 2167: FROM ap_payment_history_all aph

2163: WHERE ac.check_id =l_event_source_info.source_id_int_1
2164: AND ac.org_id = asp.org_id
2165: /*AND not exists (
2166: SELECT 1
2167: FROM ap_payment_history_all aph
2168: WHERE ac.check_id = aph.check_id
2169: AND aph.transaction_type = PAYMENT_MATURTY_TRX_TYPE
2170: )*/ /* bug 13616704 */
2171: AND(

Line 2195: FROM ap_payment_history_all aph

2191: WHERE ac.check_id =l_event_source_info.source_id_int_1
2192: AND ac.org_id = asp.org_id
2193: AND exists (
2194: SELECT 1
2195: FROM ap_payment_history_all aph
2196: WHERE ac.check_id = aph.check_id
2197: AND aph.transaction_type = PAYMENT_MATURTY_TRX_TYPE
2198: )
2199: AND(

Line 2221: FROM ap_payment_history_all aph

2217: WHERE ac.check_id =l_event_source_info.source_id_int_1
2218: AND ac.org_id = asp.org_id
2219: AND not exists (
2220: SELECT 1
2221: FROM ap_payment_history_all aph
2222: WHERE ac.check_id = aph.check_id
2223: AND aph.transaction_type = PAYMENT_MATURTY_TRX_TYPE
2224: )
2225: AND(

Line 2273: from AP_PAYMENT_HISTORY APH

2269: IF (p_event_type IN (PAYMENT_CANCELLED_TYPE, REFUND_CANCELLED_TYPE)) THEN
2270:
2271: select count(*)
2272: into l_matured_events_count
2273: from AP_PAYMENT_HISTORY APH
2274: where check_id = P_check_id
2275: and transaction_type = PAYMENT_MATURTY_TRX_TYPE;
2276:
2277:

Line 2288: from ap_payment_history APH

2284: END IF;
2285:
2286: select count(*)
2287: into l_unmatured_events_count
2288: from ap_payment_history APH
2289: where check_id = p_check_id
2290: and transaction_type = PAYMENT_MATURTY_RVRSL_TRX_TYPE;
2291:
2292: l_log_msg := 'l_unmatured_events_count = '

Line 2825: FROM ap_invoice_payments AIP, ap_payment_history_all APH

2821: -- Payment Adjustment Events.
2822: CURSOR l_invoice_payments_cur IS --bug 7042296
2823: SELECT distinct(AIP.check_id),
2824: APH.accounting_event_id
2825: FROM ap_invoice_payments AIP, ap_payment_history_all APH
2826: WHERE AIP.invoice_id = p_invoice_id
2827: AND AIP.accounting_event_id IS NOT NULL
2828: and AIP.check_id = APH.check_id
2829: and APH.accounting_event_id is not null

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

4013: G_MODULE_NAME || l_procedure_name,
4014: l_log_msg);
4015: END IF;
4016:
4017: l_log_msg := 'Right before insert into ap_payment_history table';
4018: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL ) THEN
4019: FND_LOG.STRING(G_LEVEL_STATEMENT,
4020: G_MODULE_NAME || l_procedure_name,
4021: l_log_msg);

Line 4026: INSERT INTO ap_payment_history_all

4022: END IF;
4023:
4024: BEGIN
4025:
4026: INSERT INTO ap_payment_history_all
4027: ( payment_history_id,
4028: check_id,
4029: accounting_date,
4030: transaction_type,

Line 4064: ap_payment_history_s.NEXTVAL, -- payment_history_id

4060: request_id,
4061: org_id,
4062: related_event_id ) -- Bug 5015973 -- Bug 5658623: Adding hint
4063: ( select /*+ Leading(xeg) index(ac ap_checks_u1) */
4064: ap_payment_history_s.NEXTVAL, -- payment_history_id
4065: ac.check_id, -- check_id
4066: trunc(p_accounting_date), -- accounting_date bug6602676
4067: l_event_type, -- transaction_type
4068: 'N', -- posted_flag

Line 4110: FROM ap_payment_history_all aph,

4106: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL ) THEN
4107:
4108: SELECT COUNT(*)
4109: INTO l_count
4110: FROM ap_payment_history_all aph,
4111: ap_checks_all ac
4112: WHERE aph.check_id = ac.check_id
4113: AND ac.completed_pmts_group_id = p_completed_pmts_group_id
4114: AND ac.org_id = p_org_id;

Line 4126: FROM ap_payment_history_all aph,

4122: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL ) THEN
4123:
4124: SELECT accounting_event_id
4125: INTO l_count
4126: FROM ap_payment_history_all aph,
4127: ap_checks_all ac
4128: WHERE aph.check_id = ac.check_id
4129: AND ac.completed_pmts_group_id = p_completed_pmts_group_id
4130: AND ac.org_id = p_org_id

Line 4141: l_log_msg := 'unknown exception '||SQLERRM||' when try to insert ap_payment_history table';

4137: END IF;
4138:
4139: EXCEPTION
4140: WHEN OTHERS THEN
4141: l_log_msg := 'unknown exception '||SQLERRM||' when try to insert ap_payment_history table';
4142: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL ) THEN
4143: FND_LOG.STRING(G_LEVEL_STATEMENT,
4144: G_MODULE_NAME || l_procedure_name,
4145: l_log_msg);

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

4148: APP_EXCEPTION.RAISE_EXCEPTION(); --14279929
4149:
4150: END;
4151:
4152: l_log_msg := 'After insert ap_payment_history_table and end the procedure';
4153: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL ) THEN
4154: FND_LOG.STRING(G_LEVEL_STATEMENT,
4155: G_MODULE_NAME || l_procedure_name,
4156: l_log_msg);

Line 5100: FROM AP_Payment_History APH

5096: AND XE.application_id = 200
5097: AND XE.event_status_code <> 'N'
5098: -- Bug 6890810. Added the subquery
5099: AND NOT EXISTS (SELECT 'Either Upgraded Payment OR Unaccounted Pay Adj Exists'
5100: FROM AP_Payment_History APH
5101: WHERE APH.Check_ID = AIP.Check_ID
5102: AND (NVL(APH.Historical_Flag, 'N') = 'Y'
5103: OR (APH.invoice_adjustment_event_id = p_adj_accounting_event_id
5104: AND APH.transaction_type in ( PAYMENT_ADJUSTED_TYPE,REFUND_ADJUSTED_TYPE) --bug9726978,13963864

Line 5107: FROM AP_Payment_History APH

5103: OR (APH.invoice_adjustment_event_id = p_adj_accounting_event_id
5104: AND APH.transaction_type in ( PAYMENT_ADJUSTED_TYPE,REFUND_ADJUSTED_TYPE) --bug9726978,13963864
5105: AND NVL(APH.posted_flag, 'N') <> 'Y'))) --bug 9226273
5106: AND NOT EXISTS (SELECT 'Voided but not yet insterted into AIP' --bug8214188
5107: FROM AP_Payment_History APH
5108: WHERE APH.Check_ID = AIP.Check_ID
5109: AND APH.transaction_type='PAYMENT CANCELLED')
5110: AND EXISTS (SELECT 'INVOICE DIST WITH INV ADJ EVENT ID'
5111: FROM ap_invoice_distributions aid

Line 5122: FROM ap_payment_history APH,

5118: /* BUG # 7560346 added DISTINCT keyword */
5119: CURSOR l_payment_clearings_cur IS
5120: SELECT DISTINCT APH.check_id,
5121: APH.accounting_date
5122: FROM ap_payment_history APH,
5123: ap_invoice_payments AIP,
5124: xla_events XE
5125: WHERE AIP.invoice_id = p_invoice_id
5126: AND AIP.check_id = APH.check_id

Line 5140: FROM AP_Payment_History APH

5136: /* bug # 7604906 End */
5137: /* bug 8325874 commented the line below and added subquery */
5138: --AND NVL(APH.Historical_Flag, 'N') <> 'Y' -- Bug 6890810
5139: AND NOT EXISTS (SELECT 'Either Upgraded Payment OR Unaccounted Pay Adj Exists'
5140: FROM AP_Payment_History APH
5141: WHERE APH.Check_ID = AIP.Check_ID
5142: AND (NVL(APH.Historical_Flag, 'N') = 'Y'
5143: OR (APH.invoice_adjustment_event_id = p_adj_accounting_event_id
5144: AND APH.transaction_type = PAYMENT_CLEARING_ADJUSTED_TYPE

Line 5148: FROM ap_payment_history APH1

5144: AND APH.transaction_type = PAYMENT_CLEARING_ADJUSTED_TYPE
5145: AND NVL(APH.posted_flag, 'N') <> 'Y'))) --bug 9726978
5146: /* bug # 8325874 End */
5147: AND NOT EXISTS (SELECT 'PAYMENT UNCLEARING/CANCELLATION EXISTS'
5148: FROM ap_payment_history APH1
5149: WHERE APH1.check_id = AIP.check_id
5150: AND ((APH1.rev_pmt_hist_id = APH.payment_history_id
5151: AND APH1.transaction_type = 'PAYMENT UNCLEARING')
5152: OR APH1.transaction_type = 'PAYMENT CANCELLED'))

Line 5167: FROM ap_payment_history APH,

5163: /* BUG # 7560346 added DISTINCT keyword */
5164: CURSOR l_payment_maturities_cur IS
5165: SELECT DISTINCT APH.check_id,
5166: APH.accounting_date
5167: FROM ap_payment_history APH,
5168: ap_invoice_payments AIP,
5169: xla_events XE
5170: WHERE AIP.invoice_id = p_invoice_id
5171: AND AIP.check_id = APH.check_id

Line 5181: FROM AP_Payment_History APH

5177: AND XE.event_status_code <> 'N'
5178: /* bug 8325874 commented the line below and added subquery */
5179: --AND NVL(APH.Historical_Flag, 'N') <> 'Y' -- Bug 6890810
5180: AND NOT EXISTS (SELECT 'Either Upgraded Payment OR Unaccounted Pay Adj Exists'
5181: FROM AP_Payment_History APH
5182: WHERE APH.Check_ID = AIP.Check_ID
5183: AND (NVL(APH.Historical_Flag, 'N') = 'Y'
5184: OR (APH.invoice_adjustment_event_id = p_adj_accounting_event_id
5185: AND APH.transaction_type = PAYMENT_MATURITY_ADJUSTED_TYPE

Line 5189: FROM ap_payment_history APH1

5185: AND APH.transaction_type = PAYMENT_MATURITY_ADJUSTED_TYPE
5186: AND NVL(APH.posted_flag, 'N') <> 'Y'))) --bug 9726978
5187: /* bug # 8325874 End */
5188: AND NOT EXISTS (SELECT 'PAYMENT MATURITY-REVERSAL/CANCELLATION EXISTS'
5189: FROM ap_payment_history APH1
5190: WHERE APH1.check_id = AIP.check_id
5191: AND ((APH1.rev_pmt_hist_id = APH.payment_history_id
5192: AND APH1.transaction_type = 'PAYMENT MATURITY REVERSAL')
5193: OR APH1.transaction_type = 'PAYMENT CANCELLED'))

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

5252:
5253: l_event_type xla_events.event_type_code%TYPE;
5254: l_pay_type ap_checks_all.payment_type_flag%TYPE;
5255: l_automatic_offsets_flag ap_system_parameters_all.automatic_offsets_flag%TYPE; ---7209263
5256: l_bank_curr_code ap_payment_history_all.bank_currency_code%TYPE; ---7337949
5257:
5258: -- Bug 8276852 Start
5259: l_bank_to_base_xrate_type ap_payment_history_all.bank_to_base_xrate_type%TYPE;
5260: l_bank_to_base_xrate_date ap_payment_history_all.bank_to_base_xrate_date%TYPE;

Line 5259: l_bank_to_base_xrate_type ap_payment_history_all.bank_to_base_xrate_type%TYPE;

5255: l_automatic_offsets_flag ap_system_parameters_all.automatic_offsets_flag%TYPE; ---7209263
5256: l_bank_curr_code ap_payment_history_all.bank_currency_code%TYPE; ---7337949
5257:
5258: -- Bug 8276852 Start
5259: l_bank_to_base_xrate_type ap_payment_history_all.bank_to_base_xrate_type%TYPE;
5260: l_bank_to_base_xrate_date ap_payment_history_all.bank_to_base_xrate_date%TYPE;
5261: l_bank_to_base_xrate ap_payment_history_all.bank_to_base_xrate%TYPE;
5262: l_charges_bank_amount ap_payment_history_all.charges_bank_amount%TYPE; /*Bug13385106 */
5263: -- Bug 8276852 End

Line 5260: l_bank_to_base_xrate_date ap_payment_history_all.bank_to_base_xrate_date%TYPE;

5256: l_bank_curr_code ap_payment_history_all.bank_currency_code%TYPE; ---7337949
5257:
5258: -- Bug 8276852 Start
5259: l_bank_to_base_xrate_type ap_payment_history_all.bank_to_base_xrate_type%TYPE;
5260: l_bank_to_base_xrate_date ap_payment_history_all.bank_to_base_xrate_date%TYPE;
5261: l_bank_to_base_xrate ap_payment_history_all.bank_to_base_xrate%TYPE;
5262: l_charges_bank_amount ap_payment_history_all.charges_bank_amount%TYPE; /*Bug13385106 */
5263: -- Bug 8276852 End
5264:

Line 5261: l_bank_to_base_xrate ap_payment_history_all.bank_to_base_xrate%TYPE;

5257:
5258: -- Bug 8276852 Start
5259: l_bank_to_base_xrate_type ap_payment_history_all.bank_to_base_xrate_type%TYPE;
5260: l_bank_to_base_xrate_date ap_payment_history_all.bank_to_base_xrate_date%TYPE;
5261: l_bank_to_base_xrate ap_payment_history_all.bank_to_base_xrate%TYPE;
5262: l_charges_bank_amount ap_payment_history_all.charges_bank_amount%TYPE; /*Bug13385106 */
5263: -- Bug 8276852 End
5264:
5265: /* bug12363669 start */

Line 5262: l_charges_bank_amount ap_payment_history_all.charges_bank_amount%TYPE; /*Bug13385106 */

5258: -- Bug 8276852 Start
5259: l_bank_to_base_xrate_type ap_payment_history_all.bank_to_base_xrate_type%TYPE;
5260: l_bank_to_base_xrate_date ap_payment_history_all.bank_to_base_xrate_date%TYPE;
5261: l_bank_to_base_xrate ap_payment_history_all.bank_to_base_xrate%TYPE;
5262: l_charges_bank_amount ap_payment_history_all.charges_bank_amount%TYPE; /*Bug13385106 */
5263: -- Bug 8276852 End
5264:
5265: /* bug12363669 start */
5266: l_pmt_to_base_xrate_type ap_payment_history_all.pmt_to_base_xrate_type%type;

Line 5266: l_pmt_to_base_xrate_type ap_payment_history_all.pmt_to_base_xrate_type%type;

5262: l_charges_bank_amount ap_payment_history_all.charges_bank_amount%TYPE; /*Bug13385106 */
5263: -- Bug 8276852 End
5264:
5265: /* bug12363669 start */
5266: l_pmt_to_base_xrate_type ap_payment_history_all.pmt_to_base_xrate_type%type;
5267: l_pmt_to_base_xrate_date ap_payment_history_all.pmt_to_base_xrate_date%type;
5268: l_pmt_to_base_xrate ap_payment_history_all.pmt_to_base_xrate%type;
5269: /* bug12363669 end*/
5270:

Line 5267: l_pmt_to_base_xrate_date ap_payment_history_all.pmt_to_base_xrate_date%type;

5263: -- Bug 8276852 End
5264:
5265: /* bug12363669 start */
5266: l_pmt_to_base_xrate_type ap_payment_history_all.pmt_to_base_xrate_type%type;
5267: l_pmt_to_base_xrate_date ap_payment_history_all.pmt_to_base_xrate_date%type;
5268: l_pmt_to_base_xrate ap_payment_history_all.pmt_to_base_xrate%type;
5269: /* bug12363669 end*/
5270:
5271: l_accounting_date DATE := p_accounting_date; -- bug 10126192

Line 5268: l_pmt_to_base_xrate ap_payment_history_all.pmt_to_base_xrate%type;

5264:
5265: /* bug12363669 start */
5266: l_pmt_to_base_xrate_type ap_payment_history_all.pmt_to_base_xrate_type%type;
5267: l_pmt_to_base_xrate_date ap_payment_history_all.pmt_to_base_xrate_date%type;
5268: l_pmt_to_base_xrate ap_payment_history_all.pmt_to_base_xrate%type;
5269: /* bug12363669 end*/
5270:
5271: l_accounting_date DATE := p_accounting_date; -- bug 10126192
5272: l_count NUMBER; --bug12569594

Line 5600: FROM ap_payment_history_all APH

5596: ,l_pmt_to_base_xrate_type
5597: ,l_pmt_to_base_xrate_date
5598: ,l_pmt_to_base_xrate
5599: /* bug12363669 end*/
5600: FROM ap_payment_history_all APH
5601: WHERE APH.check_id = l_pay_clear_check_ids(i)
5602: AND APH.transaction_type = 'PAYMENT CLEARING'
5603: --added for bug 7614505
5604: AND NOT EXISTS( SELECT 'PAYMENT UNCLEARING EXISTS'

Line 5605: FROM ap_payment_history_all APH1

5601: WHERE APH.check_id = l_pay_clear_check_ids(i)
5602: AND APH.transaction_type = 'PAYMENT CLEARING'
5603: --added for bug 7614505
5604: AND NOT EXISTS( SELECT 'PAYMENT UNCLEARING EXISTS'
5605: FROM ap_payment_history_all APH1
5606: WHERE APH1.rev_pmt_hist_id = APH.payment_history_id
5607: AND APH1.transaction_type = 'PAYMENT UNCLEARING'
5608: AND APH1.check_id = APH.check_id);
5609:

Line 6308: FROM ap_payment_history APH

6304:
6305: /* Get the accounting date of 'clearing' payment history */
6306: SELECT APH.accounting_date
6307: INTO l_accounting_date
6308: FROM ap_payment_history APH
6309: WHERE APH.payment_history_id =
6310: (SELECT max(payment_history_id)
6311: FROM ap_payment_history APH2
6312: WHERE APH2.check_id = p_check_id

Line 6311: FROM ap_payment_history APH2

6307: INTO l_accounting_date
6308: FROM ap_payment_history APH
6309: WHERE APH.payment_history_id =
6310: (SELECT max(payment_history_id)
6311: FROM ap_payment_history APH2
6312: WHERE APH2.check_id = p_check_id
6313: AND APH2.posted_flag = 'N'
6314: AND APH2.transaction_type = 'PAYMENT CLEARING');
6315:

Line 6350: FROM ap_payment_history APH

6346: ELSIF (p_event_type_code = PAYMENT_MATURITY_REVERSED_TYPE) THEN
6347:
6348: SELECT APH.accounting_date
6349: INTO l_accounting_date
6350: FROM ap_payment_history APH
6351: WHERE payment_history_id =
6352: (SELECT max(payment_history_id)
6353: FROM ap_payment_history APH2
6354: WHERE APH2.check_id = p_check_id

Line 6353: FROM ap_payment_history APH2

6349: INTO l_accounting_date
6350: FROM ap_payment_history APH
6351: WHERE payment_history_id =
6352: (SELECT max(payment_history_id)
6353: FROM ap_payment_history APH2
6354: WHERE APH2.check_id = p_check_id
6355: AND APH2.posted_flag = 'N'
6356: AND APH2.transaction_type = 'PAYMENT MATURITY');
6357:

Line 6537: ap_payment_history_all APH,

6533: WHERE AIP.check_id = APH.check_id
6534: AND ROWNUM = 1
6535: ) ledger_id
6536: FROM
6537: ap_payment_history_all APH,
6538: ap_checks_all AC
6539: WHERE
6540: APH.check_id = AC.check_id
6541: AND AP_UTILITIES_PKG.GET_CURRENT_GL_DATE(TRUNC(APH.accounting_date), aph.org_id) --bug5956469

Line 6576: ap_payment_history_all APH,

6572: WHERE AIP.check_id = APH.check_id
6573: AND ROWNUM = 1
6574: ) ledger_id
6575: FROM
6576: ap_payment_history_all APH,
6577: ap_checks_all AC
6578: WHERE
6579: APH.check_id = AC.check_id
6580: AND APH.accounting_date BETWEEN p_from_date AND p_to_date

Line 6986: FROM ap_payment_history_all APH,

6982: FROM ap_invoice_payments_all AIP
6983: WHERE AIP.check_id = APH.check_id
6984: AND ROWNUM = 1
6985: ) ledger_id
6986: FROM ap_payment_history_all APH,
6987: ap_checks_all AC
6988: WHERE APH.check_id = AC.check_id
6989: AND APH.org_id = AC.org_id
6990: AND AP_UTILITIES_PKG.GET_CURRENT_GL_DATE(TRUNC(APH.accounting_date), aph.org_id) --bug5956469

Line 7005: FROM ap_payment_history_all APH,

7001: FROM ap_invoice_payments_all AIP
7002: WHERE AIP.check_id = APH.check_id
7003: AND ROWNUM = 1
7004: ) ledger_id
7005: FROM ap_payment_history_all APH,
7006: ap_checks_all AC
7007: WHERE APH.check_id = AC.check_id
7008: AND APH.org_id = AC.org_id
7009: AND APH.accounting_date BETWEEN p_from_date AND p_to_date