The following lines contain the word 'select', 'insert', 'update' or 'delete':
| 03-DEC-02 A. Quaglia update_balance_flag: decoupled update |
| statements. Locking removed. |
| 10-DEC-02 A. Quaglia Overloaded update_balance_flag with |
| p_event_id,p_entity_id,p_application_id |
| 11-DEC-02 A. Quaglia update_balance_flag added where condition |
| on accounting_entry_status_code and |
| balance_type_code. |
| 12-DEC-02 A. Quaglia update_balance_flag: added parameter |
| p_application_id where missing, added |
| NOT NULL check. |
| 27-MAY-03 A. Quaglia replaced XLA_95100_COMMON_ERROR with |
| XLA_COMMON_ERROR. |
| 05-MAR-04 A.Quaglia Changed trace handling as per Sandeep's |
| code. |
| 25-MAR-04 A.Quaglia Fixed debug changes issues: |
| -Replaced global variable for trace |
| with local one |
| -Fixed issue with SQL%ROWCOUNT which is |
| modified after calling debug proc |
+======================================================================*/
--Generic Procedure/Function template
/*======================================================================+
| |
| Private Function |
| |
| Description |
| ----------- |
| |
| |
| Pseudo-code |
| ----------- |
| |
| |
| Open issues |
| ----------- |
| |
| |
+======================================================================*/
--
-- Private exceptions
--
le_resource_busy EXCEPTION;
SELECT gcc.reference3
INTO l_qualifier_value
FROM gl_code_combinations gcc
WHERE gcc.code_combination_id = p_code_combination_id;
SELECT xsl.control_account_type_code
INTO l_je_source_name
FROM xla_subledgers xsl
WHERE xsl.application_id = p_application_id;
FUNCTION update_balance_flag ( p_application_id IN INTEGER
,p_ae_header_id IN INTEGER
,p_ae_line_num IN INTEGER
)
RETURN BOOLEAN
IS
l_log_module VARCHAR2 (2000);
l_log_module := C_DEFAULT_MODULE||'.update_balance_flag';
(p_location => 'xla_control_accounts_pkg.update_balance_flag');
UPDATE xla_ae_lines xal
SET xal.control_balance_flag = C_CONTROL_BALANCE_FLAG_PENDING
WHERE xal.ROWID IN
( SELECT ael.ROWID
FROM xla_ae_headers aeh
,gl_ledgers xgl
,xla_subledgers xsb
,xla_ae_lines ael
,gl_code_combinations gcc
WHERE aeh.ae_header_id = p_ae_header_id
AND aeh.application_id = p_application_id
AND aeh.balance_type_code = 'A'
AND aeh.accounting_entry_status_code IN ('D', 'F')
AND ael.ae_header_id = aeh.ae_header_id
AND ael.application_id = aeh.application_id
AND ael.party_type_code IS NOT NULL
AND ael.party_id IS NOT NULL
AND ael.control_balance_flag IS NULL
AND xgl.ledger_id = aeh.ledger_id
AND xsb.application_id = aeh.application_id
AND nvl(xsb.control_account_type_code, 'N') <> 'N'
AND gcc.chart_of_accounts_id = xgl.chart_of_accounts_id
AND gcc.code_combination_id = ael.code_combination_id
AND gcc.reference3 = xsb.control_account_type_code
);
UPDATE xla_ae_lines xal
SET xal.control_balance_flag = C_CONTROL_BALANCE_FLAG_PENDING
WHERE xal.ROWID IN
( SELECT ael.ROWID
FROM xla_ae_headers aeh
,gl_ledgers xgl
,xla_subledgers xsb
,xla_ae_lines ael
,gl_code_combinations gcc
WHERE aeh.ae_header_id = p_ae_header_id
AND aeh.application_id = p_application_id
AND aeh.balance_type_code = 'A'
AND aeh.accounting_entry_status_code IN ('D', 'F')
AND ael.ae_header_id = aeh.ae_header_id
AND ael.application_id = aeh.application_id
AND ael.ae_line_num = p_ae_line_num
AND ael.party_type_code IS NOT NULL
AND ael.party_id IS NOT NULL
AND ael.control_balance_flag IS NULL
AND xgl.ledger_id = aeh.ledger_id
AND xsb.application_id = aeh.application_id
AND nvl(xsb.control_account_type_code, 'N') <> 'N'
AND gcc.chart_of_accounts_id = xgl.chart_of_accounts_id
AND gcc.code_combination_id = ael.code_combination_id
AND gcc.reference3 = xsb.control_account_type_code
);
(p_location => 'xla_control_accounts_pkg.update_balance_flag');
END update_balance_flag;
FUNCTION update_balance_flag ( p_event_id IN INTEGER
,p_entity_id IN INTEGER
,p_application_id IN INTEGER
)
RETURN BOOLEAN
IS
l_log_module VARCHAR2 (2000);
l_log_module := C_DEFAULT_MODULE||'.update_balance_flag';
(p_location => 'xla_control_accounts_pkg.update_balance_flag');
UPDATE xla_ae_lines xal
SET xal.control_balance_flag = C_CONTROL_BALANCE_FLAG_PENDING
WHERE xal.ROWID IN
( SELECT ael.ROWID
FROM xla_ae_headers aeh
,gl_ledgers xgl
,xla_subledgers xsb
,xla_ae_lines ael
,gl_code_combinations gcc
WHERE aeh.event_id = p_event_id
AND aeh.entity_id = p_entity_id
AND aeh.application_id = p_application_id
AND aeh.balance_type_code = 'A'
AND aeh.accounting_entry_status_code IN ('D', 'F')
AND ael.ae_header_id = aeh.ae_header_id
AND ael.application_id = aeh.application_id
AND ael.party_type_code IS NOT NULL
AND ael.party_id IS NOT NULL
AND ael.control_balance_flag IS NULL
AND xgl.ledger_id = aeh.ledger_id
AND xsb.application_id = aeh.application_id
AND nvl(xsb.control_account_type_code, 'N') <> 'N'
AND gcc.code_combination_id = ael.code_combination_id
AND gcc.reference3 = xsb.control_account_type_code
);
(p_location => 'xla_control_accounts_pkg.update_balance_flag');
END update_balance_flag;