DBA Data[Home] [Help]

APPS.FUN_RECON_RPT_PKG dependencies on GL_BALANCES

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

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

Line 61: gl_balances glb1,

57: ,glb1.currency_code TRANSACTION_CURRENCY
58: ,glb1.period_name TRANSACTING_PERIOD_NAME
59: ,glp2.period_name TRADING_PERIOD_NAME
60: FROM fun_inter_accounts_v fia1,
61: gl_balances glb1,
62: gl_ledger_le_v gl1,
63: gl_periods glp1,
64: fun_inter_accounts_v fia2,
65: gl_ledger_le_v gl2,

Line 1307: l_gl_balances_query VARCHAR2(32000);

1303: l_get_account_query VARCHAR2(32000);
1304: l_jelines_sla_query VARCHAR2(32000);
1305: l_jelines_gl_query VARCHAR2(32000);
1306: l_jelines_sum_query VARCHAR2(32000);
1307: l_gl_balances_query VARCHAR2(32000);
1308: l_gl_balances_query1 VARCHAR2(32000);
1309: l_sum_unmatched_query VARCHAR2(32000);
1310: l_gl_unmatched_query VARCHAR2(32000);
1311: l_sla_unmatched_query VARCHAR2(32000);

Line 1308: l_gl_balances_query1 VARCHAR2(32000);

1304: l_jelines_sla_query VARCHAR2(32000);
1305: l_jelines_gl_query VARCHAR2(32000);
1306: l_jelines_sum_query VARCHAR2(32000);
1307: l_gl_balances_query VARCHAR2(32000);
1308: l_gl_balances_query1 VARCHAR2(32000);
1309: l_sum_unmatched_query VARCHAR2(32000);
1310: l_gl_unmatched_query VARCHAR2(32000);
1311: l_sla_unmatched_query VARCHAR2(32000);
1312:

Line 1321: l_gl_balances_query_rev VARCHAR2(32000);

1317: l_get_account_query_rev VARCHAR2(32000);
1318: l_jelines_sla_query_rev VARCHAR2(32000);
1319: l_jelines_gl_query_rev VARCHAR2(32000);
1320: l_jelines_sum_query_rev VARCHAR2(32000);
1321: l_gl_balances_query_rev VARCHAR2(32000);
1322: l_gl_balances_query_rev1 VARCHAR2(32000);
1323: l_sum_unmatched_query_rev VARCHAR2(32000);
1324: l_gl_unmatched_query_rev VARCHAR2(32000);
1325: l_sla_unmatched_query_rev VARCHAR2(32000);

Line 1322: l_gl_balances_query_rev1 VARCHAR2(32000);

1318: l_jelines_sla_query_rev VARCHAR2(32000);
1319: l_jelines_gl_query_rev VARCHAR2(32000);
1320: l_jelines_sum_query_rev VARCHAR2(32000);
1321: l_gl_balances_query_rev VARCHAR2(32000);
1322: l_gl_balances_query_rev1 VARCHAR2(32000);
1323: l_sum_unmatched_query_rev VARCHAR2(32000);
1324: l_gl_unmatched_query_rev VARCHAR2(32000);
1325: l_sla_unmatched_query_rev VARCHAR2(32000);
1326:

Line 1427: l_gl_balances_query := C_FUN_GL_BALANCE_QUERY;

1423:
1424: l_get_account_query := C_FUN_GET_ACCTS_QUERY;
1425: l_jelines_sum_query := C_FUN_JELINES_SUM_QUERY;
1426: l_sum_unmatched_query := C_SUM_UNMATCHED_QUERY;
1427: l_gl_balances_query := C_FUN_GL_BALANCE_QUERY;
1428: l_gl_balances_query1 := C_FUN_GL_BALANCE_QUERY1;
1429: l_jelines_gl_query := C_FUN_JELINES_GL_QUERY;
1430: l_gl_unmatched_query := C_GL_UNMATCHED_QUERY;
1431: l_jelines_sla_query := C_FUN_JELINES_SLA_QUERY;

Line 1428: l_gl_balances_query1 := C_FUN_GL_BALANCE_QUERY1;

1424: l_get_account_query := C_FUN_GET_ACCTS_QUERY;
1425: l_jelines_sum_query := C_FUN_JELINES_SUM_QUERY;
1426: l_sum_unmatched_query := C_SUM_UNMATCHED_QUERY;
1427: l_gl_balances_query := C_FUN_GL_BALANCE_QUERY;
1428: l_gl_balances_query1 := C_FUN_GL_BALANCE_QUERY1;
1429: l_jelines_gl_query := C_FUN_JELINES_GL_QUERY;
1430: l_gl_unmatched_query := C_GL_UNMATCHED_QUERY;
1431: l_jelines_sla_query := C_FUN_JELINES_SLA_QUERY;
1432: l_sla_unmatched_query := C_SLA_UNMATCHED_QUERY;

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

1434:
1435:
1436: IF p_trans_ledger_id IS NOT NULL -- User input parameter
1437: THEN
1438: l_gl_balances_query := l_gl_balances_query || ' AND fia1.ledger_id = '||p_trans_ledger_id;
1439: l_get_account_query := l_get_account_query || ' AND fia1.ledger_id = '||p_trans_ledger_id;
1440: l_jelines_sum_query := l_jelines_sum_query || ' AND gjl.ledger_id = '||p_trans_ledger_id;
1441: l_sum_unmatched_query := l_sum_unmatched_query || ' AND SRC_TRANS_LEDGER_ID = '||p_trans_ledger_id;
1442: l_jelines_gl_query := l_jelines_gl_query || ' AND gjl.ledger_id = '||p_trans_ledger_id;

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

1446: END IF;
1447:
1448: IF P_TRANS_LEGAL_ENTITY_ID IS NOT NULL -- User input parameter
1449: THEN
1450: l_gl_balances_query := l_gl_balances_query || ' AND fia1.from_le_id = '||P_TRANS_LEGAL_ENTITY_ID ;
1451: l_get_account_query := l_get_account_query || ' AND fia1.from_le_id = '||P_TRANS_LEGAL_ENTITY_ID ;
1452: l_sum_unmatched_query := l_sum_unmatched_query || ' AND SRC_TRANS_LE_ID = '||P_TRANS_LEGAL_ENTITY_ID ;
1453: l_gl_unmatched_query := l_gl_unmatched_query || ' AND fia.from_le_id = '||P_TRANS_LEGAL_ENTITY_ID ;
1454: l_sla_unmatched_query := l_sla_unmatched_query || ' AND fia.from_le_id = '||P_TRANS_LEGAL_ENTITY_ID ;

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

1456: END IF;
1457:
1458: IF p_trans_gl_period IS NOT NULL -- User input parameter
1459: THEN
1460: l_gl_balances_query := l_gl_balances_query|| ' AND glb1.period_name = '''||p_trans_gl_period ||'''' ;
1461: l_jelines_sum_query := l_jelines_sum_query || ' AND gjl.period_name = '''||p_trans_gl_period ||'''' ;
1462: l_sum_unmatched_query := l_sum_unmatched_query || ' AND PERIOD_NAME = '''||p_trans_gl_period ||'''' ;
1463: l_jelines_gl_query := l_jelines_gl_query || ' AND gjl.period_name = '''||p_trans_gl_period ||'''' ;
1464: l_gl_unmatched_query := l_gl_unmatched_query || ' AND gjl.period_name = '''||p_trans_gl_period ||'''' ;

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

1469: END IF;
1470:
1471: IF p_tp_ledger_id IS NOT NULL -- User input parameter
1472: THEN
1473: l_gl_balances_query := l_gl_balances_query || ' AND fia2.ledger_id = '||p_tp_ledger_id ;
1474:
1475: l_get_account_query := l_get_account_query || ' AND fia2.ledger_id = '||p_tp_ledger_id ;
1476:
1477:

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

1490: END IF;
1491:
1492: IF P_TP_LEGAL_ENTITY_ID IS NOT NULL -- User input parameter
1493: THEN
1494: l_gl_balances_query := l_gl_balances_query || ' AND fia1.to_le_id = '||P_TP_LEGAL_ENTITY_ID ;
1495: l_get_account_query := l_get_account_query || ' AND fia1.to_le_id = '||P_TP_LEGAL_ENTITY_ID ;
1496: l_sum_unmatched_query := l_sum_unmatched_query || ' AND SRC_TRAD_LE_ID = '||P_TP_LEGAL_ENTITY_ID ;
1497: l_gl_unmatched_query := l_gl_unmatched_query || ' AND fia.to_le_id = '||P_TP_LEGAL_ENTITY_ID ;
1498: l_sla_unmatched_query := l_sla_unmatched_query || ' AND fia.to_le_id = '||P_TP_LEGAL_ENTITY_ID ;

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

1500:
1501:
1502: IF P_TP_GL_PERIOD IS NOT NULL -- User input parameter
1503: THEN
1504: l_gl_balances_query := l_gl_balances_query || ' AND glp2.period_name = '''||p_tp_gl_period ||'''' ;
1505: ELSE
1506: -- find corresponding GL period in the trading ledger side.
1507: l_gl_balances_query := l_gl_balances_query ||
1508: ' AND ''' ||l_period_end_date||''' BETWEEN glp2.start_date and glp2.end_date

Line 1507: l_gl_balances_query := l_gl_balances_query ||

1503: THEN
1504: l_gl_balances_query := l_gl_balances_query || ' AND glp2.period_name = '''||p_tp_gl_period ||'''' ;
1505: ELSE
1506: -- find corresponding GL period in the trading ledger side.
1507: l_gl_balances_query := l_gl_balances_query ||
1508: ' AND ''' ||l_period_end_date||''' BETWEEN glp2.start_date and glp2.end_date
1509: AND glp2.adjustment_period_flag = glp1.adjustment_period_flag';
1510: END IF;
1511:

Line 1514: l_gl_balances_query1 := REPLACE(l_gl_balances_query1,

1510: END IF;
1511:
1512: IF P_CURRENCY IS NOT NULL
1513: THEN
1514: l_gl_balances_query1 := REPLACE(l_gl_balances_query1,
1515: '$additional_currency_columns$',
1516: l_add_currency_cols);
1517: ELSE
1518: l_gl_balances_query1 := REPLACE(l_gl_balances_query1,

Line 1518: l_gl_balances_query1 := REPLACE(l_gl_balances_query1,

1514: l_gl_balances_query1 := REPLACE(l_gl_balances_query1,
1515: '$additional_currency_columns$',
1516: l_add_currency_cols);
1517: ELSE
1518: l_gl_balances_query1 := REPLACE(l_gl_balances_query1,
1519: '$additional_currency_columns$',
1520: ',NULL');
1521: END IF;
1522:

Line 1523: l_gl_balances_query1 := REPLACE(l_gl_balances_query1,

1519: '$additional_currency_columns$',
1520: ',NULL');
1521: END IF;
1522:
1523: l_gl_balances_query1 := REPLACE(l_gl_balances_query1,
1524: '$sub_query$',
1525: l_gl_balances_query);
1526:
1527:

Line 1525: l_gl_balances_query);

1521: END IF;
1522:
1523: l_gl_balances_query1 := REPLACE(l_gl_balances_query1,
1524: '$sub_query$',
1525: l_gl_balances_query);
1526:
1527:
1528: IF P_TP_GL_PERIOD IS NULL
1529: THEN

Line 1543: l_gl_balances_query1 := l_gl_balances_query1 ||

1539:
1540: l_sum_unmatched_query := REPLACE(l_sum_unmatched_query, '$where_clause1$', l_add_where_clause1);
1541: l_sla_unmatched_query := l_sla_unmatched_query || l_add_where_clause1;
1542:
1543: l_gl_balances_query1 := l_gl_balances_query1 ||
1544: ' ORDER BY TRANSACTING_LE, TRADING_PARTNER_LE, TRANSACTION_CURRENCY';
1545:
1546:
1547: l_jelines_sum_query := REPLACE (l_jelines_sum_query,

Line 1604: l_gl_balances_query_rev := C_FUN_GL_BALANCE_QUERY;

1600: -- Now do the queries to get the reverse side of the relationship
1601: -- so this is where the transacting_ledger becomes the trading_ledger
1602: -- and the trading ledger is now the transacting ledger.
1603:
1604: l_gl_balances_query_rev := C_FUN_GL_BALANCE_QUERY;
1605: l_gl_balances_query_rev1 := C_FUN_GL_BALANCE_QUERY1;
1606: l_get_account_query_rev := C_FUN_GET_ACCTS_QUERY;
1607: l_jelines_sum_query_rev := C_FUN_JELINES_SUM_QUERY;
1608: l_sum_unmatched_query_rev:= C_SUM_UNMATCHED_QUERY;

Line 1605: l_gl_balances_query_rev1 := C_FUN_GL_BALANCE_QUERY1;

1601: -- so this is where the transacting_ledger becomes the trading_ledger
1602: -- and the trading ledger is now the transacting ledger.
1603:
1604: l_gl_balances_query_rev := C_FUN_GL_BALANCE_QUERY;
1605: l_gl_balances_query_rev1 := C_FUN_GL_BALANCE_QUERY1;
1606: l_get_account_query_rev := C_FUN_GET_ACCTS_QUERY;
1607: l_jelines_sum_query_rev := C_FUN_JELINES_SUM_QUERY;
1608: l_sum_unmatched_query_rev:= C_SUM_UNMATCHED_QUERY;
1609: l_jelines_gl_query_rev := C_FUN_JELINES_GL_QUERY;

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

1614:
1615:
1616: IF p_trans_ledger_id IS NOT NULL -- User input parameter
1617: THEN
1618: l_gl_balances_query_rev := l_gl_balances_query_rev || ' AND fia2.ledger_id = '||p_trans_ledger_id;
1619:
1620: l_get_account_query_rev := l_get_account_query_rev || ' AND fia2.ledger_id = '||p_trans_ledger_id;
1621:
1622:

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

1635: END IF;
1636:
1637: IF p_trans_legal_entity_id IS NOT NULL -- User input parameter
1638: THEN
1639: l_gl_balances_query_rev := l_gl_balances_query_rev || ' AND fia2.from_le_id = '||P_TRANS_LEGAL_ENTITY_ID ;
1640: l_get_account_query_rev := l_get_account_query_rev || ' AND fia2.from_le_id = '||P_TRANS_LEGAL_ENTITY_ID ;
1641: l_sum_unmatched_query_rev := l_sum_unmatched_query_rev || ' AND SRC_TRAD_LE_ID = '||P_TRANS_LEGAL_ENTITY_ID ;
1642: l_gl_unmatched_query_rev := l_gl_unmatched_query_rev || ' AND fia.to_le_id = '||P_TRANS_LEGAL_ENTITY_ID ;
1643: l_sla_unmatched_query_rev := l_sla_unmatched_query_rev || ' AND fia.to_le_id = '||P_TRANS_LEGAL_ENTITY_ID ;

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

1644: END IF;
1645:
1646: IF p_trans_gl_period IS NOT NULL -- User input parameter
1647: THEN
1648: l_gl_balances_query_rev := l_gl_balances_query_rev|| ' AND glp2.period_name = '''||p_trans_gl_period ||'''' ;
1649: l_jelines_sla_query_rev := l_jelines_sla_query_rev || ' AND aeh.accounting_date BETWEEN '''||l_period_start_date ||''' AND ''' || l_period_end_date || '''';
1650: l_sla_unmatched_query_rev := l_sla_unmatched_query_rev ||' AND aeh.accounting_date BETWEEN '''||l_period_start_date ||''' AND ''' || l_period_end_date || '''';
1651: END IF;
1652:

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

1651: END IF;
1652:
1653: IF p_tp_ledger_id IS NOT NULL -- User input parameter
1654: THEN
1655: l_gl_balances_query_rev := l_gl_balances_query_rev || ' AND fia1.ledger_id = '||p_tp_ledger_id ;
1656: l_get_account_query_rev := l_get_account_query_rev || ' AND fia1.ledger_id = '||p_tp_ledger_id;
1657: l_jelines_sum_query_rev := l_jelines_sum_query_rev || ' AND gjl.ledger_id = '||p_tp_ledger_id;
1658: l_sum_unmatched_query_rev := l_sum_unmatched_query_rev || ' AND SRC_TRANS_LEDGER_ID = '||p_tp_ledger_id;
1659: l_jelines_gl_query_rev := l_jelines_gl_query_rev || ' AND gjl.ledger_id = '||p_tp_ledger_id;

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

1665:
1666:
1667: IF P_TP_LEGAL_ENTITY_ID IS NOT NULL -- User input parameter
1668: THEN
1669: l_gl_balances_query_rev := l_gl_balances_query_rev || ' AND fia1.from_le_id = '||P_TP_LEGAL_ENTITY_ID ;
1670: l_get_account_query_rev := l_get_account_query_rev || ' AND fia1.from_le_id = '||P_TP_LEGAL_ENTITY_ID ;
1671: l_gl_unmatched_query_rev := l_gl_unmatched_query_rev || ' AND fia.from_le_id = '||P_TP_LEGAL_ENTITY_ID ;
1672: l_sla_unmatched_query_rev := l_sla_unmatched_query_rev || ' AND fia.from_le_id = '||P_TP_LEGAL_ENTITY_ID ;
1673: END IF;

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

1674:
1675:
1676: IF p_tp_gl_period IS NOT NULL -- User input parameter
1677: THEN
1678: l_gl_balances_query_rev := l_gl_balances_query_rev || ' AND glb1.period_name = '''||p_tp_gl_period ||'''' ;
1679: l_jelines_sum_query_rev := l_jelines_sum_query_rev || ' AND gjl.period_name = '''||p_tp_gl_period ||'''' ;
1680: l_sum_unmatched_query_rev := l_sum_unmatched_query_rev || ' AND PERIOD_NAME = '''||p_tp_gl_period ||'''' ;
1681: l_jelines_gl_query_rev := l_jelines_gl_query_rev || ' AND gjl.period_name = '''||p_tp_gl_period ||'''' ;
1682: l_gl_unmatched_query_rev := l_gl_unmatched_query_rev || ' AND gjl.period_name = '''||p_tp_gl_period ||'''' ;

Line 1689: l_gl_balances_query_rev := l_gl_balances_query_rev ||

1685: l_sla_unmatched_query_rev := l_sla_unmatched_query_rev || ' AND aeh.period_name = '''||p_tp_gl_period ||'''' ;
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: ELSE
1688: -- find corresponding GL period in the relating ledger side.
1689: l_gl_balances_query_rev := l_gl_balances_query_rev ||
1690: ' AND ''' ||l_period_end_date||''' BETWEEN glp1.start_date and glp1.end_date
1691: AND glp1.adjustment_period_flag = glp2.adjustment_period_flag';
1692:
1693: l_jelines_sum_query_rev := l_jelines_sum_query_rev ||

Line 1716: l_gl_balances_query_rev1 := REPLACE(l_gl_balances_query_rev1,

1712: END IF;
1713:
1714: IF p_currency IS NOT NULL
1715: THEN
1716: l_gl_balances_query_rev1 := REPLACE(l_gl_balances_query_rev1,
1717: '$additional_currency_columns$',
1718: l_add_currency_cols);
1719: ELSE
1720: l_gl_balances_query_rev1 := REPLACE(l_gl_balances_query_rev1,

Line 1720: l_gl_balances_query_rev1 := REPLACE(l_gl_balances_query_rev1,

1716: l_gl_balances_query_rev1 := REPLACE(l_gl_balances_query_rev1,
1717: '$additional_currency_columns$',
1718: l_add_currency_cols);
1719: ELSE
1720: l_gl_balances_query_rev1 := REPLACE(l_gl_balances_query_rev1,
1721: '$additional_currency_columns$',
1722: ',NULL');
1723: END IF;
1724:

Line 1725: l_gl_balances_query_rev1 := REPLACE(l_gl_balances_query_rev1,

1721: '$additional_currency_columns$',
1722: ',NULL');
1723: END IF;
1724:
1725: l_gl_balances_query_rev1 := REPLACE(l_gl_balances_query_rev1,
1726: '$sub_query$',
1727: l_gl_balances_query_rev);
1728:
1729:

Line 1727: l_gl_balances_query_rev);

1723: END IF;
1724:
1725: l_gl_balances_query_rev1 := REPLACE(l_gl_balances_query_rev1,
1726: '$sub_query$',
1727: l_gl_balances_query_rev);
1728:
1729:
1730: 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, ' ||
1731: nvl(to_char(p_trans_ledger_id), 'null') || ', ''' || p_trans_gl_period||''' , ' ||

Line 1737: l_gl_balances_query_rev1 := l_gl_balances_query_rev1 ||

1733:
1734: l_sum_unmatched_query_rev := REPLACE(l_sum_unmatched_query_rev, '$where_clause1$', l_add_where_clause1);
1735: l_sla_unmatched_query_rev := l_sla_unmatched_query_rev || l_add_where_clause1;
1736:
1737: l_gl_balances_query_rev1 := l_gl_balances_query_rev1 ||
1738: ' ORDER BY TRANSACTING_LE, TRADING_PARTNER_LE, TRANSACTION_CURRENCY';
1739:
1740: l_jelines_sum_query_rev := REPLACE(l_jelines_sum_query_rev,
1741: '$get_accounts_query$',

Line 1794: p_array_sql(2) := l_gl_balances_query1;

1790: ORDER BY TRANS_LE, TRAD_LE, ENTERED_CURRENCY, JE_SOURCE_NAME, JE_CATEGORY_NAME, HEADER_ID, SLA_LINE_NUMBER';
1791:
1792:
1793:
1794: p_array_sql(2) := l_gl_balances_query1;
1795: p_array_sql(3) := l_jelines_sum_query;
1796: p_array_sql(4) := l_jelines_gl_query;
1797: p_array_sql(5) := l_jelines_sla_query;
1798:

Line 1799: p_array_sql(6) := l_gl_balances_query_rev1;

1795: p_array_sql(3) := l_jelines_sum_query;
1796: p_array_sql(4) := l_jelines_gl_query;
1797: p_array_sql(5) := l_jelines_sla_query;
1798:
1799: p_array_sql(6) := l_gl_balances_query_rev1;
1800: p_array_sql(7) := l_jelines_sum_query_rev;
1801: p_array_sql(8) := l_jelines_gl_query_rev;
1802: p_array_sql(9) := l_jelines_sla_query_rev;
1803:

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

1909: --
1910: --=============================================================================
1911:
1912: /* ----------------------------------------------------------------------------
1913: This function gets Receivables and Payables balances from gl_balances
1914: ------------------------------------------------------------------------------------*/
1915:
1916:
1917: function get_balance(p_balance_type varchar2,

Line 1938: FROM gl_balances glb

1934: if (p_balance_type = 'R') then
1935:
1936: SELECT sum(glb.begin_balance_dr), sum(glb.begin_balance_cr), sum(glb.period_net_dr), sum(glb.period_net_cr)
1937: INTO l_begin_balance_dr, l_begin_balance_cr, l_period_net_dr, l_period_net_cr
1938: FROM gl_balances glb
1939: WHERE glb.period_name = p_trans_gl_period
1940: AND glb.ledger_id = p_trans_ledger_id
1941: AND glb.actual_flag = 'A'
1942: AND glb.currency_code = p_currency

Line 1954: FROM gl_balances glb

1950: elsif (p_balance_type = 'P') then
1951:
1952: SELECT sum(glb.begin_balance_dr), sum(glb.begin_balance_cr), sum(glb.period_net_dr), sum(glb.period_net_cr)
1953: INTO l_begin_balance_dr, l_begin_balance_cr, l_period_net_dr, l_period_net_cr
1954: FROM gl_balances glb
1955: WHERE glb.period_name = p_trad_gl_period
1956: AND glb.ledger_id = p_trad_ledger_id
1957: AND glb.actual_flag = 'A'
1958: AND glb.currency_code = p_currency