858: p_cr_bsv VARCHAR2,
859: p_acct_type VARCHAR2)
860: IS
861: SELECT NVL((SELECT DECODE (p_acct_type, 'D', accts.dr_ccid, 'C', cr_ccid)
862: FROM fun_balance_accounts accts
863: WHERE accts.template_id = p_template_id
864: AND accts.dr_bsv = p_dr_bsv
865: AND accts.cr_bsv = p_cr_bsv),
866: NVL((SELECT DECODE (p_acct_type, 'D', accts.dr_ccid, 'C', cr_ccid)
863: WHERE accts.template_id = p_template_id
864: AND accts.dr_bsv = p_dr_bsv
865: AND accts.cr_bsv = p_cr_bsv),
866: NVL((SELECT DECODE (p_acct_type, 'D', accts.dr_ccid, 'C', cr_ccid)
867: FROM fun_balance_accounts accts
868: WHERE accts.template_id = p_template_id
869: AND accts.dr_bsv = p_dr_bsv
870: AND accts.cr_bsv = 'OTHER1234567890123456789012345'),
871: NVL((SELECT DECODE (p_acct_type, 'D', accts.dr_ccid, 'C', cr_ccid)
868: WHERE accts.template_id = p_template_id
869: AND accts.dr_bsv = p_dr_bsv
870: AND accts.cr_bsv = 'OTHER1234567890123456789012345'),
871: NVL((SELECT DECODE (p_acct_type, 'D', accts.dr_ccid, 'C', cr_ccid)
872: FROM fun_balance_accounts accts
873: WHERE accts.template_id = p_template_id
874: AND accts.dr_bsv = 'OTHER1234567890123456789012345'
875: AND accts.cr_bsv = p_cr_bsv),
876: (SELECT DECODE (p_acct_type, 'D', accts.dr_ccid, 'C', cr_ccid)
873: WHERE accts.template_id = p_template_id
874: AND accts.dr_bsv = 'OTHER1234567890123456789012345'
875: AND accts.cr_bsv = p_cr_bsv),
876: (SELECT DECODE (p_acct_type, 'D', accts.dr_ccid, 'C', cr_ccid)
877: FROM fun_balance_accounts accts
878: WHERE accts.template_id = p_template_id
879: AND accts.dr_bsv = 'OTHER1234567890123456789012345'
880: AND accts.cr_bsv = 'OTHER1234567890123456789012345')))) ccid
881: From Dual;
895: l_dummy NUMBER;
896: l_ic_seg_num NUMBER;
897: l_bal_seg_num NUMBER;
898: -- Bug: 7368523
899: l_dr_bsv FUN_BALANCE_ACCOUNTS.DR_BSV%TYPE;
900: l_cr_bsv FUN_BALANCE_ACCOUNTS.CR_BSV%TYPE;
901: BEGIN
902:
903: -- Bug 7193385 Start
896: l_ic_seg_num NUMBER;
897: l_bal_seg_num NUMBER;
898: -- Bug: 7368523
899: l_dr_bsv FUN_BALANCE_ACCOUNTS.DR_BSV%TYPE;
900: l_cr_bsv FUN_BALANCE_ACCOUNTS.CR_BSV%TYPE;
901: BEGIN
902:
903: -- Bug 7193385 Start
904: IF (p_acct_type = 'C')