DBA Data[Home] [Help]

APPS.JL_CO_GL_NIT_MANAGEMENT dependencies on JL_CO_GL_BALANCES

Line 2529: FROM jl_co_gl_balances bal

2525:
2526:
2527: SELECT count(*)
2528: INTO l_bal_count
2529: FROM jl_co_gl_balances bal
2530: WHERE bal.period_name = p_period
2531: AND bal.period_year = p_period_year
2532: AND bal.set_of_books_id = p_sobid
2533: AND rownum = 1;

Line 2541: FROM jl_co_gl_balances bal

2537: SELECT max((bal.period_year * 100 + bal.period_num))
2538: , max(bal.period_year) --bug 10207969
2539: INTO l_pre_period_num
2540: , l_pre_period_year --bug 10207969
2541: FROM jl_co_gl_balances bal
2542: WHERE (bal.period_year * 100 + bal.period_num) < p_period_year * 100 + p_period_num
2543: AND bal.set_of_books_id = p_sobid;
2544:
2545: INSERT INTO jl_co_gl_balances (

Line 2545: INSERT INTO jl_co_gl_balances (

2541: FROM jl_co_gl_balances bal
2542: WHERE (bal.period_year * 100 + bal.period_num) < p_period_year * 100 + p_period_num
2543: AND bal.set_of_books_id = p_sobid;
2544:
2545: INSERT INTO jl_co_gl_balances (
2546: balance_id,
2547: set_of_books_id,
2548: code_combination_id,
2549: account_code,

Line 2564: (select jl_co_gl_balances_s.nextval,

2560: created_by,
2561: last_update_date,
2562: last_updated_by,
2563: last_update_login)
2564: (select jl_co_gl_balances_s.nextval,
2565: bal.set_of_books_id,
2566: bal.code_combination_id,
2567: bal.account_code,
2568: bal.nit_id,

Line 2588: FROM jl_co_gl_balances bal

2584: bal.created_by,
2585: sysdate,
2586: bal.last_updated_by,
2587: bal.last_update_login
2588: FROM jl_co_gl_balances bal
2589: , gl_code_combinations glcc --bug 10207969
2590: WHERE (bal.period_year * 100 + bal.period_num) = l_pre_period_num
2591: AND bal.code_combination_id = glcc.code_combination_id --bug 10207969
2592: AND bal.set_of_books_id = p_sobid);

Line 2616: l_balance_id jl_co_gl_balances.balance_id%TYPE;

2612: PROCEDURE Calculate_Balance(p_cid IN NUMBER,
2613: p_sobid IN NUMBER,
2614: p_userid IN NUMBER) IS
2615:
2616: l_balance_id jl_co_gl_balances.balance_id%TYPE;
2617: l_begin_bal_dr_prior_period jl_co_gl_balances.begin_balance_dr%TYPE;
2618: l_begin_bal_cr_prior_period jl_co_gl_balances.begin_balance_cr%TYPE;
2619: l_period_net_dr_prior_period jl_co_gl_balances.period_net_dr%TYPE;
2620: l_period_net_cr_prior_period jl_co_gl_balances.period_net_cr%TYPE;

Line 2617: l_begin_bal_dr_prior_period jl_co_gl_balances.begin_balance_dr%TYPE;

2613: p_sobid IN NUMBER,
2614: p_userid IN NUMBER) IS
2615:
2616: l_balance_id jl_co_gl_balances.balance_id%TYPE;
2617: l_begin_bal_dr_prior_period jl_co_gl_balances.begin_balance_dr%TYPE;
2618: l_begin_bal_cr_prior_period jl_co_gl_balances.begin_balance_cr%TYPE;
2619: l_period_net_dr_prior_period jl_co_gl_balances.period_net_dr%TYPE;
2620: l_period_net_cr_prior_period jl_co_gl_balances.period_net_cr%TYPE;
2621: l_begin_bal_dr jl_co_gl_balances.begin_balance_dr%TYPE;

Line 2618: l_begin_bal_cr_prior_period jl_co_gl_balances.begin_balance_cr%TYPE;

2614: p_userid IN NUMBER) IS
2615:
2616: l_balance_id jl_co_gl_balances.balance_id%TYPE;
2617: l_begin_bal_dr_prior_period jl_co_gl_balances.begin_balance_dr%TYPE;
2618: l_begin_bal_cr_prior_period jl_co_gl_balances.begin_balance_cr%TYPE;
2619: l_period_net_dr_prior_period jl_co_gl_balances.period_net_dr%TYPE;
2620: l_period_net_cr_prior_period jl_co_gl_balances.period_net_cr%TYPE;
2621: l_begin_bal_dr jl_co_gl_balances.begin_balance_dr%TYPE;
2622: l_begin_bal_cr jl_co_gl_balances.begin_balance_cr%TYPE;

Line 2619: l_period_net_dr_prior_period jl_co_gl_balances.period_net_dr%TYPE;

2615:
2616: l_balance_id jl_co_gl_balances.balance_id%TYPE;
2617: l_begin_bal_dr_prior_period jl_co_gl_balances.begin_balance_dr%TYPE;
2618: l_begin_bal_cr_prior_period jl_co_gl_balances.begin_balance_cr%TYPE;
2619: l_period_net_dr_prior_period jl_co_gl_balances.period_net_dr%TYPE;
2620: l_period_net_cr_prior_period jl_co_gl_balances.period_net_cr%TYPE;
2621: l_begin_bal_dr jl_co_gl_balances.begin_balance_dr%TYPE;
2622: l_begin_bal_cr jl_co_gl_balances.begin_balance_cr%TYPE;
2623: l_period_set_name gl_periods.period_set_name%TYPE;

Line 2620: l_period_net_cr_prior_period jl_co_gl_balances.period_net_cr%TYPE;

2616: l_balance_id jl_co_gl_balances.balance_id%TYPE;
2617: l_begin_bal_dr_prior_period jl_co_gl_balances.begin_balance_dr%TYPE;
2618: l_begin_bal_cr_prior_period jl_co_gl_balances.begin_balance_cr%TYPE;
2619: l_period_net_dr_prior_period jl_co_gl_balances.period_net_dr%TYPE;
2620: l_period_net_cr_prior_period jl_co_gl_balances.period_net_cr%TYPE;
2621: l_begin_bal_dr jl_co_gl_balances.begin_balance_dr%TYPE;
2622: l_begin_bal_cr jl_co_gl_balances.begin_balance_cr%TYPE;
2623: l_period_set_name gl_periods.period_set_name%TYPE;
2624: l_max_period_num gl_periods.period_num%TYPE;

Line 2621: l_begin_bal_dr jl_co_gl_balances.begin_balance_dr%TYPE;

2617: l_begin_bal_dr_prior_period jl_co_gl_balances.begin_balance_dr%TYPE;
2618: l_begin_bal_cr_prior_period jl_co_gl_balances.begin_balance_cr%TYPE;
2619: l_period_net_dr_prior_period jl_co_gl_balances.period_net_dr%TYPE;
2620: l_period_net_cr_prior_period jl_co_gl_balances.period_net_cr%TYPE;
2621: l_begin_bal_dr jl_co_gl_balances.begin_balance_dr%TYPE;
2622: l_begin_bal_cr jl_co_gl_balances.begin_balance_cr%TYPE;
2623: l_period_set_name gl_periods.period_set_name%TYPE;
2624: l_max_period_num gl_periods.period_num%TYPE;
2625:

Line 2622: l_begin_bal_cr jl_co_gl_balances.begin_balance_cr%TYPE;

2618: l_begin_bal_cr_prior_period jl_co_gl_balances.begin_balance_cr%TYPE;
2619: l_period_net_dr_prior_period jl_co_gl_balances.period_net_dr%TYPE;
2620: l_period_net_cr_prior_period jl_co_gl_balances.period_net_cr%TYPE;
2621: l_begin_bal_dr jl_co_gl_balances.begin_balance_dr%TYPE;
2622: l_begin_bal_cr jl_co_gl_balances.begin_balance_cr%TYPE;
2623: l_period_set_name gl_periods.period_set_name%TYPE;
2624: l_max_period_num gl_periods.period_num%TYPE;
2625:
2626: -- right now the currency field in jl_co_gl_balances only holds

Line 2626: -- right now the currency field in jl_co_gl_balances only holds

2622: l_begin_bal_cr jl_co_gl_balances.begin_balance_cr%TYPE;
2623: l_period_set_name gl_periods.period_set_name%TYPE;
2624: l_max_period_num gl_periods.period_num%TYPE;
2625:
2626: -- right now the currency field in jl_co_gl_balances only holds
2627: -- functional_currency_code. But in the future if the functionality
2628: -- is changed to hold balances for multiple currencies then curreny_code
2629: -- should be added to the BALANCE_TRX cursor and in other sql joins also
2630:

Line 2681: FROM jl_co_gl_balances jlcgb

2677: BEGIN
2678:
2679: SELECT balance_id
2680: INTO l_balance_id
2681: FROM jl_co_gl_balances jlcgb
2682: WHERE jlcgb.set_of_books_id = trx.sobid
2683: AND jlcgb.nit_id = trx.nitid
2684: AND jlcgb.code_combination_id = trx.ccid
2685: AND jlcgb.period_name = trx.period_name;

Line 2715: FROM jl_co_gl_balances jlcgb

2711: INTO l_begin_bal_dr_prior_period,
2712: l_begin_bal_cr_prior_period,
2713: l_period_net_dr_prior_period,
2714: l_period_net_cr_prior_period
2715: FROM jl_co_gl_balances jlcgb
2716: WHERE jlcgb.nit_id = trx.nitid
2717: AND jlcgb.set_of_books_id = trx.sobid
2718: AND jlcgb.code_combination_id = trx.ccid
2719: AND (jlcgb.period_year * 100 + jlcgb.period_num) =

Line 2722: FROM jl_co_gl_balances jlcgb1

2718: AND jlcgb.code_combination_id = trx.ccid
2719: AND (jlcgb.period_year * 100 + jlcgb.period_num) =
2720: (SELECT max(jlcgb1.period_year * 100 +
2721: jlcgb1.period_num)
2722: FROM jl_co_gl_balances jlcgb1
2723: WHERE jlcgb1.nit_id = trx.nitid
2724: AND jlcgb1.set_of_books_id = trx.sobid
2725: AND jlcgb1.code_combination_id = trx.ccid
2726: AND (jlcgb1.period_year * 100 + jlcgb1.period_num) <

Line 2752: INSERT INTO jl_co_gl_balances (

2748: l_period_net_dr_prior_period ;
2749: l_begin_bal_cr := l_begin_bal_cr_prior_period +
2750: l_period_net_cr_prior_period ;
2751:
2752: INSERT INTO jl_co_gl_balances (
2753: balance_id,
2754: set_of_books_id,
2755: code_combination_id,
2756: account_code,

Line 2771: VALUES ( jl_co_gl_balances_s.nextval,

2767: created_by,
2768: last_update_date,
2769: last_updated_by,
2770: last_update_login)
2771: VALUES ( jl_co_gl_balances_s.nextval,
2772: trx.sobid,
2773: trx.ccid,
2774: trx.acccode,
2775: trx.nitid,

Line 2794: UPDATE jl_co_gl_balances jlcgb

2790: ELSE
2791: -- Balance record exists - Update period_net of current record
2792: FND_FILE.PUT_LINE(FND_FILE.log,
2793: 'If l_balance_id is non 0 then update :' ||to_char(trx.acc_dr));
2794: UPDATE jl_co_gl_balances jlcgb
2795: SET period_net_dr = (period_net_dr + trx.acc_dr) ,
2796: period_net_cr = (period_net_cr + trx.acc_cr),
2797: last_update_date = sysdate,
2798: last_updated_by = p_userid,

Line 2812: UPDATE jl_co_gl_balances jlcgb

2808: -- each balance_trx.
2809: -- For income statement accounts only the records in the same year
2810: -- as the transaction needs to be updated
2811:
2812: UPDATE jl_co_gl_balances jlcgb
2813: SET begin_balance_dr = (begin_balance_dr + trx.acc_dr),
2814: begin_balance_cr = (begin_balance_cr + trx.acc_cr),
2815: last_update_date = sysdate,
2816: last_updated_by = p_userid,

Line 2886: UPDATE jl_co_gl_balances jlcgb

2882:
2883: FOR trx IN reversal_trx
2884: LOOP
2885:
2886: UPDATE jl_co_gl_balances jlcgb
2887: -- period_net should be updated only for the purge period
2888: SET period_net_dr =
2889: (period_net_dr - DECODE(jlcgb.period_name, trx.period_name,
2890: trx.acc_dr,0)),

Line 2923: -- in jl_co_gl_trx and jl_co_gl_balances for that NIT

2919: -- After the update if the period_net_dr and cr amounts are 0
2920: -- delete the balance record so that one would be able to delete
2921: -- an invalid NIT via the Define Third Party form.
2922: -- The form does not let you delete a NIT if there are records
2923: -- in jl_co_gl_trx and jl_co_gl_balances for that NIT
2924:
2925: /* Bug 8339893: Irrespective of balances being ZERO or not, if there are
2926: * NO records in table JL_CO_GL_TRX for same SOB, NIT, CCID and PERIOD NEITHER
2927: * for OTHER PROCESS_ID, then we can safely delete balances for SAME SOB,

Line 2931: DELETE FROM jl_co_gl_balances jlcgb

2927: * for OTHER PROCESS_ID, then we can safely delete balances for SAME SOB,
2928: * NIT, CCID and PERIOD since this cursor already grouped this info for
2929: * current PROCESS_ID, meaning there are NO other TRXs using such balance */
2930:
2931: DELETE FROM jl_co_gl_balances jlcgb
2932: WHERE jlcgb.set_of_books_id = trx.sobid
2933: AND jlcgb.nit_id = trx.nitid
2934: AND jlcgb.code_combination_id = trx.ccid
2935: AND jlcgb.period_name = trx.period_name