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 288: ap_checks ac

284: asp.org_id
285: INTO l_functional_currency_code,
286: l_org_id
287: FROM ap_system_parameters asp,
288: ap_checks ac
289: WHERE ac.org_id = asp.org_id
290: AND ac.check_id = x_check_id;
291:
292: l_debug_info := 'Call rounding function';

Line 431: l_pmt_currency_code ap_checks.currency_code%TYPE;

427: l_recon_accounting_flag ap_system_parameters.recon_accounting_flag%TYPE;
428: l_currency_case VARCHAR2(30);
429: l_status_code VARCHAR2(30) ;
430:
431: l_pmt_currency_code ap_checks.currency_code%TYPE;
432: l_functional_currency_code ap_system_parameters.base_currency_code%TYPE;
433: l_bank_to_base_xrate ap_checks.exchange_rate%TYPE;
434: l_bank_to_base_xrate_type ap_checks.exchange_rate_type%TYPE;
435: l_bank_to_base_xrate_date ap_checks.exchange_date%TYPE;

Line 433: l_bank_to_base_xrate ap_checks.exchange_rate%TYPE;

429: l_status_code VARCHAR2(30) ;
430:
431: l_pmt_currency_code ap_checks.currency_code%TYPE;
432: l_functional_currency_code ap_system_parameters.base_currency_code%TYPE;
433: l_bank_to_base_xrate ap_checks.exchange_rate%TYPE;
434: l_bank_to_base_xrate_type ap_checks.exchange_rate_type%TYPE;
435: l_bank_to_base_xrate_date ap_checks.exchange_date%TYPE;
436: l_trx_pmt_amount NUMBER;
437: l_errors_pmt_amount NUMBER;

Line 434: l_bank_to_base_xrate_type ap_checks.exchange_rate_type%TYPE;

430:
431: l_pmt_currency_code ap_checks.currency_code%TYPE;
432: l_functional_currency_code ap_system_parameters.base_currency_code%TYPE;
433: l_bank_to_base_xrate ap_checks.exchange_rate%TYPE;
434: l_bank_to_base_xrate_type ap_checks.exchange_rate_type%TYPE;
435: l_bank_to_base_xrate_date ap_checks.exchange_date%TYPE;
436: l_trx_pmt_amount NUMBER;
437: l_errors_pmt_amount NUMBER;
438: l_charges_pmt_amount NUMBER;

Line 435: l_bank_to_base_xrate_date ap_checks.exchange_date%TYPE;

431: l_pmt_currency_code ap_checks.currency_code%TYPE;
432: l_functional_currency_code ap_system_parameters.base_currency_code%TYPE;
433: l_bank_to_base_xrate ap_checks.exchange_rate%TYPE;
434: l_bank_to_base_xrate_type ap_checks.exchange_rate_type%TYPE;
435: l_bank_to_base_xrate_date ap_checks.exchange_date%TYPE;
436: l_trx_pmt_amount NUMBER;
437: l_errors_pmt_amount NUMBER;
438: l_charges_pmt_amount NUMBER;
439: l_trx_base_amount NUMBER;

Line 442: l_remainder_errors_pmt_amt ap_checks.amount%TYPE;

438: l_charges_pmt_amount NUMBER;
439: l_trx_base_amount NUMBER;
440: l_errors_base_amount NUMBER;
441: l_charges_base_amount NUMBER;
442: l_remainder_errors_pmt_amt ap_checks.amount%TYPE;
443: l_remainder_charges_pmt_amt ap_checks.amount%TYPE;
444: l_errors_bank_amount ap_checks.amount%TYPE;
445: l_charges_bank_amount ap_checks.amount%TYPE;
446:

Line 443: l_remainder_charges_pmt_amt ap_checks.amount%TYPE;

439: l_trx_base_amount NUMBER;
440: l_errors_base_amount NUMBER;
441: l_charges_base_amount NUMBER;
442: l_remainder_errors_pmt_amt ap_checks.amount%TYPE;
443: l_remainder_charges_pmt_amt ap_checks.amount%TYPE;
444: l_errors_bank_amount ap_checks.amount%TYPE;
445: l_charges_bank_amount ap_checks.amount%TYPE;
446:
447: l_max_pmt_amt ap_checks.amount%TYPE;

Line 444: l_errors_bank_amount ap_checks.amount%TYPE;

440: l_errors_base_amount NUMBER;
441: l_charges_base_amount NUMBER;
442: l_remainder_errors_pmt_amt ap_checks.amount%TYPE;
443: l_remainder_charges_pmt_amt ap_checks.amount%TYPE;
444: l_errors_bank_amount ap_checks.amount%TYPE;
445: l_charges_bank_amount ap_checks.amount%TYPE;
446:
447: l_max_pmt_amt ap_checks.amount%TYPE;
448: l_pay_sum_amt ap_checks.amount%TYPE;

Line 445: l_charges_bank_amount ap_checks.amount%TYPE;

441: l_charges_base_amount NUMBER;
442: l_remainder_errors_pmt_amt ap_checks.amount%TYPE;
443: l_remainder_charges_pmt_amt ap_checks.amount%TYPE;
444: l_errors_bank_amount ap_checks.amount%TYPE;
445: l_charges_bank_amount ap_checks.amount%TYPE;
446:
447: l_max_pmt_amt ap_checks.amount%TYPE;
448: l_pay_sum_amt ap_checks.amount%TYPE;
449: l_payment_count NUMBER;

Line 447: l_max_pmt_amt ap_checks.amount%TYPE;

443: l_remainder_charges_pmt_amt ap_checks.amount%TYPE;
444: l_errors_bank_amount ap_checks.amount%TYPE;
445: l_charges_bank_amount ap_checks.amount%TYPE;
446:
447: l_max_pmt_amt ap_checks.amount%TYPE;
448: l_pay_sum_amt ap_checks.amount%TYPE;
449: l_payment_count NUMBER;
450: l_pmt_not_matured NUMBER := 0 ;
451: l_running_total_payments NUMBER := 0;

Line 448: l_pay_sum_amt ap_checks.amount%TYPE;

444: l_errors_bank_amount ap_checks.amount%TYPE;
445: l_charges_bank_amount ap_checks.amount%TYPE;
446:
447: l_max_pmt_amt ap_checks.amount%TYPE;
448: l_pay_sum_amt ap_checks.amount%TYPE;
449: l_payment_count NUMBER;
450: l_pmt_not_matured NUMBER := 0 ;
451: l_running_total_payments NUMBER := 0;
452: l_runtotal_trx_bank_amount NUMBER := 0;

Line 455: l_check_amount ap_checks.amount%TYPE;

451: l_running_total_payments NUMBER := 0;
452: l_runtotal_trx_bank_amount NUMBER := 0;
453: l_runtotal_errors_bank_amount NUMBER := 0;
454: l_runtotal_charges_bank_amount NUMBER := 0;
455: l_check_amount ap_checks.amount%TYPE;
456: l_check_id ap_checks.check_id%TYPE;
457: l_payment_xrate ap_checks.exchange_rate%TYPE;
458: l_status_lookup_code ap_checks.status_lookup_code%TYPE;
459:

Line 456: l_check_id ap_checks.check_id%TYPE;

452: l_runtotal_trx_bank_amount NUMBER := 0;
453: l_runtotal_errors_bank_amount NUMBER := 0;
454: l_runtotal_charges_bank_amount NUMBER := 0;
455: l_check_amount ap_checks.amount%TYPE;
456: l_check_id ap_checks.check_id%TYPE;
457: l_payment_xrate ap_checks.exchange_rate%TYPE;
458: l_status_lookup_code ap_checks.status_lookup_code%TYPE;
459:
460: l_future_pay_flag VARCHAR2(1) ;

Line 457: l_payment_xrate ap_checks.exchange_rate%TYPE;

453: l_runtotal_errors_bank_amount NUMBER := 0;
454: l_runtotal_charges_bank_amount NUMBER := 0;
455: l_check_amount ap_checks.amount%TYPE;
456: l_check_id ap_checks.check_id%TYPE;
457: l_payment_xrate ap_checks.exchange_rate%TYPE;
458: l_status_lookup_code ap_checks.status_lookup_code%TYPE;
459:
460: l_future_pay_flag VARCHAR2(1) ;
461: l_ind_errors_pmt_amount ap_checks.amount%TYPE;

Line 458: l_status_lookup_code ap_checks.status_lookup_code%TYPE;

454: l_runtotal_charges_bank_amount NUMBER := 0;
455: l_check_amount ap_checks.amount%TYPE;
456: l_check_id ap_checks.check_id%TYPE;
457: l_payment_xrate ap_checks.exchange_rate%TYPE;
458: l_status_lookup_code ap_checks.status_lookup_code%TYPE;
459:
460: l_future_pay_flag VARCHAR2(1) ;
461: l_ind_errors_pmt_amount ap_checks.amount%TYPE;
462: l_ind_charges_pmt_amount ap_checks.amount%TYPE;

Line 461: l_ind_errors_pmt_amount ap_checks.amount%TYPE;

457: l_payment_xrate ap_checks.exchange_rate%TYPE;
458: l_status_lookup_code ap_checks.status_lookup_code%TYPE;
459:
460: l_future_pay_flag VARCHAR2(1) ;
461: l_ind_errors_pmt_amount ap_checks.amount%TYPE;
462: l_ind_charges_pmt_amount ap_checks.amount%TYPE;
463: l_debug_info VARCHAR2(240);
464: l_org_id NUMBER;
465: l_distinct_org NUMBER; -- Bug 5674397

Line 462: l_ind_charges_pmt_amount ap_checks.amount%TYPE;

458: l_status_lookup_code ap_checks.status_lookup_code%TYPE;
459:
460: l_future_pay_flag VARCHAR2(1) ;
461: l_ind_errors_pmt_amount ap_checks.amount%TYPE;
462: l_ind_charges_pmt_amount ap_checks.amount%TYPE;
463: l_debug_info VARCHAR2(240);
464: l_org_id NUMBER;
465: l_distinct_org NUMBER; -- Bug 5674397
466:

Line 474: FROM ap_checks

470: -- Distinct Org Cursor
471: -- Bug 5674397
472: CURSOR distinct_org_cur IS
473: SELECT distinct org_id
474: FROM ap_checks
475: WHERE checkrun_id = X_CHECKRUN_ID;
476:
477: -- Payment Batch Cursor
478: -- Bug 5674397. Added the parameter

Line 489: FROM ap_checks_all c,

485: c.currency_code,
486: asp.base_currency_code,
487: asp.org_id,
488: nvl(asp.recon_accounting_flag, 'N')
489: FROM ap_checks_all c,
490: ap_system_parameters_all asp
491: WHERE c.checkrun_id = X_CHECKRUN_id
492: AND c.org_id = p_org_id
493: AND c.org_id = asp.org_id

Line 534: FROM AP_CHECKS

530:
531: -- Bug 5674397 Moving at the begining
532: SELECT count(check_id), sum(amount) , max(amount)
533: INTO l_payment_count, l_pay_sum_amt, l_max_pmt_amt
534: FROM AP_CHECKS
535: WHERE checkrun_id = x_checkrun_id
536: AND status_lookup_code NOT IN
537: ('VOIDED','SETUP', 'OVERFLOW','SPOILED',
538: 'STOP INITIATED','UNCONFIRMED SET UP',

Line 599: FROM ap_checks ac,

595: INTO l_pmt_currency_code,
596: l_functional_currency_code,
597: l_org_id,
598: l_recon_accounting_flag
599: FROM ap_checks ac,
600: ap_system_parameters asp
601: WHERE ac.checkrun_id = X_CHECKRUN_ID
602: AND asp.org_id = ac.org_id
603: AND ac.org_id = l_distinct_org

Line 1047: FROM ap_checks_all c,

1043: l_future_pay_flag,
1044: l_functional_currency_code,
1045: l_org_id,
1046: l_recon_accounting_flag
1047: FROM ap_checks_all c,
1048: ap_system_parameters_all asp
1049: WHERE c.check_id = X_CHECK_ID
1050: AND c.org_id = asp.org_id;
1051:

Line 1433: l_check_amount ap_checks.amount%TYPE;

1429: AS
1430:
1431: --bgufix:5623562
1432: l_recon_accounting_flag ap_system_parameters.recon_accounting_flag%TYPE;
1433: l_check_amount ap_checks.amount%TYPE;
1434: l_rev_pmt_hist_id ap_payment_history.rev_pmt_hist_id%TYPE;
1435: l_check_id ap_checks.check_id%TYPE;
1436: l_ind_trx_bank_amount ap_payment_history.trx_bank_amount%TYPE;
1437: l_ind_errors_bank_amount ap_payment_history.errors_bank_amount%TYPE;

Line 1435: l_check_id ap_checks.check_id%TYPE;

1431: --bgufix:5623562
1432: l_recon_accounting_flag ap_system_parameters.recon_accounting_flag%TYPE;
1433: l_check_amount ap_checks.amount%TYPE;
1434: l_rev_pmt_hist_id ap_payment_history.rev_pmt_hist_id%TYPE;
1435: l_check_id ap_checks.check_id%TYPE;
1436: l_ind_trx_bank_amount ap_payment_history.trx_bank_amount%TYPE;
1437: l_ind_errors_bank_amount ap_payment_history.errors_bank_amount%TYPE;
1438: l_ind_charges_bank_amount ap_payment_history.charges_bank_amount%TYPE;
1439: l_bank_currency_code ap_payment_history.bank_currency_code%TYPE;

Line 1467: FROM ap_checks

1463: -- Distinct Org Cursor
1464: -- Bug 5674397
1465: CURSOR distinct_org_cur IS
1466: SELECT distinct org_id
1467: FROM ap_checks
1468: WHERE checkrun_id = X_CHECKRUN_ID;
1469:
1470: -- Payment Batch Cursor
1471:

Line 1495: ap_checks_all C

1491: C.check_id,
1492: NVL(c.amount, 0),
1493: c.org_id
1494: FROM ap_payment_history_all APHA,
1495: ap_checks_all C
1496: WHERE APHA.check_id = C.check_id
1497: AND C.checkrun_id = X_CHECKRUN_ID
1498: AND C.org_id = p_org_id -- Bug 5674397
1499: AND APHA.transaction_type = 'PAYMENT CLEARING'

Line 1672: ap_checks_all ac

1668: --bugfix:5674397
1669: SELECT nvl(recon_accounting_flag, 'N')
1670: INTO l_recon_accounting_flag
1671: FROM ap_system_parameters_all asp,
1672: ap_checks_all ac
1673: WHERE asp.org_id = ac.org_id
1674: AND ac.check_id = X_CHECK_ID;
1675:
1676: --bugfix:5623562 -- 5674397

Line 1733: ap_checks C

1729: l_ind_charges_base_amount,
1730: l_check_amount,
1731: l_org_id
1732: FROM ap_payment_history APHA,
1733: ap_checks C
1734: WHERE APHA.check_id = X_CHECK_ID
1735: AND APHA.check_id = C.check_id
1736: AND APHA.transaction_type = 'PAYMENT CLEARING'
1737: AND C.status_lookup_code IN ('CLEARED',

Line 2096: UPDATE ap_checks

2092: IF (CC_CHECKRUN_ID IS NOT NULL AND CC_CHECK_ID IS NULL) THEN
2093:
2094: l_debug_info := 'cc_checkrun_id not null and cc_check_id null, before Update';
2095:
2096: UPDATE ap_checks
2097: SET CLEARED_DATE = NULL,
2098: CLEARED_AMOUNT = NULL,
2099: CLEARED_BASE_AMOUNT = NULL,
2100: CLEARED_ERROR_AMOUNT = NULL,

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

2116: 'CLEARED BUT UNACCOUNTED');
2117:
2118: ELSE
2119:
2120: l_debug_info := 'cc_checkrun_id null or cc_check_id not null, before Update ap_checks';
2121:
2122: UPDATE ap_checks
2123: SET CLEARED_DATE = NULL,
2124: CLEARED_AMOUNT = NULL,

Line 2122: UPDATE ap_checks

2118: ELSE
2119:
2120: l_debug_info := 'cc_checkrun_id null or cc_check_id not null, before Update ap_checks';
2121:
2122: UPDATE ap_checks
2123: SET CLEARED_DATE = NULL,
2124: CLEARED_AMOUNT = NULL,
2125: CLEARED_BASE_AMOUNT = NULL,
2126: CLEARED_ERROR_AMOUNT = NULL,

Line 2200: UPDATE ap_checks

2196: FROM
2197: DUAL;
2198:
2199: l_debug_info := ' inside Recon_Update_Check, Before Update';
2200: UPDATE ap_checks
2201: SET CLEARED_AMOUNT = RU_CLEARED_AMOUNT,
2202: CLEARED_BASE_AMOUNT = RU_CLEARED_BASE_AMOUNT,
2203: CLEARED_ERROR_AMOUNT = RU_CLEARED_ERROR_AMOUNT,
2204: CLEARED_ERROR_BASE_AMOUNT = RU_CLEARED_ERROR_BASE_AMOUNT,