DBA Data[Home] [Help]

APPS.AP_RECONCILIATION_PKG dependencies on AP_CHECKS

Line 10: -- In this case we simply update the AP_CHECKS and no entry is generated

6: -- 1) PAYMENT MATURITY
7: -- In this case we insert a record into the AP_PAYMENT_HISTORY which
8: -- contains all information in currency of payment.
9: -- 2) PAYMENT CLEARING WITH RECONCILIATION ACCOUNTING OFF
10: -- In this case we simply update the AP_CHECKS and no entry is generated
11: -- for AP_PAYMENT_HISTORY. The amounts need to be properly converted
12: -- to the payment currency.
13: -- 3) PAYMENT CLEARING WITH RECONCILIATION ACCOUNTING ON
14: -- Same as 2

Line 52: -- largest. For the cleared amount in AP_CHECKS, we use the check amount +

48: -- POSSIBLE TRANSACTION CONTEXTS:
49: -- 1) Payment batch.
50: -- In this case we prorate errors and charges across
51: -- all checks in the batch with any remaining amount going to the
52: -- largest. For the cleared amount in AP_CHECKS, we use the check amount +
53: -- prorated errors and charges converted to payment currency
54: -- 2) Check
55: -- In this case all trx_amount, errors and charges converted to payment
56: -- currency go to the check.

Line 293: l_exchange_rate AP_CHECKS_ALL.EXCHANGE_RATE%TYPE;

289: l_debug_info VARCHAR2(240);
290: l_api_name CONSTANT VARCHAR2(1000) := 'Recon_Payment_Maturity' ;
291:
292: -- bug 9069767 starts
293: l_exchange_rate AP_CHECKS_ALL.EXCHANGE_RATE%TYPE;
294: l_exchange_date AP_CHECKS_ALL.EXCHANGE_DATE%TYPE;
295: l_exchange_rate_type AP_CHECKS_ALL.EXCHANGE_RATE_TYPE%TYPE;
296: -- bug 9069767 ends
297: BEGIN

Line 294: l_exchange_date AP_CHECKS_ALL.EXCHANGE_DATE%TYPE;

290: l_api_name CONSTANT VARCHAR2(1000) := 'Recon_Payment_Maturity' ;
291:
292: -- bug 9069767 starts
293: l_exchange_rate AP_CHECKS_ALL.EXCHANGE_RATE%TYPE;
294: l_exchange_date AP_CHECKS_ALL.EXCHANGE_DATE%TYPE;
295: l_exchange_rate_type AP_CHECKS_ALL.EXCHANGE_RATE_TYPE%TYPE;
296: -- bug 9069767 ends
297: BEGIN
298: current_calling_sequence := X_CALLING_SEQUENCE ||

Line 295: l_exchange_rate_type AP_CHECKS_ALL.EXCHANGE_RATE_TYPE%TYPE;

291:
292: -- bug 9069767 starts
293: l_exchange_rate AP_CHECKS_ALL.EXCHANGE_RATE%TYPE;
294: l_exchange_date AP_CHECKS_ALL.EXCHANGE_DATE%TYPE;
295: l_exchange_rate_type AP_CHECKS_ALL.EXCHANGE_RATE_TYPE%TYPE;
296: -- bug 9069767 ends
297: BEGIN
298: current_calling_sequence := X_CALLING_SEQUENCE ||
299: 'AP_RECONCILIATION_PKG.RECON_PAYMENT_MATURITY' ;

Line 335: ap_checks ac

331: asp.org_id
332: INTO l_functional_currency_code,
333: l_org_id
334: FROM ap_system_parameters asp,
335: ap_checks ac
336: WHERE ac.org_id = asp.org_id
337: AND ac.check_id = x_check_id;
338:
339: --Start bug 12555714 : commenting the IF block on exchange rate fields

Line 357: FROM ap_checks_all

353: exchange_rate_type
354: INTO l_exchange_rate,
355: l_exchange_date,
356: l_exchange_rate_type
357: FROM ap_checks_all
358: WHERE check_id = X_CHECK_ID;
359: END IF;
360: */
361: --bug 9069767 ends

Line 523: l_pmt_currency_code ap_checks.currency_code%TYPE;

519: l_recon_accounting_flag ap_system_parameters.recon_accounting_flag%TYPE;
520: l_currency_case VARCHAR2(30);
521: l_status_code VARCHAR2(30) ;
522:
523: l_pmt_currency_code ap_checks.currency_code%TYPE;
524: l_functional_currency_code ap_system_parameters.base_currency_code%TYPE;
525: l_bank_to_base_xrate ap_checks.exchange_rate%TYPE;
526: l_bank_to_base_xrate_type ap_checks.exchange_rate_type%TYPE;
527: l_bank_to_base_xrate_date ap_checks.exchange_date%TYPE;

Line 525: l_bank_to_base_xrate ap_checks.exchange_rate%TYPE;

521: l_status_code VARCHAR2(30) ;
522:
523: l_pmt_currency_code ap_checks.currency_code%TYPE;
524: l_functional_currency_code ap_system_parameters.base_currency_code%TYPE;
525: l_bank_to_base_xrate ap_checks.exchange_rate%TYPE;
526: l_bank_to_base_xrate_type ap_checks.exchange_rate_type%TYPE;
527: l_bank_to_base_xrate_date ap_checks.exchange_date%TYPE;
528: l_trx_pmt_amount NUMBER;
529: l_errors_pmt_amount NUMBER;

Line 526: l_bank_to_base_xrate_type ap_checks.exchange_rate_type%TYPE;

522:
523: l_pmt_currency_code ap_checks.currency_code%TYPE;
524: l_functional_currency_code ap_system_parameters.base_currency_code%TYPE;
525: l_bank_to_base_xrate ap_checks.exchange_rate%TYPE;
526: l_bank_to_base_xrate_type ap_checks.exchange_rate_type%TYPE;
527: l_bank_to_base_xrate_date ap_checks.exchange_date%TYPE;
528: l_trx_pmt_amount NUMBER;
529: l_errors_pmt_amount NUMBER;
530: l_charges_pmt_amount NUMBER;

Line 527: l_bank_to_base_xrate_date ap_checks.exchange_date%TYPE;

523: l_pmt_currency_code ap_checks.currency_code%TYPE;
524: l_functional_currency_code ap_system_parameters.base_currency_code%TYPE;
525: l_bank_to_base_xrate ap_checks.exchange_rate%TYPE;
526: l_bank_to_base_xrate_type ap_checks.exchange_rate_type%TYPE;
527: l_bank_to_base_xrate_date ap_checks.exchange_date%TYPE;
528: l_trx_pmt_amount NUMBER;
529: l_errors_pmt_amount NUMBER;
530: l_charges_pmt_amount NUMBER;
531: l_trx_base_amount NUMBER;

Line 534: l_remainder_errors_pmt_amt ap_checks.amount%TYPE;

530: l_charges_pmt_amount NUMBER;
531: l_trx_base_amount NUMBER;
532: l_errors_base_amount NUMBER;
533: l_charges_base_amount NUMBER;
534: l_remainder_errors_pmt_amt ap_checks.amount%TYPE;
535: l_remainder_charges_pmt_amt ap_checks.amount%TYPE;
536: l_errors_bank_amount ap_checks.amount%TYPE;
537: l_charges_bank_amount ap_checks.amount%TYPE;
538:

Line 535: l_remainder_charges_pmt_amt ap_checks.amount%TYPE;

531: l_trx_base_amount NUMBER;
532: l_errors_base_amount NUMBER;
533: l_charges_base_amount NUMBER;
534: l_remainder_errors_pmt_amt ap_checks.amount%TYPE;
535: l_remainder_charges_pmt_amt ap_checks.amount%TYPE;
536: l_errors_bank_amount ap_checks.amount%TYPE;
537: l_charges_bank_amount ap_checks.amount%TYPE;
538:
539: l_max_pmt_amt ap_checks.amount%TYPE;

Line 536: l_errors_bank_amount ap_checks.amount%TYPE;

532: l_errors_base_amount NUMBER;
533: l_charges_base_amount NUMBER;
534: l_remainder_errors_pmt_amt ap_checks.amount%TYPE;
535: l_remainder_charges_pmt_amt ap_checks.amount%TYPE;
536: l_errors_bank_amount ap_checks.amount%TYPE;
537: l_charges_bank_amount ap_checks.amount%TYPE;
538:
539: l_max_pmt_amt ap_checks.amount%TYPE;
540: l_pay_sum_amt ap_checks.amount%TYPE;

Line 537: l_charges_bank_amount ap_checks.amount%TYPE;

533: l_charges_base_amount NUMBER;
534: l_remainder_errors_pmt_amt ap_checks.amount%TYPE;
535: l_remainder_charges_pmt_amt ap_checks.amount%TYPE;
536: l_errors_bank_amount ap_checks.amount%TYPE;
537: l_charges_bank_amount ap_checks.amount%TYPE;
538:
539: l_max_pmt_amt ap_checks.amount%TYPE;
540: l_pay_sum_amt ap_checks.amount%TYPE;
541: l_payment_count NUMBER;

Line 539: l_max_pmt_amt ap_checks.amount%TYPE;

535: l_remainder_charges_pmt_amt ap_checks.amount%TYPE;
536: l_errors_bank_amount ap_checks.amount%TYPE;
537: l_charges_bank_amount ap_checks.amount%TYPE;
538:
539: l_max_pmt_amt ap_checks.amount%TYPE;
540: l_pay_sum_amt ap_checks.amount%TYPE;
541: l_payment_count NUMBER;
542: l_pmt_not_matured NUMBER := 0 ;
543: l_running_total_payments NUMBER := 0;

Line 540: l_pay_sum_amt ap_checks.amount%TYPE;

536: l_errors_bank_amount ap_checks.amount%TYPE;
537: l_charges_bank_amount ap_checks.amount%TYPE;
538:
539: l_max_pmt_amt ap_checks.amount%TYPE;
540: l_pay_sum_amt ap_checks.amount%TYPE;
541: l_payment_count NUMBER;
542: l_pmt_not_matured NUMBER := 0 ;
543: l_running_total_payments NUMBER := 0;
544: l_runtotal_trx_bank_amount NUMBER := 0;

Line 547: l_check_amount ap_checks.amount%TYPE;

543: l_running_total_payments NUMBER := 0;
544: l_runtotal_trx_bank_amount NUMBER := 0;
545: l_runtotal_errors_bank_amount NUMBER := 0;
546: l_runtotal_charges_bank_amount NUMBER := 0;
547: l_check_amount ap_checks.amount%TYPE;
548: l_check_id ap_checks.check_id%TYPE;
549: l_payment_xrate ap_checks.exchange_rate%TYPE;
550: l_status_lookup_code ap_checks.status_lookup_code%TYPE;
551:

Line 548: l_check_id ap_checks.check_id%TYPE;

544: l_runtotal_trx_bank_amount NUMBER := 0;
545: l_runtotal_errors_bank_amount NUMBER := 0;
546: l_runtotal_charges_bank_amount NUMBER := 0;
547: l_check_amount ap_checks.amount%TYPE;
548: l_check_id ap_checks.check_id%TYPE;
549: l_payment_xrate ap_checks.exchange_rate%TYPE;
550: l_status_lookup_code ap_checks.status_lookup_code%TYPE;
551:
552: l_future_pay_flag VARCHAR2(1) ;

Line 549: l_payment_xrate ap_checks.exchange_rate%TYPE;

545: l_runtotal_errors_bank_amount NUMBER := 0;
546: l_runtotal_charges_bank_amount NUMBER := 0;
547: l_check_amount ap_checks.amount%TYPE;
548: l_check_id ap_checks.check_id%TYPE;
549: l_payment_xrate ap_checks.exchange_rate%TYPE;
550: l_status_lookup_code ap_checks.status_lookup_code%TYPE;
551:
552: l_future_pay_flag VARCHAR2(1) ;
553: l_ind_errors_pmt_amount ap_checks.amount%TYPE;

Line 550: l_status_lookup_code ap_checks.status_lookup_code%TYPE;

546: l_runtotal_charges_bank_amount NUMBER := 0;
547: l_check_amount ap_checks.amount%TYPE;
548: l_check_id ap_checks.check_id%TYPE;
549: l_payment_xrate ap_checks.exchange_rate%TYPE;
550: l_status_lookup_code ap_checks.status_lookup_code%TYPE;
551:
552: l_future_pay_flag VARCHAR2(1) ;
553: l_ind_errors_pmt_amount ap_checks.amount%TYPE;
554: l_ind_charges_pmt_amount ap_checks.amount%TYPE;

Line 553: l_ind_errors_pmt_amount ap_checks.amount%TYPE;

549: l_payment_xrate ap_checks.exchange_rate%TYPE;
550: l_status_lookup_code ap_checks.status_lookup_code%TYPE;
551:
552: l_future_pay_flag VARCHAR2(1) ;
553: l_ind_errors_pmt_amount ap_checks.amount%TYPE;
554: l_ind_charges_pmt_amount ap_checks.amount%TYPE;
555: l_debug_info VARCHAR2(2400);
556: l_org_id NUMBER;
557: l_distinct_org NUMBER; -- Bug 5674397

Line 554: l_ind_charges_pmt_amount ap_checks.amount%TYPE;

550: l_status_lookup_code ap_checks.status_lookup_code%TYPE;
551:
552: l_future_pay_flag VARCHAR2(1) ;
553: l_ind_errors_pmt_amount ap_checks.amount%TYPE;
554: l_ind_charges_pmt_amount ap_checks.amount%TYPE;
555: l_debug_info VARCHAR2(2400);
556: l_org_id NUMBER;
557: l_distinct_org NUMBER; -- Bug 5674397
558:

Line 564: l_pmt_to_base_xrate ap_checks.exchange_rate%TYPE;

560: cant_do_recon_acct EXCEPTION;
561: l_api_name CONSTANT VARCHAR2(1000) := 'Recon_Payment_Clearing' ;
562:
563: -- bug8628166
564: l_pmt_to_base_xrate ap_checks.exchange_rate%TYPE;
565: l_pmt_to_base_xrate_type ap_checks.exchange_rate_type%TYPE;
566: l_pmt_to_base_xrate_date ap_checks.exchange_date%TYPE;
567:
568: -- Distinct Org Cursor

Line 565: l_pmt_to_base_xrate_type ap_checks.exchange_rate_type%TYPE;

561: l_api_name CONSTANT VARCHAR2(1000) := 'Recon_Payment_Clearing' ;
562:
563: -- bug8628166
564: l_pmt_to_base_xrate ap_checks.exchange_rate%TYPE;
565: l_pmt_to_base_xrate_type ap_checks.exchange_rate_type%TYPE;
566: l_pmt_to_base_xrate_date ap_checks.exchange_date%TYPE;
567:
568: -- Distinct Org Cursor
569: -- Bug 5674397

Line 566: l_pmt_to_base_xrate_date ap_checks.exchange_date%TYPE;

562:
563: -- bug8628166
564: l_pmt_to_base_xrate ap_checks.exchange_rate%TYPE;
565: l_pmt_to_base_xrate_type ap_checks.exchange_rate_type%TYPE;
566: l_pmt_to_base_xrate_date ap_checks.exchange_date%TYPE;
567:
568: -- Distinct Org Cursor
569: -- Bug 5674397
570: CURSOR distinct_org_cur IS

Line 572: FROM ap_checks

568: -- Distinct Org Cursor
569: -- Bug 5674397
570: CURSOR distinct_org_cur IS
571: SELECT distinct org_id
572: FROM ap_checks
573: WHERE checkrun_id = X_CHECKRUN_ID;
574:
575: -- Payment Batch Cursor
576: -- Bug 5674397. Added the parameter

Line 587: FROM ap_checks_all c,

583: c.currency_code,
584: asp.base_currency_code,
585: asp.org_id,
586: nvl(asp.recon_accounting_flag, 'N')
587: FROM ap_checks_all c,
588: ap_system_parameters_all asp
589: WHERE c.checkrun_id = X_CHECKRUN_id
590: AND c.org_id = p_org_id
591: AND c.org_id = asp.org_id

Line 637: FROM AP_CHECKS

633: ---------------------------------------------------------------
634: -- Bug 5674397 Moving at the begining
635: SELECT count(check_id), sum(amount) , max(amount)
636: INTO l_payment_count, l_pay_sum_amt, l_max_pmt_amt
637: FROM AP_CHECKS
638: WHERE checkrun_id = x_checkrun_id
639: AND status_lookup_code NOT IN
640: ('VOIDED','SETUP', 'OVERFLOW','SPOILED',
641: 'STOP INITIATED','UNCONFIRMED SET UP',

Line 710: FROM ap_checks ac,

706: INTO l_pmt_currency_code,
707: l_functional_currency_code,
708: l_org_id,
709: l_recon_accounting_flag
710: FROM ap_checks ac,
711: ap_system_parameters asp
712: WHERE ac.checkrun_id = X_CHECKRUN_ID
713: AND asp.org_id = ac.org_id
714: AND ac.org_id = l_distinct_org

Line 744: FROM ap_checks_all ac

740: exchange_rate
741: INTO l_pmt_to_base_xrate_date,
742: l_pmt_to_base_xrate_type,
743: l_pmt_to_base_xrate
744: FROM ap_checks_all ac
745: WHERE check_id = l_check_id;
746: END IF;
747: END IF;
748: -- bug8628166 - end

Line 1289: FROM ap_checks_all c,

1285: l_future_pay_flag,
1286: l_functional_currency_code,
1287: l_org_id,
1288: l_recon_accounting_flag
1289: FROM ap_checks_all c,
1290: ap_system_parameters_all asp
1291: WHERE c.check_id = X_CHECK_ID
1292: AND c.org_id = asp.org_id;
1293:

Line 1334: FROM ap_checks_all ac

1330: exchange_rate
1331: INTO l_pmt_to_base_xrate_date,
1332: l_pmt_to_base_xrate_type,
1333: l_pmt_to_base_xrate
1334: FROM ap_checks_all ac
1335: WHERE check_id = X_CHECK_ID;
1336: END IF;
1337: END IF;
1338: -- bug8628166 - end

Line 1760: l_check_amount ap_checks.amount%TYPE;

1756: AS
1757:
1758: --bgufix:5623562
1759: l_recon_accounting_flag ap_system_parameters.recon_accounting_flag%TYPE;
1760: l_check_amount ap_checks.amount%TYPE;
1761: l_rev_pmt_hist_id ap_payment_history.rev_pmt_hist_id%TYPE;
1762: l_check_id ap_checks.check_id%TYPE;
1763: l_ind_trx_bank_amount ap_payment_history.trx_bank_amount%TYPE;
1764: l_ind_errors_bank_amount ap_payment_history.errors_bank_amount%TYPE;

Line 1762: l_check_id ap_checks.check_id%TYPE;

1758: --bgufix:5623562
1759: l_recon_accounting_flag ap_system_parameters.recon_accounting_flag%TYPE;
1760: l_check_amount ap_checks.amount%TYPE;
1761: l_rev_pmt_hist_id ap_payment_history.rev_pmt_hist_id%TYPE;
1762: l_check_id ap_checks.check_id%TYPE;
1763: l_ind_trx_bank_amount ap_payment_history.trx_bank_amount%TYPE;
1764: l_ind_errors_bank_amount ap_payment_history.errors_bank_amount%TYPE;
1765: l_ind_charges_bank_amount ap_payment_history.charges_bank_amount%TYPE;
1766: l_bank_currency_code ap_payment_history.bank_currency_code%TYPE;

Line 1795: FROM ap_checks

1791: -- Distinct Org Cursor
1792: -- Bug 5674397
1793: CURSOR distinct_org_cur IS
1794: SELECT distinct org_id
1795: FROM ap_checks
1796: WHERE checkrun_id = X_CHECKRUN_ID;
1797:
1798: -- Payment Batch Cursor
1799:

Line 1823: ap_checks_all C

1819: C.check_id,
1820: NVL(c.amount, 0),
1821: c.org_id
1822: FROM ap_payment_history_all APHA,
1823: ap_checks_all C
1824: WHERE APHA.check_id = C.check_id
1825: AND C.checkrun_id = X_CHECKRUN_ID
1826: AND C.org_id = p_org_id -- Bug 5674397
1827: AND APHA.transaction_type = 'PAYMENT CLEARING'

Line 2016: ap_checks_all ac

2012: --bugfix:5674397
2013: SELECT nvl(recon_accounting_flag, 'N')
2014: INTO l_recon_accounting_flag
2015: FROM ap_system_parameters_all asp,
2016: ap_checks_all ac
2017: WHERE asp.org_id = ac.org_id
2018: AND ac.check_id = X_CHECK_ID;
2019:
2020: --bugfix:5623562 -- 5674397

Line 2081: ap_checks C

2077: l_ind_charges_base_amount,
2078: l_check_amount,
2079: l_org_id
2080: FROM ap_payment_history APHA,
2081: ap_checks C
2082: WHERE APHA.check_id = X_CHECK_ID
2083: AND APHA.check_id = C.check_id
2084: AND APHA.transaction_type = 'PAYMENT CLEARING'
2085: AND C.status_lookup_code IN ('CLEARED',

Line 2486: UPDATE ap_checks

2482: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||l_api_name,l_debug_info);
2483: END IF;
2484: ---------------------------------------------------------------
2485:
2486: UPDATE ap_checks
2487: SET CLEARED_DATE = NULL,
2488: CLEARED_AMOUNT = NULL,
2489: CLEARED_BASE_AMOUNT = NULL,
2490: CLEARED_ERROR_AMOUNT = NULL,

Line 2510: l_debug_info := 'cc_checkrun_id null or cc_check_id not null, before Update ap_checks';

2506: 'CLEARED BUT UNACCOUNTED');
2507:
2508: ELSE
2509: ----------------------------------------------------------------------------------------
2510: l_debug_info := 'cc_checkrun_id null or cc_check_id not null, before Update ap_checks';
2511: IF (G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
2512: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||l_api_name,l_debug_info);
2513: END IF;
2514: ---------------------------------------------------------------

Line 2516: UPDATE ap_checks

2512: FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||l_api_name,l_debug_info);
2513: END IF;
2514: ---------------------------------------------------------------
2515:
2516: UPDATE ap_checks
2517: SET CLEARED_DATE = NULL,
2518: CLEARED_AMOUNT = NULL,
2519: CLEARED_BASE_AMOUNT = NULL,
2520: CLEARED_ERROR_AMOUNT = NULL,

Line 2610: UPDATE ap_checks_all

2606: end if ;
2607:
2608: ----------------------------------------------------------------
2609: --bug 8545814
2610: UPDATE ap_checks_all
2611: SET CLEARED_AMOUNT = RU_CLEARED_AMOUNT,
2612: CLEARED_BASE_AMOUNT = RU_CLEARED_BASE_AMOUNT,
2613: CLEARED_ERROR_AMOUNT = RU_CLEARED_ERROR_AMOUNT,
2614: CLEARED_ERROR_BASE_AMOUNT = RU_CLEARED_ERROR_BASE_AMOUNT,