DBA Data[Home] [Help]

APPS.FUN_RECON_RPT_PKG dependencies on GL_BALANCES

Line 49: -- Note below is actually a subquery for gl balances balances. This is used

45: -- of the trading ledger
46: -- The same query when passed with different parameters will be used such
47: -- that fia1 relates to the receivables account side of the trading ledger
48: -- fia2 relates to the payables account side of the transacting ledger
49: -- Note below is actually a subquery for gl balances balances. This is used
50: -- within C_FUN_GL_BALANCE_QUERY1 (which is the full query)
51: C_FUN_GL_BALANCE_QUERY CONSTANT VARCHAR2(30000) :=
52: '
53: SELECT distinct le1.legal_entity_id TRANSACTING_LE_ID

Line 65: gl_balances glb1,

61: ,glb1.currency_code TRANSACTION_CURRENCY
62: ,glb1.period_name TRANSACTING_PERIOD_NAME
63: ,glp2.period_name TRADING_PERIOD_NAME
64: FROM fun_inter_accounts_v fia1,
65: gl_balances glb1,
66: gl_ledgers gl1,
67: xle_entity_profiles le1,
68: gl_periods glp1,
69: fun_inter_accounts_v fia2,

Line 1333: l_gl_balances_query VARCHAR2(32000);

1329: l_get_account_query VARCHAR2(32000);
1330: l_jelines_sla_query VARCHAR2(32000);
1331: l_jelines_gl_query VARCHAR2(32000);
1332: l_jelines_sum_query VARCHAR2(32000);
1333: l_gl_balances_query VARCHAR2(32000);
1334: l_gl_balances_query1 VARCHAR2(32000);
1335: l_sum_unmatched_query VARCHAR2(32000);
1336: l_gl_unmatched_query VARCHAR2(32000);
1337: l_sla_unmatched_query VARCHAR2(32000);

Line 1334: l_gl_balances_query1 VARCHAR2(32000);

1330: l_jelines_sla_query VARCHAR2(32000);
1331: l_jelines_gl_query VARCHAR2(32000);
1332: l_jelines_sum_query VARCHAR2(32000);
1333: l_gl_balances_query VARCHAR2(32000);
1334: l_gl_balances_query1 VARCHAR2(32000);
1335: l_sum_unmatched_query VARCHAR2(32000);
1336: l_gl_unmatched_query VARCHAR2(32000);
1337: l_sla_unmatched_query VARCHAR2(32000);
1338:

Line 1347: l_gl_balances_query_rev VARCHAR2(32000);

1343: l_get_account_query_rev VARCHAR2(32000);
1344: l_jelines_sla_query_rev VARCHAR2(32000);
1345: l_jelines_gl_query_rev VARCHAR2(32000);
1346: l_jelines_sum_query_rev VARCHAR2(32000);
1347: l_gl_balances_query_rev VARCHAR2(32000);
1348: l_gl_balances_query_rev1 VARCHAR2(32000);
1349: l_sum_unmatched_query_rev VARCHAR2(32000);
1350: l_gl_unmatched_query_rev VARCHAR2(32000);
1351: l_sla_unmatched_query_rev VARCHAR2(32000);

Line 1348: l_gl_balances_query_rev1 VARCHAR2(32000);

1344: l_jelines_sla_query_rev VARCHAR2(32000);
1345: l_jelines_gl_query_rev VARCHAR2(32000);
1346: l_jelines_sum_query_rev VARCHAR2(32000);
1347: l_gl_balances_query_rev VARCHAR2(32000);
1348: l_gl_balances_query_rev1 VARCHAR2(32000);
1349: l_sum_unmatched_query_rev VARCHAR2(32000);
1350: l_gl_unmatched_query_rev VARCHAR2(32000);
1351: l_sla_unmatched_query_rev VARCHAR2(32000);
1352:

Line 1454: l_gl_balances_query := C_FUN_GL_BALANCE_QUERY;

1450: l_get_account_query := C_FUN_GET_ACCTS_QUERY;
1451: l_jelines_sum_query := C_FUN_JELINES_SUM_QUERY;
1452: l_sum_unmatched_query := C_SUM_UNMATCHED_QUERY;
1453: --Bug: 8947605
1454: l_gl_balances_query := C_FUN_GL_BALANCE_QUERY;
1455: l_gl_balances_query1 := C_FUN_GL_BALANCE_QUERY1;
1456: l_jelines_gl_query := C_FUN_JELINES_GL_QUERY;
1457: l_gl_unmatched_query := C_GL_UNMATCHED_QUERY;
1458: l_jelines_sla_query := C_FUN_JELINES_SLA_QUERY;

Line 1455: l_gl_balances_query1 := C_FUN_GL_BALANCE_QUERY1;

1451: l_jelines_sum_query := C_FUN_JELINES_SUM_QUERY;
1452: l_sum_unmatched_query := C_SUM_UNMATCHED_QUERY;
1453: --Bug: 8947605
1454: l_gl_balances_query := C_FUN_GL_BALANCE_QUERY;
1455: l_gl_balances_query1 := C_FUN_GL_BALANCE_QUERY1;
1456: l_jelines_gl_query := C_FUN_JELINES_GL_QUERY;
1457: l_gl_unmatched_query := C_GL_UNMATCHED_QUERY;
1458: l_jelines_sla_query := C_FUN_JELINES_SLA_QUERY;
1459: l_sla_unmatched_query := C_SLA_UNMATCHED_QUERY;

Line 1465: l_gl_balances_query := l_gl_balances_query || ' AND fia1.ledger_id = '||p_trans_ledger_id;

1461:
1462:
1463: IF p_trans_ledger_id IS NOT NULL -- User input parameter
1464: THEN
1465: l_gl_balances_query := l_gl_balances_query || ' AND fia1.ledger_id = '||p_trans_ledger_id;
1466: l_get_account_query := l_get_account_query || ' AND fia1.ledger_id = '||p_trans_ledger_id;
1467: l_jelines_sum_query := l_jelines_sum_query || ' AND gjl.ledger_id = '||p_trans_ledger_id;
1468: l_sum_unmatched_query := l_sum_unmatched_query || ' AND SRC_TRANS_LEDGER_ID = '||p_trans_ledger_id;
1469: l_jelines_gl_query := l_jelines_gl_query || ' AND gjl.ledger_id = '||p_trans_ledger_id;

Line 1477: l_gl_balances_query := l_gl_balances_query || ' AND fia1.from_le_id = '||P_TRANS_LEGAL_ENTITY_ID ;

1473: END IF;
1474:
1475: IF P_TRANS_LEGAL_ENTITY_ID IS NOT NULL -- User input parameter
1476: THEN
1477: l_gl_balances_query := l_gl_balances_query || ' AND fia1.from_le_id = '||P_TRANS_LEGAL_ENTITY_ID ;
1478: l_get_account_query := l_get_account_query || ' AND fia1.from_le_id = '||P_TRANS_LEGAL_ENTITY_ID ;
1479: l_sum_unmatched_query := l_sum_unmatched_query || ' AND SRC_TRANS_LE_ID = '||P_TRANS_LEGAL_ENTITY_ID ;
1480: l_gl_unmatched_query := l_gl_unmatched_query || ' AND fia.from_le_id = '||P_TRANS_LEGAL_ENTITY_ID ;
1481: l_sla_unmatched_query := l_sla_unmatched_query || ' AND fia.from_le_id = '||P_TRANS_LEGAL_ENTITY_ID ;

Line 1487: l_gl_balances_query := l_gl_balances_query|| ' AND glb1.period_name = '''||p_trans_gl_period ||'''' ;

1483: END IF;
1484:
1485: IF p_trans_gl_period IS NOT NULL -- User input parameter
1486: THEN
1487: l_gl_balances_query := l_gl_balances_query|| ' AND glb1.period_name = '''||p_trans_gl_period ||'''' ;
1488: l_jelines_sum_query := l_jelines_sum_query || ' AND gjl.period_name = '''||p_trans_gl_period ||'''' ;
1489: l_sum_unmatched_query := l_sum_unmatched_query || ' AND PERIOD_NAME = '''||p_trans_gl_period ||'''' ;
1490: l_jelines_gl_query := l_jelines_gl_query || ' AND gjl.period_name = '''||p_trans_gl_period ||'''' ;
1491: l_gl_unmatched_query := l_gl_unmatched_query || ' AND gjl.period_name = '''||p_trans_gl_period ||'''' ;

Line 1500: l_gl_balances_query := l_gl_balances_query || ' AND fia2.ledger_id = '||p_tp_ledger_id ;

1496: END IF;
1497:
1498: IF p_tp_ledger_id IS NOT NULL -- User input parameter
1499: THEN
1500: l_gl_balances_query := l_gl_balances_query || ' AND fia2.ledger_id = '||p_tp_ledger_id ;
1501:
1502: l_get_account_query := l_get_account_query || ' AND fia2.ledger_id = '||p_tp_ledger_id ;
1503:
1504:

Line 1521: l_gl_balances_query := l_gl_balances_query || ' AND fia1.to_le_id = '||P_TP_LEGAL_ENTITY_ID ;

1517: END IF;
1518:
1519: IF P_TP_LEGAL_ENTITY_ID IS NOT NULL -- User input parameter
1520: THEN
1521: l_gl_balances_query := l_gl_balances_query || ' AND fia1.to_le_id = '||P_TP_LEGAL_ENTITY_ID ;
1522: l_get_account_query := l_get_account_query || ' AND fia1.to_le_id = '||P_TP_LEGAL_ENTITY_ID ;
1523: l_sum_unmatched_query := l_sum_unmatched_query || ' AND SRC_TRAD_LE_ID = '||P_TP_LEGAL_ENTITY_ID ;
1524: l_gl_unmatched_query := l_gl_unmatched_query || ' AND fia.to_le_id = '||P_TP_LEGAL_ENTITY_ID ;
1525: l_sla_unmatched_query := l_sla_unmatched_query || ' AND fia.to_le_id = '||P_TP_LEGAL_ENTITY_ID ;

Line 1531: l_gl_balances_query := l_gl_balances_query || ' AND glp2.period_name = '''||p_tp_gl_period ||'''' ;

1527:
1528:
1529: IF P_TP_GL_PERIOD IS NOT NULL -- User input parameter
1530: THEN
1531: l_gl_balances_query := l_gl_balances_query || ' AND glp2.period_name = '''||p_tp_gl_period ||'''' ;
1532: ELSE
1533: -- find corresponding GL period in the trading ledger side.
1534: l_gl_balances_query := l_gl_balances_query ||
1535: ' AND ''' ||l_period_end_date||''' BETWEEN glp2.start_date and glp2.end_date

Line 1534: l_gl_balances_query := l_gl_balances_query ||

1530: THEN
1531: l_gl_balances_query := l_gl_balances_query || ' AND glp2.period_name = '''||p_tp_gl_period ||'''' ;
1532: ELSE
1533: -- find corresponding GL period in the trading ledger side.
1534: l_gl_balances_query := l_gl_balances_query ||
1535: ' AND ''' ||l_period_end_date||''' BETWEEN glp2.start_date and glp2.end_date
1536: AND glp2.adjustment_period_flag = glp1.adjustment_period_flag';
1537: END IF;
1538:

Line 1541: l_gl_balances_query1 := REPLACE(l_gl_balances_query1,

1537: END IF;
1538:
1539: IF P_CURRENCY IS NOT NULL
1540: THEN
1541: l_gl_balances_query1 := REPLACE(l_gl_balances_query1,
1542: '$additional_currency_columns$',
1543: l_add_currency_cols);
1544: ELSE
1545: l_gl_balances_query1 := REPLACE(l_gl_balances_query1,

Line 1545: l_gl_balances_query1 := REPLACE(l_gl_balances_query1,

1541: l_gl_balances_query1 := REPLACE(l_gl_balances_query1,
1542: '$additional_currency_columns$',
1543: l_add_currency_cols);
1544: ELSE
1545: l_gl_balances_query1 := REPLACE(l_gl_balances_query1,
1546: '$additional_currency_columns$',
1547: ',NULL');
1548: END IF;
1549:

Line 1550: l_gl_balances_query1 := REPLACE(l_gl_balances_query1,

1546: '$additional_currency_columns$',
1547: ',NULL');
1548: END IF;
1549:
1550: l_gl_balances_query1 := REPLACE(l_gl_balances_query1,
1551: '$sub_query$',
1552: l_gl_balances_query);
1553:
1554:

Line 1552: l_gl_balances_query);

1548: END IF;
1549:
1550: l_gl_balances_query1 := REPLACE(l_gl_balances_query1,
1551: '$sub_query$',
1552: l_gl_balances_query);
1553:
1554:
1555: IF P_TP_GL_PERIOD IS NULL
1556: THEN

Line 1570: --bug8844695 l_gl_balances_query1 := l_gl_balances_query1 ||

1566:
1567: l_sum_unmatched_query := REPLACE(l_sum_unmatched_query, '$where_clause1$', l_add_where_clause1);
1568: l_sla_unmatched_query := l_sla_unmatched_query || l_add_where_clause1;
1569:
1570: --bug8844695 l_gl_balances_query1 := l_gl_balances_query1 ||
1571: --bug8844695 ' ORDER BY TRANSACTING_LE, TRADING_PARTNER_LE, TRANSACTION_CURRENCY';
1572:
1573:
1574: l_jelines_sum_query := REPLACE (l_jelines_sum_query,

Line 1640: l_gl_balances_query_rev := C_FUN_GL_BALANCE_QUERY;

1636: -- Now do the queries to get the reverse side of the relationship
1637: -- so this is where the transacting_ledger becomes the trading_ledger
1638: -- and the trading ledger is now the transacting ledger.
1639: --Bug: 8947605
1640: l_gl_balances_query_rev := C_FUN_GL_BALANCE_QUERY;
1641: l_gl_balances_query_rev1 := C_FUN_GL_BALANCE_QUERY1;
1642: l_get_account_query_rev := C_FUN_GET_ACCTS_QUERY;
1643: l_jelines_sum_query_rev := C_FUN_JELINES_SUM_QUERY;
1644: l_sum_unmatched_query_rev:= C_SUM_UNMATCHED_QUERY;

Line 1641: l_gl_balances_query_rev1 := C_FUN_GL_BALANCE_QUERY1;

1637: -- so this is where the transacting_ledger becomes the trading_ledger
1638: -- and the trading ledger is now the transacting ledger.
1639: --Bug: 8947605
1640: l_gl_balances_query_rev := C_FUN_GL_BALANCE_QUERY;
1641: l_gl_balances_query_rev1 := C_FUN_GL_BALANCE_QUERY1;
1642: l_get_account_query_rev := C_FUN_GET_ACCTS_QUERY;
1643: l_jelines_sum_query_rev := C_FUN_JELINES_SUM_QUERY;
1644: l_sum_unmatched_query_rev:= C_SUM_UNMATCHED_QUERY;
1645: l_jelines_gl_query_rev := C_FUN_JELINES_GL_QUERY;

Line 1654: l_gl_balances_query_rev := l_gl_balances_query_rev || ' AND fia2.ledger_id = '||p_trans_ledger_id;

1650:
1651:
1652: IF p_trans_ledger_id IS NOT NULL -- User input parameter
1653: THEN
1654: l_gl_balances_query_rev := l_gl_balances_query_rev || ' AND fia2.ledger_id = '||p_trans_ledger_id;
1655:
1656: l_get_account_query_rev := l_get_account_query_rev || ' AND fia2.ledger_id = '||p_trans_ledger_id;
1657:
1658:

Line 1675: l_gl_balances_query_rev := l_gl_balances_query_rev || ' AND fia2.from_le_id = '||P_TRANS_LEGAL_ENTITY_ID ;

1671: END IF;
1672:
1673: IF p_trans_legal_entity_id IS NOT NULL -- User input parameter
1674: THEN
1675: l_gl_balances_query_rev := l_gl_balances_query_rev || ' AND fia2.from_le_id = '||P_TRANS_LEGAL_ENTITY_ID ;
1676: l_get_account_query_rev := l_get_account_query_rev || ' AND fia2.from_le_id = '||P_TRANS_LEGAL_ENTITY_ID ;
1677: l_sum_unmatched_query_rev := l_sum_unmatched_query_rev || ' AND SRC_TRAD_LE_ID = '||P_TRANS_LEGAL_ENTITY_ID ;
1678: l_gl_unmatched_query_rev := l_gl_unmatched_query_rev || ' AND fia.to_le_id = '||P_TRANS_LEGAL_ENTITY_ID ;
1679: l_sla_unmatched_query_rev := l_sla_unmatched_query_rev || ' AND fia.to_le_id = '||P_TRANS_LEGAL_ENTITY_ID ;

Line 1684: l_gl_balances_query_rev := l_gl_balances_query_rev|| ' AND glp2.period_name = '''||p_trans_gl_period ||'''' ;

1680: END IF;
1681:
1682: IF p_trans_gl_period IS NOT NULL -- User input parameter
1683: THEN
1684: l_gl_balances_query_rev := l_gl_balances_query_rev|| ' AND glp2.period_name = '''||p_trans_gl_period ||'''' ;
1685: l_jelines_sla_query_rev := l_jelines_sla_query_rev || ' AND aeh.accounting_date BETWEEN '''||l_period_start_date ||''' AND ''' || l_period_end_date || '''';
1686: l_sla_unmatched_query_rev := l_sla_unmatched_query_rev ||' AND aeh.accounting_date BETWEEN '''||l_period_start_date ||''' AND ''' || l_period_end_date || '''';
1687: END IF;
1688:

Line 1691: l_gl_balances_query_rev := l_gl_balances_query_rev || ' AND fia1.ledger_id = '||p_tp_ledger_id ;

1687: END IF;
1688:
1689: IF p_tp_ledger_id IS NOT NULL -- User input parameter
1690: THEN
1691: l_gl_balances_query_rev := l_gl_balances_query_rev || ' AND fia1.ledger_id = '||p_tp_ledger_id ;
1692: l_get_account_query_rev := l_get_account_query_rev || ' AND fia1.ledger_id = '||p_tp_ledger_id;
1693: l_jelines_sum_query_rev := l_jelines_sum_query_rev || ' AND gjl.ledger_id = '||p_tp_ledger_id;
1694: l_sum_unmatched_query_rev := l_sum_unmatched_query_rev || ' AND SRC_TRANS_LEDGER_ID = '||p_tp_ledger_id;
1695: l_jelines_gl_query_rev := l_jelines_gl_query_rev || ' AND gjl.ledger_id = '||p_tp_ledger_id;

Line 1705: l_gl_balances_query_rev := l_gl_balances_query_rev || ' AND fia1.from_le_id = '||P_TP_LEGAL_ENTITY_ID ;

1701:
1702:
1703: IF P_TP_LEGAL_ENTITY_ID IS NOT NULL -- User input parameter
1704: THEN
1705: l_gl_balances_query_rev := l_gl_balances_query_rev || ' AND fia1.from_le_id = '||P_TP_LEGAL_ENTITY_ID ;
1706: l_get_account_query_rev := l_get_account_query_rev || ' AND fia1.from_le_id = '||P_TP_LEGAL_ENTITY_ID ;
1707: l_gl_unmatched_query_rev := l_gl_unmatched_query_rev || ' AND fia.from_le_id = '||P_TP_LEGAL_ENTITY_ID ;
1708: l_sla_unmatched_query_rev := l_sla_unmatched_query_rev || ' AND fia.from_le_id = '||P_TP_LEGAL_ENTITY_ID ;
1709: END IF;

Line 1714: l_gl_balances_query_rev := l_gl_balances_query_rev || ' AND glb1.period_name = '''||p_tp_gl_period ||'''' ;

1710:
1711:
1712: IF p_tp_gl_period IS NOT NULL -- User input parameter
1713: THEN
1714: l_gl_balances_query_rev := l_gl_balances_query_rev || ' AND glb1.period_name = '''||p_tp_gl_period ||'''' ;
1715: l_jelines_sum_query_rev := l_jelines_sum_query_rev || ' AND gjl.period_name = '''||p_tp_gl_period ||'''' ;
1716: l_sum_unmatched_query_rev := l_sum_unmatched_query_rev || ' AND PERIOD_NAME = '''||p_tp_gl_period ||'''' ;
1717: l_jelines_gl_query_rev := l_jelines_gl_query_rev || ' AND gjl.period_name = '''||p_tp_gl_period ||'''' ;
1718: l_gl_unmatched_query_rev := l_gl_unmatched_query_rev || ' AND gjl.period_name = '''||p_tp_gl_period ||'''' ;

Line 1725: l_gl_balances_query_rev := l_gl_balances_query_rev ||

1721: l_sla_unmatched_query_rev := l_sla_unmatched_query_rev || ' AND aeh.period_name = '''||p_tp_gl_period ||'''' ;
1722: l_sla_unmatched_query_rev := l_sla_unmatched_query_rev || ' AND aeh.accounting_date BETWEEN '''||l_period_start_date ||''' AND ''' || l_period_end_date || '''';
1723: ELSE
1724: -- find corresponding GL period in the relating ledger side.
1725: l_gl_balances_query_rev := l_gl_balances_query_rev ||
1726: ' AND ''' ||l_period_end_date||''' BETWEEN glp1.start_date and glp1.end_date
1727: AND glp1.adjustment_period_flag = glp2.adjustment_period_flag';
1728:
1729: l_jelines_sum_query_rev := l_jelines_sum_query_rev ||

Line 1752: l_gl_balances_query_rev1 := REPLACE(l_gl_balances_query_rev1,

1748: END IF;
1749:
1750: IF p_currency IS NOT NULL
1751: THEN
1752: l_gl_balances_query_rev1 := REPLACE(l_gl_balances_query_rev1,
1753: '$additional_currency_columns$',
1754: l_add_currency_cols);
1755: ELSE
1756: l_gl_balances_query_rev1 := REPLACE(l_gl_balances_query_rev1,

Line 1756: l_gl_balances_query_rev1 := REPLACE(l_gl_balances_query_rev1,

1752: l_gl_balances_query_rev1 := REPLACE(l_gl_balances_query_rev1,
1753: '$additional_currency_columns$',
1754: l_add_currency_cols);
1755: ELSE
1756: l_gl_balances_query_rev1 := REPLACE(l_gl_balances_query_rev1,
1757: '$additional_currency_columns$',
1758: ',NULL');
1759: END IF;
1760:

Line 1761: l_gl_balances_query_rev1 := REPLACE(l_gl_balances_query_rev1,

1757: '$additional_currency_columns$',
1758: ',NULL');
1759: END IF;
1760:
1761: l_gl_balances_query_rev1 := REPLACE(l_gl_balances_query_rev1,
1762: '$sub_query$',
1763: l_gl_balances_query_rev);
1764:
1765:

Line 1763: l_gl_balances_query_rev);

1759: END IF;
1760:
1761: l_gl_balances_query_rev1 := REPLACE(l_gl_balances_query_rev1,
1762: '$sub_query$',
1763: l_gl_balances_query_rev);
1764:
1765:
1766: l_add_where_clause1 := ' AND FUN_RECON_RPT_PKG.match_ap_ar_invoice(fia.from_le_id, fia.ledger_id, glp.period_name, fia.to_le_id, ' ||
1767: nvl(to_char(p_trans_ledger_id), 'null') || ', ''' || p_trans_gl_period||''' , ' ||

Line 1773: l_gl_balances_query_rev1 := l_gl_balances_query_rev1 ||

1769:
1770: l_sum_unmatched_query_rev := REPLACE(l_sum_unmatched_query_rev, '$where_clause1$', l_add_where_clause1);
1771: l_sla_unmatched_query_rev := l_sla_unmatched_query_rev || l_add_where_clause1;
1772:
1773: l_gl_balances_query_rev1 := l_gl_balances_query_rev1 ||
1774: ' ORDER BY TRANSACTING_LE, TRADING_PARTNER_LE, TRANSACTION_CURRENCY';
1775:
1776: l_jelines_sum_query_rev := REPLACE(l_jelines_sum_query_rev,
1777: '$get_accounts_query$',

Line 1830: p_array_sql(2) := l_gl_balances_query1 || ' --bug8844695

1826: ORDER BY TRANS_LE, TRAD_LE, ENTERED_CURRENCY, JE_SOURCE_NAME, JE_CATEGORY_NAME, HEADER_ID, SLA_LINE_NUMBER';
1827:
1828:
1829:
1830: p_array_sql(2) := l_gl_balances_query1 || ' --bug8844695
1831: UNION
1832: ' || l_gl_balances_query_rev1;
1833: p_array_sql(3) := l_jelines_sum_query || '
1834: UNION

Line 1832: ' || l_gl_balances_query_rev1;

1828:
1829:
1830: p_array_sql(2) := l_gl_balances_query1 || ' --bug8844695
1831: UNION
1832: ' || l_gl_balances_query_rev1;
1833: p_array_sql(3) := l_jelines_sum_query || '
1834: UNION
1835: ' || l_jelines_sum_query_rev;
1836: p_array_sql(4) := l_jelines_gl_query || '

Line 1956: This function gets Receivables and Payables balances from gl_balances

1952: --
1953: --=============================================================================
1954:
1955: /* ----------------------------------------------------------------------------
1956: This function gets Receivables and Payables balances from gl_balances
1957: ------------------------------------------------------------------------------------*/
1958:
1959:
1960: function get_balance(p_balance_type varchar2,

Line 1974: l_currency gl_balances.CURRENCY_CODE%TYPE;

1970: l_begin_balance_dr number;
1971: l_begin_balance_cr number;
1972: l_period_net_dr number;
1973: l_period_net_cr number;
1974: l_currency gl_balances.CURRENCY_CODE%TYPE;
1975:
1976: begin
1977:
1978:

Line 1996: FROM gl_balances glb

1992: sum(glb.begin_balance_cr),
1993: sum(glb.period_net_dr),
1994: sum(glb.period_net_cr)
1995: INTO l_begin_balance_dr, l_begin_balance_cr, l_period_net_dr, l_period_net_cr
1996: FROM gl_balances glb
1997: WHERE glb.period_name = p_trans_gl_period
1998: AND glb.ledger_id = p_trans_ledger_id
1999: AND glb.actual_flag = 'A'
2000: AND glb.currency_code = p_currency

Line 2015: FROM gl_balances glb

2011: sum(glb.begin_balance_cr_beq),
2012: sum(glb.period_net_dr_beq),
2013: sum(glb.period_net_cr_beq)
2014: INTO l_begin_balance_dr, l_begin_balance_cr, l_period_net_dr, l_period_net_cr
2015: FROM gl_balances glb
2016: WHERE glb.period_name = p_trans_gl_period
2017: AND glb.ledger_id = p_trans_ledger_id
2018: AND glb.actual_flag = 'A'
2019: AND glb.currency_code = p_currency

Line 2040: FROM gl_balances glb

2036: if( l_currency <> p_currency) THEN
2037:
2038: SELECT sum(glb.begin_balance_dr), sum(glb.begin_balance_cr), sum(glb.period_net_dr), sum(glb.period_net_cr)
2039: INTO l_begin_balance_dr, l_begin_balance_cr, l_period_net_dr, l_period_net_cr
2040: FROM gl_balances glb
2041: WHERE glb.period_name = p_trad_gl_period
2042: AND glb.ledger_id = p_trad_ledger_id
2043: AND glb.actual_flag = 'A'
2044: AND glb.currency_code = p_currency

Line 2057: FROM gl_balances glb

2053: else
2054:
2055: SELECT sum(glb.begin_balance_dr_beq), sum(glb.begin_balance_cr_beq), sum(glb.period_net_dr_beq), sum(glb.period_net_cr_beq)
2056: INTO l_begin_balance_dr, l_begin_balance_cr, l_period_net_dr, l_period_net_cr
2057: FROM gl_balances glb
2058: WHERE glb.period_name = p_trad_gl_period
2059: AND glb.ledger_id = p_trad_ledger_id
2060: AND glb.actual_flag = 'A'
2061: AND glb.currency_code = p_currency