2064: l_success_rec NUMBER := 0;
2065: l_error_rec NUMBER := 0;
2066: BEGIN
2067:
2068: fnd_file.put_line(fnd_file.log,'------------Parameters-----------');
2069: fnd_file.put_line(fnd_file.log,'Batch Code : '||p_batch_code);
2070: fnd_file.put_line(fnd_file.log,'Purge Mode : '||p_purge_mode);
2071: fnd_file.put_line(fnd_file.log,'---------------------------------');
2072:
2065: l_error_rec NUMBER := 0;
2066: BEGIN
2067:
2068: fnd_file.put_line(fnd_file.log,'------------Parameters-----------');
2069: fnd_file.put_line(fnd_file.log,'Batch Code : '||p_batch_code);
2070: fnd_file.put_line(fnd_file.log,'Purge Mode : '||p_purge_mode);
2071: fnd_file.put_line(fnd_file.log,'---------------------------------');
2072:
2073: IF g_log_enabled THEN
2066: BEGIN
2067:
2068: fnd_file.put_line(fnd_file.log,'------------Parameters-----------');
2069: fnd_file.put_line(fnd_file.log,'Batch Code : '||p_batch_code);
2070: fnd_file.put_line(fnd_file.log,'Purge Mode : '||p_purge_mode);
2071: fnd_file.put_line(fnd_file.log,'---------------------------------');
2072:
2073: IF g_log_enabled THEN
2074: l_log_module := C_DEFAULT_MODULE||'.update_balances';
2067:
2068: fnd_file.put_line(fnd_file.log,'------------Parameters-----------');
2069: fnd_file.put_line(fnd_file.log,'Batch Code : '||p_batch_code);
2070: fnd_file.put_line(fnd_file.log,'Purge Mode : '||p_purge_mode);
2071: fnd_file.put_line(fnd_file.log,'---------------------------------');
2072:
2073: IF g_log_enabled THEN
2074: l_log_module := C_DEFAULT_MODULE||'.update_balances';
2075: END IF;
2081: END IF;
2082:
2083: FOR l_balances_int_rec IN c_balances_int(p_batch_code) LOOP
2084: BEGIN
2085: fnd_file.new_line(fnd_file.log,2);
2086: fnd_file.put_line(fnd_file.log,'Processing record with:');
2087: fnd_file.put_line(fnd_file.log,'Supporting Reference Name : '||l_balances_int_rec.analytical_criterion_code);
2088: fnd_file.put_line(fnd_file.log,'Supporting Reference Type : '||l_balances_int_rec.analytical_criterion_type_code);
2089: fnd_file.put_line(fnd_file.log,'Supporting Reference 1 : '||l_balances_int_rec.ac1);
2082:
2083: FOR l_balances_int_rec IN c_balances_int(p_batch_code) LOOP
2084: BEGIN
2085: fnd_file.new_line(fnd_file.log,2);
2086: fnd_file.put_line(fnd_file.log,'Processing record with:');
2087: fnd_file.put_line(fnd_file.log,'Supporting Reference Name : '||l_balances_int_rec.analytical_criterion_code);
2088: fnd_file.put_line(fnd_file.log,'Supporting Reference Type : '||l_balances_int_rec.analytical_criterion_type_code);
2089: fnd_file.put_line(fnd_file.log,'Supporting Reference 1 : '||l_balances_int_rec.ac1);
2090: fnd_file.put_line(fnd_file.log,'Supporting Reference 2 : '||l_balances_int_rec.ac2);
2083: FOR l_balances_int_rec IN c_balances_int(p_batch_code) LOOP
2084: BEGIN
2085: fnd_file.new_line(fnd_file.log,2);
2086: fnd_file.put_line(fnd_file.log,'Processing record with:');
2087: fnd_file.put_line(fnd_file.log,'Supporting Reference Name : '||l_balances_int_rec.analytical_criterion_code);
2088: fnd_file.put_line(fnd_file.log,'Supporting Reference Type : '||l_balances_int_rec.analytical_criterion_type_code);
2089: fnd_file.put_line(fnd_file.log,'Supporting Reference 1 : '||l_balances_int_rec.ac1);
2090: fnd_file.put_line(fnd_file.log,'Supporting Reference 2 : '||l_balances_int_rec.ac2);
2091: fnd_file.put_line(fnd_file.log,'Supporting Reference 3 : '||l_balances_int_rec.ac3);
2084: BEGIN
2085: fnd_file.new_line(fnd_file.log,2);
2086: fnd_file.put_line(fnd_file.log,'Processing record with:');
2087: fnd_file.put_line(fnd_file.log,'Supporting Reference Name : '||l_balances_int_rec.analytical_criterion_code);
2088: fnd_file.put_line(fnd_file.log,'Supporting Reference Type : '||l_balances_int_rec.analytical_criterion_type_code);
2089: fnd_file.put_line(fnd_file.log,'Supporting Reference 1 : '||l_balances_int_rec.ac1);
2090: fnd_file.put_line(fnd_file.log,'Supporting Reference 2 : '||l_balances_int_rec.ac2);
2091: fnd_file.put_line(fnd_file.log,'Supporting Reference 3 : '||l_balances_int_rec.ac3);
2092: fnd_file.put_line(fnd_file.log,'Supporting Reference 4 : '||l_balances_int_rec.ac4);
2085: fnd_file.new_line(fnd_file.log,2);
2086: fnd_file.put_line(fnd_file.log,'Processing record with:');
2087: fnd_file.put_line(fnd_file.log,'Supporting Reference Name : '||l_balances_int_rec.analytical_criterion_code);
2088: fnd_file.put_line(fnd_file.log,'Supporting Reference Type : '||l_balances_int_rec.analytical_criterion_type_code);
2089: fnd_file.put_line(fnd_file.log,'Supporting Reference 1 : '||l_balances_int_rec.ac1);
2090: fnd_file.put_line(fnd_file.log,'Supporting Reference 2 : '||l_balances_int_rec.ac2);
2091: fnd_file.put_line(fnd_file.log,'Supporting Reference 3 : '||l_balances_int_rec.ac3);
2092: fnd_file.put_line(fnd_file.log,'Supporting Reference 4 : '||l_balances_int_rec.ac4);
2093: fnd_file.put_line(fnd_file.log,'Supporting Reference 5 : '||l_balances_int_rec.ac5);
2086: fnd_file.put_line(fnd_file.log,'Processing record with:');
2087: fnd_file.put_line(fnd_file.log,'Supporting Reference Name : '||l_balances_int_rec.analytical_criterion_code);
2088: fnd_file.put_line(fnd_file.log,'Supporting Reference Type : '||l_balances_int_rec.analytical_criterion_type_code);
2089: fnd_file.put_line(fnd_file.log,'Supporting Reference 1 : '||l_balances_int_rec.ac1);
2090: fnd_file.put_line(fnd_file.log,'Supporting Reference 2 : '||l_balances_int_rec.ac2);
2091: fnd_file.put_line(fnd_file.log,'Supporting Reference 3 : '||l_balances_int_rec.ac3);
2092: fnd_file.put_line(fnd_file.log,'Supporting Reference 4 : '||l_balances_int_rec.ac4);
2093: fnd_file.put_line(fnd_file.log,'Supporting Reference 5 : '||l_balances_int_rec.ac5);
2094: fnd_file.put_line(fnd_file.log,'Period : '||l_balances_int_rec.period_name);
2087: fnd_file.put_line(fnd_file.log,'Supporting Reference Name : '||l_balances_int_rec.analytical_criterion_code);
2088: fnd_file.put_line(fnd_file.log,'Supporting Reference Type : '||l_balances_int_rec.analytical_criterion_type_code);
2089: fnd_file.put_line(fnd_file.log,'Supporting Reference 1 : '||l_balances_int_rec.ac1);
2090: fnd_file.put_line(fnd_file.log,'Supporting Reference 2 : '||l_balances_int_rec.ac2);
2091: fnd_file.put_line(fnd_file.log,'Supporting Reference 3 : '||l_balances_int_rec.ac3);
2092: fnd_file.put_line(fnd_file.log,'Supporting Reference 4 : '||l_balances_int_rec.ac4);
2093: fnd_file.put_line(fnd_file.log,'Supporting Reference 5 : '||l_balances_int_rec.ac5);
2094: fnd_file.put_line(fnd_file.log,'Period : '||l_balances_int_rec.period_name);
2095:
2088: fnd_file.put_line(fnd_file.log,'Supporting Reference Type : '||l_balances_int_rec.analytical_criterion_type_code);
2089: fnd_file.put_line(fnd_file.log,'Supporting Reference 1 : '||l_balances_int_rec.ac1);
2090: fnd_file.put_line(fnd_file.log,'Supporting Reference 2 : '||l_balances_int_rec.ac2);
2091: fnd_file.put_line(fnd_file.log,'Supporting Reference 3 : '||l_balances_int_rec.ac3);
2092: fnd_file.put_line(fnd_file.log,'Supporting Reference 4 : '||l_balances_int_rec.ac4);
2093: fnd_file.put_line(fnd_file.log,'Supporting Reference 5 : '||l_balances_int_rec.ac5);
2094: fnd_file.put_line(fnd_file.log,'Period : '||l_balances_int_rec.period_name);
2095:
2096: IF NOT validate_balances_rec(l_balances_int_rec,l_message_codes) THEN
2089: fnd_file.put_line(fnd_file.log,'Supporting Reference 1 : '||l_balances_int_rec.ac1);
2090: fnd_file.put_line(fnd_file.log,'Supporting Reference 2 : '||l_balances_int_rec.ac2);
2091: fnd_file.put_line(fnd_file.log,'Supporting Reference 3 : '||l_balances_int_rec.ac3);
2092: fnd_file.put_line(fnd_file.log,'Supporting Reference 4 : '||l_balances_int_rec.ac4);
2093: fnd_file.put_line(fnd_file.log,'Supporting Reference 5 : '||l_balances_int_rec.ac5);
2094: fnd_file.put_line(fnd_file.log,'Period : '||l_balances_int_rec.period_name);
2095:
2096: IF NOT validate_balances_rec(l_balances_int_rec,l_message_codes) THEN
2097: /*
2090: fnd_file.put_line(fnd_file.log,'Supporting Reference 2 : '||l_balances_int_rec.ac2);
2091: fnd_file.put_line(fnd_file.log,'Supporting Reference 3 : '||l_balances_int_rec.ac3);
2092: fnd_file.put_line(fnd_file.log,'Supporting Reference 4 : '||l_balances_int_rec.ac4);
2093: fnd_file.put_line(fnd_file.log,'Supporting Reference 5 : '||l_balances_int_rec.ac5);
2094: fnd_file.put_line(fnd_file.log,'Period : '||l_balances_int_rec.period_name);
2095:
2096: IF NOT validate_balances_rec(l_balances_int_rec,l_message_codes) THEN
2097: /*
2098: * Some validations failed
2102: (p_module => l_log_module
2103: ,p_msg => 'validations failed with l_message_codes:'||l_message_codes
2104: ,p_level => C_LEVEL_STATEMENT);
2105: END IF;
2106: fnd_file.put_line(fnd_file.log,'Import Failed with error codes: '||l_message_codes);
2107: fnd_file.new_line(fnd_file.log,2);
2108: UPDATE xla_ac_balances_int
2109: SET status = 'ERROR',
2110: message_codes = l_message_codes,
2103: ,p_msg => 'validations failed with l_message_codes:'||l_message_codes
2104: ,p_level => C_LEVEL_STATEMENT);
2105: END IF;
2106: fnd_file.put_line(fnd_file.log,'Import Failed with error codes: '||l_message_codes);
2107: fnd_file.new_line(fnd_file.log,2);
2108: UPDATE xla_ac_balances_int
2109: SET status = 'ERROR',
2110: message_codes = l_message_codes,
2111: last_updated_by = g_user_id,
2127: merge_balances_rec(l_balances_int_rec);
2128: /*
2129: * Successfully merged the records. Update the status of the interface record
2130: */
2131: fnd_file.put_line(fnd_file.log,'Import Succeeded');
2132: fnd_file.new_line(fnd_file.log,2);
2133: UPDATE xla_ac_balances_int
2134: SET status = 'IMPORTED',
2135: message_codes = NULL,
2128: /*
2129: * Successfully merged the records. Update the status of the interface record
2130: */
2131: fnd_file.put_line(fnd_file.log,'Import Succeeded');
2132: fnd_file.new_line(fnd_file.log,2);
2133: UPDATE xla_ac_balances_int
2134: SET status = 'IMPORTED',
2135: message_codes = NULL,
2136: last_updated_by = g_user_id,